Methods for encoding / decoding images and recording media for storing bitstreams

By deriving multiple intra-frame prediction modes and weighted calculation techniques, combined with histograms and extrapolation filters, the image encoding/decoding process is optimized, solving the compression and transmission problems of high-resolution video and achieving more efficient data compression and transmission.

CN123077086APending Publication Date: 2026-11-10ELECTRONICS & TELECOMM RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202580027026.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-07-04
Filing Date
2025-04-08
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing image encoding/decoding technologies are insufficient for effectively compressing and transmitting high-resolution, high-quality video, resulting in excessively large amounts of encoded/decoded data.

Method used

By deriving multiple intra-frame prediction modes for the current block, selecting a prediction mode based on a histogram, and generating a final prediction block through weighted summation, the image encoding/decoding process is optimized by combining intra-frame sub-partitioning modes and extrapolation filters.

Benefits of technology

It improves the prediction accuracy of image encoding/decoding, reduces the amount of encoding/decoding data, and enhances video compression and transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123077086A_ABST
    Figure CN123077086A_ABST
Patent Text Reader

Abstract

A method, apparatus, and recording medium for image encoding / decoding are disclosed. The image decoding method according to this disclosure may include the following steps: deriving multiple intra-frame prediction modes for a current block; obtaining multiple prediction blocks for the current block based on the multiple intra-frame prediction modes; and obtaining a final prediction block for the current block by performing a weighted summation of the multiple prediction blocks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method, apparatus, and recording medium for image encoding / decoding. Background Technology

[0002] With the continuous development of the information and communication industry, video services provided through broadcasting, the Internet, and other means have expanded globally.

[0003] Users require videos with higher resolution and higher image quality. To meet these needs, image encoding / decoding technologies suitable for such videos are required. Image encoding technologies can generate compressed video by compressing the video containing the indicated image, using less data. Image decoding technologies can use the compressed video to generate reconstructed images.

[0004] Various image encoding / decoding techniques exist, such as partitioning, prediction, transform, quantization, filtering, and entropy coding / decoding. By introducing, modifying, enhancing, and combining these techniques, video and images can be compressed, transmitted, and stored more efficiently. Summary of the Invention

[0005] This disclosure provides a method for determining at least one intra-prediction mode for intra-prediction of the current block.

[0006] This disclosure provides a method for configuring a reconstruction region around a current block as a template and deriving a histogram based on the configured template.

[0007] This disclosure provides a method for deriving the intra-prediction mode of the current block based on the histogram of the current block.

[0008] This disclosure provides a method for obtaining the final prediction block of the current block by performing a weighted summation of multiple prediction blocks.

[0009] This disclosure provides a method for deriving the weights of a weighted sum in a decoder in the same manner as in an encoder.

[0010] This disclosure provides a method for partitioning a current block into multiple sub-partitions based on an intra-fractional sub-partition (ISP) mode and deriving the prediction mode and prediction block for each sub-partition.

[0011] This disclosure provides a method for obtaining a predicted block for the current block based on an extrapolation filter.

[0012] Technical solution The image decoding method according to this disclosure may include: deriving a plurality of intra-frame prediction modes for a current block; obtaining a plurality of prediction blocks for the current block based on the plurality of intra-frame prediction modes; and obtaining a final prediction block for the current block by weighted summation of the plurality of prediction blocks.

[0013] The image coding method according to this disclosure may include: deriving a plurality of intra-prediction modes for a current block; obtaining a plurality of prediction blocks for the current block based on the plurality of intra-prediction modes; and obtaining a final prediction block for the current block by weighted summation of the plurality of prediction blocks.

[0014] In the image encoding / decoding method according to this disclosure, multiple prediction modes can be selected in descending order of amplitude values ​​or occurrence counts on the histogram of the current block.

[0015] In the image encoding / decoding method according to this disclosure, the histogram is a gradient histogram, and the gradient histogram can be generated by accumulating the magnitude values ​​of the reference samples included in the reference sample line of the current block for each intra-frame prediction mode.

[0016] In the image encoding / decoding method according to this disclosure, the gradient histogram is an occurrence count histogram, and the occurrence count histogram can be derived by adding the occurrence counts of intra-frame prediction modes of multiple reference blocks.

[0017] In the image encoding / decoding method according to this disclosure, the number of occurrences of the intra-prediction mode of the reference block can be set to the size of the reference block or the number of basic units included in the reference block.

[0018] In the image encoding / decoding method according to this disclosure, when a reference block has multiple intra-prediction modes, the number of occurrences of each of the multiple intra-prediction modes can be determined based on the ratio of the amplitude values ​​among the multiple intra-prediction modes.

[0019] In the image encoding / decoding method according to this disclosure, the final prediction block of the current block can be obtained by weighted summing of the plurality of prediction blocks and the additional prediction blocks derived based on the non-directional prediction mode.

[0020] In the image encoding / decoding method according to this disclosure, the non-directional prediction mode is a directional plane mode, and the interpolation direction of the directional plane mode can be determined based on the directionality of the best intra-frame prediction mode among multiple prediction blocks.

[0021] In the image encoding / decoding method according to this disclosure, the final prediction block of the current block can be obtained by weighted summation of multiple prediction blocks and additional prediction blocks derived from the block vector.

[0022] In the image encoding / decoding method according to this disclosure, the weight assigned to each of the multiple prediction blocks can be determined based on the ratio of amplitude values ​​or the ratio of the occurrence frequency of multiple prediction blocks.

[0023] In the image encoding / decoding method according to this disclosure, multiple intra-frame prediction modes can be selected from the most probable mode (MPM) list of the current block.

[0024] In the image encoding / decoding method according to this disclosure, the plurality of intra-prediction mode candidates can be selected in ascending order of template matching cost among the intra-prediction mode candidates included in the MPM list.

[0025] In the image encoding / decoding method according to this disclosure, the final prediction block of the current block can be obtained by weighted summing of the plurality of prediction blocks and the additional prediction blocks derived based on the extrapolation filter.

[0026] In this disclosure, a recording medium for recording a bitstream generated by an image encoding method may be provided.

[0027] Technical effect According to this disclosure, prediction accuracy can be improved by performing intra-block prediction based on multiple intra-prediction modes.

[0028] According to this disclosure, by providing a method for deriving a histogram based on the reconstructed region around the current block and deriving the intra-frame prediction mode of the current block based on the histogram, the amount of encoded / decoded data can be reduced.

[0029] According to this disclosure, the final prediction block of the current block can be obtained by weighted summation of multiple prediction blocks, thereby improving prediction accuracy.

[0030] According to this disclosure, the amount of encoded / decoded data can be reduced by providing a method that derives the weights of the weighted sum in the decoder in the same manner as the encoder.

[0031] According to this disclosure, prediction accuracy can be improved by providing a method for partitioning the current block into multiple sub-partitions according to the intra-fractional sub-partition (ISP) mode and deriving the prediction mode and prediction block of each sub-partition.

[0032] According to this disclosure, prediction accuracy can be improved by providing a method for obtaining the predicted block of the current block based on an extrapolation filter. Attached Figure Description

[0033] Figure 1 A system for video encoding and decoding according to an embodiment is shown; Figure 2 An image partitioning structure according to an embodiment is shown; Figure 3 The structure of intra-frame prediction according to an embodiment is shown; Figure 4 The structure for explaining the inter-frame prediction process according to the embodiments is shown; Figure 5 The order in which spatial candidates are added to the candidate list is shown according to an embodiment; Figure 6 Several in-loop filters are shown according to the example; Figure 7 The structure of entropy encoding and entropy decoding is shown based on the example.

[0034] Figure 8 This is a flowchart of an intra-frame prediction method according to an embodiment of the present disclosure.

[0035] Figure 9 Multiple reference sample lines are shown.

[0036] Figure 10 This represents an example of template configuration.

[0037] Figure 11 Show the corresponding block.

[0038] Figure 12 This represents an example of deriving the gradient of the sample points included in the template.

[0039] Figure 13 This example demonstrates how to derive the gradient of multiple lines.

[0040] Figure 14 This shows blocks at spatially / temporally adjacent / non-adjacent locations.

[0041] Figure 15 This example illustrates how the position of a reference block can be adjusted using a block vector / motion vector derived from a co-located block.

[0042] Figure 16 This represents an example of deriving new merge candidates.

[0043] Figure 17 Show the blocks adjacent to the current block.

[0044] Figure 18 and Figure 19 A configuration example of a reference template for exporting prediction templates is shown.

[0045] Figure 20 The weights applied to the two prediction blocks are shown.

[0046] Figure 21 This represents an example of building a merge list for merging predictions in TIMD mode.

[0047] Figure 22This indicates the partition shape of the current block when ISP is applied.

[0048] Figure 23 and Figure 24 This shows an example of template configuration for each sub-partition when ISP mode is applied.

[0049] Figure 25 This is an example of a template for configuring sub-partitions.

[0050] Figure 26 This indicates the shape of various extrapolation filters.

[0051] Figure 27 An extrapolation filter with a block shape is shown.

[0052] Figure 28 This is an explanatory diagram of the reference area used to derive the filter coefficients of the extrapolation filter.

[0053] Figure 29 This section provides an example of a reference area configuration when there is no referenceable area above or to the left. Detailed Implementation

[0054] Various modifications can be applied to this disclosure. Furthermore, this disclosure can have various embodiments. Specific embodiments will be described with reference to the accompanying drawings and detailed description.

[0055] The specific embodiments are not intended to limit this disclosure to a particular mode of practice, and it should be understood that all changes, equivalents and alternatives that do not depart from the spirit or technical scope of this disclosure are included as embodiments in this disclosure.

[0056] These embodiments are described to enable those skilled in the art to readily practice them. It should be noted that the various embodiments differ from one another but are not necessarily mutually exclusive. For example, shapes, structures, and characteristics associated with the embodiments may be applied to or implemented in other embodiments without departing from the spirit and scope of this disclosure. Furthermore, it should be understood that the position or arrangement of various components in the embodiments may be changed without departing from the spirit and scope of this disclosure. Therefore, the appended detailed description is not intended to limit the scope of this disclosure, and the scope of the exemplary embodiments is limited only by the appended claims and their equivalents, provided they are properly described.

[0057] A detailed description of the embodiments, which will be described later, can be referenced in the accompanying drawings. The descriptions made in or shown in the drawings are to be considered part of the detailed description of this disclosure. In the drawings, similar reference numerals may be used to designate the same or similar functions in various aspects. Dependencies between components are not limited to those shown in the drawings.

[0058] In embodiments, singular expressions may include, and may be limited to, plural expressions unless specifically indicated in the context. In other words, in embodiments, expressions such as “at least one” and “one or more” may be replaced by the term “multiple”. Terms such as “ / ”, “and / or”, “at least one of ~”, and “one or more of ~” describing multiple items may refer to 1) one of multiple items, 2) some of multiple items, 3) a combination of some of multiple items, or 4) a combination of multiple items. Furthermore, plural expressions may be replaced by singular expressions. Here, a plural number may represent an integer of 1, 2, 3, 4, or 5 or greater.

[0059] In embodiments, terms associated with numbers such as “first” and “second” can be used to explain various components. These terms are only used to distinguish one component from another and are not intended to limit the components. For example, a first component may be referred to as a second component without departing from the scope of this disclosure. Similarly, a second component may also be referred to as a first component.

[0060] The fact that the first component sends (or provides) information to the second component can mean that the first component sends the information directly to the second component, or it can mean that the first component sends the information to the second component through a third component. Here, the information received (or acquired) by the second component can be information sent by the first component, or information generated by applying specific processing to information sent by the first component.

[0061] The components in the embodiments may be illustrated independently to indicate different functional characteristics, and this illustration does not imply that each component corresponds to a separate hardware or software element. That is, for ease of description, the components in the embodiments may be divided and enumerated. Two or more components described in one embodiment may be considered as one component. Furthermore, a component described in an embodiment may be divided into multiple components, which are divided and perform the component's function individually. Embodiments in which these components are integrated and embodiments in which these components are separate may be included within the scope of this disclosure without departing from its essence.

[0062] The terminology used in the embodiments is for describing specific embodiments only and is not intended to limit this disclosure. In the embodiments, terms such as "comprising" or "having" are intended to indicate the presence of features, numbers, steps, operations, components, parts, or combinations thereof described in the embodiments. These terms do not exclude the possibility of the presence or addition of other features, numbers, steps, operations, components, parts, or combinations thereof not explicitly described in the embodiments. That is, the description of a component "comprising" a specific component in the embodiments does not exclude additional components besides the specific component, and means that additional components may be included within the scope of the embodiments of this disclosure or within the technical spirit of this disclosure.

[0063] Some components in the embodiments may be optional components in addition to those necessary for performing the basic functions of this disclosure. Such optional components can be used to improve performance. Embodiments may be implemented as structures that include only the necessary components required to achieve the essence of the embodiments, rather than optional components. Such structures are included within the scope of the embodiments.

[0064] Embodiments of this disclosure will now be described in detail with reference to the accompanying drawings to enable those skilled in the art to readily practice this disclosure. In the description of this disclosure, detailed descriptions of known functions and configurations that are considered to obscure the main points of the disclosure will be omitted. In the following description of this disclosure, the same reference numerals are used to denote the same or similar components throughout the drawings, and repeated descriptions of the same components will be omitted.

[0065] Substitution of terms in the embodiments In the following description, terms listed in a single line may be used in the embodiments to have the same meaning and may be used interchangeably with each other in the embodiments.

[0066] - "one or more" and "at least one" - "two or more", "multiple", "more than one" and "more" (in embodiments, "one or more" or "at least one" may be further limited to "two or more", "multiple" or "more") - "Information" and "Signal" - "Value", "Predefined Value", "Specific Value", "Threshold", "Baseline Value", and "Reference Value" - "Statistical Values" and "Statistical Values" - "Indicator", "Index", "Flag", and "Information" - "Encoder" and "Encoding Device" - "Decoder" and "Decoding Device" - "Entropy coding", "encoding" and "encoding" - "Entropy decoding", "decoding" and "decoding" - "Encoding / Decoding" and "Encoding and / or Decoding" - "video", "moving image", "image", "picture", "frame", and "screen" - "Reference Screenshot" and "Reference Image" - "Reference Screen List (RPL)" and "Reference Image List" - "Original", "Input", and "Source" - "block", "unit", and "signal" - "Square" and "Square Shape" - "pixel", "sample", and "pel" - "Region", "District", "Part", and "Fragment" - "Partition", "Segment", and "Divide" - "quaternary" and "quaternary" - "luma component", "luma", "luminance component", "luminance", and "Y" - "chroma component", "chroma", "chromaticity", "chromaticity component", "Cb and Cr", "Cb or Cr", "Cb", "Cr", "U and V", "U or V", "U or "V" - "target", "current" (e.g., target block and current block, or target image and current image) - "Neighbor", "Nearby", "Adjacent", "Neighbor / Nearby" (e.g., neighbor block, adjacent block, and neighbor / nearby block) - "Paired" and "COL" - "Reconstruction" and "Decoding" - "Reconstructed", "reconstructed", and "decoded" - "difference", "discrepancy", "error", "residual" - Maximum coding unit (LCU) and coding tree unit (CTU) - "Inter-frame" and "inter" - "Inter-frame prediction", "inter-prediction", and "motion compensation" - "Inter-frame mode", "Inter-frame prediction mode", "Inter-mode", and "Inter-prediction mode" - "Motion Vectors", "Predicted Motion Vectors", and "Advanced Motion Vector Prediction (AMVP)" - "List" and "Candidate List" - "Spatial Candidates" and "Spatial Merge Candidates" - "Time Candidates" and "Time Merged Candidates" - "Predicting Motion Vector Candidates" and "Motion Vector Predictors" - "Forecasting Methods" and "Forecasting Models" - "intra" and "withinframe" - "Intra-prediction" and "Intra-frame prediction" - "Intra-frame mode" and "Intra-frame prediction mode" - "Inverse quantization" and "scaling" - "Quantization Matrix" and "Scaling List" - "Quantization matrix coefficients" and "Matrix coefficients" - "Transformation Coefficient Level", "Quantization Level", "Quantization Coefficient", "Quantization Transformation Coefficient", and "Quantization Transformation Coefficient Level" - "Inverse quantization coefficients" and "Inverse quantization transform coefficients" - "Scan Type" and "Scan Direction" - "Directional Mode", "Angle Mode", "Angled Mode", and "Intra-Frame Prediction Mode" - "Intra-prediction mode (mode number)," "Intra-prediction mode (mode index)," "Intra-prediction mode (mode value)," "Intra-prediction mode (mode angle)," "Intra-prediction mode (mode direction)," "Intra-prediction direction (mode number)," "Intra-prediction direction (mode index)," "Intra-prediction direction (mode value)," and "Intra-prediction direction (mode angle)." - "Merge Mode" and "Motion Merge Mode" - "Geometric Partitioning (GPM)" and "Triangle Partitioning" In addition to the terms exemplified above, terms that have the same meaning based on common knowledge in the art may be used interchangeably with each other in the embodiments.

[0067] The information and range of information values ​​described in the embodiments In embodiments, information may include constants, flags, indexes, variables, encoding / decoding parameters, elements, syntax elements, motion information, attributes, entities, objects, data, etc. In other words, the term "information" may be used interchangeably with "data," "flags," "indexes," "variables," "elements," "syntax elements," "motion information," "attributes," or "entities."

[0068] This information can have one of multiple values. The term "nth value" can refer to the nth value among multiple values.

[0069] For example, the first value can represent "0" or logical false. The second value can represent "1" or (logical) true. Alternatively, the first value can represent "1" or (logical) true. The second value can represent "0" or (logical) false.

[0070] A flag can be information with either a value of "0" or "1". In embodiments, the values ​​of flags, i.e., "0" and "1", can be replaced with "1" and "0", respectively. For example, information indicating whether to perform a specific process or whether to apply a specific process can be considered a flag.

[0071] When variables such as i or j are used to indicate rows, columns, or indices, the variables can be integers equal to or greater than 0 and less than or equal to n-1. Optionally, the variables can be integers equal to or greater than 1 and less than or equal to n. Here, n can be the number of rows, the number of columns, or the number of entities indicated by the index.

[0072] Concepts related to encoding and decoding The concepts related to encoding and decoding will be described below. The following description can be applied to the embodiments.

[0073] Predefined value: A predefined value can refer to a value shared by both the encoding and decoding devices. For example, a predefined value can be restricted to and interpreted as a fixed value. Optionally, a predefined value can be a value shared between the encoding and decoding devices via signaling. Optionally, a predefined value can be a value derived by both the encoding and decoding devices through the same process, such that the encoding and decoding devices have a common value. Optionally, a predefined value can be a common value possessed by both the encoding and decoding devices. The description of predefined values ​​can also be applied to predefined information. In the above description, "information" can be used instead of "value".

[0074] Availability: The fact that a particular pattern is available for a particular objective means that the pattern selected from the particular patterns is used for the particular objective. Other patterns belonging to the category of a particular pattern may be unavailable patterns. Unavailable patterns may not be used for a particular objective. The description of a particular pattern may also apply to other specific information. In the above description, "information" can be used instead of "pattern".

[0075] Adjacent: The terms "direction" and "second entity" for "first entity" can refer to the "direction" of the first entity and the "second entity" adjacent to a corner / surface of the first entity. For example, the term "top-left block" for "target block" can be the block adjacent to the top-left corner of the target block. Here, "first entity" can be a target cell, target block, or target sample. The term "direction" can refer to one of the directions corresponding to top-left, top, top-right, top-right, left, right, bottom-left, bottom, and bottom-right. The term "second entity" can be a cell, block, or sample. Here, regarding the directions corresponding to top-left, top-right, bottom-left, and bottom-right, the corners of the first entity and the corners of the second entity can be diagonally adjacent to each other. Regarding the directions corresponding to top, left, right, and bottom, a surface of the first entity and a surface of the second entity can be in contact with each other.

[0076] - For example, the block adjacent to the top left of the target block can be the block above the block adjacent to the left of the target block. - The block adjacent to the top right of the target block can be the block to the right of the block above the target block. - The block adjacent to the bottom left of the target block can be the block at the bottom of the block adjacent to the left of the target block.

[0077] Encoding and decoding: Encoding and decoding can refer to the encoding and / or decoding of images.

[0078] Signals: Signals can refer to information about an image, unit, or block. A specific signal can refer to a specific image, unit, or block.

[0079] Image: An image can refer to one of the frames that make up a video, or it can refer to the video itself. For example, "image encoding and / or decoding" can refer to "video encoding and / or decoding," and it can also refer to "encoding and / or decoding of one of the images that make up a video."

[0080] - An image can refer to the entirety of a picture, or it can refer to a part of a picture, such as a block.

[0081] Target image: The target image can be an encoded target image that serves as the encoding target and / or a decoded target image that serves as the decoding target. Furthermore, the target image can be an input image processed by an encoding device or a reconstructed image processed by a decoding device. The target image can be an image that includes target blocks.

[0082] Sub-screen: A screen can be divided into one or more sub-screens.

[0083] - A sub-screen can be a square or rectangular area within the screen. Each sub-screen can have one or more CTUs.

[0084] A subscreen may include one or more stripes and / or one or more parallel blocks. For example, a subscreen may include one or more stripe rows and one or more stripe columns. Optionally, each subscreen may include one or more parallel block rows and one or more parallel block columns.

[0085] - A sub-picture may include one or more strips that collectively cover a rectangular area within the picture. Therefore, the boundary of each sub-picture can always be the boundary of a strip. Furthermore, the boundary of each vertical sub-picture can always be the boundary of a vertical parallel block.

[0086] Strip: A strip may include one or more parallel blocks in a frame. A strip may include one or more rows of parallel blocks and one or more columns of parallel blocks.

[0087] Parallel Blocks: Parallel blocks can be square or rectangular areas on the screen. A parallel block can have one or more CTUs. The screen can be divided into one or more parallel block rows and one or more parallel block columns.

[0088] CTU: An image can be partitioned into multiple coding tree units (CTUs).

[0089] - A CTU may include a Y-coded tree block (CTB) and at least one of a Cb CTB and a Cr CTB associated with the Y CTB, and may include information about each CTB. This information may include syntax elements.

[0090] - One or more partition types can be used for each CTU partition to form sub-units such as coding units (CUs), prediction units (PUs), and transform units (TUs). One or more partition types can include quadtree (QT) partitions, binary tree (BT) partitions, and ternary tree (TT) partitions. Furthermore, multi-type tree (MTT) partitions can be used for each CTU partition, employing a combination of multiple partition types.

[0091] CTB: CTB can refer to one of Y CTB, Cb CTB, and Cr CTB.

[0092] Unit: A unit can be defined for a specific process in encoding and decoding. A unit can be information about a specific region in an image. An image can be recursively divided into multiple parts to perform specific encoding and decoding processes. A unit can refer to the region to which a specific process is applied and information about that region.

[0093] - Unit type can refer to the specific processing applied to a unit. A specific processing can be applied to a unit based on its unit type. A "specific" unit can be a unit that is named as a "specific" processing in the encoding / decoding process. For example, a unit can be at least one of the following: original unit, CTU, coding unit, prediction unit, residual unit, reconstructed residual unit, transform unit, and reconstruction unit.

[0094] - A cell may include samples having a two-dimensional (2D) form or arrangement. In this respect, the term "cell" may refer to a "block". For example, a block may be at least one of a raw block, a CTB, a coded block (CB), a prediction block (PB), a residual block, a reconstructed residual block, a transform block (TB), and a reconstructed block. For example, a partition of a cell may refer to a partition of the block corresponding to the cell.

[0095] - A unit can include syntax elements. In other words, a block and its syntax elements can be collectively referred to as a "unit".

[0096] - A block can be an M×N sample array. Here, M and N can refer to positive integer values, and a block can typically refer to a sample array in 2D form. The current block can refer to an encoded target block as the target to be encoded in the encoding process and a decoded target block as the target to be decoded. Furthermore, the current block can be at least one of an encoded block, a prediction block, a residual block, a transform block, and a reconstruction block. Blocks can have various sizes and shapes. For example, block shapes can include one or more of a quadrilateral, rectangle, square, rectangle with a horizontal length different from its vertical length (i.e., a rectangle), trapezoid, triangle, right triangle, and pentagon. Here, the horizontal and vertical lengths of the rectangle can be different from each other. Furthermore, block shapes can include other geometric shapes that can be represented in two dimensions. For example, a block shape can be a rectangle or a pentagon defined by excluding a right triangle region from a rectangular region. Here, the right-angled vertex of the right triangle can be one of the vertices of the rectangle. Furthermore, a block shape can be a combination of two or more of the above shapes. Additionally, a block shape can be the remaining shape obtained by excluding one shape from the above shapes.

[0097] - In embodiments, the rectangle may be limited to non-square rectangles. In embodiments, when the shape of a particular target is described as a rectangular shape, the description may further imply that the horizontal length and vertical length of the particular target are different from each other.

[0098] - In an embodiment, the block may be limited to at least one of a vertically oriented block and a horizontally oriented block. A vertically oriented block may be a block with a vertical length greater than its horizontal length. A horizontally oriented block may be a block with a horizontal length greater than its vertical length.

[0099] - A unit may include a luminance component block (i.e., a Y block) and two chrominance component blocks (i.e., a Cb block, a Cr block, or at least one combination thereof), and may include information about each block. The information may contain syntax elements.

[0100] Information about a cell may include the cell type, cell size, cell depth, cell encoding order, cell decoding order, etc.

[0101] Target unit: A target unit can be an encoding target unit that is to be encoded in encoding and a decoding target unit that is to be decoded. A target unit can be a specific region in a target frame to which one or more specific encoding / decoding processes will be applied. A specific type of unit can be generated by applying specific processes to the target unit. Optionally, a target unit can refer to a unit having a specific type for a specific encoding / decoding process.

[0102] Depth: A block can be hierarchically partitioned into multiple sub-blocks while having a depth that depends on the tree structure. The multiple sub-blocks generated from the partitioning operation of a block can be called "partitions".

[0103] - When the blocks that make up an image are represented in a tree structure, the block depth can represent the level of the node corresponding to each block. Optionally, the block depth can indicate the number of partitions applied until the block is determined. As the block is further partitioned, the block depth can increase by 1.

[0104] In a tree structure, the root node can be considered to have the lowest level, and leaf nodes the highest level. The root node can be the topmost node in the tree structure and can correspond to the unpartitioned initial block. The level of the root node can be 0 or 1. When the root node's level is 0, a node with level 1 can refer to the block determined as the initial block is partitioned once. A node with level n can refer to the block determined when the initial block is partitioned n times. Leaf nodes can be the bottommost nodes in the tree structure. Leaf nodes can be nodes that cannot be further partitioned. The depth of a leaf node can be a predefined maximum depth. For example, the maximum depth can be a positive integer such as 3. The root node can refer to CTU. Leaf nodes can refer to at least one of CU, PU, ​​and TU.

[0105] - Depth can have a type that depends on the partition type. QT depth can represent the depth in a quadtree partition. BT depth can represent the depth in a binary tree partition. TT depth can represent the depth in a ternary tree partition.

[0106] Sample: A sample can be the basic unit that makes up a block. A sample can consist of one or more bits. Bit depth refers to the number of bits that make up a sample. Samples can range from 0 to 2. Bd The value of -1 indicates that this depends on the bit depth.

[0107] PU: PU can represent the basic unit used for prediction-related processing. For example, prediction-related processing may include inter-frame prediction, intra-frame prediction, intra-block copy (IBC) prediction, intra-frame compensation, and motion compensation.

[0108] A prediction unit (PU) can be partitioned into multiple sub-PUs, each with a size smaller than the PU. Each of the multiple sub-PUs can also be a basic unit for prediction-related processing. In other words, prediction unit partitions generated from the partitioning operation of prediction units can also be prediction units.

[0109] TU: A TU can be a basic unit for processing associated with a residual block. Processing associated with a residual block can include at least one of transform, inverse transform, quantization, dequantization, transform coefficient encoding, transform coefficient decoding, entropy encoding, or entropy decoding, or combinations thereof. A TU can be partitioned into multiple sub-transform units, each sub-transform unit having a size smaller than the TU. Each of the multiple sub-TUs can also be a basic unit for processing associated with a residual block. In other words, a transform unit partition generated from a partitioning operation of a transform unit can also be a transform unit.

[0110] - The transformation may include one or more of the primary transformation and the secondary transformation, and the inverse transformation may include one or more of the primary inverse transformation and the secondary inverse transformation.

[0111] Parameter set: The parameter set can correspond to the header information in the structure of the bit stream.

[0112] - The parameter set may include at least one of the following: video parameter set (VPS), sequence parameter set (SPS), picture parameter set (PPS), adaptive parameter set (APS), or decoding parameter set (DPS), or a combination thereof.

[0113] Information transmitted via signals using a parameter set can be applied to a screen referencing that parameter set. For example, information in a VPS can be applied to a screen referencing a VPS. Information in an SPS can be applied to a screen referencing an SPS. Information in a PPS can be applied to a screen referencing a PPS. A parameter set can reference a higher-level parameter set. For example, a PPS can reference an SPS. An SPS can reference a VPS.

[0114] - In addition, the parameter set may include parallel block group information, stripe header information, and parallel block header information. A parallel block group can refer to a group or stripe that includes multiple parallel blocks.

[0115] Most Probable Mode (MPM): MPM can refer to an intra-prediction mode that has a high probability of intra-prediction for the target block.

[0116] - One or more different MPMs can be determined based on the encoding / decoding parameters associated with the target block and the attributes of the entities associated with the target block.

[0117] - One or more MPMs can be determined based on the intra-prediction modes of a reference block. A reference block can include multiple reference blocks. One or more different MPMs can be determined based on which intra-prediction modes have been used in one or more reference blocks. Reference blocks can include spatially neighboring blocks.

[0118] MPM List: An MPM list can be a list that includes one or more MPMs. The number of one or more MPMs in the MPM list can be predefined.

[0119] MPM Index: The MPM index can indicate the MPM used for intra-frame prediction of the target block among one or more MPMs in the MPM list.

[0120] MPM Usage Indicator: The MPM usage indicator indicates whether the MPM list has been used for the prediction of the target block.

[0121] Prediction mode: The prediction mode can be information indicating the prediction method used for the target block, such as a mode to be used for intra-frame prediction or a mode to be used for inter-frame prediction. The prediction mode can indicate one of the prediction-related modes, as will be described in the embodiments. Furthermore, the prediction mode can include at least one of intra-frame mode, inter-frame mode, intra-frame block copy mode, or a combination thereof.

[0122] Reference image list: The reference image list can be a list that includes one or more reference images that will be used for the prediction of the target block.

[0123] - The list of reference images can include multiple lists. Multiple lists of reference images can include list 0 (List0; L0), list 1 (List1; L1), etc.

[0124] - For inter-frame prediction of a target block, one or more lists of reference images can be used. In the names of information related to inter-frame prediction, parts such as "L0" and "L1" may refer to the list of reference images associated with that information.

[0125] Reference image (reference frame): The reference image (frame) can be an image referenced for predicting the target block. Optionally, the reference frame can be an image that includes the reference block. The reference frame can include images before the target image, the target image, and images after the target image.

[0126] Reference Image Index: A reference image index can be an index that indicates a reference image (picture) among one or more reference images in a list of reference images used for predicting the target block.

[0127] Reference block: A reference block can be a block that is referenced for encoding / decoding the target block (such as prediction and filtering). For example, a reference block can include reference samples that are referenced to derive prediction samples, and can refer to a block that provides information for decoding the target block.

[0128] Reference sample: A reference sample can be a sample used for encoding / decoding a target block (such as prediction and filtering).

[0129] Inter-frame prediction indicator: The inter-frame prediction indicator can indicate the direction of inter-frame prediction for a target block. Inter-frame prediction can be one of unidirectional and bidirectional prediction. Optionally, the inter-frame prediction indicator can represent the number of reference images used to generate prediction blocks for the target block. Optionally, the inter-frame prediction indicator can represent the number of prediction blocks used for inter-frame prediction of the target block. The reference direction can refer to the inter-frame prediction indicator. For example, the inter-frame prediction indicator can represent one of a unidirectional indicator and a bidirectional indicator. Optionally, in an inter-frame mode that uses only reference images in reference image list L0, the inter-frame prediction indicator can have a "0" as a first value; in an inter-frame mode that uses only reference images in reference image list L1, the inter-frame prediction indicator can have a "1" as a second value; and in an inter-frame mode that uses at least two of the reference images in reference image list L0 and reference images in reference image list L1, the inter-frame prediction indicator can have a "2" as a third value.

[0130] Prediction list utilization flag: The prediction list utilization flag for a specific reference image list indicates whether at least one reference image in the specific reference image list is used to generate a prediction block for the target block. For example, a prediction list utilization flag of "0" indicates that reference images from the specific reference image list are not used to generate the prediction block. A prediction list utilization flag of "1" indicates that reference images from the specific reference image list are used to generate the prediction block.

[0131] - Inter-frame prediction indicators can be derived using prediction list utilization flags. Conversely, prediction list utilization flags can be derived using inter-frame prediction indicators. For example, inter-frame prediction indicators can be derived using prediction list utilization flags from multiple reference image lists. When an inter-frame prediction indicator indicates that a specific reference list among the multiple reference image lists is used, the prediction list utilization flag for the specific reference list indicated by the inter-frame prediction indicator can be set to "1", while the prediction list utilization flags for the remaining reference image lists not indicated by the inter-frame prediction indicator can be set to "0".

[0132] Reference direction: The reference direction can indicate a list of reference images used for the prediction of the target block. For example, the reference direction can indicate one or more of reference image lists L0 and L1.

[0133] - The reference direction indicates only the list of reference images used for prediction of the target block, and may not indicate that the orientation of the reference images in the list is limited to either the forward or backward direction. In other words, each of the reference image lists L0 and L1 may include both forward and backward images. Here, forward can indicate the direction from the target image to an image preceding the target image. Forward inter-frame prediction can be an inter-frame prediction using an image preceding the target image as a reference image. The backward direction can indicate the direction from the target image to an image following the target image. Backward inter-frame prediction can be an inter-frame prediction using an image following the target image as a reference image.

[0134] - A unidirectional reference direction can mean using one list of reference images. A bidirectional reference direction can mean using two lists of reference images. For example, a reference direction can indicate one of the following: using only reference image list L0, using only reference image list L1, or using both reference image lists. Furthermore, the reference direction can be indicated by an inter-frame prediction indicator.

[0135] Picture Order Count (POC): The POC of an image (picture) can indicate the display order or output order of the images (pictures).

[0136] Motion information: Motion information can be information used to specify a reference block. Motion information may include information used for inter-frame prediction, such as motion vectors (MV), reference image index, reference image, inter-frame prediction indicator, and prediction list utilization flags. Furthermore, motion information may include information used in a specific inter-frame prediction mode, such as MV candidates, MV candidate indices, merge candidates, and merge indices.

[0137] - For inter-frame prediction of a target block, multiple motion information related to multiple lists of reference images can be used separately. Motion information of a specific list of reference images can be used for prediction using that specific list of reference images. Multiple (intermediate) prediction blocks can be derived separately from multiple motion information. The (final) prediction block of the target block can be generated using the statistical values ​​of the multiple (intermediate) prediction blocks.

[0138] MV: Motion vector (MV) can be a two-dimensional (2D) vector used for inter-frame prediction. MV can refer to the offset between the target block and the reference block. Alternatively, MV can indicate the difference between the position of the target block and the position of the reference block.

[0139] - For example, it can be in the form of (mv x , mv y MV is represented in the form of ) x It can indicate the horizontal component, and mv y It can indicate the vertical component.

[0140] - The zero vector can be (0,0)MV.

[0141] Block Vector (BV): BV can be a two-dimensional (2D) vector used for intra-block replication prediction. BV can refer to the offset between a target block and a reference block in the target image. In other words, BV can indicate the displacement between a target block and a reference block in the target image.

[0142] - For example, similar to MV, it can be in (bv x , bv y BV is represented in the form of ) . bv x It can indicate the horizontal component, and bv y It can indicate the vertical component.

[0143] - The zero vector can be (0,0)MV.

[0144] Motion information candidates: In a specific prediction, motion information of a target block can be selected from motion information candidates determined by a specific scheme. Motion information candidates can refer to the motion information of a reference block, and can refer to the reference block itself containing motion information. Here, the reference block can be a block determined by a specific scheme to select motion information candidates.

[0145] Candidate List: The candidate list can be a list containing one or more candidates. For example, the candidate list may include a motion information candidate list, a merge candidate list, an MV candidate list, an MPM list, etc. The candidate list can be generated by both the encoding and decoding devices in the same way. In other words, the candidate list used by the encoding device and the candidate list used by the decoding device can be the same as each other, and the same candidate list can be shared between the encoding and decoding devices. The encoding device can select candidates from the candidates in the candidate list to be used for processing the target block. An indicator indicating the selected candidate can be sent from the encoding device to the decoding device via a signal. The decoding device can specify the candidate to be used for processing the target block from the candidates in the candidate list by utilizing the indicator. Optionally, the encoding and decoding devices can specify the candidate to be used for processing the target block from the candidates in the candidate list based on the same rules.

[0146] Motion information candidate list: The motion information candidate list can refer to a list constructed using one or more motion information candidates.

[0147] Motion Information Candidate Index: A motion information candidate index can be an identifier or indicator that indicates a motion information candidate in the motion information candidate list for prediction of the target block.

[0148] - In a specific inter-frame prediction mode, motion information of the target block can be derived using motion information from additional reconstructed blocks. The additional block can be a neighboring block. In this mode, the motion information of the target block itself may not be transmitted separately; instead, additional information for deriving the motion information of the target block based on the motion information of the additional reconstructed blocks may be transmitted. This additional information may include information indicating blocks within the additional reconstructed blocks (such as motion information candidate indices) whose motion information is used to derive the motion information of the target block.

[0149] For example, inter-frame prediction modes can include AMVP mode, merge mode, skip mode, etc. Motion information candidate indices can be merge indexes or MV candidate indices.

[0150] - In an embodiment, MV can be a part of motion information. In an embodiment, information related to motion information (such as motion information candidates, motion information candidate lists, and motion information candidate indexes) can be replaced with information related to MV (such as MV candidates, MV candidate lists, and MV candidate indexes), and the description of motion information can also be applied to MV.

[0151] Merging: The term "merging" can refer to merging multiple motion information from multiple blocks, or it can refer to applying motion information together with the motion information of an additional block to a target block. In other words, a merging pattern can refer to a pattern for deriving the motion information of a target block from the motion information of neighboring blocks.

[0152] Merge candidate: A merge candidate may refer to a specific (reconstructed) block used to merge the target block, and may refer to the motion information of that specific block. Optionally, a merge candidate may include the motion information of that specific block.

[0153] Merge candidates for the target block can include spatial merge candidates, temporal merge candidates, history-based candidates, average candidates based on the average of two merge candidates, zero merge candidates, etc.

[0154] Merge candidate list: The merge candidate list can be a list constructed using one or more merge candidates.

[0155] Merge Index: A merge index can be an indicator that identifies a merge candidate in a merge candidate list for predicting the target block. The motion information of the merge candidate indicated by the merge index in the merge candidate list can be used as the motion information of the target block.

[0156] Neighboring blocks: Neighboring blocks can be blocks adjacent to the target block. Neighboring blocks can include spatially neighboring blocks and temporally neighboring blocks. A neighboring block can refer to a reconstructed neighboring block in the reference image.

[0157] Spatial neighbor block: A spatial neighbor block can be a block that is spatially adjacent to the target block.

[0158] - Target blocks and spatially neighboring blocks can be included in the target image.

[0159] - A spatially neighboring block may include a block whose boundary at least a portion is in contact with at least a portion of the boundary of the target block. Optionally, a spatially neighboring block may include a block whose distance from the target block is less than or equal to a specific value.

[0160] - Spatial neighbor blocks can include blocks that are diagonally adjacent to the vertex of the target block.

[0161] - Spatial neighbor blocks can include the top-left block adjacent to the top-left of the target block, the top block adjacent to the top of the target block, the top-right block adjacent to the top-right of the target block, the left block adjacent to the left side of the target block, the right block adjacent to the right side of the target block, the bottom-left block adjacent to the bottom-left of the target block, the bottom block adjacent to the bottom of the target block, and the bottom-right block adjacent to the bottom-right of the target block.

[0162] Temporally adjacent blocks: Temporally adjacent blocks can be blocks that are temporally adjacent to the target block.

[0163] - Temporally adjacent blocks can include co-occurring blocks (COL blocks). A COL block can be a block in a reconstructed image stored in a reference image (picture) buffer. A co-occurring image (co-occurring picture: COL picture) can refer to a picture that includes a COL block. A COL picture can be an image included in a list of reference images.

[0164] - COL blocks can be determined based on the position of target blocks in the target image. The fact that two blocks are "temporally adjacent" can imply that the positions of the two blocks meet specific conditions.

[0165] - The position of the COL block in the COL frame can be the same as the position of the target block in the target image. Optionally, the position of the COL block in the COL frame can correspond to the position of the target block in the target image. Here, the positions of corresponding blocks can mean that the areas of the blocks are the same, that the area of ​​a block is included in the area of ​​the additional block, or that a block occupies a specific position in the additional block.

[0166] For example, the position of a COL block in a COL image can be the same as the position of a target block in the target image. Alternatively, a COL block can be a block in a COL image that includes COL samples. A COL sample can be a sample point with the same coordinates as a specific sample point in the target block.

[0167] - A temporally neighboring block can be a block that is spatially adjacent to the target block in time.

[0168] Search Range: The search range can refer to the 2D range of the MV search performed during inter-frame prediction. For example, when the best MV is derived to process the target block, the best MV is selected from the MVs within the indicated search range.

[0169] Transform coefficients: Transform coefficients can be coefficients generated by performing a transformation on the residual block. Alternatively, transform coefficients can be coefficient values ​​generated by performing dequantization on the quantization level.

[0170] Quantization level: The quantization level can be an integer number used as the input for dequantization.

[0171] Quantization: Quantization can be a process that generates quantization levels for transform coefficients. Quantization levels can be generated by applying quantization to transform coefficients. Transformation can also be considered as part of quantization.

[0172] Dequantization: Dequantization can be a process of multiplying a factor by a quantization level. (Reconstructed) transform coefficients can be generated by applying dequantization to the quantization level.

[0173] Quantization parameter (QP): QP can refer to a factor used when generating the quantization levels of the transform coefficients. Additionally, QP can refer to a factor used when generating the (reconstructed) transform coefficients for the quantization levels used in inverse quantization. Optionally, QP can be a value mapped to the quantization step size.

[0174] Difference QP: Difference QP can be the difference between the QP predicted through specific processing and the QP of the target block. In other words, the QP of the target block can be the sum of the predicted QP and the difference QP.

[0175] Quantization matrix: A quantization matrix is ​​a matrix used in quantization or dequantization to improve the subjective or objective quality of an image.

[0176] Quantization matrix coefficients: Quantization matrix coefficients can be each element in the quantization matrix.

[0177] Scan: A scan can refer to a method of arranging values ​​in a block or matrix. These values ​​can be coefficients. For example, a scan can refer to the arrangement of values ​​in 2D or 1D form, and the rearrangement of values ​​in 1D or 2D form. A reverse scan can refer to the arrangement (or rearrangement) that is the opposite of the arrangement performed in a scan.

[0178] Non-zero transform coefficients: Non-zero transform coefficients can refer to transform coefficients with non-zero values ​​or quantization levels with non-zero values.

[0179] Bitstream: A bitstream can refer to a stream / sequence of bits that includes encoded information generated by encoding an image. A bitstream may include information dependent on specific syntax elements. For example, the information may include syntax elements. An encoding device can generate a bitstream that includes multiple pieces of information dependent on specific syntax elements. A decoding device can extract multiple pieces of information from the bitstream based on specific syntax elements.

[0180] Signaling: Signaling information can refer to sending information from an encoding device to a decoding device via a bitstream. For example, the information may include syntax elements. Optionally, signaling can refer to the process by which the encoding device includes information in a bitstream. Information signaled by the encoding device can be used by the decoding device. In signaling, the bitstream can be transmitted over a network and can be included in a storage / recording medium. In embodiments, a description indicating that information is signaled may include: 1) the encoding device determines and generates information to signal the information; 2) the encoding device generates encoded information by encoding the information; 3) the (encoded) information is sent from the encoding device to the decoding device via a bitstream; 4) the decoding device obtains the information by decoding the encoded information; and 5) the decoding device determines and generates information by signaling the information.

[0181] Encoding devices generate encoded information by encoding data. Encoded information can be transmitted as a signal via a bitstream. Decoding devices retrieve information by decoding the encoded information.

[0182] Signaling information for a specific target can mean that multiple messages are used for that specific target, and that the processing indicated by these multiple messages is applied to that specific target. For example, signaling information at the unit level can mean using / processing corresponding information for each specific unit.

[0183] - Information sent by signaling may include one or more sub-messages. Sending specific information by signaling can mean sending each of the one or more sub-messages included in the specific information by signaling.

[0184] Selective signaling: - The selective transmission of information via signals. Selective signaling of information can refer to the process by which an encoding device selectively includes information in a bitstream (depending on specific conditions). Selective signaling of information can also refer to the process by which a decoding device selectively retrieves information from a bitstream (depending on specific conditions).

[0185] Skipping signal transmission: - Signal transmission of information can be skipped. Skipping signal transmission of information can refer to the process by which the encoding device does not include information in the bitstream (depending on specific conditions). Skipping signal transmission of information can also refer to the process by which the decoding device does not obtain information from the bitstream (depending on specific conditions). In an embodiment, the decoding device can derive the skipped signal transmission information by utilizing other information.

[0186] Symbols: A symbol can refer to at least one piece of information about the target unit, such as the syntax elements, encoding / decoding parameters, quantization levels, and transform coefficients of the target unit or block. Additionally, a symbol can refer to the target of entropy encoding or the result of entropy decoding.

[0187] Entropy coding: Entropy coding is a technique that allocates fewer bits to symbols that appear more frequently and more bits to symbols that appear less frequently. Since symbols are represented in this way, the size of the bitstream indicating symbols can be reduced.

[0188] Entropy coding can be implemented using any method such as Variable Length Coding (VLC) and Context Adaptive Binary Arithmetic Coding (CABAC). For example, entropy coding can be performed using a variable-length table in Variable Length Coding (VLC). In CABAC, for example, a binarization method for symbols and a probabilistic model for symbols / bits can be derived to perform entropy coding, and arithmetic coding using context can be performed.

[0189] Entropy decoding: In entropy decoding, the processes performed in entropy encoding can be reversed. Symbols can be generated by performing entropy decoding on a bitstream.

[0190] Parsing: Parsing can refer to determining the value of a syntax element by performing entropy decoding on the encoded information of a bitstream. Alternatively, parsing can refer to entropy decoding itself.

[0191] Statistical values: Values ​​of multiple pieces of information related to a specific entity (or multiple entities) described in the embodiments can be used as inputs for specific operations. Statistical values ​​can be values ​​derived by performing specific operations on values ​​related to such a specific entity (or multiple entities). For example, statistical values ​​of multiple pieces of specific information can indicate one or more values ​​generated by the average, weighted average (or weighted mean), weighted sum, minimum, maximum, mode, median, interpolated values, sum of products, and product of sums of the values ​​of multiple pieces of specific information. Furthermore, information in the embodiments having specific values ​​determined through operations (computations) (such as constants, variables, and encoding / decoding parameters) can have specific statistical values ​​according to the embodiments.

[0192] Encoder / decoder parameters In this embodiment, the encoding / decoding parameters may be information required for encoding / decoding. These parameters may include information transmitted by signals from the encoding device to the decoding device, information calculated / derived during the encoding / decoding process described in this embodiment, and information used for processing the encoding / decoding described in this embodiment.

[0193] In embodiments, encoding / decoding parameters may include one or more of the following: CTU size, cell size, cell type, cell shape, cell depth, minimum cell size, maximum cell size, maximum cell depth, minimum cell depth, cell partitioning information, quadtree (QT) partitioning information, binary tree (BT) partitioning information, BT partitioning direction, BT partitioning format, ternary tree (TT) partitioning information, TT partitioning direction, TT partitioning format, multi-type tree (MTT) partitioning information, combination of MTT partitions, MTT partitioning direction, MTT partitioning format, prediction mode, intra-frame prediction mode, luma intra-frame prediction mode, chroma intra-frame prediction mode, intra-frame partitioning... Inter-frame partition information, coded block partition information, prediction block partition information, transform block partition information, reference sample line index, reference sample filtering method, reference sample filter tap, reference sample filter coefficient, prediction block filtering method, prediction block filter tap, prediction block filter coefficient, prediction block boundary filtering method, prediction block boundary filter tap, prediction block boundary filter coefficient, inter-frame prediction mode, motion information, motion vector (MV), motion vector difference (MVD), MVD resolution, MV value, MV representation accuracy, reference image list, reference image, reference image index, inter-frame prediction direction, inter-frame prediction indicator, prediction list utilization flag, frame order count (POC), MV candidate, MV candidate index The following are included: MV candidate list, Advanced Motion Vector Prediction (AMVP) mode usage information, merge candidates, merge index, merge candidate list, merge mode usage information, motion information correction information, skip mode usage information, intra-block copy mode usage information, block vector (BV), block vector difference (BVD), BVD resolution, BV magnitude, BV representation accuracy, BV candidates, BV candidate index, BV candidate list, interpolation filter taps, interpolation filter coefficients, transform type, transform size, transform selection information, primary transform usage information, secondary transform usage information, primary transform selection information, secondary transform selection information, residual block existence information, coding block style, coding block flag, and quantization parameters (QP). Differential QP, quantization matrix, deblocking filter usage information, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape / form, adaptive sample offset usage information, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, adaptive loop filter usage information, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form, binarization / debinarization methods, context model, context model determination method, context model update method, normal mode usage information, bypass mode usage information, effective coefficient flag, last effective coefficient flag, coefficient group cell encoding / decoding flag, last effective coefficient position.Flags indicating whether the indicator coefficient value is greater than 1, greater than 2, greater than 3, remaining coefficient value information, sign information, context binary bits, bypass binary bits, reconstructed samples, reconstructed luminance samples, reconstructed chrominance samples, residual samples, residual luminance samples, residual chrominance samples, transform coefficients, luminance transform coefficients, chrominance transform coefficients, transform coefficient levels, luminance transform coefficient levels, chrominance transform coefficient levels, transform coefficient level scanning method, quantization level, quantized luminance level, quantized chrominance level, and the size of the MV search range on the decoding device side. The decoding device's MV search range shape, MV search iteration count, frame type, stripe identification information, stripe type, stripe partition information, parallel block group identification information, parallel block group type, parallel block group partition information, parallel block identification information, parallel block type, parallel block partition information, bit depth, input sample bit depth, reconstructed sample bit depth, residual sample bit depth, transform coefficient bit depth, quantization level bit depth, mapping availability information, luminance signal information, chrominance signal information, target block color space, residual block color space, and temporal layer information.

[0194] In addition, the encoding and decoding parameters may also include 1) the value of information that may be included in the encoding and decoding parameters, 2) a combination of multiple pieces of information that may be included in the encoding and decoding parameters, 3) statistical values ​​of information that may be included in the encoding and decoding parameters, 4) information related to the encoding and decoding parameters, 5) information used to calculate / derive the encoding and decoding parameters, and 6) information calculated / derived using the encoding and decoding parameters.

[0195] In an embodiment, "X usage information" can be information indicating whether "X is used / applied / executed". Optionally, "X usage information" can be information indicating whether "X is available". For example, "specific mode usage information" can be information indicating whether a specific mode is used. Mode information can indicate the mode used for the target block among the modes described in the embodiment. In an embodiment, specific mode usage information can be replaced with mode information, and the description of specific mode usage information can also be applied to mode information. "X usage information" and "X indicator" can be used interchangeably.

[0196] In embodiments, encoding / decoding parameters and syntax elements can correspond to each other. For example, a syntax element according to an embodiment can be used as an encoding / decoding parameter, and the encoding / decoding parameter can be sent as a syntax element using a signal.

[0197] In the embodiments, "X existence information" can be regarded as "information indicating whether X exists" or "information indicating whether information indicating X exists in the bitstream".

[0198] In an embodiment, "X selection information" can be information indicating one of the candidates or methods for X. "X selection information" can be considered as an "X index".

[0199] In an embodiment, the partitioning form of a particular tree can indicate one of symmetric partitioning and asymmetric partitioning, and can indicate one of QT, BT, TT, and no partitioning. The partitioning direction of a particular tree can indicate one of horizontal and vertical directions.

[0200] In an embodiment, when the codec parameter has one of a plurality of values, "codec parameter" can be replaced with "information indicating whether the codec parameter has a specific value among a plurality of values ​​that can be used for the codec parameter".

[0201] In an embodiment, when the encoding / decoding parameter has one of multiple values, "encoding / decoding parameter" can be replaced with "indicating whether the encoding / decoding parameter indicates information about a specific target among multiple targets".

[0202] Systems for video encoding and decoding Figure 1 A system for video encoding and decoding according to an embodiment is shown.

[0203] System 100 may include at least one or a combination of encoding device 110 or decoding device 150.

[0204] Each of the encoding device 110 and the decoding device 150 can be a computer or an electronic device.

[0205] Structure of encoding devices The encoding device 110 may include a processor 120, a memory 140, and a communicator 149.

[0206] The processor 120, memory 140 and communicator 149 can be connected to each other via a bus.

[0207] Processor 120 may be a semiconductor device that executes instructions or computer-executable code, such as a central processing unit (CPU). Processor 120 may be at least one hardware processor.

[0208] In an embodiment, the processor 120 may generate and process information input to or output from the encoding device 110 or used in the encoding device 110, and may perform comparisons, determinations, etc., related to the information.

[0209] Processor 120 may include multiple components. These components may include partitioner 122, subtractor 124, transformer 125, quantizer 126, dequantizer 127, inverse transformer 128, adder 129, filter 130, and entropy encoder 139.

[0210] At least some of the aforementioned components may be program modules. Program modules may be included in the encoding device 110 in the form of operating systems, applications, and other program modules. Program modules may be instructions or computer-executable code stored in memory 140 and executed by processor 120.

[0211] The memory 140 may include various types of volatile and non-volatile storage media. For example, the memory 140 may include memory such as read-only memory (ROM) and random access memory (RAM).

[0212] The memory 140 may store instructions and computer-executable code for the operation of the encoding device 110, and may also store the information and bit streams described in the embodiments. The memory 140 may include a reference screen buffer 141.

[0213] The communicator 149 can perform functions related to communication of information in the encoding device 110. For example, the communicator 149 can send a bit stream to the decoding device 150.

[0214] In the names of components of encoding device 110, "-cell" can be used instead of "-device" or "-device". Memory 140 can be designated as a storage cell.

[0215] Operation of encoding devices Encoding device 110 can sequentially encode one or more images (pictures) of a video.

[0216] The memory 140 can store the original image. The original image can be used as the target image in the encoding device 110.

[0217] The processor 120 can generate a bitstream including encoded information by performing encoding on the target image, and can store the generated bitstream in the memory 140. The generated bitstream can be stored in a computer-readable storage medium and can be transmitted by the communicator 149 to the communicator 189 of the decoding device 150 via a wired and / or wireless transmission medium.

[0218] The partitioner 122 can determine the target block by partitioning the target image.

[0219] Predictor 123 can determine the prediction mode of the target block. Predictor 123 can generate a prediction block for the target block by performing a prediction corresponding to the prediction mode.

[0220] The prediction mode for the target block can be one of the available prediction modes. For example, available prediction modes may include intra-frame prediction, inter-frame prediction, and IBC prediction.

[0221] For example, when the prediction mode corresponds to intra-frame prediction, predictor 123 can generate a prediction block for the target block by performing intra-frame prediction on the target block.

[0222] For example, when the prediction mode corresponds to inter-frame prediction, predictor 123 can generate a prediction block for the target block by performing inter-frame prediction on the target block.

[0223] For example, when the prediction mode corresponds to IBC, predictor 123 can generate a prediction block for the target block by performing IBC on the target block.

[0224] Subtractor 124 can generate a residual block of the target block. The residual block can be the difference between the original block and the predicted block. The original block can be a region indicated by the target block in the original image. Alternatively, the residual block can refer to a block generated by applying one or more of a transform and quantization to the difference between the original block and the predicted block.

[0225] Transformer 125 can generate transformation coefficients by performing a transformation on the residual block.

[0226] Transformer 125 can perform a transformation using one of a variety of transformation methods.

[0227] For example, various transformation methods can include Discrete Cosine Transform (DCT), Discrete Sine Transform (DST), Karhunen-Loeve Transform (KLT), and transformations based on each transform.

[0228] Transform skip mode can be a mode that uses both the reconstructed residual block and the prediction block without any transform or inverse transform performed to generate the reconstructed block. When transform skip mode is applied to the target block, the transform and inverse transform of the target block can be skipped, and only the quantization and inverse quantization (dequantization) of the target block can be performed.

[0229] Quantizer 126 can generate quantization levels by applying quantization using quantization parameters to transform coefficients. In this embodiment, the quantization level may also be referred to as a "transform coefficient".

[0230] The entropy encoder 139 generates encoded information by performing entropy encoding based on a probability distribution of information used for image decoding. The bitstream may include the encoded information.

[0231] Information used for image decoding may include quantization levels, syntax elements, etc., calculated by quantizer 126.

[0232] The probability distribution can be determined based on the quantization level and encoding / decoding parameters.

[0233] The entropy encoder 139 can use a scan to change quantization levels in 2D block form to 1D vector form in order to perform encoding on the quantization levels. During the scan, the encoding / decoding parameters such as the block size and the intra-frame prediction mode of the block can be used to determine which of the following scans—upper right diagonal scan, vertical scan, and horizontal scan—will be used.

[0234] When encoding a target image / block, predictor 123 uses a reference image / block to perform prediction. The encoded target image / block can be used as a reference image / block for another image / block to be processed subsequently. Therefore, processor 120 can perform reconstruction on the encoded target block and can store the reconstructed image, including the reconstructed target block generated by reconstruction, as a reference image in reference image buffer 141. Inverse quantization and inverse transform can be performed on the encoded target block to perform reconstruction.

[0235] The dequantizer 127 can generate dequantized transformation coefficients by performing dequantization on the quantization level.

[0236] The inverse transformer 128 can generate inverse quantization and inverse transform coefficients by performing an inverse transform on the inverse quantization transform coefficients. In embodiments, the inverse quantization and / or inverse transform coefficients may refer to coefficients on which at least one or a combination of inverse quantization and inverse transform has been applied. The inverse quantization and inverse transform coefficients may be reconstructed residual blocks.

[0237] Adder 129 can generate a reconstruction block by adding the prediction block and the reconstruction residual block to each other.

[0238] The reconstructed block can be processed by filter 130. Filter 130 can be configured to apply one or more of a plurality of filters to the target. Each of the plurality of filters can be an in-loop filter. The target can be a reconstructed sample, a reconstructed block, or a reconstructed image.

[0239] The reference frame buffer 141 can store reconstructed blocks / images provided from the filter 130. The reconstructed image can be an image that includes reconstructed blocks. Alternatively, the reconstructed image can be an image composed of reconstructed blocks.

[0240] The reference frame buffer 141 can provide the stored reconstructed image as a reference image to the predictor 123. From the viewpoint of storing the decoded (i.e., reconstructed) image (frame), the reference frame buffer 141 can also be referred to as the "decoded frame buffer (DPB)".

[0241] Structure of decoding device The decoding device 150 may include a processor 160, a memory 180, and a communicator 189.

[0242] The description of the processor 120, memory 140, and communicator 149 associated with the encoding device 110 can also be applied to the processor 160, memory 180, and communicator 189 associated with the decoding device 150. Repeated descriptions will be omitted here.

[0243] Processor 160 may include multiple components. These components may include entropy decoder 161, partitioner 162, predictor 163, dequantizer 167, inverse transformer 168, adder 169, and filter 170.

[0244] The memory 180 may include a reference screen buffer 181.

[0245] The communicator 189 can perform functions related to communication with information in the decoding device 150. For example, the communicator 189 can receive a bit stream from the encoding device 110.

[0246] In the names of components of the decoding device 150, "-unit" can be used instead of "-device" or "-device". The memory 180 can be designated as a storage unit.

[0247] Operation of decoding devices The communicator 149 of the encoding device 110 can send the bit stream generated by the encoding device 110 to the decoding device 150. Optionally, a computer-readable storage medium storing the bit stream can send the bit stream generated by the encoding device 110 to the decoding device 150.

[0248] The communicator 189 can receive a bit stream from the encoding device 110 via a wired / wireless transmission medium. The received bit stream can be stored in the memory 180.

[0249] Processor 160 may obtain bit streams from memory 180 or computer-readable storage media.

[0250] Bitstreams may include encoded information.

[0251] The entropy decoder 161 can generate information for image decoding by performing entropy decoding on the encoded information of the bitstream based on a probability distribution.

[0252] Information used for image decoding can include quantization levels, syntax elements, etc.

[0253] The entropy decoder 161 can use scanning to change quantization levels in 1D vector form to 2D block form in order to perform decoding on the quantization levels. During scanning, it can be determined which of the following scans—upper right diagonal scan, vertical scan, and horizontal scan—to use based on encoding and decoding parameters such as the block size and the intra-frame prediction mode of the block.

[0254] The entropy decoder 161 can provide syntax elements to other components of the processor 160, such as the partitioner 162.

[0255] A common description of the relationship between components of the encoding device and components of the decoding device. Decoding device 150 uses the bitstream generated by encoding device 110 to perform decoding. Encoding device 110 can use the reconstructed image derived in decoding device 150 instead of the original image not provided to decoding device 150 to encode the target block. Therefore, encoding device 110 and decoding device 150 need to be able to generate reconstructed blocks / images in the same way. In this regard, the description of partitioner 122, predictor 123, dequantizer 127, inverse transformer 128, adder 129, filter 130, and reference frame buffer 141 of encoding device 110 disclosed in the embodiments can be applied to partitioner 162, predictor 163, dequantizer 167, inverse transformer 168, adder 169, filter 170, and reference frame buffer 181 of decoding device 150, respectively. Repeated descriptions will be omitted here.

[0256] Furthermore, each of the partitioner 122, predictor 123, dequantizer 127, inverse transformer 128, adder 129, and filter 130 of the encoding device 110 can generate information about the syntax elements for processing a specified target. Furthermore, each of the partitioner 162, predictor 163, dequantizer 167, inverse transformer 168, adder 169, and filter 170 of the decoding device 150 can use the information about the syntax elements to perform processing on the target (the same processing performed by the encoding device 110).

[0257] As described above, corresponding components of the encoding device 110 and the decoding device 150 can perform the same or corresponding functions. In embodiments, the processor may refer to the processor 120 of the encoding device 110 and / or the processor 160 of the decoding device 150. For example, in functions related to prediction, the processor may refer to the predictor 123, subtractor 124, and adder 129, and may also refer to the predictor 163 and adder 169. In functions related to transformation, the processor may refer to the transformer 125 and inverse transformer 128, and may also refer to the inverse transformer 168. In functions related to quantization, the processor may refer to the quantizer 126 and dequantizer 127, and may also refer to the dequantizer 167. In functions related to entropy encoding / decoding, the processor may refer to the entropy encoder 139 and / or entropy decoder 161. In functions related to filtering, the processor may refer to the filter 130 and / or filter 170. The memory may refer to the memory 140 of the encoding device 110 and / or the memory 180 of the decoding device 150. The reference frame buffer may refer to the reference frame buffer 141 of the encoding device 110 and / or the reference frame buffer 181 of the decoding device 150. The communicator may refer to the communicator 149 of the encoding device 110 and / or the communicator 189 of the decoding device 150.

[0258] Partitions of the units that make up an image Figure 2 An image partitioning structure according to an embodiment is shown.

[0259] Figure 2 An example of a cell being divided into multiple sub-cells can be illustrated.

[0260] A CU can be used as the basic unit for image encoding and decoding. Furthermore, a CU can be used as the basic unit for prediction, transform, quantization, inverse quantization, inverse transform, entropy coding, and entropy decoding.

[0261] A CU can be used as a unit for applying prediction modes. In other words, it can be determined which of the available prediction modes available for each CU will be applied to encoding and decoding. For example, available prediction modes may include intra-frame prediction, inter-frame prediction, and intra-block copy (IBC) prediction.

[0262] The target image 200 can be sequentially partitioned into units of CTUs. For each CTU, a partitioning structure can be determined. A CTU may be partitioned into CUs depending on the partitioning structure. Optionally, a CTU may be used as a CU. The size of a CTU can be the largest CU size.

[0263] Each CU can have depth information. Depth information can refer to the depth of the CU and can also represent the size of the CU. The depth of a CTU can be 0. The depth of a CU generated by partitioning a CTU can be 1. When a parent CU is partitioned into child CUs, the depth of the child CU can be increased by 1 from the depth of the parent CU. The number of CUs generated by partitioning can be a positive integer equal to or greater than 2, including 2, 4, 8, 16, etc. Depending on the number of child CUs, at least one of the horizontal and vertical dimensions of the child CUs generated by partitioning the parent CU can be less than at least one of the horizontal and vertical dimensions of the parent CU.

[0264] The partitioned CUs can be recursively partitioned in the same way up to a predefined maximum depth or a predefined minimum size. The depth of the smallest decoding unit (SCU) can be the predefined maximum depth, and the size of the SCU can be the predefined minimum size. The size of the SCU can be the minimum CU size.

[0265] For example, the range of CU depths can correspond to values ​​from 0 to 3. Depending on the CU depth, the CU can have dimensions ranging from 64×64 to 8×8. A CTU with a depth of 0 can be a 64×64 block. 0 can be the minimum depth. An SCU with a depth of 3 can be an 8×8 block. 3 can be the maximum depth. Depth 0 can represent a CTU as a 64×64 block. Depth 1 can represent a CU as a 32×32 block. Depth 2 can represent a CU as a 16×16 block. Depth 3 can represent an SCU as an 8×8 block.

[0266] The partition information of a CU indicates whether the CU has been partitioned. The partition information can be a 1-bit flag. All CUs except SCUs can include partition information. For example, the partition information of a CU that is not further partitioned can be "0" as the first value, while the partition information of a partitioned CU can be "1" as the second value.

[0267] Quadtree (QT) partitioning refers to dividing a CU into four CUs. When a parent CU is partitioned into four child CUs, the horizontal and vertical dimensions of each child CU can be half of the horizontal and vertical dimensions of the parent CU, respectively.

[0268] Binary tree (BT) partitioning refers to dividing a CU into two CUs. For example, when a parent CU is partitioned into two child CUs, the horizontal or vertical dimension of each child CU can be half the horizontal or vertical dimension of the parent CU.

[0269] Ternary tree (TT) partitioning refers to dividing a single CU (Computer Unit) into three CUs. For example, when a parent CU is partitioned into three child CUs, the three child CUs can be generated by partitioning the parent CU's horizontal or vertical dimensions in a 1:2:1 ratio. The horizontal or vertical dimensions of the child CUs can be 1 / 4, 1 / 2, and 1 / 4 of the parent CU's horizontal or vertical dimensions, respectively.

[0270] exist Figure 2 In this configuration, the QT partition is applied to the first CTU. The QT partition, BT partition, and TT partition are applied to the second CTU.

[0271] To partition a CTU, at least one of the following different partition types can be applied to the CTU: QT partition, BT partition, and TT partition. Different partition types can be applied based on specific priorities.

[0272] For example, QT partitions can be preferentially applied to CTUs. CUs that cannot be further partitioned with QT partitions can correspond to leaf nodes of QT. A CU that is a leaf node of QT can be the root node of a BT and / or TT. A CU that is a leaf node of QT can be partitioned in BT or TT form, or it can be left unpartitioned. In this case, the QT partitions may not be applied again to CUs generated by applying BT or TT partitions to CUs that are leaf nodes of QT.

[0273] QT partitioning information can be used to signal the partitions of the CU corresponding to each node of the QT. QT partitioning information can be a flag. The QT partitioning information of a cell can indicate whether the cell is partitioned in QT format. A "0" as the first value of the QT partitioning information indicates that the CU is not partitioned in QT format. QT partitioning information with a first value can refer to Multi-Type Tree (MTT) partitioning. MTT partitioning can include BT partitioning and TT partitioning. A "1" as the second value of the QT partitioning information indicates that the CU is partitioned in QT format.

[0274] There may be no priority between BT and TT partitions. That is, CUs corresponding to leaf nodes of QT can be partitioned in either BT or TT format. Furthermore, CUs generated by BT or TT partitions can be further partitioned in either BT or TT format, or they may not be further partitioned.

[0275] The CU corresponding to a leaf node of QT can be the root node of MTT. For each CU corresponding to a node of MTT, the CU may also include partition direction information and partition format information in MTT format.

[0276] Partition direction information indicates the partitioning direction of an MTT partition. A "0" as the first value of the partition direction information indicates that the CU is partitioned horizontally. A "1" as the second value of the partition direction information indicates that the CU is partitioned vertically.

[0277] Partition format information indicates the partition format used for Multi-Type Tree (MTT) partitioning. A "0" as the first value of the partition format information indicates that the CU is partitioned in TT format. A "1" as the second value of the partition format information indicates that the CU is partitioned in BT format.

[0278] Here, each of the partition direction information and partition format information mentioned above can be a flag with a specific length (e.g., 1 bit).

[0279] The partition information of a CU may also include QT partition information, partition direction information, and partition format information.

[0280] A CU that has not been further partitioned through QT, BT, or TT partitioning can be used as a unit for specific processes such as prediction, transform, quantization, inverse quantization, inverse transform, entropy coding, and entropy decoding. In other words, for a specific process, the CU may not be further partitioned. Therefore, the partitioning information used to partition the CU into PUs and / or TUs may not exist in the bitstream.

[0281] Conversely, when the size of the CU is larger than the maximum TU size, the CU can be recursively partitioned until the size of the CU becomes smaller than or equal to the maximum TU size. For example, when the size of the CU is 64×64 and the maximum TU size is 32×32, the CU can be partitioned into four 32×32 TUs to perform the transformation. Similarly, when the size of the CU is 32×64 and the maximum TU size is 32×32, the CU can be partitioned into two 32×32 TUs to perform the transformation.

[0282] In this scenario, it's not necessary to separately send a signal indicating whether the CU has been partitioned for transformation. Instead, partitioning can be determined by comparing the CU's dimensions (horizontal / vertical) with the maximum TU's dimensions (horizontal / vertical). For example, if the CU's horizontal dimension is greater than the maximum TU's horizontal dimension, the CU can be vertically bisected. Similarly, if the CU's vertical dimension is greater than the maximum TU's vertical dimension, the CU can be horizontally bisected.

[0283] For example, the minimum size of a CU can be 4×4. For example, the maximum size of a transform block can be 64×64. For example, the minimum size of a transform block can be 4×4. The minimum size of a QT can be the minimum size of the CU corresponding to a leaf node of the QT. The maximum depth of an MTT can be the maximum depth of the path from the root node to a leaf node of the MTT.

[0284] The maximum size of BT can represent the maximum size of the CU corresponding to each node of BT, and the maximum size of TT can represent the maximum size of the CU corresponding to each node of TT. The minimum size of BT and / or the minimum size of TT can be set as the minimum size of the CU.

[0285] When the depth of the CU corresponding to a node in the MTT is equal to the maximum depth of the MTT, the CU may not be partitioned in BT form and / or TT form.

[0286] Based on the various sizes and depths of the CU described above, each piece of information described in the embodiments may or may not exist in the bitstream.

[0287] Information about the maximum or minimum size described in the embodiments can be transmitted via signals at a level higher than the CU. In the embodiments, levels higher than the CU may include video level, sequence level, picture level, sub-picture level, parallel block group level, parallel block level, stripe level, etc.

[0288] The information described in the embodiments can be transmitted separately using signals for different types of stripes. Different types of stripes may include intra-frame stripes and inter-frame stripes.

[0289] Block processing depends on block attributes Whether to apply / execute a specific process described in the embodiments can be determined based on the attributes of a block associated with a specific process. Whether to apply / execute a specific process described in the embodiments can be determined based on whether the attributes of a block associated with a specific process satisfy specific conditions. For example, a block may include a target block, neighboring blocks, and reference blocks. The block may include other blocks described in the embodiments. A block may be one of the blocks and units described in the embodiments.

[0290] The blocks for a particular process described in the application examples may have a square shape or a non-square shape.

[0291] In this embodiment, the attributes of a block may include its size. When specific conditions related to the block size are met, specific processes described in this embodiment may be applied / performed.

[0292] In an embodiment, specific conditions may include a minimum block size condition and a maximum block size condition. The block applying the minimum block size condition and the block applying the maximum block size condition may be different from each other.

[0293] In the embodiments, the minimum block size and / or maximum block size for a specific process can be predefined.

[0294] In an embodiment, the processing according to the embodiment may be applied / executed when the block size is equal to or greater than the minimum block size and / or when the block size is less than or equal to the maximum block size. Optionally, in an embodiment, the processing according to the embodiment may be applied / executed when the block size is greater than the minimum block size and when the block size is less than the maximum block size.

[0295] In this embodiment, the processing according to the embodiment may be applied / executed only when the block size is equal to or greater than the minimum block size and less than or equal to the maximum block size. Alternatively, the processing according to the embodiment may be applied / executed only when the block size is greater than the minimum block size and less than or equal to the maximum block size. Alternatively, the processing according to the embodiment may be applied / executed only when the block size is equal to or greater than the minimum block size and less than the maximum block size. The processing according to the embodiment may be applied / executed only when the block size is greater than the minimum block size and less than the maximum block size.

[0296] In this embodiment, the processing according to the embodiment may be applied / executed only if the block size is a predefined block size.

[0297] In embodiments, block size can be determined based on various methods. For example, block size can represent the horizontal or vertical dimension of the block. Block size can represent both the horizontal and vertical dimensions of the block. Block size can represent the area of ​​the block. Block size can represent 1) the result of a known equation, 2) the result of an equation according to the embodiment, or 3) a statistical value using the horizontal and vertical dimensions of the block.

[0298] Furthermore, for the first size, the processing according to the first embodiment can be applied / executed, and for the second size, the processing according to the second embodiment can be applied / executed.

[0299] In embodiments, the block size can be 2×2, 4×4, 8×8, 16×16, 32×32, 64×64, or 128×128. Optionally, in embodiments, the block size can be (2 SIZE X )×(2 SIZE Y (or similar.) SIZE X It can be one of 1 or a larger integer. SIZE Y It can be one of 1 or a larger integer.

[0300] Predictive information used for prediction Prediction information can be used to generate prediction blocks for the target block.

[0301] Encoding device 110 can generate prediction information required for prediction and can generate a bit stream including the prediction information. The prediction information can be transmitted from encoding device 110 to decoding device 150 via the bit stream. Decoding device 150 can obtain the prediction information from the bit stream and can generate a prediction block by performing prediction on the target block using the prediction information.

[0302] The prediction information may include intra-frame prediction information, inter-frame prediction information, and IBC prediction information. In embodiments, the prediction information may be replaced by intra-frame prediction information, inter-frame prediction information, and / or IBC prediction information. Intra-frame prediction may include the information for intra-frame prediction described in the embodiments. Inter-frame prediction may include the information for inter-frame prediction described in the embodiments. IBC information may include the information for IBC prediction described in the embodiments.

[0303] Intra-frame prediction Figure 3 The structure of intra-frame prediction according to an embodiment is shown.

[0304] Intra-frame prediction can be performed using reference samples and encoding / decoding parameters for the target block. The reference samples can be (reconstructed) samples within a (reconstructed) reference block. Optionally, intermediate prediction samples can be generated using samples such as reconstructed samples described in the embodiments, and then the intermediate prediction samples can be used to generate reference samples. Processes such as filtering described in the embodiments can be applied when generating reference samples.

[0305] A reference block can be a (spatial) neighbor block of the target block. Encoding / decoding parameters can be those used for the target block and / or those used for the reference block. In intra-frame prediction, a reference sample can be a neighboring sample.

[0306] Predicted blocks can be generated by performing intra-frame prediction on the target block based on reference points of the target image and information related to those reference points, according to an intra-frame prediction mode. The size of the target block and the size of the predicted block can be equal.

[0307] In this embodiment, the prediction block may be a PU. Alternatively, the prediction block may correspond to a CU or TU described in the embodiment. The prediction block may have a square or rectangular shape.

[0308] Intra-frame prediction modes can be represented by at least one of mode number, mode value, mode angle, and mode direction. Figure 3The lower right portion shows the prediction directions for multiple intra prediction modes used for the target block. Among these intra prediction modes, all except DC mode and planar mode can be directional modes. A directional mode can be an intra prediction mode with a specific direction or angle. The intra prediction mode for the target block can be selected from directional modes and non-directional modes.

[0309] In the rectangle indicating the target block in the lower right part of the figure, the number "0" can indicate a planar mode as a non-directional intra-prediction mode. The number "1" can indicate a DC mode as a non-directional intra-prediction mode. In the rectangle indicating the target block in the lower right part of the figure, the arrow from the center of the rectangle to the outside indicates the prediction direction of the directional intra-prediction mode. Furthermore, the numbers indicated near the arrows can represent examples of mode values ​​assigned to the intra-prediction mode or the prediction direction of the intra-prediction mode.

[0310] Intra-prediction can be performed based on the intra-prediction mode used for the target block. One of the intra-prediction modes available for the target block can be used as the intra-prediction mode for the target block.

[0311] The number of intra-prediction modes available for the target block can be a predefined value. Alternatively, the number of intra-prediction modes available for the target block can be determined based on the attributes of the prediction block. For example, the attributes of the prediction block can include codec parameters such as shape, size, and color components.

[0312] For example, in Figure 3 In the image, the directional patterns indicated by the dashed lines (i.e., directional patterns with numbers corresponding to any one of -14 to -1 or any one of 67 to 80) can be applied only for predictions of non-square blocks. Therefore, the number of intra-frame prediction patterns available for predictions of square blocks can be 67 (planar mode, DC mode, 65 directional patterns).

[0313] For example, the number of available intra-prediction modes can vary depending on which of the luma or chroma signals corresponds to the color component of the block. The number of available intra-prediction modes for the luma component block can be greater than the number of available intra-prediction modes for the chroma component block.

[0314] Intra-frame prediction modes can include horizontally-below mode, horizontal mode, vertical mode, and vertically-right mode. Horizontally-below mode can be an intra-frame prediction mode located below the horizontal mode. Vertically-right mode can be a mode located to the right of the vertical mode. For example, in... Figure 3In the above, the mode value for the horizontal mode can be 18. The mode value for the vertical mode can be 50. Intra-prediction modes (each of which has a mode value of 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, and 66) can be vertical right-side modes. Intra-prediction modes with a mode value of 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, and 17 can be horizontal bottom-side modes.

[0315] The number of intra-prediction modes and the mode number of each intra-prediction mode described above are merely examples. The number of intra-prediction modes and the mode number of each intra-prediction mode may be defined differently depending on the embodiments, their implementation methods, and / or necessity.

[0316] When generating a prediction block for a target block in the intra-frame prediction mode of planar mode, the sample value of the prediction sample can be generated by using the weighted sum of the upper reference sample of the target sample, the left reference sample of the target sample, the upper right reference sample of the target block, and the lower left reference sample of the target block, based on the position of the prediction sample in the prediction block.

[0317] When the intra-frame prediction mode is DC mode, a prediction block can be generated based on the average of the sample values ​​of multiple reference samples. These reference samples can include the upper reference sample and the left reference sample of the target block. The values ​​of the prediction samples in the prediction block can be determined based on the average of the sample values ​​of the multiple reference samples. Furthermore, filtering using the values ​​of the reference samples can be performed on specific rows and / or specific columns in the target block. A specific row can be one or more upper rows adjacent to the upper reference sample. A specific column can be one or more left columns adjacent to the left reference sample.

[0318] When the intra-frame prediction mode is directional mode, the prediction block can be generated using the top reference sample, left reference sample, top right reference sample, and / or bottom left reference sample of the target block.

[0319] The intra-prediction mode of the target block can be determined using the intra-prediction modes of its neighboring blocks. Information for determining the intra-prediction mode of the target block can be transmitted using signals.

[0320] For example, when the intra-prediction mode of the target block and the intra-prediction mode of the neighboring blocks are the same, an indicator indicating that the intra-prediction mode of the target block and the intra-prediction mode of the neighboring blocks are the same can be sent by signaling.

[0321] For example, an indicator can be sent to indicate an intra-prediction mode that is the same as the intra-prediction mode of the target block among the intra-prediction modes of multiple neighboring blocks.

[0322] For example, when the intra prediction modes of the target block and neighboring blocks are different from each other, an indicator indicating the intra prediction mode of the target block can be sent using signals. Alternatively, information for deriving the intra prediction mode of the target block based on the intra prediction modes of neighboring blocks can be sent using signals.

[0323] Reference samples used for intra-frame prediction of the target block may include lower left reference samples, left side reference samples, upper left reference samples, upper top reference samples, upper right reference samples, etc.

[0324] For example, a left reference sample can be a reconstructed reference sample adjacent to the left side of the target block. A top reference sample can be a reconstructed reference sample adjacent to the top of the target block. A top-left reference sample can be a reconstructed reference sample diagonally adjacent to the top-left side of the target block. A bottom-left reference sample can be a sample located below the left reference sample on the same line as the left sample line formed by the left reference samples. A top-right reference sample can be a sample located to the right of the top reference sample on the same line as the top sample line formed by the top reference samples.

[0325] Reference samples for intra-prediction of the target block can be determined based on the intra-prediction mode of the target block. One or more reference samples can be used to determine the sample values ​​for the prediction samples of the prediction block. Figure 3 In the diagram, the direction of the intra-prediction mode, indicated by the arrow, can indicate the direction from the predicted sample to each reference sample. The direction of the intra-prediction mode can represent the dependency between the reference sample and the predicted sample. For example, depending on the intra-prediction mode, the sample value of a particular reference sample can be used as the sample value of at least one sample in the prediction block. Here, the particular reference sample and at least one sample in the prediction block can be samples that are specified as a straight line in the direction of the corresponding intra-prediction mode. In other words, the sample value of the particular reference sample can be copied to the sample value of the predicted sample located in the direction opposite to the direction of the intra-prediction mode. Optionally, the sample value of the predicted sample in the prediction block can be the sample value of the reference sample located in the direction of the intra-prediction mode based on the position of the predicted sample.

[0326] Reference points used for intra-frame prediction are not limited to those points that are exactly adjacent to the target block. For example... Figure 3 As shown, for intra-frame prediction of the target block, at least one or a combination of reference sample lines 0 to 3 can be used.

[0327] Figure 3Each reference sample line may include one or more reference samples. When the reference sample line number is smaller, it indicates a reference sample closer to the target block. Reference sample line 0 may be a line containing reference samples that are directly adjacent to the target block. When the top-left coordinate of the target block is (X, Y), the horizontal length of the target block is W, and the vertical length of the target block is H, the reference sample on reference sample line 0 may be a sample with x-coordinate X-1 or y-coordinate Y-1. Here, the y-coordinate of a reference sample with x-coordinate X-1 may be from Y-1 to Y+2H. The x-coordinate of a reference sample with y-coordinate Y-1 may be from X-1 to X+2W. Reference samples in reference sample line A may be samples with x-coordinate XA-1 or y-coordinate YA-1. Here, the y-coordinate of a reference sample with x-coordinate XA-1 may be from YA-1 to Y+2H+A. The x-coordinate of a reference sample with y-coordinate YA-1 may be from XA-1 to X+2W+A. “A” can be 1, 2 or 3.

[0328] Samples in fragments A and F can be derived by filling with samples that are closest to fragments B and E, respectively, instead of being obtained from reconstructed neighboring blocks.

[0329] A reference sample line index can indicate the reference sample line among multiple reference sample lines used for intra-frame prediction of the target block. For example, a reference sample line index can have a value corresponding to one of 0 to 3. The reference sample line index can be transmitted by signal.

[0330] When inter-color component intra-frame prediction is used for a target block, a predicted block for the second color component can be generated based on the reconstructed block of the first color component of the target block. For example, the first color component can be the luma component, and the second color component can be the chroma component.

[0331] For intra-frame prediction between color components, parameters between the first and second color components can be derived based on a template. For example, the parameters can be those of a linear model.

[0332] For example, the template may include an upper reference sample and / or a left reference sample of the target block, and may include an upper reference sample and / or a left reference sample of the reconstructed block of the first color component corresponding to the reference sample.

[0333] When parameters are exported, a predicted block for the second color component can be generated for the target block by applying the reconstructed block of the first color component to the linear model. Depending on the image format or the type of inter-color component intra-frame prediction, subsampling / downsampling can be performed on the neighboring samples of the reconstructed block of the first color component and the reconstructed block of the first color component. When subsampling is performed, the corresponding samples exported through subsampling can be used to perform parameter export and inter-color component intra-frame prediction.

[0334] Intra-fragmented sub-partitioning (ISP) prediction refers to the sequential execution of intra-fragmentation over multiple sub-blocks generated by partitioning a target block. In ISP prediction, the target block can be partitioned into two or four sub-blocks in the horizontal and / or vertical directions. The sub-blocks generated from the partitions can be reconstructed sequentially. When intra-fragmentation is performed on each sub-block, a sub-prediction block can be generated for each sub-block. Furthermore, when inverse quantization and / or inverse transform is performed on each sub-block, a sub-residual block can be generated for the corresponding sub-block. The corresponding reconstructed sub-block can be generated by adding the sub-prediction block to the sub-residual block. The reconstructed sub-block can be used as reference samples for intra-fragmentation of other sub-blocks to be processed subsequently.

[0335] When performing prediction for a target block, it can be determined whether samples included in the reconstructed neighboring blocks can be used as reference samples for the target block. When there are unusable samples among the samples in the neighboring blocks that cannot be used as reference samples for the target block, the sample value of each unusable sample can be replaced by a value generated based on the copying and / or interpolation of the sample value using at least one sample included in the reconstructed neighboring blocks. When the sample value of a sample is replaced by a value generated by copying and / or interpolation, the corresponding sample can be used as a reference sample for the target block.

[0336] When performing intra-frame prediction, the sample values ​​of prediction samples in the prediction block can be determined based on the sample values ​​of reference samples. The position of the reference sample can be specified by the position of the prediction sample and the direction of the intra-frame prediction mode. When the position specified by the position of the prediction sample and the direction of the intra-frame prediction mode is an integer position, the sample value of a reference sample indicated by the integer position can be used to determine the sample value of the prediction sample in the prediction block. When the position specified by the position of the prediction sample and the direction of the intra-frame prediction mode is not an integer position, an interpolated reference sample can be generated based on the two reference samples closest to the specified position. The sample value of the interpolated reference sample can be used to determine the sample value of the prediction sample. In other words, when the position specified by the position of the prediction sample and the direction of the intra-frame prediction mode indicates the position between two reference samples, an interpolated sample value can be generated based on the sample values ​​of the two samples.

[0337] Inter-frame prediction Figure 4 The structure of inter-frame prediction for explaining inter-frame prediction processing according to an embodiment is shown.

[0338] Figure 4 The rectangle shown can represent an image (screen). Furthermore, in Figure 4 In the image, the arrow can specify the prediction direction.

[0339] Based on the encoding / decoding type, the individual images that make up a video can be classified into I-frames (i.e., intra-frame frames), P-frames (i.e., one-way predictive frames), and B-frames (i.e., two-way predictive frames). Encoding and decoding of each frame can be performed according to its encoding / decoding type.

[0340] When the target frame is an I-frame, information from the target frame can be used to perform encoding and decoding of the target frame without referencing inter-frame prediction of other images. For example, intra-frame prediction and / or IBC prediction can be used to perform encoding and decoding of the I-frame.

[0341] Encoding and decoding of P-frames and B-frames can be performed through at least one of intra-frame prediction, IBC prediction, and inter-frame prediction using a reference image.

[0342] When the target frame is a P-frame, one-way inter-frame prediction using a list of reference images can be used to perform encoding and decoding of the target frame.

[0343] When the target frame is a B-frame, the encoding and decoding of the target frame can be performed using one-way inter-frame prediction or two-way inter-frame prediction with two reference image lists.

[0344] In the following text, inter-frame prediction for a target block in inter-frame mode according to an embodiment will be described in detail.

[0345] When the prediction mode of the target block is inter-frame mode, inter-frame prediction can be performed on the target block. The target block can be a prediction block or a partition prediction block.

[0346] Inter-frame prediction can be performed using reference images and motion information. In inter-frame prediction, a reference image index can be used to select a reference image (reference frame), and motion information can be used to determine a reference block within the reference image corresponding to the target block. The determined reference block can then be used to generate a predicted block for the target block.

[0347] Motion information can be derived using encoding / decoding parameters, etc. For example, motion information can be derived using motion information from reconstructed neighboring blocks, motion information from COL blocks, and / or motion information from blocks adjacent to COL blocks.

[0348] In this embodiment, the candidate list can be used for inter-frame prediction. The candidate list may include multiple candidates. An index indicating the candidate in the candidate list used for inter-frame prediction of the target block can be transmitted by signaling. The candidate list can be derived by the encoding device 110 and the decoding device 150 in the same manner based on the same information. Here, the same information may include the reconstructed image and the reconstructed block. Furthermore, in order to execute the candidate selection using the index, the order of the candidates in the candidate list needs to be consistent.

[0349] In this embodiment, prediction for a target block can be performed by utilizing the motion information of spatial candidates or temporal candidates as the motion information of the target block. The motion information of spatial candidates can be referred to as spatial motion information. The motion information of temporal candidates can be referred to as temporal motion information.

[0350] Spatial candidates can be reconstructed spatial neighbor blocks that are spatially adjacent to the target block.

[0351] Spatial candidates can be 1) blocks that exist in the target image, 2) blocks that have been reconstructed by decoding, and 3) blocks that are adjacent to the target block.

[0352] Spatial candidates can include the target block's left block, top block, bottom left block, top right block, and top left block.

[0353] Temporal candidates can be reconstructed time neighbors that exist in the reconstructed COL image (picture) and correspond to the target block.

[0354] In this embodiment, the motion information of spatial candidates can be the motion information of blocks including spatial candidates. The motion information of temporal candidates can be the motion information of blocks including temporal candidates.

[0355] In inter-frame prediction, COL blocks can be identified for the target block. The region of the target block in the target image and the region of the COL block in the COL frame can be the same. In other words, a COL block can be a block that occupies a specific area in the COL frame. The specific area can be the region in the COL frame that corresponds to the region of the target block.

[0356] The time candidate can indicate the position inside the COL block within the COL screen and / or the position outside the COL block.

[0357] For example, a COL block can include a first COL block and a second COL block. The top-left coordinate of the COL block is (xP, yP) and the size of the COL block is (nPSW, nPSH). The first COL block can be the block occupying coordinates (xP+nPSW, yP+nPSH). The second COL block can be the block occupying coordinates (xP+(nPSW>>1), yP+(nPSH>>1)). When the first COL block is unavailable, the second COL block can be selectively used as the COL block.

[0358] The MV of the target block can be determined based on the MV of the COL block. Scaling can be performed on the MV of the COL block. The scaled MV of the COL block can be used as the MV of the target block or the predicted MV. Optionally, the MVs of temporal candidates listed in the candidate list related to inter-frame prediction can be scaled MVs.

[0359] The ratio of the scaled MV to the COL block's MV can be the same as the ratio of the first time distance to the second time distance. The first time distance can be the distance between the reference image of the target block and the target image. The second time distance can be the distance between the reference image of the COL block and the COL image.

[0360] The scheme for deriving motion information can be determined based on the inter-frame prediction mode of the target block. For example, AMVP mode, merge mode, skip mode, merge mode with MVD, sub-block merge mode, GPM, combined inter-intra-frame prediction (CIIP) mode, or affine inter-frame prediction mode can be used as the inter-frame prediction mode. The various inter-frame prediction modes will be described in the following embodiments.

[0361] AMVP mode When the AMVP pattern is used as the prediction pattern, a list of MV candidates, including one or more MV candidates, can be created using spatial MV candidates, temporal MV candidates, history-based MV candidates, zero vectors, etc. At least one of spatial MV candidates, temporal MV candidates, zero vectors, etc., can be identified and used as an MV candidate.

[0362] Spatial candidates can include reconstructed spatial neighbor blocks. The motion vectors (MVs) of the reconstructed spatial neighbor blocks can be referred to as spatial motion vector (MV) candidates. Temporal candidates can include COL blocks and blocks adjacent to COL blocks. The MV of a COL block or the MV of a block adjacent to a COL block can be referred to as temporal motion vector (MV) candidates. History-based MV candidates can be MVs included in a list of MVs of other blocks that were encoded / decoded before the target block was encoded / decoded.

[0363] Encoding device 110 can use an MV candidate list to determine, within a search range, the MV to be used for encoding the target block. The maximum number of MV candidates in the MV candidate list can be predefined. N can represent the predefined maximum number. For example, N can be 2. Optionally, the maximum number of candidates can be signaled from the encoding device to the decoding device, or it can be derived by the decoding device. Encoding device 110 can determine, from the MV candidates in the MV candidate list, the MV candidates that will be used as the predicted MV for the target block. The MV to be used for encoding the target block can be the MV that can be encoded at the minimum cost. Encoding device 110 can determine whether an AMVP pattern will be used for encoding the target block and can generate AMVP pattern usage information indicating whether an AMVP pattern is used.

[0364] Inter-frame prediction information may include 1) AMVP mode usage information, 2) MV candidate index, 3) MVD, 4) MVD resolution information, 5) reference orientation, and 6) reference image index, and may also include residual blocks. The inter-frame prediction information can be transmitted from the encoding device 110 to the decoding device 150 via a bitstream.

[0365] Decoding device 150 can obtain AMVP mode usage information from the bitstream. When the AMVP mode usage information indicates that the AMVP mode is used, decoding device 150 can obtain MV candidate index, MVD, MVD resolution information, reference orientation, and reference image index from the bitstream. Among the MV candidates included in the MV candidate list, the MV candidate indicated by the MV candidate index can be selected as the predicted MV of the target block.

[0366] MVD can represent the difference between the MV actually used for inter-frame prediction of the target block and the predicted MV. Encoding device 110 can derive a predicted MV that is closer to the MV actually used for inter-frame prediction of the target block in order to use an MVD with the smallest possible value. Decoding device 150 can derive the MV of the target block by adding the MVD to the predicted MV. In other words, the MV of the target block derived by decoding device 150 can be the sum of the MVD and the predicted MV candidate.

[0367] Furthermore, the encoding device 110 can generate MVD resolution information. The MVD resolution information can be used to adjust the MVD resolution. The decoding device 150 can use the MVD resolution information to adjust the MVD resolution.

[0368] Furthermore, the encoding device 110 can calculate the MVD based on an affine model. The affine control points MV of the target block can be derived based on the sum of the affine control point MV candidates and the MVD. The MV of each sub-block in the target block can be derived using the affine control points MV.

[0369] Merge mode When using the merge mode, motion information from spatial candidates, motion information from temporal candidates, etc., can be used to create a merge candidate list that includes multiple merge candidates. Motion information can include 1) motion vector (MV), 2) reference image index, 3) reference orientation, etc. Each merge candidate can be a piece of motion information.

[0370] Merge candidates may include 1) spatial merge candidates generated based on spatial candidates, 2) temporal merge candidates generated based on temporal candidates, 3) historical merge candidates, 4) average merge candidates, and 5) zero merge candidates.

[0371] Historically based merge candidates can include information from multiple motion information of other blocks that were encoded / decoded before the target block was encoded / decoded.

[0372] The average merge candidate can be a merge candidate generated based on the average of two merge candidates in the merge candidate list.

[0373] Zero-vector motion information can be zero-vector motion information. Zero-vector motion information can be motion information where MV is a zero-vector.

[0374] Merging candidates can be added to the merging candidate list according to a predefined method and a predefined order, so that the merging candidate list has a preset number of merging candidates. The encoding device 110 and the decoding device 150 can construct the same merging candidate list by using the predefined method and predefined order.

[0375] Encoding device 110 can select a merge candidate from a merge candidate list to be used for encoding the target block. Encoding device 110 can determine whether a merge mode will be used to encode the target block and can generate merge mode usage information indicating whether a merge mode is used.

[0376] Inter-frame prediction information may include 1) merging mode usage information, 2) merging index, and 3) correction information, and may include residual blocks. The inter-frame prediction information can be transmitted from the encoding device 110 to the decoding device 150 as a bit stream.

[0377] Decoding device 150 can obtain merge mode usage information from the bitstream. When the merge mode usage information indicates that a merge mode is being used, decoding device 150 can obtain information related to the merge mode from the bitstream, such as the merge index.

[0378] Encoding device 110 can select the best merge candidate from merge candidates included in the merge candidate list, and can set the value of the merge index to indicate the selected merge candidate.

[0379] The correction information can be used to correct the MV. Encoding device 110 can generate the correction information. Decoding device 150 can derive the corrected MV by correcting the MV of the merge candidate selected by the merge index based on the correction information. The corrected MV can be used as the MV of the target block.

[0380] In an embodiment, the correction information may include MVD (Modular Value Determination). The correction information may include one or more of correction usage information, correction direction information, and correction size information. The correction usage information may indicate whether correction of the MV is used. A merging mode that performs MV correction based on the correction information may be referred to as a merging mode with MVD.

[0381] In merge mode, predictions for the target block can be performed using merge candidates indicated by the merge index from among the merge candidates included in the merge candidate list.

[0382] The motion information of the target block can be derived using 1) MV, 2) reference image index, 3) reference direction, etc., of the merge candidates indicated by the merge index.

[0383] In an embodiment, the merge candidates in the merge candidate list can be specific modes for deriving inter-frame prediction information. Each merge candidate can be information indicating a specific mode for deriving inter-frame prediction information. Inter-frame prediction information for a target block can be derived based on the specific mode indicated by the merge candidate. In this regard, a specific mode can be considered a specific inter-frame prediction information deriving mode or a specific motion information deriving mode. A specific mode can include a series of processes for deriving inter-frame prediction information.

[0384] Inter-frame prediction information for the target block can be derived based on a specific mode indicated by the merge candidate selected by the merge index from the merge candidate list. For example, the specific mode may include a sub-block motion information derivation mode and an affine motion information derivation mode, and may also include other modes for deriving motion information as described in the embodiments.

[0385] Skip mode can be a mode that does not use residual blocks. In other words, when using skip mode, the reconstructed block can be the same as the predicted block. The description of merge mode in the embodiments can also be applied to skip mode. The difference between merge mode and skip mode lies in whether residual blocks are sent and used. In other words, except for not sending / using residual blocks, skip mode can be similar to merge mode, and the description of merge mode can also be applied to skip mode.

[0386] Sub-block merging mode can be a mode for deriving motion information of target sub-blocks within a target block. When applying sub-block merging mode, a list of sub-block merging candidates can be created using affine control point motion vector merging candidates and / or sub-block-based temporal merging candidates. Sub-block-based temporal merging candidates can be the motion information of the COL sub-blocks of the target sub-block.

[0387] In GPM, two motion information points of the target block can be used to generate a first prediction block and a second prediction block. For each coordinate of the target block, the weighted sum of the first prediction sample points of the first prediction block and the second prediction sample points of the second prediction block can be used to generate the final prediction block of the final prediction block.

[0388] Here, the first weight of the first predicted sample and the second weight of the second predicted sample can be determined based on the boundaries of the GPM. The boundaries can indicate the partition lines used to partition the target block. According to the boundaries, the target block can be partitioned into a first partition region and a second partition region.

[0389] When the distance between the final predicted sample point and the boundary is less than or equal to the reference value, the value of the final predicted sample point in the final prediction block can be determined by the weighted sum of the first predicted sample point in the first prediction block and the second predicted sample point in the second prediction block. When the distance between the final predicted sample point and the boundary is greater than the reference value, one of the first weight and the second weight can be 1, and the other can be 0.

[0390] The Combined Inter-Frame Intra-Frame Prediction (CIIP) mode can be a mode that uses a weighted sum of prediction samples generated by inter-frame prediction and prediction samples generated by intra-frame prediction to derive prediction samples for the target block.

[0391] In the above mode, improvements can be made to the derived motion information itself, and the improved motion information can be used as the motion information for the target block. For example, blocks within a specific region determined based on the derived motion information can be searched, and the motion information of the block with the minimum sum of absolute differences (SAD) among the found blocks can be used as the improved motion information for the target block. The specific region can be a square region within a reference image specified by the motion information. The point indicated by the motion information can be the center of the specific region.

[0392] In the aforementioned mode, optical flow can be used to perform compensation for the predicted samples derived through inter-frame prediction.

[0393] Figure 5 The order in which spatial candidates are added to the candidate list is shown according to an embodiment.

[0394] exist Figure 5 The text describes the locations of spatial candidates.

[0395] The large block at the center of the attached diagram indicates the target block. The five smaller blocks adjacent to the target block represent spatial candidates.

[0396] The target block's coordinates can be (xP, yP), and the target block's size can be (nPSW, nPSH).

[0397] Spatial candidate A0 can be the block that is adjacent to the lower left of the target block. A0 can be the block that occupies the sample point corresponding to the coordinates (xP-1, yP+nPSH).

[0398] Spatial candidate A1 can be the block to the left of the target block. A1 can be the bottommost block among the blocks to the left of the target block. Optionally, A1 can be the block above A0. A1 can be the block that occupies the sample point corresponding to the coordinates (xP-1, yP+nPSH).

[0399] Spatial candidate B0 can be the block that is adjacent to the top right of the target block. B0 can be the block that occupies the sample point corresponding to the coordinates (xP+nPSW, yP-1).

[0400] Spatial candidate B1 can be the block above the target block. B1 can be the rightmost block among the blocks above the target block. Optionally, B1 can be the block to the left of B0. B1 can be the block that occupies the sample point corresponding to the coordinates (xP+nPSW-1, yP-1).

[0401] Spatial candidate B2 can be the block that is the top-left neighbor of the target block. B2 can be the block that occupies the sample point corresponding to the coordinates (xP-1, yP-1).

[0402] like Figure 5 As shown, when adding spatial candidates to the candidate list, the order B1, A1, B0, A0, and B2 can be used. That is, available spatial candidates can be added to the candidate list in the order of B1, A1, B0, A0, and B2. Figure 5 middle, Figure 5 The order in which spatial candidates are added to the merge candidate list in the diagram is merely an example.

[0403] The candidate list can include motion information candidate list, merged candidate list, MV candidate list, BV candidate list, MPM list, etc.

[0404] To add a spatial or temporal candidate to the candidate list, it can be determined whether the spatial or temporal candidate is available. When a candidate block exists outside the boundaries of an image, strip, parallel block, etc., the availability of the corresponding candidate block can be set to "false". The description "the availability of the corresponding candidate block can be set to false" can mean that the corresponding candidate block is designated as "unavailable".

[0405] The maximum number of candidates in the candidate list can be set. N can represent the preset maximum number of candidates. The preset maximum number of candidates can be signaled via parameter sets, headers, etc. For example, the maximum number of candidates in the candidate list for a target block in a strip can be set via the strip header. For example, N can be essentially 5.

[0406] IBC mode IBC mode can be an intra-frame block copy prediction mode, in which predicted blocks for the target block are generated by referencing previously reconstructed regions in the target image. In this sense, IBC mode can be referred to as the current image reference mode. A block vector (BV) can be used to specify the previously reconstructed region.

[0407] IBC mode usage information can be used to determine whether the target block is encoded / decoded in IBC mode. Encoding device 110 can determine whether IBC mode will be used to encode the target block and can generate IBC mode usage information indicating whether IBC mode is used. Decoding device 150 can obtain IBC mode usage information from the bitstream.

[0408] In IBC mode, predicted blocks for a target block can be generated based on BV. BV can specify a reference block. BV can refer to the displacement between the target block and the reference block. The reference block can be a block in the target image (picture). The description of MV in the embodiments can also be applied to BV.

[0409] IBC modes can include skip mode, merge mode, AMVP mode, etc. The descriptions of AMVP mode, merge mode, and skip mode in the embodiments can be similarly applied to the AMVP mode, merge mode, and skip mode of IBC modes, respectively.

[0410] In skip or merge mode, a merge candidate list can be constructed, and the merge index can specify one of the merge candidates in the merge candidate list. The BV of the specified merge candidate can be used as the BV of the target block.

[0411] In the AMVP model, BVD can be used. The description of MVD in the examples can also be applied to BVD.

[0412] In IBC mode, the reference block can be limited to a block in a previously reconstructed region of the target image. Optionally, the reference block can be included in the target CTU or in at least one of the left-hand CTUs. For example, the BV value can be restricted such that the reference block is located in a specific region. The specific region can be a region corresponding to three blocks of a specific size that are encoded / decoded before the block of a specific size including the target block is encoded / decoded. The specific size can be 64×64.

[0413] Transformation and Quantization Quantization levels can be generated by performing a transform / quantization on the residual block. A residual block can refer to the difference between the original block and the predicted block. Reconstructed residual blocks can be generated by performing inverse quantization and / or inverse transform on the quantization levels. Reconstructed residual blocks can refer to the difference between the reconstructed block and the predicted block.

[0414] When performing a transformation or inverse transformation, a separable transformation or a two-dimensional (2D) non-separable transformation can be performed on the residual block. A separable transformation can be a transformation that performs a 1D transformation on the residual block in each of the horizontal and vertical directions.

[0415] Transform kernels used for transformations may include: 1) various DCT kernels, such as DCT type 2 (DCT-II); 2) DST kernels; and 3) kernels derived through training. For 1D transforms, in addition to DCT-II, DCT type and DST type may also include DCT-V, DCT-VIII, DST-I, and DST-VII.

[0416] Transform sets can be used when determining the DCT type, DST type, or kernel derived through training for the transform. Each transform set can include multiple transform candidates. Each transform candidate can be a kernel derived through a DCT type, DST type, or training.

[0417] Encoding device 110 can perform transform and inverse transform using transform candidates included in each transform set. Decoding device 150 can perform inverse transform using transform candidates included in each transform set. Transform selection information can be transmitted by signaling, indicating which of a plurality of transform candidates included in the transform set applied to the residual block will be used. Transform selection information may include vertical transform selection information and horizontal transform selection information. Vertical transform selection information may indicate which of the transforms belonging to the transform set will be used for vertical transform. Horizontal transform selection information may indicate which of the transforms belonging to the transform set will be used for horizontal transform.

[0418] The transformation may include at least one of a primary transformation and a secondary transformation. Primary transformation coefficients can be generated by performing a primary transformation on the residual block, and secondary transformation coefficients can be generated by performing a secondary transformation on the transformation coefficients. Here, the transformation coefficients may include both primary and secondary transformation coefficients.

[0419] Primary transformation can refer to multiple transformation selection (MTS) that applies different transformations to various 1D directions (i.e., vertical and horizontal directions).

[0420] Secondary transformations can be transformations used to increase the energy concentration of the transformation coefficients generated by the primary transformation. Secondary transformations can be 1) separable transformations such as the primary transformation, and 2) 2D non-separable transformations. 2D non-separable transformations can refer to low-frequency non-separable transformations (LFNST) or non-separable primary transformations (NSPT).

[0421] NSPT can be applied to specific block sizes (such as 4×4, 4×8, 8×4, 4×16, 16×4, 8×8, 8×16 and 16×8) for intra-frame encoding and decoding.

[0422] The primary transformation can be performed using at least one of several predefined transformation methods. In the example, the predefined transformation methods may include DCT, DST, KLT, etc. Furthermore, depending on the transformation kernel functions that define the DCT and DST, the primary transformation can be a transformation with various transformation types. For example, depending on the multiple transformation kernels, the primary transformation may include multiple transformations such as DCT-2, DCT-4, DCT-5, DCT-7, DCT-8, DST-1, DST-2, DST-4, DST-7, and DST-8.

[0423] In an embodiment, the transform type can be determined based on encoding / decoding parameters associated with the target block. For example, the transform type can be determined based on one or more of the following: 1) the prediction mode of the target block (e.g., one of intra-frame prediction and inter-frame prediction), 2) the size of the target block, 3) the shape of the target block, 4) the intra-frame prediction mode of the target block, 5) the components of the target block (e.g., one of luma component and chroma component), and 6) the partition type applied to the target block (e.g., one of QT, BT, TT, and non-separable type).

[0424] For example, in the case of a primary transformation, a transformation set can be defined even in a secondary transformation. The method for deriving and / or determining the transformation set according to the embodiment can also be applied to both secondary and primary transformations.

[0425] In this embodiment, primary and / or secondary transformations can be determined for a specific target. Transformation selection information may include transformation target information. The transformation target information may refer to a target to which primary and / or secondary transformations have been applied.

[0426] For example, primary and / or secondary transformations can be applied to one or more signal components, including the luminance and chrominance components.

[0427] In this embodiment, the transform selection information may include primary transform usage information and secondary transform usage information. The primary transform usage information may indicate whether the primary transform is applied to the residual block of the target block. The secondary transform usage information may indicate whether the secondary transform is applied to the residual block of the target block.

[0428] In an embodiment, the application of primary and / or secondary transforms can be determined based on the encoding / decoding parameters of the target / neighboring block (such as the size and shape of the target / neighboring block).

[0429] In an embodiment, the transform selection information may include primary transform selection information and secondary transform selection information. The primary transform selection information indicates the transform method to be applied to the residual block from among a variety of transform methods available in the primary transform. The primary transform selection information may be a primary transform index. The secondary transform selection information indicates the transform method to be applied to the transform coefficients from among a variety of transform methods available in the secondary transform. The secondary transform selection information may be a secondary transform index.

[0430] In embodiments, transformation methods for primary and secondary transforms can be derived separately based on specific information such as encoding / decoding parameters. For example, encoding / decoding parameters may include encoding / decoding parameters for the target block / neighboring block.

[0431] In this embodiment, information related to the transformation, such as transformation selection information and sub-information of the transformation selection information, can be transmitted via signals to a specific target. For example, the specific target may be a CU.

[0432] Information related to the transformation (such as transformation selection information) and sub-information of the transformation selection information can be exported for a specific target. For example, the specific target can be a CU.

[0433] Quantization levels can be generated by performing quantization on the results generated by performing primary and / or secondary transformations or on the residual block.

[0434] The above description of the transformation can also be applied to the inverse transformation. In this application, the inverse processing of the transformation description can be performed in the inverse transformation. The term "transformation" in the names of components related to the transformation can be changed to the term "inverse transformation." Furthermore, the input of the transformation can be regarded as the output of the inverse transformation. The output of the transformation can be regarded as the input of the inverse transformation. The decoding device 150 can acquire transformation-related information such as transformation selection information, and can perform the inverse processing of the transformation-related processing indicated by the transformation-related information by using the transformation-related information.

[0435] A target block can include multiple sub-blocks. Each sub-block can be defined based on the minimum block size or minimum block shape. A target block can be partitioned into multiple sub-blocks, each of which can include coefficients such as 4×4, 2×8, and 8×2. A target block can be a transform block. Transform coefficients or quantization levels can be represented by the shape of the block. Transform coefficients can be quantized transform coefficients.

[0436] Transform coefficients or quantization levels can be scanned using at least one scan type selected from diagonal scan, vertical scan, and horizontal scan. A diagonal scan can be either an upper right diagonal scan or a lower left diagonal scan.

[0437] For example, the coefficients of a block can be changed or arranged in 1D vector form by using a diagonal scan. A vertical scan can be an operation that scans coefficients with a 2D block shape in the column direction. A horizontal scan can be an operation that scans coefficients with a 2D block shape in the row direction.

[0438] The scan type of coefficients can be determined based on encoding and decoding parameters such as intra-prediction mode, block size, and block shape. For example, it can be determined which scan—diagonal, vertical, or horizontal—will be used based on encoding and decoding parameters such as intra-prediction mode, block size, and block shape. A block can be a transform unit.

[0439] Depending on the type of scan, a scan can begin at a specific starting point and terminate at a specific ending point.

[0440] During a scan, the scan order corresponding to the scan type can be applied to the sub-blocks first. Next, the scan order corresponding to the scan type can be applied to the transform coefficients or quantization levels within each sub-block.

[0441] Encoding device 110 can generate a bit stream that includes entropy-coded transform coefficients or entropy-coded quantization levels by performing entropy coding on transform coefficients or quantization levels.

[0442] Decoding device 150 can obtain entropy-coded transform coefficients or entropy-coded quantization levels from the bitstream, and can generate transform coefficients or quantization levels by performing entropy decoding on the entropy-coded transform coefficients or entropy-coded quantization levels. The coefficients can be arranged in 2D blocks via inverse scanning. The inverse scanning arrangement can be a rearrangement that is the reverse of the scanning arrangement.

[0443] The inverse scan transform coefficients or the quantization level of the inverse scan can be generated by inverse scanning the coefficients. Here, the inverse scan type can include diagonal scan, vertical scan, and horizontal scan, and the inverse scan type of the inverse transform corresponding to the scan type of the transform can be selected.

[0444] Decoding device 150 can perform dequantization on the (inverse scan) coefficients. Depending on whether a secondary inverse transform is to be performed, a secondary inverse transform can be performed on the result of the dequantization. Furthermore, depending on whether a primary inverse transform is to be performed, a primary inverse transform can be performed on the result of the secondary inverse transform. Reconstructed residual blocks can be generated by selectively performing both secondary and primary inverse transforms on the coefficients.

[0445] Filtering To improve image quality, filtering can be performed on blocks. Filtering can be used to determine or update the values ​​of target samples.

[0446] The target sample point can be one of the sample points described in the embodiments. For example, the target sample point can be one or more of the sample points described in the embodiments, such as prediction sample points, reference sample points, residual sample points, reconstruction sample points, and filtered reconstruction sample points.

[0447] The target sample point can be a sample point within one or more of the following: target image, target strip, target CTB, target block, reference sample point line, and template. The target block can be one of the above-mentioned blocks. For example, the target block can be one or more of the blocks described in the embodiments, such as transform block, prediction block, reference block, residual block, and reconstruction block.

[0448] In the embodiments, the filtering process described as being applied to one object can also be applied to another object. For example, the filtering process described in a specific in-loop filtering can also be applied to transform blocks, prediction blocks, reference blocks, residual blocks, etc.

[0449] Specific types of filtering can be used for filtering processes according to embodiments. Filter types may include filter taps (or filter tap lengths), filter shapes, filter strengths, filter coefficients (or weights), and the offset of each filter.

[0450] Filter taps can represent the number of input samples used for the filter. Input samples may include target samples. Optionally, input samples may include specific values ​​determined for target samples. Input samples may include one or more reference samples. One or more reference samples may be determined based on the properties of the target block described in the embodiments. Properties may include encoding / decoding parameters. For example, the properties of the target sample may include the location of the target sample. One or more reference samples may be specified based on their position relative to the location of the target sample.

[0451] The filter shape can be represented by the shape formed by the input samples. A specific value determined for a target sample can be considered as the target sample. In other words, when a specific value determined for a target sample is used as an input sample for the filter, the target sample can also be considered to form the filter shape.

[0452] The samples whose values ​​are determined by filtering can include multiple samples. The filter strength can represent the range of samples whose values ​​are determined by filtering. The filter strength can be either a strong filter strength or a weak filter strength. The number of samples whose values ​​are determined by a strong filter strength can be greater than the number of samples whose values ​​are determined by a weak filter strength. Optionally, the filter strength can represent the range of values ​​changed by filtering. The range of sample values ​​changed by a strong filter strength can be wider than the range of sample values ​​changed by a weak filter strength.

[0453] Filter coefficients can be the coefficients or weights of the input samples.

[0454] An offset can be a specific value that will be added to the result of a computation (such as a weighted sum) performed using the values ​​of the input samples and coefficients.

[0455] Filtering, interpolation, and sampling all share the characteristic that the values ​​of the sample points are updated. Therefore, the description of any one of filtering, interpolation, and sampling in the embodiments can also be applied to another of filtering, interpolation, and sampling. Here, sampling can include at least one of upsampling, downsampling, and subsampling.

[0456] For example, after performing upsampling, downsampling, and subsampling on reference samples or reference lines used to derive gradients, gradients can be computed to derive gradient histograms and their corresponding prediction modes. In this case, the reference samples or reference lines may include at least one of neighboring reconstructed samples (or reconstructed blocks), prediction samples (or prediction blocks), or residual samples (or residual blocks). The derived prediction mode information can be used not only as prediction modes for generating prediction samples but also as virtual intra-frame prediction modes for determining transform kernels or transform kernel sets.

[0457] Filtering may include filtering performed by predictor 123, predictor 163, etc.

[0458] When encoding a target block, prediction errors may exist between the original samples in the original block and the predicted samples in the prediction block. To reduce prediction errors, filtering can be performed on at least one of the predicted samples in the prediction block and the reference samples used for prediction.

[0459] For example, in intra-frame prediction, reference samples may include one or more of the following: top-left reference sample, top-right reference sample, left-side reference sample, and bottom-left reference sample. Filtering of the prediction samples can be performed by applying specific weights to the prediction samples, left-side reference sample, top-side reference sample, and / or top-left reference sample, respectively.

[0460] Filtering can be performed on at least one of the predicted sample and the reference sample based on the attributes of the target block and the attributes of the predicted sample. For example, whether to perform filtering, the type of filter, the region to which the filter is applied, the filter weights, the reference sample, the range of the reference sample, and the location of the reference sample can be determined based on the attributes of the target block and the attributes of the predicted sample.

[0461] For example, the attributes of the target block may include information related to the target block described in the embodiments, such as the target block's 1) size, 2) prediction mode, 3) intra-frame prediction mode, 4) reference sample line, 5) sample value, and 6) encoding / decoding parameters.

[0462] For example, the attributes of the predicted sample may include information related to the predicted sample described in the embodiments, such as 1) the sample value of the predicted sample and 2) the position of the predicted sample in the target block, and may include encoding and decoding parameters related to the predicted sample.

[0463] Filtering may include in-loop filtering performed by filter 130, filter 170, etc.

[0464] Figure 6 Several in-loop filters are shown according to the example.

[0465] Multiple in-loop filters used for in-loop filtering may include one or more of a luminance map with chroma scaling (LMCS), a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF).

[0466] Multiple in-loop filters can be connected sequentially to each other. For example, multiple in-loop filters can be connected in the order of LMCS, deblocking filter, SAO, and ALF. Furthermore, multiple in-loop filters can be connected in a sequence of all available permutations of the multiple in-loop filters. The output of one of the multiple in-loop filters can be used as the input of the next filter.

[0467] like Figure 6 As shown, an input image can be fed into a first filter. The input image can be a block as described in the embodiments. For example, the input image can be a reconstructed block generated by adder 129 or adder 169. The output of one filter can be the input of the next filter. The output image can be generated by the last filter. The output image can be a filtered block as described in the embodiments. For example, the output image can be a filtered reconstructed image generated by filter 130 or filter 170.

[0468] The target block can represent the image input to the filter. The target block for filtering can represent the image output from the filter.

[0469] LMCS can include luminance signal mapping of the luminance signal of the target block and chrominance signal scaling of the chrominance signal of the target block.

[0470] Luminance signal mapping can perform codeword reallocation for luminance signals.

[0471] Luminance signal mapping can include forward mapping and backward mapping. In forward mapping, the existing dynamic range can be partitioned into multiple intervals. The mapped dynamic range can be determined by performing codeword reallocation on the input image using a linear model for the corresponding intervals. In backward mapping, a reverse mapping is performed from the mapped dynamic range back to the existing dynamic range.

[0472] Chromaticity scaling can correct chromaticity signals based on the relationship between luminance signals and their corresponding chromaticity signals.

[0473] Forward mapping can be performed between inter-frame prediction and reconstruction of the luma signal, and between inter-frame prediction and chroma scaling for the luma signal. Inverse mapping can be performed between reconstruction and in-loop filtering of the luma signal. Chroma scaling can be performed between inverse transform and reconstruction of the chroma signal.

[0474] This structure allows for the inverse quantization, inverse transform, prediction, and reconstruction of luminance and chrominance signals within the mapped dynamic range. It also enables intra-loop filtering, inter-frame prediction, intra-frame prediction, and reconstruction of chrominance signals within the existing dynamic range.

[0475] Deblocking filters remove block distortion that occurs at the boundaries between blocks in a reconstructed image. For example, a block can be a transform block. Furthermore, a block can be a sub-block of a specific block as described in the embodiments. Here, the boundary between blocks can refer to the sample points adjacent to the boundary between blocks.

[0476] Deblocking filters can be applied to both vertical and horizontal boundaries between blocks. After filtering the vertical boundaries between blocks, filtering can be applied again to the horizontal boundaries between the filtered blocks.

[0477] Deblocking filters can be applied selectively. The decision to apply a deblocking filter to a target block can be determined based on at least one of the following: a specific number of samples included in a specific number of columns or rows in the target block, and a specific number of samples included in a specific number of columns or rows in neighboring blocks adjacent to a specific boundary.

[0478] When a deblocking filter is to be applied to a target block, the filter to be applied can be determined based on the required intensity of the deblocking filter. In other words, a filter selected from several other filters based on the intensity of the deblocking filter can be applied to the target block. These multiple filters can include one of the following: a long-tap filter, a strong filter, a weak filter, or a Gaussian filter.

[0479] The maximum length of the deblocking filter can be determined based on the properties of the target block, such as the size of the target block, the components of the target block, and the encoding / decoding parameters of the target block.

[0480] SAO can perform compensation for distortion between the original and reconstructed images based on samples. To compensate, SAO can apply an appropriate offset to the sample values ​​of the samples. That is, an offset can be added to the sample values.

[0481] Offsets can be determined for a target block. For example, offsets can be determined for each component of the CTB. The determined offsets can be applied to samples within a specific component of the CTB.

[0482] SAO can include SAOs that include edge offset (EO) and SAOs that use band offset (BO). Depending on the characteristics of the samples in a particular block, such as a CTU, it can be determined whether to perform an SAO using EO or an SAO using BO.

[0483] In SAO using EO, distortion correction in samples can be performed based on the orientation of edges within the target block. EO style categories can include horizontal, vertical, 135-degree diagonal, and 45-degree diagonal styles. For the target block, information indicating the style category to be applied and multiple offsets for that style category can be signaled. The number of offsets can be up to four. For target samples within the target block, adjacent samples can be determined based on the orientation of the style category. The offset to be applied to the target sample can be determined using the styles of the adjacent samples.

[0484] In the offset using BO, the luminance values ​​in the target block can be classified into specific bands, thus correcting distortion in the samples. The bit depth of the input image can be divided into m intervals. For example, m could be 32. The specific band can be n consecutive intervals among the m intervals. For example, n could be 4. N offsets for the n intervals can be transmitted using signals. Furthermore, information indicating the first interval selected from the n intervals among the m intervals can be transmitted using signals. The offset of the interval corresponding to the target sample can be added to the sample value of the target sample in the target cell.

[0485] ALF can perform compensation for distortion between the reconstructed image and the original image.

[0486] The filter coefficients of ALF can be transmitted as a signal via a bitstream.

[0487] The filter shape of an ALF can be determined by the components of the target block. For example, a 7×7 diamond filter can be used for the luminance component. A 5×5 diamond filter can be used for the chrominance component.

[0488] In ALF, the characteristics of a specific block can be determined, and the category of that block can be determined based on those characteristics. In other words, ALF determination and category determination can be performed on a 4×4 block basis. Filter coefficients can be calculated based on the category. A specific block can be a block with a 4×4 size.

[0489] Based on the orientation and activity determined using the gradient of a specific block, one of 25 categories can be chosen as the category of a particular block. Depending on the gradient of the particular block, rotational transformations, vertical symmetric transformations, and / or diagonal symmetric transformations of the filter can be applied.

[0490] Information related to whether or not ALF is applied can be sent via signals to specific units such as CTB.

[0491] The available signal transmission indicates the index of the filter in the available filters that will be applied to a specific unit. Here, the available filters may include fixed filters and filters configured using a parameter set. For example, the parameter set may be an adaptive parameter set (APS). Fixed filters may be defined equivalently by the encoding device 110 and the decoding device 150. The filter coefficients of filters configured using the parameter set can be determined based on the encoding and decoding parameters.

[0492] Entropy encoding and entropy decoding Figure 7 The entropy encoding and entropy decoding are shown based on the example.

[0493] exist Figure 7 The upper part shows the entropy encoding process performed by the entropy encoder 139.

[0494] The entropy encoder 139 may include a context modeler, a binarization unit, and an entropy coding unit. The context modeler may include a context selection unit and a context memory.

[0495] A binarization unit generates binary bits for syntax elements by performing binarization on the syntax elements of a target block. Binarization can be a process that converts syntax elements into binary bit form.

[0496] Information about syntax elements and binary bits can be provided from the binarization unit to the context selection unit.

[0497] The context modeler can perform context updates.

[0498] Context can represent the probability of occurrence of each bit of the encoded syntax element.

[0499] The context modeler can perform context updates to apply the current probability information to the bit encoding of the syntax elements of the target block. The updated context can be stored in the context memory. Here, the updated context corresponding to the syntax elements of the target block (the bits in the syntax elements of the target block) can be derived by the context modeler.

[0500] The context selection unit can select a context corresponding to the binary bits of the syntax elements of the target block. The selected context can be loaded from the context memory and can be used as an updated context for entropy encoding of the binary bits of the syntax elements of the target block.

[0501] The updated context can be used for entropy encoding of the syntactic elements of the target block.

[0502] An entropy encoder can generate encoded information of the syntax elements of a target block by performing entropy encoding using the generated binary bits and the updated context, and can generate a bit stream including the encoded information. The entropy encoder can use at least one of arithmetic encoding methods and bypass encoding methods.

[0503] exist Figure 7 The lower part shows the entropy decoding process performed by the entropy decoder 161.

[0504] The entropy decoder 161 may include a context modeler, an entropy decoding unit, and a debinarization unit. The context modeler may include a context selection unit and a context memory.

[0505] The context modeler can perform context updates.

[0506] The context can represent the probability of occurrence of each bit of a decoded syntax element.

[0507] The context modeler can perform context updates to apply the currently decoded probability information to the entropy decoding of the bits of the syntax elements of the target block. The updated context can be stored in the context memory. Here, the updated context corresponding to the syntax elements of the target block (the bits in the syntax elements of the target block) can be derived by the context modeler.

[0508] The context selection unit can select a context corresponding to the binary bits of the syntax elements of the target block. The selected context can be loaded from the context memory and can be used as an updated context for entropy decoding of the binary bits of the syntax elements of the target block.

[0509] The updated context can be used for entropy decoding of the syntactic elements of the target block.

[0510] An entropy decoder can generate the binary bits of the syntax elements of a target block by entropy decoding the encoded information of the bitstream based on an updated context. The entropy decoder can use at least one of arithmetic decoding methods and bypass decoding methods.

[0511] A debinarization unit can obtain the syntax elements of a target block by performing debinarization on at least one bit of the generated binary data. Debinarization can be a process that converts at least one bit of the binary data into the form of a syntax element.

[0512] Information about syntax elements and binary bits can be provided to the context selection unit from the debinarization unit.

[0513] Each syntax element can be one of the encoded solution parameters described in the embodiment.

[0514] In this disclosure, the decoder-side intra-frame mode derivation (DIMD) method refers to a method for adding a prediction mode derived based on the gradients of neighboring pixels to the MPM list. By adding the prediction mode derived based on the gradients of neighboring pixels to the MPM list, the prediction efficiency based on the MPM list can be improved during intra-frame prediction.

[0515] When DIMD is applied, the prediction patterns derived by calculating the gradients of neighboring pixels can also be added to the MPM list on the decoder side in the same way as on the encoder side.

[0516] In this disclosure, the intra-frame template matching method refers to a method of deriving a predicted block of the current block by configuring a template based on the neighboring pixels of the current block and searching for the region most similar to the template in the reconstructed region within the current image.

[0517] In this disclosure, the template-based intra-prediction mode derivation method refers to a method that calculates the matching cost based on the template of each intra-prediction mode in the MPM list and derives the intra-prediction mode of the current block based on the calculated matching cost. The matching cost can represent SAD, SATD, or MRSAD, etc.

[0518] The intra-frame prediction method according to this disclosure will be described in detail below.

[0519] Figure 8 This is a flowchart of an intra-frame prediction method according to an embodiment of the present disclosure.

[0520] Reference Figure 8 The method for performing intra-frame prediction according to this disclosure may include step S810 of deriving an intra-frame prediction mode and step S820 of deriving a prediction signal.

[0521] Furthermore, this disclosure discloses various methods for intra-frame prediction. The methods for intra-frame prediction based on [the following text is a detailed description of the following methods]. Figure 8 The flowchart describes various methods for performing intra-frame prediction.

[0522] To obtain a prediction signal for the current block, one of a number of reference sample lines can be selected, and the prediction signal can be obtained based on the reference samples belonging to the selected reference sample line.

[0523] Figure 9 Multiple reference sample lines are shown.

[0524] For example, when the intra-prediction mode of the current block is planar, one of multiple reference sample lines can be selected, and the prediction signal can be obtained based on the reference samples belonging to the selected reference sample line.

[0525] The encoder can generate at least one prediction signal based on multiple reference sample lines and determine the prediction signal with the lowest cost from the perspective of encoding cost. Then, the reference sample line used to obtain the prediction signal with the lowest cost can be determined as the optimal reference sample line, and the information indicating the optimal reference sample line among the multiple reference sample lines can be encoded and transmitted as a signal.

[0526] The decoder can select one of multiple reference sample lines based on the information transmitted by the signal, and obtain the predicted signal based on the reference samples belonging to the selected reference sample line.

[0527] In addition, the method used to select one of multiple reference sample lines can be called a multiple reference line (MRL).

[0528] Predicted signals derived from planar patterns When performing plane-based predictions, the interpolation direction can be variably set.

[0529] For example, a horizontal prediction signal can be obtained by using only horizontal interpolation. Equation 1 shows an example of obtaining a horizontal prediction signal.

[0530] Equation 1

[0531] In Equation 1, W represents the width of the current block. Horizontal interpolation can be obtained by interpolating the left reference sample rec(-1,y) and the upper right reference sample rec(W,-1) of the current block.

[0532] Alternatively, the vertical prediction signal can be obtained by using only vertical interpolation. Equation 2 shows an example of obtaining the vertical prediction signal.

[0533] Equation 2

[0534] In Equation 2, H represents the width of the current block. Horizontal interpolation can be obtained by interpolating the upper reference point rec(x,-1) and the lower left reference point rec(-1,H) of the current block.

[0535] A planar pattern whose interpolation direction is limited to either the vertical or horizontal direction can be called a directional planar pattern. Specifically, a planar pattern that uses only horizontal interpolation can be called a horizontal planar pattern, and a planar pattern that uses only vertical interpolation can be called a vertical planar pattern.

[0536] As another example, the average of the horizontal and vertical prediction signals can be set as the final prediction signal for the current block. A planar pattern using both horizontal and vertical interpolation can be called a general planar pattern.

[0537] Additionally, the transform kernel of the current block can be adaptively determined based on its intra-prediction mode. In this case, when using the directional plane mode, the intra-prediction mode of the current block can be considered as the directional intra-prediction mode used to derive the transform kernel of the current block.

[0538] For example, when a horizontal plane mode is applied to the current block, the intra-prediction mode of the current block can be treated as a horizontal mode to derive the transform kernel of the current block. In other words, the transform kernel applied to the current block when a horizontal plane mode is applied can be the same as the transform kernel applied to the current block when a horizontal mode is applied.

[0539] On the other hand, when the vertical plane mode is applied to the current block, the intra-prediction mode of the current block can be regarded as the vertical mode used to derive the transform kernel of the current block. In other words, the transform kernel applied to the current block when the vertical plane mode is applied can be the same as the transform kernel applied to the current block when the vertical mode is applied.

[0540] When applying the directional plane mode, information indicating the interpolation direction can be encoded and transmitted as a signal. In other words, information indicating either the horizontal plane mode or the vertical plane mode can be encoded and transmitted as a signal.

[0541] Optionally, the interpolation direction for the directional plane mode can be determined based on the coding or prediction information of neighboring blocks adjacent to the current block. For example, when the intra-prediction mode of a neighboring block adjacent to the current block is a vertical plane mode or a directional mode close to a vertical mode, the vertical plane mode can be applied to the current block. On the other hand, when the intra-prediction mode of a neighboring block adjacent to the current block is a horizontal plane mode or a directional mode close to a horizontal mode, the horizontal plane mode can be applied to the current block.

[0542] You can define a direction mode that is close to horizontal and a direction mode that is close to vertical, as shown in the following example.

[0543] Case 1) Directional pattern close to horizontal: greater than or equal to 2 and less than 34 Orientation pattern close to vertical mode: greater than or equal to 34 and less than 66 Case 2) Directional pattern close to horizontal: greater than or equal to 8 and less than 28 Orientation mode close to vertical: greater than or equal to 40 and less than 60 Scenario 3) Directional pattern close to horizontal: greater than or equal to 13 and less than 23 Orientation mode close to vertical: greater than or equal to 45 and less than 55 When the intra-prediction mode of a neighboring block does not correspond to the directional modes of the near-horizontal mode and the near-vertical mode, the general planar mode can be applied to the current block.

[0544] Furthermore, in the example above, it is shown that when the intra-prediction mode of a neighboring block is a directional mode close to the horizontal mode, the horizontal plane mode is applied to the current block, and when the intra-prediction mode of a neighboring block is a directional mode close to the vertical mode, the vertical plane mode is applied to the current block.

[0545] Conversely, when the intra-prediction mode of a neighboring block is a directional mode close to the horizontal mode, the vertical plane mode can be set to be applied to the current block, and when the intra-prediction mode of a neighboring block is a directional mode close to the vertical mode, the horizontal plane mode can be set to be applied to the current block.

[0546] The interpolation direction of the orientation plane pattern can also be determined using the DIMD method. For example, when the pattern with the maximum amplitude in the gradient histogram of the current block is a vertical pattern or a pattern close to a vertical pattern, a vertical plane pattern can be applied to the current block. On the other hand, when the pattern with the maximum amplitude in the gradient histogram of the current block is a horizontal pattern or a pattern close to a horizontal pattern, a horizontal plane pattern can be applied to the current block.

[0547] When determining the interpolation direction for the orientation plane mode based on neighboring blocks or DIMD mode, the encoding / decoding of information indicating the interpolation direction can be omitted.

[0548] Optionally, the interpolation direction of the directional plane pattern can also be determined based on the template cost. For example, predictions based on each of the horizontal and vertical plane patterns can be performed on templates adjacent to the current block. Then, the matching cost of each of the horizontal and vertical plane patterns can be calculated based on the cost between the reconstructed sample and the predicted sample within the template.

[0549] Then, the prediction signal for the current block can be obtained based on the pattern with lower matching cost in the horizontal plane pattern and the vertical plane pattern.

[0550] Deriving Predicted Signals Based on DIMD Mode Based on the DIMD method, a prediction signal for the current block can be generated. Specifically, when the DIMD pattern is applied to the current block, the prediction signal can be obtained through the following steps 1 and 2.

[0551] (Step 1) Steps for deriving the gradient histogram (HoG) of the current block A region that includes at least one reconstructed sample point adjacent to a block can be set as a template. Alternatively, templates can be set on a reference sample point line, block, or region basis.

[0552] Figure 10 This represents an example of template configuration.

[0553] As in Figure 10 In the example shown, the template may include at least one of the top reconstruction area, the left reconstruction area, or the top left reconstruction area of ​​the block.

[0554] For example, in Figure 10 In the example shown, the configurations of the first to seventh templates can be summarized as follows.

[0555] The first template (L-shaped template) consists of the upper left reconstruction area, the upper reconstruction area, and the left reconstruction area of ​​the block. Second template: consists only of the top left reconstructed area of ​​the block. The third template consists of the upper left and upper top reconstruction areas of the block. The fourth template consists of the upper left reconstruction area and the left reconstruction area of ​​the block. Fifth template: Consists only of the area above the block being reconstructed. Template 6: Consists only of the left-side reconstruction area of ​​the block. The seventh template consists of the upper reconstruction area and the left reconstruction area of ​​the block. Information related to template configuration can be encoded and signaled. For example, information indicating one of multiple template candidates can be encoded and signaled. Multiple template candidates may include... Figure 10 At least one of the first to seventh templates listed in the document.

[0556] Optionally, the size and / or shape of the template can be determined based on the encoding / decoding information of the current block or neighboring blocks. Specifically, the size and / or shape of the template can be adaptively determined according to the size of the current block or neighboring blocks.

[0557] For example, when the size of the current block or neighboring blocks is less than a threshold, the number of lines or sample points in the configuration template can be reduced compared to when the size of the current block or neighboring blocks is not less than the threshold.

[0558] For example, when the size of the current block or neighboring blocks is less than a threshold, the number of lines or sample points in the configuration template can be increased compared to when the size of the current block or neighboring blocks is not less than the threshold.

[0559] For example, when the size of the current block or neighboring blocks is greater than a threshold, the number of lines or sample points in the configuration template can be reduced compared to when the size of the current block or neighboring blocks is not greater than the threshold.

[0560] For example, when the size of the current block or neighboring blocks is greater than a threshold, the number of lines or sample points in the configuration template can be increased compared to when the size of the current block or neighboring blocks is not greater than the threshold.

[0561] Additionally, block size can represent the block's width, height, or a statistical value of at least one of the width and height. The statistical value can represent the larger of the width and height (i.e., maximum (width, height)), the smaller of the width and height (i.e., minimum (width, height)), or the average of the width and height.

[0562] The template size can be adaptively determined based on block partitioning information.

[0563] For example, when the current block is not square, the template can be configured by setting the size of the reconstructed area adjacent to the larger of the top edge (i.e., width) and left edge (i.e., height) of the current block to be greater than the size of the reconstructed area adjacent to the smaller edge.

[0564] As another example, templates can be configured based on the motion vectors or block vectors of adjacent or co-located blocks. Additionally, a co-located block refers to a block within the same frame that is in the same position as the current block.

[0565] Figure 11 Show the corresponding block.

[0566] For example, a block that includes a position corresponding to the center position (C1) of the current block in the same frame or a block that includes a position corresponding to the lower right corner (C0) of the current block can be set as a same block.

[0567] Once the motion vectors or block vectors of neighboring or co-located blocks are determined, the template can be configured based on the positions indicated by the corresponding block vectors or motion vectors.

[0568] The gradient values ​​of the sample points belonging to the template can be calculated. In this case, the gradient of the sample point can be calculated for each of the horizontal and vertical directions. Specifically, the horizontal and vertical gradients of each of the multiple sample points included in the template can be derived by moving the filter window within the template.

[0569] Figure 12 This represents an example of deriving the gradient of the sample points included in the template.

[0570] exist Figure 12 The example shown illustrates a template consisting of three lines, and the gradient of the sample points belonging to the center line is obtained by applying a 3×3 size filter.

[0571] Based on the gradient value, the directionality of the sample point or the direction prediction pattern corresponding to the directionality can be derived. For example, the directionality of the sample point can be derived according to Equation 3 below.

[0572] Equation 3

[0573] In Equation 3, Gy represents the vertical gradient and Gx represents the vertical gradient.

[0574] The intra-frame prediction mode of a sample can be set to a directional prediction mode with the same or similar directionality as the calculated directionality. To this end, the directionality value corresponding to each directional prediction mode can be pre-stored in the encoder and decoder.

[0575] As in Figure 12 In the example shown, when exporting HoG, gradients can be exported for samples belonging to one of the multiple reference sample lines that constitute the template.

[0576] Alternatively, gradients can be derived for multiple lines by increasing the number of lines.

[0577] Figure 13 This example demonstrates how to derive the gradient of multiple lines.

[0578] exist Figure 13 The example shown illustrates obtaining gradients starting from the left / top boundary of the current block for samples belonging to the second row and samples belonging to the fifth row.

[0579] In other words, the gradient of samples belonging to the second row can be derived by applying a 3×3 filter to samples belonging to the first to third rows, and the gradient of samples belonging to the fifth row can be derived by applying a 3×3 filter to samples belonging to the fourth to sixth rows.

[0580] In addition to the example shown, gradients can also be derived for each row except the first and last rows.

[0581] It can export HoG for each of multiple lines.

[0582] Optionally, a HoG can be exported for each of the multiple lines, and then the exported HoGs can be merged into one.

[0583] In this scenario, a merged HoG can be derived by weighted summation of multiple HoGs. The weights assigned to each HoG are determined based on the distance between the current block and the line used to derive the corresponding HoG.

[0584] For example, the weights assigned to a HoG derived from a line at a distance of a first value from the current block can have larger values ​​than the weights assigned to a HoG derived from a line at a distance of a second value from the current block (where the second value is greater than the first value).

[0585] In other words, the weights applied to a HoG are inversely proportional to the distance between the current block and the line used to derive the corresponding HoG.

[0586] For example, the weight assigned to the HoG derived from the first line (i.e., the line with index 1) can be 4, the weight assigned to the HoG derived from the second line (i.e., the line with index 2) can be 3, the weight assigned to the HoG derived from the third line (i.e., the line with index 3) can be 2, and the weight assigned to the HoG derived from the fourth line (i.e., the line with index 4) can be 1.

[0587] Optionally, after configuring a template that includes lines, the weights assigned to HoGs derived from the corresponding lines can be determined based on the matching cost of the template.

[0588] For example, when performing a weighted summation of HoG from two lines, each of the weights W_L1 assigned to the HoG from the first line and W_L2 assigned to the HoG from the second line can be derived according to Equation 4 below.

[0589] Equation 4

[0590] In Equation 4 above, Tmcost_L1 represents the matching cost of the template including the first line (i.e., the line with index 1), and Tmcost_L2 represents the matching cost of the template including the second line (i.e., the line with index 2).

[0591] A merged HoG can also be derived by merging only the intra-prediction modes that are commonly included in multiple HoGs.

[0592] When deriving HoG for each line or sample group, the optimal reference line or optimal sample group can be determined based on template matching cost.

[0593] For example, after deriving an intra-prediction mode based on HoG derived for a line or sample group, intra-prediction for a template can be performed based on the derived intra-prediction mode. Then, the matching cost of the template can be calculated based on the difference between the predicted samples and the reconstructed samples within the template.

[0594] This process can be repeated for each line or sample group to calculate the template matching cost for each line or sample group.

[0595] Then, the matching costs of multiple lines or multiple sample groups can be compared to select the line or sample group with the lowest matching cost for the current block.

[0596] When deriving a HoG for each line or sample group, you can select an intra-prediction mode that appears a certain number of times in multiple HoGs. When multiple intra-prediction modes appear a certain number of times, you can select one of the multiple intra-prediction modes again.

[0597] The intra-prediction mode selected based on the processing can be set as the intra-prediction mode for the current block.

[0598] Based on the MRL method, the lines from which the HoG is derived can be determined. Specifically, information indicating one of multiple lines can be encoded / decoded, and the HoG can be derived for the line indicated by the corresponding information.

[0599] Optionally, a HoG can be derived for each of the line indicated by the MRL method and at least one adjacent line. Here, an adjacent line can refer to a line whose index difference with the line indicated by the MRL method is less than an offset. The offset can be 1, 2, 3, or 4, etc. For example, when the index of the line indicated by the MRL method is L, at least one adjacent line can include at least one of the following: line with index L-1, line with index L-2, line with index L-3, line with index L-4, line with index L+1, line with index L+2, line with index L+3, or line with index L+4.

[0600] The number of reference sample lines from which the HoG is derived, or the size of a pixel group, can be adaptively determined based on at least one of the block size or shape.

[0601] For example, as the size of the current block increases, the number of lines from which the HoG is derived, or the size of the pixel group from which the HoG is derived, can increase.

[0602] For example, you can compare the top edge (i.e., width) and left edge (i.e., height) of the current block to place more lines on the longer edge or set the pixel group on the longer edge to be larger.

[0603] To reduce complexity, HoG export can be performed in a limited manner. For example, HoG can only be exported for the current block if the block size is greater than or equal to a threshold.

[0604] For example, the threshold can be 8×8. Alternatively, the threshold representing the number of samples within a block can be 32, 64, or 128.

[0605] Optionally, HoG can be derived for the current block only when the DIMD mode is applied to a neighboring block adjacent to the current block or when the intra-prediction mode of the neighboring block is derived based on HoG.

[0606] HoG calculated for adjacent blocks can also be inherited by the current block. Specifically, the HoG of at least one of the following can be used for the current block: a block that is spatially adjacent to the current block, a block that is not spatially adjacent, a block that is temporally adjacent, a block that is not temporally adjacent, or a co-located block.

[0607] Figure 14 This shows blocks at spatially / temporally adjacent / non-adjacent locations.

[0608] exist Figure 14 The diagram shows that positions 1 to 5 are spatially adjacent to the current block, while positions 6 to 23 are not spatially adjacent to the current block.

[0609] Furthermore, since the reference frame is encoded / decoded before the current frame, the right and / or bottom positions of the current block within the reference frame can also be reconstructed in advance. Therefore, temporally adjacent positions can include not only no.1 to no.5, but also no.24 to no.26, which are located to the right and / or bottom of the current block. Additionally, positions that are not temporally adjacent to the current block can include no.27 to no.36 and no.6 to no.23.

[0610] In addition, co-occurring blocks (see Figure 11 It can also be used to export the HoG of the current block.

[0611] Temporally / spatially adjacent / non-adjacent positions can also be adjusted based on block vectors or motion vectors. When a temporally / spatially adjacent / non-adjacent position is adjusted, the HoG of the current block can be derived based on the HoG of the block including the adjusted position. Here, the adjusted position can represent a position separated from the initial position by a block vector or motion vector.

[0612] Figure 15 This example illustrates how the position of a reference block can be adjusted using a block vector / motion vector derived from a co-located block.

[0613] Furthermore, the position can be adjusted only for blocks within the same frame from which the block vector or motion vector is derived. For example, when deriving a block vector from a block that is spatially adjacent to the current block, the position can be adjusted only for spatially adjacent / non-adjacent positions, and not for temporally adjacent / non-adjacent positions.

[0614] Alternatively, the position can be adjusted only for blocks within the frame that are different from the blocks from which the block vector or motion vector is derived.

[0615] Alternatively, all available positions can be adjusted without taking into account the screen to which the block from which the block vector or motion vector is derived belongs.

[0616] Optionally, the HoG can also be derived on a per-block or per-subblock basis. Specifically, similar to the SbTMVP method, the reference block of the current block can be determined using block vectors or motion vectors. Then, the HoG of the sub-blocks within the current block can be derived from the sub-blocks (i.e., the reference sub-blocks) that have positions / sizes corresponding to the positions / sizes of the sub-blocks within the reference block.

[0617] A list managed using a first-in, first-out (FIFO) method can be defined. HoGs of blocks encoded / decoded before the current block can be stored in the corresponding list. In other words, HoGs can be inserted into the list sequentially according to the encoding / decoding order of the blocks. Such a list can be called a history-based list.

[0618] At least one HoG stored in a history-based list can be used for the current block.

[0619] As mentioned above, the HoG of a neighboring block can be set as the HoG of the current block.

[0620] Optionally, HoGs inherited from neighboring blocks and HoGs derived from templates based on the current block can be merged.

[0621] At least one prediction pattern can be derived based on HoG inherited from neighboring blocks, and a prediction signal for the current block can be obtained based on the at least one derived prediction pattern.

[0622] HoG can be inherited and used only from neighboring blocks encoded / decoded with a specific prediction mode. Here, the specific prediction mode may include at least one of DIMD, TIMD, or DIMD merge.

[0623] For example, HoG information can only be inherited from a reference block when the DIMD mode is applied to the reference block.

[0624] Optionally, HoG information can only be inherited from a reference block if the DIMD or TIMD mode is applied to the reference block.

[0625] Optionally, HoG information can only be inherited from a reference block if DIMD or the DIMD merge mode is applied to the reference block.

[0626] A merge list for HoG inheritance can be constructed, and at least one of the merge candidates included in the merge list can be selected. In this case, information indicating the selection of a candidate among the candidates included in the merge list can be encoded and sent using a signal.

[0627] The merge list may include at least one of the following: HoG derived from blocks at spatially / temporally adjacent / non-adjacent locations, HoG derived from a history-based list, and HoG derived from blocks at fixed locations.

[0628] Additionally, the size of the merge list can be predefined in the encoder and decoder. For example, the number of candidates that can be included in the merge list could be 12.

[0629] Optionally, information indicating the size of the merged list can be encoded and sent using signals.

[0630] A merged HoG can also be derived by merging multiple neighboring blocks or multiple merge candidates.

[0631] For example, a merged HoG can be derived by merging the HoGs of adjacent blocks at a predefined location. For instance, the adjacent blocks at the predefined location could include blocks adjacent to the current block (e.g., ...). Figure 14 At least one of (no.1 to no.5) in the list.

[0632] For example, a merged HoG can be derived by merging the HoGs of all blocks adjacent to the current block.

[0633] Optionally, multiple blocks adjacent to the current block can be selected, and the HoGs of the selected blocks can be merged to derive a merged HoG.

[0634] Alternatively, you can select only the blocks that are adjacent to the left of the current block or the blocks that are adjacent to the top of the current block, and then merge the HoGs of the selected blocks to obtain the merged HoG.

[0635] Alternatively, the merged HoG can be derived by merging the HoGs of neighboring blocks encoded / decoded under a specific prediction mode. Here, the specific prediction mode may include at least one of DIMD, TIMD, or DIMD merging.

[0636] For example, a merged HoG can be derived by merging the HoGs of reference blocks that have applied DIMD mode.

[0637] For example, a merged HoG can be derived by merging the HoGs of reference blocks that have applied DIMD or TIMD modes.

[0638] For example, a merged HoG can be derived by merging reference blocks that have applied DIMD or DIMD merge mode.

[0639] Furthermore, when generating a merged HoG, the number of neighboring blocks used to generate the merged HoG can be limited to a threshold or less. For example, the maximum number of neighboring blocks used to generate the merged HoG can be 12.

[0640] Predicting blocks using merged HoG can be termed merged gradient-based merged prediction. Furthermore, merged gradient-based merged prediction can be permitted in a limited manner.

[0641] For example, the size of the block can be used to determine whether gradient-based merge predictions are allowed. For instance, when the block size is 4×4, gradient-based merge predictions may not be available.

[0642] Optionally, it can be determined whether the merged gradient-based merged prediction can be applied to the current block based on the prediction modes of neighboring blocks. For example, the merged gradient-based merged prediction can be applied to the current block only when DIMD is applied to neighboring blocks or when the intra-prediction modes of neighboring blocks are obtained based on HoG.

[0643] Merged HoGs can be generated in a limited manner.

[0644] For example, the generation of a merged HoG can be determined based on the block size. Specifically, to reduce complexity, a merged HoG can be generated only if the block size is equal to or greater than a threshold. For example, a merged HoG can only be exported / used for the current block if the current block size is greater than or equal to 8×8.

[0645] Optionally, a merged HoG can only be exported if the number of candidates included in the merge list has not reached the maximum. In this case, the merged HoG can be inserted as a new candidate into the merge list.

[0646] HoG information derived from a template based on the current block can be stored and used. Here, the HoG information may include at least one of HoG values ​​or template information from which gradient values ​​are derived. Here, the HoG values ​​may represent the cumulative magnitude (or magnitude) value of each directional element or directional prediction mode.

[0647] Furthermore, even when using a histogram of occurrences (HoC), the embodiments of this disclosure using HoG can be applied equivalently. In other words, the embodiments described in this disclosure can be replaced by occurrence values ​​using HoC instead of amplitude values ​​using HoG.

[0648] In this disclosure, a "histogram" may represent a histogram of gradients or a histogram of occurrences.

[0649] A detailed description of HoC will follow later.

[0650] Furthermore, gradient values ​​can be stored individually based on the type (or shape) or location of the template used to calculate the gradient values.

[0651] For example, when deriving multiple HoGs based on each of the templates consisting only of the upper reconstruction region, the template consisting only of the left reconstruction region, and the L-shaped template, multiple HoGs can be stored separately.

[0652] Furthermore, when the top or left reconstruction region is unavailable, the HoG of the neighboring block adjacent to the corresponding direction can be set to the HoG for that direction. For example, if the left reconstruction region of the current block is unavailable, the template may not be configured to have only the left reconstruction region. In this case, instead of deriving the HoG based on the left template, the HoG of the left neighboring block of the current block can be inherited.

[0653] When storing HoG information, HoG values ​​can be stored together with the corresponding direction elements or direction prediction patterns. In other words, a HoG value can represent a pair of direction elements and amplitude values, or a pair of direction prediction patterns and amplitude values. For example, a HoG value can represent the index of a pair of direction prediction patterns and the amplitude value of the corresponding direction prediction pattern.

[0654] Furthermore, when storing HoC information, HoG values ​​can be stored together with the corresponding direction elements or direction prediction patterns. In other words, an HoC value can represent a pair of direction elements and their occurrence counts, or a pair of direction prediction patterns and their occurrence counts. For example, an HoC value can represent the index of a pair of direction prediction patterns and the occurrence count of the corresponding direction prediction pattern.

[0655] Furthermore, the frequency of occurrences on HoC can be converted to the amplitude values ​​on HoG, or the amplitude on HoG can be converted to the frequency of occurrences on HoC. In other words, when different types of histograms exist, they can be converted to one type.

[0656] The directional element or directional prediction pattern to be stored can be selected based on the magnitude value or frequency of occurrence of the directional element or directional prediction pattern.

[0657] For example, directional elements or directional prediction patterns can be sorted in descending order of amplitude value or frequency of occurrence, and then the N directional elements or N directional prediction patterns with high amplitude values ​​or frequencies of occurrence can be stored. In this case, N can be a predefined value in the encoder and decoder. Optionally, information indicating N can be encoded and sent to the decoder as a signal.

[0658] Optionally, either the amplitude value or the frequency of occurrence of a directional element or a directional prediction pattern greater than a threshold can be stored, and either the amplitude value or the frequency of occurrence of a directional element or a directional prediction pattern less than the threshold can be discarded without storing it. In this case, the threshold may have a predefined value in the encoder and decoder. Optionally, information indicating the threshold can be encoded and sent to the decoder as a signal.

[0659] The amplitude value or the number of occurrences can be stored in blocks of a predetermined size, or in units of CTU, screen, parallel block, or strip.

[0660] For example, when storing amplitude values ​​or occurrence counts in units of CTU, the HoG calculated for sub-partitions within the CTU can be summed, or the amplitude values ​​or occurrence counts of specific directional elements (or specific directional patterns) can be summed and stored in the HoG calculated for sub-partitions within the CTU.

[0661] Optionally, amplitude values ​​or occurrence counts can be stored in M×N blocks. Here, M and N can be preset values ​​in the encoder / decoder. Optionally, information for determining M and N can be sent from the encoder to the decoder.

[0662] Optionally, the amplitude value or the number of occurrences can be stored in units of the smallest block size. For example, the unit of the smallest block can be 4×4.

[0663] Optionally, the amplitude value or the number of occurrences can be stored in units of the maximum block size. For example, the unit of the maximum block could be a 256×256 size.

[0664] Furthermore, when storing the amplitude value or the number of occurrences of a direction element or direction pattern, the maximum cumulative number of occurrences (i.e., the maximum number of occurrences) or the maximum amplitude value of the direction element or direction pattern can be limited. Here, the maximum amplitude value or the maximum cumulative number can be M, and for example, M can be 32, 64, 128, or 256.

[0665] The value of M can be predefined in the encoder and decoder. Alternatively, information indicating M can be encoded and transmitted as a signal.

[0666] When storing HoG information, the size of the value obtained by adding the magnitude values ​​or occurrence counts of the directional elements (or directional patterns) extracted from the entire HoG can be limited.

[0667] When storing the amplitude value or the number of occurrences of a direction element or direction pattern, you can scale the amplitude value or the cumulative quantity (i.e., the number of occurrences) or the direction element or direction pattern.

[0668] In this disclosure, scaling may include at least one of adding an offset to a target value (e.g., an amplitude value or a number of occurrences), subtracting an offset from it, multiplying it by a weight, or dividing it by a weight.

[0669] For example, it can also store the value obtained by dividing the amplitude value or cumulative number of each directional element (each directional mode) by N. N can be 2.

[0670] For example, it can also store the amplitude value or the cumulative number of each directional element (each directional mode) multiplied by M. M can be 0.5.

[0671] For example, the value obtained by subtracting the offset from the amplitude value, or the cumulative number of directional elements (directional patterns), can also be stored. Here, the offset can be the average of the amplitude values ​​or the average of the cumulative number of directional elements (directional patterns) on the histogram. Optionally, the offset can be the average of the amplitude values ​​or the cumulative number of corresponding directional elements (directional patterns) in multiple histograms. Here, the histogram can represent a histogram of gradients or a histogram of occurrences.

[0672] (Step 2) The step of deriving the prediction model based on HoG and generating prediction blocks based on the prediction model. At least one directional prediction mode can be derived based on HoG or HoC, and the predicted block for the current block can be obtained based on the derived directional prediction mode. Encoding / decoding of the current block can be performed based on the obtained predicted block.

[0673] Multiple prediction modes can also be derived based on HoG or HoC. Multiple prediction blocks can be derived based on multiple prediction modes, and the prediction block (signal) of the current block can be generated by weighted sum, fusion, or mixing of multiple prediction blocks.

[0674] For example, multiple prediction modes can be selected based on the amplitude value or cumulative number (or occurrence count) of each directional mode on the histogram. For instance, N intra-frame prediction modes with large amplitude values ​​or cumulative numbers can be selected. In this case, N can be a preset value in the encoder and decoder. Optionally, the information representing N can be encoded and transmitted as a signal.

[0675] Optionally, a direction prediction mode (or direction element) with an amplitude value or cumulative number greater than a threshold can be selected. Here, the threshold can be a predefined value in the encoder and decoder. Optionally, information representing the threshold can be encoded and transmitted as a signal.

[0676] Alternatively, the prediction mode can be selected based on the encoding cost.

[0677] Here, encoding cost refers to the cost calculated for encoding the residual signal generated based on the difference between the original block (signal) and the predicted block (signal) or the predicted signal. For example, encoding cost can represent one of SAD, SSE, or SATD (which represents the error value between two signals), or the rate-distortion cost obtained by adding the cost required to encode the residual signal to the error cost. Furthermore, the predicted block can be generated using a directional prediction mode selected via a gradient histogram (HoG).

[0678] Specifically, prediction blocks can be generated based on each of several prediction modes selected from HoG or HoC. Then, the coding cost of the corresponding prediction mode can be calculated based on the prediction blocks derived from the prediction modes.

[0679] When calculating the prediction cost of multiple prediction patterns, the prediction patterns can be sorted in ascending order of coding cost. Optionally, N prediction patterns with low coding costs can be selected.

[0680] Alternatively, you can select only the direction prediction mode (or direction element) with a coding cost less than a threshold from among multiple prediction modes.

[0681] Optionally, information indicating the selected prediction mode can be encoded and transmitted using signals.

[0682] It is possible to perform a weighted summation of multiple prediction blocks under certain conditions.

[0683] For example, for the luma component block, it is permissible to obtain the prediction block based on a weighted sum of multiple prediction blocks. On the other hand, for the chroma component block, it is not permissible to obtain the prediction block by weighted summation of multiple prediction blocks. In other words, for the chroma component block, only one direction prediction mode can be selected.

[0684] Optionally, information indicating whether a prediction block is obtained by weighted summation of multiple prediction blocks can be encoded and transmitted as a signal. From a rate-distortion optimization perspective, the encoder can determine the optimal method between a method for obtaining a prediction block using weighted summation and a method for obtaining a prediction block without weighted summation. When it is determined that weighted summation is not used, only one directional prediction mode is selected from the histogram, while when it is determined that weighted summation is used, multiple directional prediction modes can be selected from the histogram. Here, the histogram can represent a histogram of gradients or a histogram of occurrence counts.

[0685] As another example, multiple prediction blocks can be derived based on multiple prediction patterns, and the prediction pattern used for weighted summation can be selected based on the differences between the prediction blocks.

[0686] For example, suppose five prediction patterns are selected using a histogram. In this case, five prediction blocks can be obtained based on each of the five prediction patterns. Then, the error values ​​between each prediction block (i.e., SAD, SSE, or SATD) can be derived. For example, when the five prediction blocks are referred to as the first to fifth prediction blocks, ten error values ​​can be calculated for the five prediction blocks as follows.

[0687] First prediction block - second prediction block, first prediction block - third prediction block, first prediction block - fourth prediction block, first prediction block - fifth prediction block, second prediction block - third prediction block, second prediction block - fourth prediction block, second prediction block - fifth prediction block, third prediction block - fourth prediction block, third prediction block - fifth prediction block, fourth prediction block - fifth prediction block.

[0688] After selecting at least one pair in ascending order of error values, the prediction blocks included in the selected pairs can be weighted and summed to obtain the prediction block for the current block.

[0689] Optionally, after selecting at least one pair with an error value less than a threshold, the predicted blocks included in the selected pair can be weighted and summed to obtain the predicted block of the current block.

[0690] Optionally, at least one pair with error values ​​greater than a threshold can be removed. The prediction block for the current block can then be obtained by weighted summation of the prediction blocks included in the residual pairs.

[0691] Alternatively, the prediction block of the current block can be derived by weighted summing of the prediction blocks obtained based on HoG or HoC (i.e., the prediction blocks obtained based on the DIMD mode) and the prediction blocks obtained by another prediction method.

[0692] Here, the prediction method may include at least one of inter-frame prediction, intra-frame template matching (IntraTMP), intra-frame block copy (IBC) prediction, matrix-weighted intra-frame prediction (MIP), or non-directional prediction (e.g., DC or planar). For the chroma component, the prediction mode may further include inter-component prediction (e.g., CCLM, GLM, or CCCM, etc.).

[0693] For example, the predicted block of the current block can be obtained by a combination of multiple directional prediction modes based on DIMD mode, IntraTMP, or non-directional prediction modes (e.g., DC or plane).

[0694] For example, when deriving N prediction modes based on a DIMD pattern, at least one of the N prediction modes and a non-directional prediction mode can be selected based on the matching cost. When multiple prediction modes are selected, multiple prediction blocks can be derived based on each of the multiple prediction modes, and the prediction block of the current block can be derived by weighted summing of the multiple prediction blocks. Here, the non-directional prediction mode can be either DC or plane.

[0695] For example, suppose we derive five directional prediction modes based on the DIMD model. Alternatively, suppose we select two directional prediction modes and one non-directional prediction mode from the five directional prediction modes and one non-directional prediction mode. In this case, we can obtain three prediction blocks based on each of the two directional prediction modes and the non-directional prediction mode. Then, we can obtain the prediction block for the current block by performing a weighted sum of the three prediction blocks.

[0696] In an embodiment, the prediction mode of a reference block indicated by a block vector can be used instead of the non-directional prediction mode. Here, the block vector can be derived via IBC or IntraTMP.

[0697] Alternatively, instead of deriving prediction blocks based on non-directional prediction modes, a reference block indicated by a block vector can be set as the prediction block.

[0698] Optionally, in an embodiment, the prediction mode of a reference block indicated by a motion vector can be used instead of the non-directional prediction mode. Here, the motion vector can be derived from neighboring blocks, or it can be derived based on information encoded / decoded for the current block.

[0699] As another example, the prediction block of the current block can be obtained by weighted summing of the prediction blocks obtained from block vectors or motion vectors and the prediction blocks derived based on non-directional prediction modes. For example, the prediction block of the current block can be obtained by weighted summing of the prediction blocks obtained by weighted summation and at least one prediction block derived based on a DIMD mode.

[0700] Optionally, multiple prediction blocks can be derived based on non-directional prediction modes and directional prediction modes derived from DIMD modes, and the prediction block of the current block can be obtained by weighted summation of multiple prediction blocks and prediction blocks obtained from block vectors or motion vectors.

[0701] Furthermore, when deriving prediction blocks through weighted summation, if a non-directional prediction mode is used and the non-directional prediction mode is planar, it can be set to use a directional planar mode instead of a general planar mode. In this case, whether to use the directional planar mode or at least one of the interpolation directions of the directional planar mode can be determined based on the directional prediction mode based on the DIMD mode.

[0702] For example, when the direction prediction pattern derived from the DIMD pattern is close to the vertical pattern, the vertical plane pattern can be used. On the other hand, when the direction prediction pattern derived from the DIMD pattern is close to the horizontal pattern, the horizontal plane pattern can be used.

[0703] The directional modes that are close to horizontal and close to vertical can be defined as in the examples in cases 1) to 3) above.

[0704] Additionally, when the orientation prediction pattern derived from the DIMD pattern does not correspond to the orientation patterns of the near-horizontal and near-vertical patterns, the general planar pattern can be used.

[0705] Predictive blocks derived from vertical plane patterns and those derived from horizontal plane patterns can be weighted and summed. For example, Equation 5 shows an example of weighted summation of predictive blocks derived from vertical plane patterns and those derived from horizontal plane patterns.

[0706] Equation 5

[0707] In Equation 5, `vertical_planar` represents the prediction block derived based on the vertical plane pattern (hereinafter referred to as the vertical prediction block), and `horizontal_planar` represents the prediction block derived based on the horizontal plane pattern (hereinafter referred to as the horizontal prediction block). Furthermore, `w1` represents the weight assigned to the vertical prediction block, and `w2` represents the weight assigned to the horizontal prediction block.

[0708] Furthermore, deriving prediction blocks by weighted summation of vertical and horizontal prediction blocks can be termed a hybrid planar pattern.

[0709] A prediction block obtained through a mixed-plane mode can be set as the prediction block for the current block. Alternatively, the prediction block for the current block can be derived by weighted summing of the prediction blocks obtained through the mixed-plane mode and the prediction blocks derived based on another prediction mode.

[0710] The weights assigned to each of the vertical and horizontal prediction blocks can be determined based on the directional prediction pattern derived from the DIMD pattern.

[0711] For example, when the orientation prediction pattern derived from the DIMD pattern is closer to the horizontal pattern, the weights assigned to the horizontal prediction blocks can be set to values ​​greater than those assigned to the vertical prediction blocks. For instance, in Equation 5, w1 can be set to 1, and w2 can be set to 3.

[0712] For example, when the orientation prediction pattern derived from the DIMD pattern is closer to the vertical pattern, the weights assigned to the vertical prediction blocks can be set to a greater value than the weights assigned to the horizontal prediction blocks. For example, in Equation 5, w1 can be set to 3 and w2 can be set to 1.

[0713] Furthermore, when it is determined that the orientation prediction mode derived based on the DIMD mode is not close to either the vertical or horizontal mode, the weights assigned to the vertical prediction block and the weights assigned to the horizontal prediction block can be set to the same.

[0714] Non-directional prediction modes used in conjunction with directional prediction modes derived from DIMD modes can include at least one of a general plane mode, DC, a prediction mode derived from block vectors, a directional plane mode, or a hybrid plane mode. In other words, at least one of the listed non-directional prediction mode candidates can be used together with a directional prediction mode derived from DIMD modes to derive the prediction block for the current block.

[0715] Information indicating one of the non-directional prediction mode candidates can be encoded and transmitted using a signal.

[0716] Optionally, a template matching cost can be calculated for each non-directional prediction mode candidate, and a non-directional prediction mode candidate with the lowest template matching cost can be selected.

[0717] Furthermore, the configuration of non-directional prediction mode candidates can differ depending on the directional prediction mode derived from the DIMD mode.

[0718] For example, when the directional prediction mode derived from the DIMD mode is close to the vertical mode, the non-directional prediction mode candidate may include at least one of the following.

[0719] Candidate 1: DC Candidate 2: Prediction patterns derived from block vectors Candidate 3: General planar mode Option 4: Vertical Plane Mode Candidate 5: Mixed planar mode (w1>w2) For example, when the directional prediction mode derived from the DIMD mode is close to the horizontal mode, the non-directional prediction mode candidate may include at least one of the following.

[0720] Candidate 1: DC Candidate 2: Prediction patterns derived from block vectors Candidate 3: General planar mode Option 4: Horizontal Plane Mode Candidate 5: Mixed Planar Mode (w1) <w2) Furthermore, for all prediction methods that utilize planar models, directional planar models or hybrid planar models can be used instead of general planar models.

[0721] For example, when applying TIMD fusion, the prediction signal for the current block can be obtained by weighted summing the prediction signal derived from the TIMD mode and the prediction signal obtained from the planar mode-based prediction. In this case, the planar mode-based prediction can be a general planar mode, an oriented planar mode (vertical planar mode or horizontal planar mode), or a hybrid planar mode.

[0722] Furthermore, the interpolation direction of the orientation plane mode or the weight of the mixed plane mode can be determined by considering the orientation of at least one of the best or secondary modes derived from the TIMD mode.

[0723] For example, when at least one of the best or secondary modes is close to the vertical mode, a vertical plane mode can be used, or a hybrid plane mode can be used where the weights assigned to the vertical prediction blocks are greater than the weights assigned to the horizontal prediction blocks.

[0724] For example, when at least one of the best or second-best modes is close to the horizontal mode, a horizontal plane mode can be used, or a hybrid plane mode can be used where the weights assigned to the horizontal prediction blocks are greater than the weights assigned to the vertical prediction blocks.

[0725] When a weighted sum is performed on multiple prediction blocks, the weights used for each prediction block can be equal. Alternatively, the weights used for each prediction block can be set differentially.

[0726] Furthermore, the weights for the prediction block can be derived based on one of multiple weight set candidates. In this case, multiple weight set candidates can be predefined in the encoder and decoder.

[0727] For example, the encoder and decoder can determine the optimal weight set in terms of encoding from multiple weight set candidates. Then, the encoder can encode information indicating the optimal weight set among the multiple weight set candidates (e.g., a set index) and transmit it as a signal.

[0728] For example, suppose the weights assigned to each of the two prediction blocks are w0 and w1. In this case, the candidate set of weights for a pair of w0 and w1 can include at least one of the following.

[0729] Index 0: {w0, w1} = {1 / 4, 3 / 4} Index 1: {w0, w1} = {3 / 4, 1 / 4} Index 2: {w0, w1} = {1 / 2, 1 / 2} Optionally, a weight set candidate can be selected from multiple weight set candidates based on the prediction mode information of neighboring blocks.

[0730] For example, when encoding both the left neighbor block and the upper neighbor block in the inter-component prediction mode, the first weight set candidate (i.e., index 0) can be selected.

[0731] For example, when neither the left neighbor block nor the upper neighbor block is encoded in the inter-component prediction mode, a second weight set candidate (i.e., index 1) can be selected.

[0732] As another example, candidate weight sets can be selected based on the magnitude value or frequency of occurrence of each directional element or directional prediction pattern on the histogram.

[0733] For example, the weights assigned to prediction blocks generated based on prediction patterns with high amplitude values ​​or frequency of occurrence can be set to higher values ​​than those assigned to prediction blocks generated based on prediction patterns with low amplitude values ​​or frequency of occurrence.

[0734] For example, suppose the amplitude value or frequency of occurrence of the first prediction mode is amplitude(pred1), and the amplitude value or frequency of occurrence of the second prediction mode is amplitude(pred2). In this case, the weight w1 assigned to the first prediction block obtained based on the first prediction mode and the weight w2 assigned to the second prediction block obtained based on the second prediction mode can be derived according to Equation 6 below.

[0735] Equation 6

[0736] Furthermore, the weights assigned to at least one prediction block derived based on the DIMD pattern (i.e., the histogram of gradients) and the weights assigned to a prediction block derived based on another prediction pattern may be different.

[0737] In this scenario, the weights assigned to prediction blocks derived from another prediction mode can be set to fixed values, and the weights assigned to the prediction blocks derived from the DIMD mode can be derived based on the magnitude or frequency of the corresponding prediction mode on the histogram. Here, the weight assigned to the prediction blocks derived from another prediction mode can be 1 / N, where N represents the total number of prediction blocks.

[0738] For example, suppose three prediction blocks are derived based on two directional prediction patterns obtained from a DIMD pattern and a planar pattern. In this case, a weight of 1 / 3 can be assigned to the prediction block derived based on the planar pattern. On the other hand, the weights assigned to the prediction blocks derived based on the two directional prediction patterns can be determined based on the magnitude value or frequency of occurrence of the directional prediction patterns on the histogram. For example, according to the example in Equation 6, a weight w1 can be assigned to the first prediction block derived based on the first directional prediction pattern and a weight w2 can be assigned to the second prediction block derived based on the second directional prediction pattern.

[0739] Weights can also be determined based on the magnitude (or ratio) of the predicted patterns within the histogram (i.e., the gradient histogram or the occurrence count histogram). For example, the weights Wi(x,y) applied to the predicted sample at position (x,y) derived based on the predicted pattern i can be derived using Equation 7 or Equation 8 below.

[0740] Equation 7

[0741] Equation 8

[0742] In equations 7 and 8, wDIMD i This represents the weight assigned to the prediction pattern at index i, and can be determined based on the magnitude or number of occurrences of prediction pattern i on a histogram (i.e., a histogram of gradients or a histogram of occurrences).

[0743] For example, suppose that the two directional prediction modes derived in DIMD mode are mode 1 and mode 2, and the magnitude values ​​of each mode are 20 and 10, respectively.

[0744] In this case, the weights of the two directional modes and the weights of the non-directional mode can be derived as follows.

[0745] wDIMD1= 2 / 3 amplitude(mode1) / (amplitude(mode1) + amplitude(mode2)) =2 / 3 20 / (20+10) = 2 / 3 2 / 3 = 4 / 9 wDIMD2= 2 / 3 amplitude(mode1) / (amplitude(mode1) + amplitude(mode2)) =2 / 3 10 / (20+10) = 2 / 3 1 / 3 = 2 / 9 w nonangular = 1 / 3 In the example, w nonangular This represents the weight applied to the prediction block derived through the non-directional prediction mode.

[0746] In this example, when using HoG, the amplitude value of the directional prediction pattern can be used, and when using HoC, the cumulative number of occurrences of the directional prediction pattern can be used instead of the amplitude value.

[0747] Furthermore, the sum of weights can have predefined integer values.

[0748] For example, wDIMD1, wDIMD2, and w nonangular The sum can be 1.

[0749] H represents the height of the current block, and W represents the width of the current block.

[0750] a i Indicates a constant value. For example, a i It can be 10.

[0751] Alternatively, a can be adaptively determined based on the block size or the number of samples included in the block. i The value of a. For example, when the number of samples included in the current block is greater than 128, a i It can be set to a value less than the default value (e.g., 10).

[0752] When determining the weights of samples located at (x,y) coordinates within a prediction block based on the direction prediction pattern i, one of Equations 7 and 8 can be used selectively. Specifically, Equation 7 represents the weight w. i The method decreases as the distance from the upper boundary of the current block increases, and Equation 8 represents the weight w. i The method decreases as it gets further away from the left boundary of the current block.

[0753] In this case, the method for deriving weights can be determined based on the HoG value or ratio of each template.

[0754] For example, when the value of the directional prediction pattern i on the HoG derived from the template above the current block is greater than or equal to N times the value of the directional prediction pattern i on the HoG derived from the template to the left, the weight can be determined based on Equation 7. In this case, N can be 2.

[0755] On the other hand, when the value of the directional prediction pattern i on the HoG derived from the template to the left of the current block is greater than the value of the directional prediction pattern i on the HoG derived from the template above, or is greater than N times that value, the weight can be determined based on Equation 8. In this case, N can be 2.

[0756] Alternatively, when only the upper reconstructed region is available (i.e., only the upper template exists), the weight of each pixel can be derived based on Equation 7.

[0757] On the other hand, when only the left reconstruction region is available (i.e., only the left template exists), the weight of each pixel can be derived based on Equation 8.

[0758] As another example, a method can be used that assigns larger weights to pixels closer to the template used to derive the directional prediction pattern for generating the prediction signal. For instance, when deriving the directional prediction pattern based on the template above, the weight of each pixel can be derived based on Equation 7.

[0759] On the other hand, when deriving the direction prediction mode based on the left template, the weight of each pixel can be derived based on Equation 8.

[0760] When determining the weights, the directionality of the direction prediction pattern can be considered.

[0761] For example, when the orientation prediction mode is a vertical mode or a near-vertical mode, the weight of each pixel can be derived based on Equation 7.

[0762] On the other hand, when the orientation prediction mode is a horizontal mode or a near-horizontal mode, the weight of each pixel can be derived based on Equation 8.

[0763] Similar to luminance signals, predictive modes can also be derived for chrominance signals based on gradient histograms (HoG) derived from templates. These predictive modes for chrominance signals can be referred to as chrominance prediction modes.

[0764] In this case, a predicted signal (block) for the chroma signal block can be generated by using at least one prediction mode derived from the gradient histogram (HoG).

[0765] Alternatively, after deriving multiple prediction signals (blocks) based on multiple prediction modes, the multiple prediction signals (blocks) can be weighted and summed to generate a prediction signal (block) for the chroma signal block.

[0766] When the chromaticity prediction pattern derived from the histogram (i.e., the gradient histogram or the occurrence count histogram) is the same as the chromaticity prediction pattern derived by applying the direct pattern (DM) to the chromaticity signal, the prediction pattern with the second highest amplitude value or occurrence count on the gradient histogram (HoG) can be used as a candidate pattern for chromaticity prediction.

[0767] The predicted blocks for the chromaticity component blocks can also be obtained by combining inter-component prediction (e.g., CCLM, GLM, or CCCM) and prediction patterns derived from histograms. For example, the predicted blocks for the chromaticity component blocks can be obtained by weighted summing of the predicted blocks derived from histogram-derived prediction patterns and the predicted blocks derived from inter-component prediction.

[0768] Even in methods for generating prediction signals by mixing multiple prediction modes, at least one prediction mode can be derived from a histogram derived based on a template. Here, the method for generating prediction signals by mixing multiple prediction modes may include at least one of geometric partitioning mode (GPM), combined inter-frame-intra-frame prediction (CIIP) mode, or intra-frame fusion.

[0769] For example, when applying GPM mode, the encoded block is divided into two partitions (or blocks). In this case, a histogram for each partition can be derived based on the reconstructed reference region adjacent to the current block. Alternatively, the histogram for each partition can be derived by setting the reconstructed region adjacent to the partition as a template. The prediction mode for each partition can be derived using a partition-specific HoG.

[0770] For example, when applying the GPM pattern, at least one prediction pattern can be derived based on the histogram. Then, the at least one derived prediction pattern can be set as the prediction pattern for each partition.

[0771] For example, when applying the GPM mode, the maximum prediction mode and the second highest prediction mode can be set as the prediction mode for the partitions on the histogram.

[0772] When applying the DIMD mode, HoG can be derived based on multiple templates. Specifically, steps 1 and 2 can be performed for each template, and thus, a prediction block can be obtained for each template.

[0773] Predictive coding can be performed for each prediction block. Then, based on the coding cost, the optimal prediction block (i.e., the optimal template) can be determined. The encoder can encode and signal information about the optimal template.

[0774] The decoder can decode information about the optimal template and configure the template based on this. The decoder can then perform steps 1 and 2 based on the configured template to obtain the predicted block for the current block.

[0775] Optionally, the HoG for each template can be exported, and the prediction pattern can be exported from each HoG.

[0776] For example, four intra-frame prediction modes can be derived from a first HoG based on a template configured to include both the upper and left reconstruction regions. Furthermore, two intra-frame prediction modes can be derived from a second HoG based on a template configured to include only the upper reconstruction region, and two more can be derived from a third HoG based on a template configured to include only the left reconstruction region.

[0777] According to this method, when deriving multiple (up to eight) intra-prediction modes, the template matching cost for each of the eight intra-prediction modes can be calculated. Then, the intra-prediction mode with the lowest template matching cost can be set as the intra-prediction mode for the current block, or information indicating whether the intra-prediction mode with the lowest template matching cost is set as the intra-prediction mode for the current block can be encoded and transmitted using a signal.

[0778] When the DIMD mode is applied, merged predictions for HoG can be performed.

[0779] Specifically, HoGs at block locations where HoGs can be inherited can be inserted as candidates into the merge list.

[0780] Directional prediction patterns (angle patterns) can be exported from the HoG in the merge list, and the exported prediction patterns can be used to generate prediction blocks (signals).

[0781] In this scenario, a prediction block can be generated using a single prediction pattern. Alternatively, a prediction block can be generated by weighted summing of prediction blocks generated using multiple prediction patterns.

[0782] When multiple HOGs are included in the merge list, you can select one of the multiple HOGs.

[0783] Optionally, multiple HoGs can be selected from the merge list, and a merged HoG (MHoG) can be derived by merging the multiple selected HoGs. Based on the merged HoG, at least one directional prediction mode can be derived for the current block.

[0784] As another example, direction prediction patterns derived from HoG can be used as merging candidates. Specifically, a merging candidate can be configured to include N direction prediction patterns selected from the corresponding HoG. Here, N can be a natural number greater than or equal to 1. Selecting at least one direction prediction pattern from the HoG can follow the embodiments described above.

[0785] For example, at least one directional prediction mode can be derived from a merged HoG derived by merging multiple HoGs, and the derived directional prediction mode can be used as a merging candidate.

[0786] Predictive coding can be performed based on prediction blocks generated by prediction modes set as merging candidates, and the coding cost used for merging candidates can be calculated. When a merging candidate consists of multiple prediction modes, a prediction block can be generated by a weighted sum of multiple prediction blocks.

[0787] The best candidate within the merge list can be determined by comparing the encoding costs of the merge candidates. Furthermore, this example shows that the merge candidates have HoG information. For example, merge candidates may include information about the magnitude value of each prediction mode.

[0788] In addition to this example, merge candidates may also include HoC information. For example, merge candidates may include information about the frequency of occurrence of each prediction pattern.

[0789] The encoder can encode and signal the index of the lowest candidate in the merge list.

[0790] When constructing the merge list, if the current block's neighboring blocks have a referenceable block vector, information about the block located at a position separated from the neighboring block by a block vector (e.g., HoG information) can be added to the merge list.

[0791] Optionally, when adjacent blocks have motion vectors, information (e.g., HoG information) of blocks that are separated from adjacent blocks in the reference frame by motion vectors can be added to the merge list.

[0792] As described above, the method for deriving candidates by referencing a reference block specified by a block vector or motion vector can be applied in the same way to other merging methods as well as DIMD merging.

[0793] When performing DIMD merge prediction, not only the HoG of neighboring blocks can be used, but also the prediction mode information of neighboring blocks.

[0794] In addition, HoGs located on at least one of the following neighboring blocks can be inserted into the merge list.

[0795] Spatial adjacent / non-adjacent locations Temporally adjacent / non-adjacent locations same position Based on historical location Adjusting temporal / spatial adjacent / non-adjacent positions using block vectors / motion vectors When encoding neighboring blocks to be referenced via IntraTMP or IBC, the prediction mode of the reference block, which is separated from the neighboring blocks by block vectors, can be used as the prediction mode for merging predictions. In this case, the prediction mode of the reference block can be derived using HoG for the reference block.

[0796] When the prediction mode of the neighboring block to be referenced is a mode of predictive coding performed by mixing multiple prediction modes (e.g., intra-frame fusion, DIMD, TIMD, CIIP, or GPM), at least one of the multiple prediction modes of the reference block can be used as the prediction mode of the current block.

[0797] The number of items in the merge list for the current block can be one.

[0798] Optionally, multiple merge lists can be exported for the current block. When multiple merge lists exist, candidates included in each merge list can be exported as follows.

[0799] First merge list: DIMD-encoded blocks and their corresponding encoding information. Second merge list: TIMD-encoded blocks and their corresponding encoding information. Third merge list: Blocks encoded via IntraTMP / IBC and their corresponding encoding information. Fourth merge list: Other intra-frame prediction modes A merged list can also be constructed by distinguishing between forecasting methods with a single forecasting pattern and forecasting methods with multiple forecasting patterns.

[0800] Candidates within the merge list can be sorted based on template matching. When multiple merge lists exist, each list can be sorted according to its template matching cost, and the top N candidates (i.e., the N candidates with the lowest template matching cost) can be selected from each list. A new merge list can then be generated that includes candidates selected from the multiple merge lists.

[0801] When constructing the merge list, both the prediction patterns derived using HoG information and the prediction patterns derived from neighboring blocks can be included in a single merge list.

[0802] As another example, a merge list with prediction patterns derived using HoG information and a merge list with prediction patterns derived (inherited) from neighboring blocks can exist separately.

[0803] In this case, information indicating whether to use each merge list can be encoded and sent using signals.

[0804] To perform merge prediction, whether to use at least one of multiple merge lists, merge list indices, or merge candidate indices within merge lists can be encoded and signaled to the decoder.

[0805] The following section will describe in detail the process of configuring HoC.

[0806] When prediction is performed based on prediction pattern information inherited from neighboring blocks, the inherited prediction pattern information can be scaled and used and / or stored in the current block. For example, the prediction pattern information inherited from neighboring blocks can be scaled, and the scaled inherited prediction pattern information can be converted into the occurrence count of the prediction pattern and used and / or stored in the current block.

[0807] In this scenario, the inherited prediction pattern information can be scaled or normalized based on the size of neighboring blocks. For example, suppose the size of the neighboring block to be referenced is 32×32, and a prediction pattern is stored in the neighboring block. Alternatively, suppose the prediction patterns are stored / processed in 4×4 units.

[0808] The occurrence count of prediction patterns stored in the 4×4 regions surrounding the current block can be adjusted to match the size of neighboring blocks. For example, since a 32×32 block consists of 64 4×4 regions, the occurrence count of prediction patterns inherited from neighboring blocks can be set to 64.

[0809] Optionally, the inherited prediction pattern information can be scaled or normalized based on the number of pixels included in the neighboring block. For example, when the size of the neighboring block to be referenced is 32×32, the number of occurrences of the prediction pattern inherited from the neighboring block can be set to 1024 (i.e., the number of samples within the neighboring block).

[0810] In other words, the frequency of prediction patterns can be determined based on the size of neighboring blocks or the number of samples within neighboring blocks.

[0811] When a neighboring block has multiple prediction patterns, the occurrence count can be calculated for each prediction pattern. In this case, the occurrence count can be derived by assigning the same or different weights to each prediction pattern.

[0812] For example, assume the reference block size is 32×32, and the reference block is encoded using a TIMD fusion mode based on two prediction modes. Additionally, assume the fusion weights used to obtain the neighboring blocks (i.e., the weights assigned to the two prediction modes) have a ratio of 0.75:0.25 (i.e., 3:1).

[0813] When assuming the occurrence count is calculated in pixels, the total number of occurrences within a 32×32 block is 1024 (i.e., the total number of samples).

[0814] Based on the fusion weights, the frequency of occurrence of the best and second-best patterns in neighboring blocks can be determined. For example, since the fusion weights for the best and second-best patterns have a 3:1 ratio, the frequency of occurrence of the best pattern can be set to 768 (i.e., (3 / 4)). 1024), and the number of occurrences of the minor pattern can be set to 256 (i.e., (1 / 4)). 1024).

[0815] Alternatively, when calculating the occurrence count of a predicted pattern, the weight of the predicted pattern can be determined by using a histogram derived from neighboring blocks (i.e., a histogram of gradients or a histogram of occurrence counts).

[0816] For example, suppose the size of the neighboring block is 32×32, and the DIMD or OBIC pattern is applied to the neighboring block. Additionally, suppose that neighboring blocks are predicted using five prediction patterns, and the magnitude values ​​or frequency ratios of the five prediction patterns on HoG are as follows.

[0817] Optimal Pattern: Second Pattern: Third Pattern: Fourth Pattern: Fifth Pattern = 12:8:6:5:1 (Total: 32) When assuming the occurrence count is calculated in pixels, the total occurrence count within a 32×32 block is 1024 (i.e., the total number of samples). In this case, the occurrence count of each of the five prediction modes can be calculated as follows.

[0818] Optimal mode: =384 (=12×32) Second mode = 256 (= 8 × 32) Third pattern = 192 (= 6 × 32) Fourth mode = 160 (= 5 × 32) Fifth mode = 32 (= 1 × 32) In the example, the sum of the frequencies of the predicted pattern can be equal to 1024 (i.e., the total number of samples).

[0819] When calculating the occurrence count of each prediction pattern, the weight assigned to the reference block can vary depending on the position of neighboring reference blocks.

[0820] For example, the weight assigned to a reference block adjacent to the current block can have a higher value than the weight assigned to a reference block that is not adjacent to the current block.

[0821] For example, the weight assigned to a reference block that belongs to the same frame as the current block can have a higher value than the weight assigned to a reference block that does not belong to the same frame as the current block.

[0822] Optionally, when there are more prediction patterns, the weights assigned to the reference block can have larger values.

[0823] Optionally, the weight assigned to the reference block can vary based on the distance between the current block and the reference block.

[0824] For example, a higher weight can be assigned to a reference block that is closer to the current block.

[0825] The frequency of each predicted pattern can be calculated by setting different weights for each reference block. These can then be combined to derive an occurrence frequency histogram (HoC), which records the frequency of each predicted pattern in the current block.

[0826] Based on the prediction pattern information (or the number of occurrences of prediction patterns) inherited from neighboring blocks, the cumulative number of occurrences of the inherited prediction patterns can be calculated. Based on this, a histogram of occurrences (HoC) for each prediction pattern can be generated.

[0827] Based on HoC, at least one prediction mode can be determined for intra-prediction or intra-prediction merging for the current block. Determining the prediction mode based on HoC can also be called On-Bounds Intra-Codec (OBIC).

[0828] The occurrence count for each prediction pattern can be derived from at least one referential neighboring block around the current block. Then, the occurrence counts of each prediction pattern from multiple neighboring blocks can be combined to derive the occurrence count of the prediction pattern within the HoC according to Equation 9.

[0829] Equation 9

[0830] Equation 9 shows an example of generating HoC when the occurrence count of neighboring blocks is determined to be the same as the number of samples included in the neighboring blocks. In Equation 9, Width and Height represent the width and height of the neighboring blocks, respectively.

[0831] The sum of the occurrence counts of each prediction pattern for multiple adjacent blocks can be derived in the form of a merged HoG, as in the previous example.

[0832] The occurrence count of prediction patterns inherited from the surrounding environment can be accumulated and stored for each prediction pattern, and the prediction pattern with the highest accumulated count can be used as the prediction pattern for the current block.

[0833] Optionally, the occurrence count of prediction patterns inherited from the surrounding environment can be accumulated and stored for each prediction pattern, and N prediction patterns with high accumulated counts can be used as the prediction patterns for the current block.

[0834] N predicted blocks can be obtained by performing a prediction on the current block based on each of the N prediction patterns. Then, the predicted block for the current block can be obtained by weighted summation of the multiple predicted blocks.

[0835] In this case, as in DIMD mode, up to five prediction modes can be selected.

[0836] Optionally, such as in TIMD mode, up to two prediction modes can be selected.

[0837] When performing a weighted summation of multiple prediction blocks, the weights can be determined in a manner similar to that in DIMD mode. For example, in DIMD mode, the implementation of determining the weights of prediction blocks based on the magnitude of HoG can be changed to determining the weights based on the frequency of occurrence on HoC.

[0838] In addition to the prediction mode selected based on the frequency of occurrence, a non-directional prediction mode can also be used to obtain the predicted block for the current block.

[0839] Alternatively, instead of using a prediction block derived from a non-directional prediction mode, a prediction block derived from a block vector can be used to obtain the prediction block for the current block.

[0840] HoC can be used to perform merged predictions for each prediction pattern inherited from neighboring blocks.

[0841] For example, the prediction pattern with the highest occurrence frequency in HoC can be added as a merge candidate to the merge list of the current block.

[0842] For example, N prediction patterns can be selected in descending order of their frequency of occurrence in the HoC, and the selected N prediction patterns can be added to the merge list of the current block.

[0843] For example, you can select prediction patterns that appear more than or equal to a threshold in the HoC, and you can add the selected prediction patterns to the merge list of the current block.

[0844] HoG information can be derived based on the inherited HoG information for each prediction pattern. The HoG information derived from the occurrence count of prediction patterns can be used to generate a merged HoG.

[0845] Conversely, HoCs can also be generated based on HoGs inherited from neighboring blocks.

[0846] When deriving the HoG based on prediction pattern information or prediction pattern information inherited from neighboring blocks (or the occurrence count of each prediction pattern derived in this way), separate operations (e.g., gradient filtering) can be avoided. In other words, the HoG can be reconfigured using only the prediction pattern information stored in neighboring blocks without applying filters. In this way, the complexity caused by computing the HoG can be reduced.

[0847] In this scenario, when applying DIMD merge prediction to the current block, the candidate prediction mode for the current block can be derived using intra-prediction mode information from neighboring blocks instead of HoG. Therefore, for blocks that have completed encoding / decoding, intra-prediction mode information can be stored instead of HoG. This reduces the amount of data stored (i.e., storage space).

[0848] In this case, when intra-prediction mode information is not stored in neighboring blocks (e.g., when neighboring blocks are encoded in inter-prediction modes), the occurrence count of each prediction mode can be derived by calculating the HoG of the corresponding neighboring blocks.

[0849] The merge prediction method that uses prediction pattern information (the number of occurrences of the prediction pattern) from neighboring blocks can be a DIMD sub-pattern activated when the DIMD prediction pattern is applied to the current block. In other words, when the DIMD flag of the current block is true, it can be determined separately whether to apply the DIMD sub-pattern (i.e., the merge prediction method that uses prediction pattern information from neighboring blocks).

[0850] In this case, when determining the candidate prediction modes to be used in the Intra-Coding Mode Determination Method (OBIC) based on the number of occurrences, at least one of the prediction modes used in DIMD can be excluded.

[0851] Intra-prediction methods based on prediction mode information (number of occurrences of the prediction mode) of neighboring blocks (OBIC) or intra-merging prediction methods using OBIC can be defined as independent intra-prediction modes. For example, the encoder can determine the optimal prediction mode in intra-prediction methods such as TIMD and DIMD, OBIC, or merging prediction methods using OBIC.

[0852] Information indicating whether to perform the DIMD method can be encoded and sent via signal. When applying the DIMD mode, information indicating whether to perform merge prediction can be additionally encoded and sent via signal under the DIMD method.

[0853] Instead of deriving prediction patterns based on HoG information, merge predictions can be performed using prediction patterns derived from the occurrence frequency information of prediction patterns inherited from neighboring blocks.

[0854] In this case, the encoder can encode information indicating whether to use the occurrence-based intra-frame coding method (OBIC) and send it as a signal.

[0855] Specifically, the frequency of each prediction pattern can be calculated based on prediction pattern information inherited from neighboring blocks. Then, at least one prediction pattern with a high frequency can be selected, and a prediction signal for the current block can be generated based on the selected at least one prediction pattern.

[0856] For example, up to two or five prediction patterns can be selected in descending order of frequency of occurrence. After obtaining multiple prediction blocks based on multiple prediction patterns, the multiple prediction blocks can be weighted and summed to derive the prediction block for the current block.

[0857] The weighting method (e.g., the number of prediction patterns used for weighting and / or the weights used for weighting) can be determined based on the DIMD or TIMD methods described above.

[0858] Even during transform prediction, frequency-based prediction methods used in intra-frame prediction methods can be employed. Specifically, when determining the transform information of the current block, the frequency of occurrence of transform information in neighboring blocks can be considered. Here, transform information may include at least one of transform type, DCT, DST, LFNST, or NSPT.

[0859] For example, during context encoding for transform types, the number of occurrences of transform information can be used.

[0860] For example, during context encoding and decoding of the kernel index for LFNST or NSPT, the occurrence count of transformation information can be used.

[0861] In this case, the frequency of occurrence of transformation information can be used to reorder the probability table of the corresponding context.

[0862] Optionally, the number of occurrences of the transformation information can be used to reorder the transformation candidate table (or the index within the table).

[0863] When applying a prediction method for deriving multiple intra-prediction modes, one of the multiple intra-prediction modes can be selected and used as the final prediction mode for the current block. Here, the prediction method for deriving multiple intra-prediction modes may include at least one of DIMD, OBIC, or TIMD.

[0864] One of several prediction patterns can be selected based on template matching cost.

[0865] For example, when applying TIMD mode, if the template cost of the best mode is less than or equal to a threshold, only the best mode can be used during intra-frame prediction of the current block.

[0866] For example, when comparing template matches between the best and second-best modes, if the template matching cost of the second-best mode is at least N times that of the best mode, then only the best mode can be used during intra-frame prediction of the current block. Here, N can have a value greater than or equal to 1.

[0867] For example, when the difference between the intra-prediction mode index values ​​of the best mode and the second-best mode is less than or equal to a threshold, only the best mode can be used during intra-prediction of the current block. Here, when the difference between the intra-prediction mode index values ​​of the best mode and the second-best mode is less than or equal to a threshold, it can indicate that the two have similar directionality.

[0868] Optionally, one of several prediction modes can be selected based on HoG.

[0869] For example, intra-frame prediction for the current block can be performed by using only the prediction mode with the maximum amplitude value on the HoG.

[0870] For example, when the amplitude value of the prediction mode with the largest amplitude value on HoG is greater than or equal to a threshold, intra-frame prediction can be performed on the current block using only the corresponding prediction mode.

[0871] Optionally, one of multiple prediction patterns can be selected based on the number of times each prediction pattern occurs.

[0872] For example, intra-frame prediction for the current block can be performed using only the prediction mode that has the highest occurrence count.

[0873] For example, when the occurrence count of the prediction pattern with the highest occurrence count is greater than or equal to a threshold, intra-frame prediction can be performed on the current block using only the corresponding prediction pattern.

[0874] Alternatively, one of several prediction modes can be selected based on the number (i.e., area) of samples encoded by the corresponding prediction mode.

[0875] For example, when SGPM is applied to neighboring blocks, intra-frame prediction of the current block can be performed based on the prediction mode applied to the partitions with larger areas in the neighboring blocks.

[0876] For example, when the area of ​​a partition with a large area is greater than or equal to a threshold, intra-frame prediction for the current block can be performed based on the prediction mode applied to the corresponding partition.

[0877] Information indicating whether to select one of multiple prediction modes can be encoded and sent using signals.

[0878] When multiple prediction modes are derived for the current block, at least one of the following methods can be used: using all of the multiple prediction modes or selecting one of the multiple prediction modes.

[0879] Furthermore, the method used to select one of multiple forecast patterns can also be applied to build a merge list during merge forecasting.

[0880] For example, when a reference block is encoded in TIMD mode, two prediction modes can be derived from the reference block. Then, only one of the two prediction modes can be selected to add only the selected prediction mode to the merge list. For example, only the prediction mode with a low template matching cost or the prediction mode with a template matching cost below a threshold can be added to the merge list.

[0881] When performing merge prediction based on DIMD, the prediction pattern for the current block can be derived from the candidates in the merge list.

[0882] Furthermore, new candidates can be generated by using multiple candidates from the merged list. Specifically, a weighted sum can be performed on multiple candidates to derive a new candidate.

[0883] For example, two candidates can be selected from the top of the merge list. Here, the first two candidates in the merge list can indicate the two candidates with the smallest indices. Then, a weighted sum can be performed on the selected candidates to add a new candidate to the merge list.

[0884] For example, suppose there are two candidates as follows.

[0885] First candidate: Predictive pattern index 8 Second candidate: Predictive pattern index 4 When the weights assigned to each of the first and second candidates are 3 and 1, respectively, the weighted sum of the two modes can be obtained (i.e., ((8)). 3+4 1) / 4=7)) is added as a new candidate to the merge list.

[0886] Optionally, multiple candidates within the merging list can be selected, and the prediction signal for the current block can be generated based on the multiple selected candidates. For example, multiple prediction blocks can be obtained based on the multiple selected candidates, and the prediction block for the current block can be obtained by weighted summing of the multiple prediction blocks.

[0887] For example, two candidates can be selected from the top of the merge list. Alternatively, two predicted blocks can be obtained by performing a prediction on the current block based on each candidate. Then, the predicted block for the current block can be obtained by weighted summing of the two predicted blocks.

[0888] New merge candidates can be derived based on the magnitude or frequency of occurrence of merge candidates in the merge list.

[0889] Figure 16 This represents an example of deriving new merge candidates.

[0890] exist Figure 16In the example, assume that the initial merge list includes three merge candidates (indices 1-3). Based on the magnitude value or occurrence count value of each candidate in the merge list, the sum of magnitude or the sum of occurrence counts for each prediction pattern can be derived.

[0891] Then, S prediction patterns can be selected in descending order of the sum of magnitude or the sum of occurrences, and the selected prediction patterns can be inserted into the merge candidate list as a merge candidate.

[0892] Optionally, each of the selected prediction modes can be set as a separate merge candidate and inserted into the merge candidate list.

[0893] Alternatively, instead of adding the selected prediction mode as a new candidate to the merge list, the selected prediction mode can be set as the final prediction mode for the current block. In this case, the encoding / decoding of the index indicating one of the merge candidates can be omitted.

[0894] Deriving Predicted Signals Based on TIMD Mode Based on the TIMD method, a prediction signal for the current block can be generated. Specifically, when the TIMD pattern is applied to the current block, the prediction signal can be obtained through the following steps 1, 2, and 3.

[0895] (Step 1) Steps for constructing the most probable pattern (MPM) list for the current block (or target block) To construct the MPM list, Intra-Prediction Mode (IPM) information can be inherited from blocks encoded / decoded before the current block. In this case, blocks encoded / decoded before the current block can correspond to at least one of the following:

[0896] (1) Spatial adjacent positions (2) Spatially non-adjacent positions (3) Temporally adjacent / non-adjacent locations (4) Corresponding positions (5) Based on historical location (6) Adjusting temporal / spatial adjacent / non-adjacent positions using block vectors / motion vectors Here, historical candidates can be pre-stored in a list managed by a FIFO method. Prediction pattern information can be inserted / stored in the corresponding list according to the order in which blocks are encoded / decoded.

[0897] Temporally / spatially adjacent / non-adjacent positions can also be adjusted based on block vectors or motion vectors. When temporally / spatially adjacent / non-adjacent positions are adjusted, intra-frame prediction mode information can be inherited from the block including the adjusted position. Here, the adjusted position can represent a position separated from the initial position by block vectors or motion vectors.

[0898] Furthermore, the position can be adjusted only for blocks within the same frame from which the block vector or motion vector is derived. For example, when deriving a block vector from a block that is spatially adjacent to the current block, the position can be adjusted only for spatially adjacent / non-adjacent positions, and not for temporally adjacent / non-adjacent positions.

[0899] Alternatively, the position can be adjusted only for blocks within the frame that are different from the blocks from which the block vector or motion vector is derived.

[0900] Alternatively, all available positions can be adjusted without taking into account the screen to which the block from which the block vector or motion vector is derived belongs.

[0901] Blocks including time positions can be included in reference frames used for inter-frame prediction.

[0902] The MPM list for the current block can be constructed by inheriting the intra-prediction mode from at least one of the listed blocks.

[0903] For example, the following example can be used to generate / build a list of MPMs for the current block.

[0904] (1) A plane can be added to the MPM list. In this case, the plane can be added to the top of the MPM list. Here, the top means the position with the smallest index (i.e., index = 0) (i.e., (1) MPM_LIST[0] = PLANAR_IDX).

[0905] (2) The best prediction pattern (best pattern) stored in neighboring blocks (specifically, spatially adjacent locations) can be inserted into the MPM list. Furthermore, spatially adjacent blocks can be searched sequentially to derive MPM candidates. For example, the search order for spatially adjacent blocks could be: left neighbor, top neighbor, bottom left neighbor, top right neighbor, and top left neighbor.

[0906] (3) Prediction patterns derived by applying the DIMD pattern to the current block can be added to the MPM list. When multiple prediction patterns are derived from the DIMD pattern, at least one of the multiple prediction patterns can be added to the MPM list. For example, the best pattern or the second-best pattern can be added to the MPM list.

[0907] (4) Prediction patterns derived (or inherited) from spatially non-neighboring blocks can be inserted into the MPM list.

[0908] (5) Prediction patterns derived (or inherited) from temporally adjacent blocks can be inserted into the MPM list.

[0909] (6) Predictive patterns derived (or inherited) from the same block can be inserted into the MPM list.

[0910] (7) Historical prediction patterns can be inserted into the MPM list.

[0911] (8) Predictive patterns derived (or inherited) from blocks at the adjusted location based on block vectors / motion vectors can be inserted into the MPM list. Location adjustment can be performed by using temporally / spatially adjacent / non-adjacent locations as initial locations.

[0912] (9) Predictive modes obtained by adding / subtracting offsets from the predictive mode candidates included in the MPM list can be added to the MPM list. The offset can have a value from -4 to +4. For example, when the second candidate in the MPM list (i.e., index == 1) is predictive mode 6, at least one predictive mode from {2,3,4,5,7,8,9,10} can be added to the MPM list.

[0913] (10) Predefined prediction patterns can be added to the MPM list. Predefined prediction patterns may include at least one of the following.

[0914] {DC_IDX, VER_IDX, HOR_IDX, VER_IDX-4, VER_IDX+4, 14, 22, 42, 58, 10,26, 38, 62, 6, 30, 34, 66, 2, 48, 52, 16} Here, -4 and +4 indicate that the maximum absolute value of the offset is 4. In other words, VER_IDX-4 can include four patterns derived by adding -4, -3, -2, and -1 to VER_IDX, and VER_IDX+4 can include four patterns derived by adding +1, +2, +3, and +4 to VER_IDX.

[0915] The MPM list can be constructed according to the order of (1) to (10). Alternatively, the MPM list can be constructed in a different order than that listed.

[0916] After candidates are added to the MPM list, they can be sorted using template matching costs. Reordering can be performed after all candidates have been added to the MPM list, or it can be performed on candidates added to the MPM list in a predetermined step. For example, reordering of candidates can be performed after candidates from items (1) to (8) have been added to the MPM list. Alternatively, reordering of candidates can be performed after candidates from items (1) to (4) have been added to the MPM list.

[0917] In (1), a prediction mode derived from a block vector can be used instead of a planar mode. For example, instead of a planar mode, a prediction mode of a reference block indicated by a block vector inherited from a neighboring or co-located block can be added to the MPM list.

[0918] Predictive patterns may be added to a reserved list instead of being immediately added to the MPM list. The reserved list may include at least one predictive pattern candidate that is not immediately added to the MPM list but will be added to the MPM list in the future.

[0919] For example, suppose the intra-prediction mode to be added to the MPM list is pred_mode_idx. The intra-prediction mode can be added to the MPM list when it meets predetermined conditions. Otherwise, it can be added to the reserved list.

[0920] The predefined conditions can be defined as shown in Equation 10 below.

[0921] Equation 10

[0922]

[0923]

[0924] In this example, the variable `nbRemovedFirst` used to determine the lower bound of the bottom boundary value can be determined based on at least one of the current block's size or the ratio of the current block's width to its height. For example, the variable `deltaSize` can be derived based on the current block's width and height, and the variable `nbRemovedFirst` can be derived based on the derived variable `deltaSize`. The variable `deltaSize` can be derived as shown in Equation 11 below.

[0925] Equation 11

[0926] When an adjacent block is unavailable, the value of the variable nbRemovedFirst can be determined differently depending on the position of the corresponding adjacent block.

[0927] Figure 17 Show the blocks adjacent to the current block.

[0928] exist Figure 17 In this context, each adjacent block can be identified by a different index.

[0929] When the top-right neighboring block (i.e., the neighboring block with index 3) is unavailable, the variable nbRemovedLast can be derived as follows.

[0930] When the width and height of the current block are the same (height = width), nbRemovedLast=nbRemovedLast+5 When the width of the current block is greater than its height (height < width) and the value of deltaSize is 1, nbRemovedLast=nbRemovedLast+6 When the width of the current block is greater than its height (height < width) and the value of deltaSize is 2, nbRemovedLast=nbRemovedLast+10 When the width of the current block is greater than its height (height < width) and the value of deltaSize is greater than 2, nbRemovedLast=nbRemovedLast+12 When the lower left neighboring block (i.e., the neighboring block with index 2) is unavailable, the variable nbRemovedLast can be derived as follows.

[0931] When the width and height of the current block are the same (height = width), nbRemovedLast=nbRemovedLast+5 When the height of the current block is greater than its width (height > width) and the value of deltaSize is 1, nbRemovedLast=nbRemovedLast+6 When the height of the current block is greater than its width (height > width) and the value of deltaSize is 2, nbRemovedLast=nbRemovedLast+10 When the height of the current block is greater than its width (height > width) and the value of deltaSize is greater than 2, nbRemovedLast=nbRemovedLast+12 This process effectively changes the insertion order of prediction patterns that will be inserted into the MPM list. Therefore, this process can be called a "partial MPM reordering" process.

[0932] For at least one of the prediction patterns according to items (1) to (10) above, it can be determined whether to add the corresponding prediction pattern to the MPM list or the retention list.

[0933] Alternatively, it may be possible to determine whether to apply the reservation list only for predefined items. For example, it may be possible to allow the reservation list to be used only for prediction patterns based on items (1) through (4).

[0934] Additionally, after constructing the MPM list based on at least one of items (1) to (10), the prediction patterns included in the retained list can be added to the MPM list. For example, after constructing the MPM list based on items (1) to (4), the prediction patterns included in the retained list can be added to the MPM list.

[0935] In addition, after deriving a prediction pattern based on at least one of items (1) to (10), only some of the multiple derived prediction patterns may be added to the MPM list.

[0936] For example, if 30 prediction pattern candidates are derived from items (1) through (7), the corresponding candidates can be added to a temporary list. Then, up to N candidates can be selected in ascending order of cost by reordering based on template matching. The selected N candidates can then be added to the MPM list. For example, N can be 5 or 6.

[0937] When adding a prediction pattern derived from at least one of items (1) to (10) to the MPM list, a template cost for each prediction pattern can be calculated, and the insertion order of the prediction patterns can be determined based on the template matching cost. For example, the prediction patterns can be sorted in ascending order of template cost, and the prediction patterns can be added to the MPM list in sorting order (i.e., in ascending order of template cost).

[0938] For at least one of items (1) to (10), the prediction patterns can be sorted according to the template matching cost. For example, when multiple prediction patterns are derived from item (2), the multiple prediction patterns can be sorted according to the template matching cost, and the order in which the multiple prediction patterns are inserted into the MPM list can be determined.

[0939] In addition, when multiple prediction patterns are derived from item (3), a method for determining the insertion order of the MPM list based on template matching cost can be used.

[0940] In other words, the MPM list can be constructed in the following order.

[0941] Add the predicted mode candidates to the MPM list according to item (1) - Derive multiple predicted mode candidates according to item (2) - Sort the predicted mode candidates derived according to item (2) and add them to the MPM list in the order of sorting - Derive multiple predicted mode candidates according to item (3) - Sort the predicted mode candidates derived according to item (3) and add them to the MPM list in the order of sorting... Alternatively, the method used to rank the cost-based prediction patterns of template matching can also be applied only to items (2) to (4).

[0942] Alternatively, in addition to applying a method for sorting the template matching cost-based prediction patterns for each project, a method for sorting the template matching cost-based prediction patterns for the multiple prediction patterns derived from multiple projects can also be applied (e.g., (2) to (4)).

[0943] Furthermore, when ranking prediction patterns based on template matching cost, only some prediction patterns with lower costs among the ranked prediction patterns can be inserted into the MPM list, instead of inserting all ranked prediction patterns into the MPM list.

[0944] For example, after sorting the prediction patterns according to template matching cost, N prediction patterns can be selected in ascending order of cost. These N selected prediction pattern candidates can then be added to the MPM list. For example, N could be 12.

[0945] After constructing the MPM list, the MPM list can be updated based on the template matching cost of the predicted pattern candidates included in the MPM list.

[0946] For example, after calculating the template matching cost for each prediction pattern candidate included in the MPM list, the MPM list can be updated such that only N prediction pattern candidates with low cost are kept in the MPM list, and the remaining prediction pattern candidates are removed from the MPM list.

[0947] Furthermore, prediction mode candidates are derived from items (1) to (10), but when the number of candidates included in the MPM list reaches the maximum (i.e., the size of the MPM list), the derivation of additional prediction mode candidates can be omitted. Afterwards, the prediction mode candidates included in the MPM list can be reordered according to the template cost.

[0948] When constructing the MPM list, prediction patterns for constructing the MPM list can be derived based on HoG information inherited from neighboring blocks or prediction pattern occurrence frequency information.

[0949] For example, a merged HoG can be derived based on HoG information inherited from at least one neighboring block. Then, at least one direction prediction mode can be derived from the merged HoG, and the derived direction prediction mode can be added to the MPM list.

[0950] For example, the largest predicted pattern in the histogram (i.e., a histogram of gradients or a histogram of occurrences) can be added to the MPM list. If the same predicted pattern is already included in the MPM list, a predicted pattern with a smaller size can be added.

[0951] For example, N prediction patterns can be selected in descending order of size from a histogram (i.e., a gradient histogram or an occurrence count histogram), and these N prediction patterns can be added to the MPM list. For example, N could be 5. In this case, prediction patterns that already exist in the MPM list can be excluded from the N prediction patterns.

[0952] Predictive patterns can also be selected to be added to the MPM list based on the frequency of their occurrence rather than their magnitude.

[0953] (Step 2) Generate a prediction template and determine the prediction mode based on the MPM list. A prediction template can be generated based on prediction mode information included in the MPM list. The prediction template represents the result of performing a prediction on the template of the current block.

[0954] Figure 18 and Figure 19 This shows a configuration example of a reference template used to export the prediction template.

[0955] exist Figure 18 The example shown illustrates a reference template constructed to include the reconstructed region of the template adjacent to the current block. In other words, reference samples for performing predictions on the template can be derived from the reconstructed samples adjacent to the template.

[0956] exist Figure 19 The example shown illustrates that a reference template is constructed to include reconstructed regions adjacent to the current block. In other words, reference samples for performing predictions on the template can be derived from reconstructed samples adjacent to the current block.

[0957] A reference template may include at least one reconstructed sample line.

[0958] In this context, the MRL method can also be used to determine the reconstructed sample lines that constitute the reference template. In other words, at least one of a plurality of candidate reference sample lines can be selected, and the reference template can be constructed to include the selected reference sample line. For this purpose, index information indicating at least one of the plurality of reconstructed sample lines can be encoded and transmitted using a signal.

[0959] Multiple candidate reference sample lines can be determined based on the position of the current block, or based on the position of the template of the current block. In other words, N reconstructed sample lines adjacent to the current block can be set as candidate reference sample lines, or N reconstructed sample lines adjacent to the template can be set as candidate reference sample lines.

[0960] A prediction template can be generated using prediction mode information from the MPM list and samples included in the reference template. Specifically, a prediction template can be generated by performing intra-frame prediction on the template of the current block based on prediction modes (e.g., direction prediction modes) included in the MPM list.

[0961] A prediction template can be exported for each prediction pattern included in the MPM list. Then, for each prediction template, the template matching cost with the template of the current block can be calculated.

[0962] Next, the candidate prediction patterns included in the MPM list can be sorted in ascending order of template matching cost. Then, the top N prediction patterns in the MPM list can be selected, and these selected N prediction patterns can be set as candidate prediction patterns for TIMD prediction. Here, the top N prediction patterns can be selected in ascending order of their indices within the MPM list.

[0963] Optionally, the pattern with the lowest template matching cost can be set as the best pattern (or the initial pattern or the main pattern), and the pattern with the second lowest template matching cost can be set as the secondary pattern.

[0964] At least one of the best or second-best modes can be set as a candidate prediction mode for TIMD prediction.

[0965] Optionally, the information used to determine the candidate prediction mode can be encoded and sent to the decoder as a signal. Optionally, the candidate prediction mode can be derived based on a neighboring template.

[0966] Template matching cost can refer to the SAD, SATD, SSE, or MRSAD between predicted samples within the predicted template and reconstructed samples within the template of the current block.

[0967] Template matching can also be performed using multiple template matching cost calculation methods (metrics or measures). When multiple template matching cost calculation methods are used, the template matching cost can be calculated according to each calculation method. Then, the final encoding cost (e.g., rate-distortion cost) of the predicted pattern candidate with the lowest template matching cost can be calculated for each calculation method. The calculation method used to derive the predicted pattern candidate with the lower final encoding cost can then be determined as the final template matching calculation method.

[0968] The encoder can determine the optimal template matching cost calculation method and encode the information indicating the determined template matching cost calculation method and send it as a signal.

[0969] The use of multiple template matching cost calculation methods can also be applied to other methods that use template matching.

[0970] (Step 3) Generate prediction blocks based on prediction model information The prediction block for the current block can be generated using the prediction pattern and reference samples exported in step 2.

[0971] The encoder can encode information indicating whether to use the template-based intra-frame mode derivation (TIMD) method and send it as a signal to the decoder.

[0972] When deriving multiple prediction patterns in step 2, the current block can be predicted based on each of the multiple prediction patterns to generate multiple prediction blocks. In this case, the coding cost of each of the multiple prediction blocks can be calculated, and the prediction pattern used to derive the prediction block with the lowest coding cost can be determined as the optimal prediction pattern.

[0973] Once the optimal prediction mode is determined, the encoder can encode information indicating the optimal prediction mode among multiple prediction modes and send it as a signal.

[0974] Optionally, the prediction block of the current block can be derived by weighting, merging, or mixing multiple prediction blocks.

[0975] Specifically, multiple prediction modes can be selected from the MPM list. For example, the prediction mode candidates included in the MPM list can be sorted according to template matching cost, and then the best mode and the second-best modes can be selected.

[0976] Then, the current block can be predicted based on each of the best and second-best modes to generate two predicted blocks. Finally, the final predicted block can be obtained by weighted summing of the two predicted blocks.

[0977] Information indicating whether the current block is generated by weighted sum, fusion, or mixing of multiple prediction blocks can be encoded and sent as a signal.

[0978] Optionally, the decoder can determine, under the same conditions as the encoder, whether to generate a prediction block for the current block by weighted sum, fusion, or mixing of multiple prediction blocks. For example, when the template matching cost of the minor mode is less than twice the template matching cost of the best mode (the template cost of the best prediction mode), the prediction block for the current block can be generated by weighted sum, fusion, or mixing of multiple prediction blocks.

[0979] In addition to the prediction modes derived through TIMD (i.e., the best mode and the second-best mode), non-directional prediction modes can also be used to obtain the prediction block for the current block. In other words, the prediction block for the current block can be obtained by weighted summing at least one prediction block obtained based on at least one prediction mode derived through TIMD and a prediction block obtained based on a non-directional prediction mode. Here, the non-directional prediction mode can include at least one of the prediction modes of DC, plane, or a reference block indicated by a block vector.

[0980] One of several non-directional prediction modes can be selected based on template matching cost. In other words, among prediction modes of a reference block indicated by a DC, plane, or block vector, the prediction mode with the lowest reference block can be selected.

[0981] In this embodiment, block vectors can be derived using IBC or IntraTMP.

[0982] Alternatively, instead of deriving prediction blocks based on non-directional prediction modes, a reference block indicated by a block vector can be set as the prediction block.

[0983] Optionally, in an embodiment, the prediction mode of a reference block indicated by a motion vector can be used instead of the non-directional prediction mode. Here, the motion vector can be derived from neighboring blocks, or it can be derived based on information encoded / decoded for the current block.

[0984] As another example, the prediction block of the current block can be obtained by weighted summing of the prediction blocks obtained from block vectors or motion vectors and the prediction blocks derived based on non-directional prediction modes. For example, the prediction block of the current block can be obtained by weighted summing of the prediction blocks obtained by weighted summation and at least one prediction block derived based on a TIMD mode.

[0985] The MRL method can be used to determine the reference sample line used to generate the prediction block. For example, one of a number of reference sample line candidates can be selected, and the prediction block can be obtained based on the reference samples belonging to the selected line.

[0986] Additionally, a reference sample line can be selected for each prediction mode. For example, when using the optimal mode, the prediction block can be obtained by using the first reference sample line, while when using the secondary mode, the prediction block can be obtained by using the second reference sample line. The first reference sample line can be the Lth reference sample line, and the second reference sample line can be the (L+1)th or (L-1)th reference sample line.

[0987] When applying the MRL method, information indicating the selection of reference sample lines among multiple reference sample lines can be encoded and transmitted as a signal. When selecting a reference sample line for each prediction mode, information can be encoded and transmitted as a signal for each prediction mode.

[0988] Alternatively, information can be encoded and signaled only for the best of multiple prediction modes. In this case, for secondary modes, reference sample lines with indices N larger or smaller than the reference sample line of the best mode can be used. Here, N can be a natural number such as 1, 2, or 3.

[0989] Optionally, information about one of the multiple reference sample lines can be inherited from neighboring blocks.

[0990] After selecting at least one of multiple prediction modes or multiple prediction blocks, the prediction block for the current block can be obtained by weighting, fusing, or mixing the selected prediction blocks. In this case, at least one of multiple prediction modes or multiple prediction blocks can be selected based on error costs (e.g., SAD, SSE, or SATD).

[0991] For example, four prediction patterns can be selected using template matching costs. Four prediction blocks can then be generated based on the four selected prediction patterns.

[0992] After calculating the error values ​​between the four prediction blocks, the prediction block pair with the lowest error cos...

Claims

1. A method for decoding an image, comprising: Export multiple intra-prediction modes for the current block; Multiple prediction blocks for the current block are obtained based on the multiple intra-frame prediction modes; as well as The final prediction block of the current block is obtained by weighted summation of the multiple prediction blocks.

2. The method according to claim 1, wherein, The multiple intra-frame prediction modes are selected in descending order of amplitude or frequency of occurrence on the histogram of the current block.

3. The method according to claim 2, wherein, The histogram is a gradient histogram, and The gradient histogram is generated by accumulating the magnitude values ​​of the reference samples included in the reference sample line of the current block for each intra-frame prediction mode.

4. The method according to claim 2, wherein, The gradient histogram is a histogram of occurrences. The occurrence histogram is derived by adding the occurrence counts of intra-prediction modes of multiple reference blocks.

5. The method according to claim 4, wherein, The number of occurrences of the intra-prediction mode of the reference block is set to the size of the reference block or the number of basic units included in the reference block.

6. The method according to claim 4, wherein, When a reference block has multiple intra-prediction modes, the number of occurrences of each of the multiple intra-prediction modes is determined based on the amplitude value ratio between the multiple intra-prediction modes.

7. The method of claim 1, wherein, The final prediction block of the current block is obtained by weighted summation of the multiple prediction blocks and the additional prediction blocks derived based on the non-directional prediction mode.

8. The method according to claim 7, wherein, The non-directional prediction mode is a directional plane mode. The interpolation direction of the orientation plane mode is determined based on the orientation of the best intra-prediction mode among the plurality of prediction blocks.

9. The method according to claim 1, wherein, The final prediction block of the current block is obtained by weighted summation of the multiple prediction blocks and the additional prediction blocks derived from the block vector.

10. The method according to claim 1, wherein, The weight assigned to each of the multiple prediction blocks is determined based on the ratio of amplitude values ​​or the ratio of the occurrence frequency of the multiple prediction blocks.

11. The method of claim 1, wherein, The multiple intra-frame prediction modes are selected from the list of most likely modes (MPMs) for the current block.

12. The method according to claim 11, wherein, The plurality of intra-prediction mode candidates are selected in ascending order of template matching cost among the intra-prediction mode candidates included in the MPM list.

13. The method according to claim 1, wherein, The final predicted block for the current block is obtained by weighted summation of the multiple predicted blocks and additional predicted blocks derived based on the extrapolation filter.

14. A method for encoding an image, comprising: Export multiple intra-prediction modes for the current block; Multiple prediction blocks for the current block are obtained based on the multiple intra-frame prediction modes; as well as The final prediction block of the current block is obtained by weighted summation of the multiple prediction blocks.

15. A computer-readable recording medium for storing a bitstream generated by an image encoding method, the image encoding method comprising: Export multiple intra-prediction modes for the current block; Multiple prediction blocks for the current block are obtained based on the multiple intra-frame prediction modes; as well as The final prediction block of the current block is obtained by weighted summation of the multiple prediction blocks.