Method and device for deriving prediction signal for image encoding / decoding

By deriving directional prediction modes from gradient histograms and applying weighted sums of prediction blocks, the method enhances encoding efficiency for high-resolution images, addressing the limitations of conventional video encoding/decoding methods and reducing transmission and storage costs.

WO2025150998A1PCT designated stage expired Publication Date: 2025-07-17ELECTRONICS & TELECOMM RES INST
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2025/000665
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-10-24
Filing Date
2025-01-10
Publication Date
2025-07-17

AI Technical Summary

Technical Problem

Conventional video encoding/decoding methods do not effectively utilize multiple intra-screen prediction modes, limiting the improvement of encoding efficiency for high-resolution and high-quality images, which results in increased transmission and storage costs.

Method used

The method involves obtaining a gradient histogram for a current block, deriving a directional prediction mode based on this histogram, and generating a prediction block using a template-based approach, incorporating motion vectors and block vectors from surrounding blocks, and applying weighted sums of prediction modes to enhance prediction performance.

Benefits of technology

This approach improves prediction performance in video encoding/decoding by leveraging template-based prediction signal derivation, leading to enhanced encoding efficiency and reduced transmission and storage costs for high-resolution images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2025000665_17072025_PF_FP_ABST
    Figure KR2025000665_17072025_PF_FP_ABST
Patent Text Reader

Abstract

An image encoding / decoding method, device, and recording medium according to the present disclosure may comprise the steps of: acquiring a first gradient histogram for the current block; deriving a directional prediction mode of the current block on the basis of the first gradient histogram; and generating a prediction block of the current block on the basis of the directional prediction mode.
Need to check novelty before this filing date? Find Prior Art

Description

Method and device for deriving prediction signals for image encoding / decoding

[0001] The present disclosure relates to a method and device for encoding / decoding an image, and more particularly, to a method and device for encoding / decoding an image using a template matching block vector.

[0002] Recently, the demand for high-resolution, high-quality images, such as HD (High Definition) and UHD (Ultra High Definition) images, is increasing across various application fields. As image data becomes higher in resolution and quality, the relative amount of data increases compared to conventional image data. Therefore, transmitting image data using existing media such as wired or wireless broadband lines or storing it using existing storage media leads to increased transmission and storage costs. To address these issues arising as image data becomes higher in resolution and quality, highly efficient image encoding / decoding technologies for higher-resolution and higher-quality images are required.

[0003] There are various technologies for image compression, such as inter-picture prediction technology that predicts pixel values ​​included in the current picture from pictures before or after the current picture, intra-picture prediction technology that predicts pixel values ​​included in the current picture using pixel information in the current picture, transformation and quantization technology for compressing the energy of the residual signal, and entropy coding technology that assigns short codes to values ​​with high frequency of appearance and long codes to values ​​with low frequency of appearance. Using these image compression technologies, image data can be effectively compressed and transmitted or stored.

[0004] Conventional video encoding / decoding methods and devices do not use multiple intra-screen prediction modes, so there is a limit to improving encoding efficiency.

[0005] The video encoding / decoding method, device, and recording medium of the present disclosure may include a step of obtaining a first slope histogram for a current block, a step of deriving a directional prediction mode of the current block based on the first slope histogram, and a step of generating a prediction block of the current block based on the directional prediction mode.

[0006] In the video encoding / decoding method, device, and recording medium of the present disclosure, the first gradient histogram can be obtained based on a gradient value calculated from a template composed of surrounding samples of the current block or a second gradient histogram of a surrounding block calculated from a surrounding block of the current block.

[0007] In the video encoding / decoding method, device, and recording medium of the present disclosure, the template can be generated based on at least one of the upper area, the upper left area, or the left area of ​​the current block.

[0008] In the video encoding / decoding method, device and recording medium of the present disclosure, the current block can be generated using a motion vector or block vector of a juxtaposed block.

[0009] In the video encoding / decoding method, device and recording medium of the present disclosure, the surrounding block may include a block at a history-based position of the current block.

[0010] In the video encoding / decoding method, device and recording medium of the present disclosure, the block of the history-based position may be a block of a position obtained from a list in the form of a First-in First-Out (FIFO).

[0011] In the video encoding / decoding method, device, and recording medium of the present disclosure, the directional prediction mode may be a mode obtained by weighting and adding a plurality of prediction modes obtained based on the cumulative occurrence number of each directional mode of the first slope histogram.

[0012] In the video encoding / decoding method, device, and recording medium of the present disclosure, the directional prediction mode may be a mode obtained by weighting and adding a plurality of prediction modes obtained based on error values ​​of prediction blocks generated using a plurality of prediction modes derived through the first slope histogram.

[0013] In the video encoding / decoding method, device, and recording medium of the present disclosure, the prediction block can be obtained through a weighted sum of a first prediction block obtained based on the directional prediction mode and a second prediction block obtained based on a prediction mode different from the directional prediction mode.

[0014] In the video encoding / decoding method, device and recording medium of the present disclosure, the other prediction mode may be an inter-screen prediction mode, an intra-screen template matching mode, an intra-screen block copy mode, a matrix-weighted intra-screen prediction mode or a non-directional mode.

[0015] In the video encoding / decoding method, device, and recording medium of the present disclosure, the weight applied to the weighted sum of the first prediction block and the second prediction block can be determined based on the first gradient histogram.

[0016] In the video encoding / decoding method, device and recording medium of the present disclosure, the current block is a block obtained by dividing an upper block of the current block, and the division may be any one of 2 divisions, 4 divisions, 6 divisions or 8 divisions.

[0017] In the video encoding / decoding method, device and recording medium of the present disclosure, the prediction modes of the divided blocks including the current block obtained by dividing the upper block may be different from each other.

[0018] A method and device for encoding / decoding an image, characterized in that it includes a method for improving prediction performance by using a template-based prediction signal derivation method during encoding / decoding of an image.

[0019] The present disclosure can provide a method and device that can improve prediction performance by using a template-based prediction signal derivation method in encoding / decoding an image.

[0020] Figure 1 illustrates a system for video coding according to one embodiment.

[0021] Figure 2 shows a segmentation structure of an image according to one embodiment.

[0022] Figure 3 illustrates the structure of intra prediction according to one embodiment.

[0023] Figure 4 shows the structure of inter prediction to explain the inter prediction process according to one embodiment.

[0024] Figure 5 shows the order in which spatial candidates are added to the candidate list according to one embodiment.

[0025] Figure 6 illustrates multiple in-loop filters according to an example.

[0026] Figure 7 shows the structure of entropy encoding and entropy decoding according to an example.

[0027] Figure 8 illustrates a flowchart of the video encoding / decoding method and device of the present disclosure.

[0028] Figure 9 illustrates an example of a window for calculating HoG and the occurrence frequency of a directional prediction mode (or directional element) corresponding to the HoG.

[0029] Figure 10 illustrates examples of various forms of template configuration.

[0030] Figure 11 illustrates an example of a juxtaposition block.

[0031] Figures 12 and 13 illustrate examples of surrounding blocks used for inheritance of histogram (HoG).

[0032] Figure 14 illustrates an example of partial MPM reordering.

[0033] Figures 15 and 16 illustrate examples of template areas of the current block and reference templates of templates.

[0034] Figure 17 illustrates an example of multiple reference lines.

[0035] Figure 18 shows an example of the weights of the current block.

[0036] Figure 19 illustrates an example of sub-partition (ISP) division within the screen.

[0037] Figures 20 and 21 illustrate examples of available sub-partition templates when sequential intra-screen sub-partition (ISP) prediction is performed.

[0038] Figure 22 illustrates an example of a template configuration by sub-partition.

[0039] The present invention is capable of various modifications. Furthermore, the present invention may have various embodiments. Specific embodiments are described in the accompanying drawings and detailed description.

[0040] It should be understood that the specific examples are not intended to limit the invention to specific embodiments, and that all modifications, equivalents, and substitutes falling within the spirit and scope of the invention are intended to be encompassed within the scope of the invention as embodiments.

[0041] The embodiments are described in sufficient detail to enable those skilled in the art to practice them. It should be understood that the various embodiments, while different from each other, are not necessarily mutually exclusive. For example, it should be understood that the shapes, structures, and characteristics described in connection with one embodiment may be applied to or implemented in other embodiments without departing from the spirit and scope of the present invention. Furthermore, it should be understood that the positions or arrangements of components within one embodiment may be modified without departing from the spirit and scope of the present invention. Accordingly, the following detailed description is not intended to be limiting, and the scope of the exemplary embodiments, if properly described, is defined only by the appended claims and all equivalents to those claimed by such claims.

[0042] A detailed description of the embodiments described below may refer to the drawings for the embodiments. Any description described in the drawings or the descriptions shown in the drawings may be considered part of the detailed description. In the drawings, similar reference numerals may designate the same or similar functions throughout various aspects. The dependencies between components may not be limited to those depicted in the drawings.

[0043] In the embodiments, a singular expression may include, and may be limited to, and / or restricted by, a plural expression, unless the context clearly excludes a plural expression. That is, expressions such as “at least one” and “one or more” in the embodiments may be replaced with “plural.” Terms such as “ / ,” “and / or,” “at least one of,” and “one or more of” described for a plurality of items may mean 1) one item of the plurality of items, 2) some of the plurality of items, 3) a combination of some of the plurality of items, or 4) a combination of the plurality of items. Furthermore, a plural expression may be replaced with a singular expression. The plural may mean an integer greater than or equal to 1, 2, 3, 4, or 5.

[0044] In the embodiments, terms related to numbers, such as "first" and "second," may be used to describe various components. These terms are used only to distinguish one component from another and do not limit the components. For example, without departing from the scope of the present invention, the first component could be referred to as the second component, and similarly, the second component could also be referred to as the first component.

[0045] When a first component transmits (or provides) information to a second component, it can mean that the first component directly transmits information to the second component, or it can mean that the first component transmits information to the second component via another third component. Here, the information that the second component receives (or obtains) can be information transmitted by the first component, or information generated by applying a specific process to information transmitted by the first component.

[0046] The components of the embodiments may be depicted independently to represent different characteristic functions, and this does not imply that each component corresponds to a separate hardware or software configuration unit. That is, the components of the embodiments may be distinguished and listed for convenience of description. Two or more components described in the embodiments may be regarded as a single component. Furthermore, a single component described in the embodiments may be separated into multiple components that perform the functions of the aforementioned component. Embodiments in which such components are integrated and embodiments in which such components are separated are also included in the scope of the present invention, as long as they do not depart from the essence of the present invention.

[0047] The terms used in the embodiments are used only to describe specific embodiments and are not intended to limit the present invention. In the embodiments, terms such as "comprise" or "have" indicate the presence of features, numbers, steps, operations, components, parts, or combinations thereof described in the embodiments. These terms do not preclude the presence or addition of other features, numbers, steps, operations, components, parts, or combinations thereof that are not explicitly described in the embodiments. In other words, the description of "comprising" a specific component of an embodiment does not exclude other components other than the specific component, and means that additional components may also be included in the scope of the embodiments of the present invention or the technical idea of ​​the present invention.

[0048] Some of the components of the embodiments may be optional, not essential components for performing the essential functions of the present invention. These optional components may be used to improve performance. The embodiments may be implemented as a structure that includes only the essential components required to implement the essence of the embodiments, excluding the optional components. Such a structure is also within the scope of the embodiments.

[0049] Hereinafter, embodiments are described in detail with reference to the attached drawings to enable those skilled in the art to easily implement the embodiments. In describing the embodiments, if a detailed description of a related known configuration or function is judged to obscure the gist of the present specification, such detailed description will be omitted. Furthermore, identical reference numerals are used for identical components in the drawings, and redundant descriptions of identical components will be omitted.

[0050]

[0051] Interchange between terms in the examples

[0052] Below, terms listed on a single line may be used with the same meaning in the embodiments and may be used interchangeably in the embodiments.

[0053] - 'one or more', 'at least one'

[0054] - 'two or more', 'a plurality of', 'multiple', 'multiple'. (In embodiments, 'one or more' or 'at least one' may be further limited to 'two or more', 'plural', or 'multiple'.)

[0055] - 'Information', 'Signal'

[0056] - 'value', 'predefined value', 'specific value', 'threshold', 'threshold value', 'baseline value', 'reference value'

[0057] - 'statistical value', 'statistics value'

[0058] - 'indicator', 'index', 'index', 'flag', 'information'

[0059] - 'encoder', 'encoding apparatus'

[0060] - 'decoder', 'decoding apparatus'

[0061] - 'Entropy encoding', 'encoding', 'encoding'

[0062] - 'Entropy decryption', 'decoding', 'decoding'

[0063] - 'coding', 'encoding and / or decoding'

[0064] - 'video', 'moving picture', 'image', 'picture', 'frame', 'screen'

[0065] - 'Reference picture', 'Reference video'

[0066] - 'Reference Picture List (RPL),' 'Reference Image List'

[0067] - 'original', 'input', 'source'

[0068] - 'Block', 'Unit', 'Signal'

[0069] - 'square', 'square shape'

[0070] - 'pixel', 'pixels', 'samples', 'pels'

[0071] - 'region', 'area', 'part', 'segment'

[0072] - 'partition', 'split', 'divide'

[0073] - 'quad', 'quarternary'

[0074] - 'luma component', 'luma', 'luminance component', 'luminance', 'Y'

[0075] - 'chroma component', 'chroma', 'chrominance', 'chrominance component', 'Cb and Cr', 'Cb or Cr', 'Cb', 'Cr', 'U and V', 'U or V', 'U', 'V'

[0076] - 'target', 'current' (e.g. target block and current block, or target image and current image)

[0077] - 'neighbor', 'neighboring', 'adjacent', 'neighbor / neighboring' (e.g., neighboring block, adjacent block, and surrounding block)

[0078] - 'collocated', 'collected'

[0079] - 'reconstruction', 'reconstruction', 'decoding'

[0080] - 'reconstructed', 'reconstructed', 'decoded'

[0081] - 'difference', 'difference', 'difference', 'error', 'residual', 'residual'

[0082] - Largest Coding Unit (LCU), Coding Tree Unit (CTU)

[0083] - 'inter', 'inter-screen'

[0084] - 'Inter prediction', 'inter prediction', 'motion compensation'

[0085] - 'Inter mode', 'Inter prediction mode', 'Inter-screen mode', 'Inter-screen prediction mode'

[0086] - 'Motion vector', 'Predicted motion vector', 'Advanced Motion Vector Prediction (AMVP)'

[0087] - 'list', 'candidate list'

[0088] - 'Spatial candidate', 'Spatial merge candidate'

[0089] - 'Temporal candidate', 'Temporal merge candidate'

[0090] - 'Prediction motion vector candidate', 'motion vector predictor'

[0091] - 'Prediction method', 'Prediction mode'

[0092] - 'Intra', 'Intra'

[0093] - 'Intra prediction', 'Intra prediction'

[0094] - 'Intra mode', 'Intra prediction mode'

[0095] - 'Dequantization', 'scaling'

[0096] - 'Quantization matrix', 'Scaling list'

[0097] - 'Quantization matrix coefficients', 'matrix coefficients'

[0098] - 'Transform coefficient level', 'quantized level', 'quantized coefficient', 'quantized transform coefficient', 'quantized transform coefficient level'

[0099] - 'Dequantized coefficient', 'dequantized transform coefficient'

[0100] - 'Scanning type', 'Scanning direction'

[0101] - 'Directional mode', 'Angle mode', 'Angular mode', 'Intra prediction mode'

[0102] - '(mode) number of intra prediction mode', '(mode) index of intra prediction mode', '(mode) value of intra prediction mode', '(mode) angle of intra prediction mode', '(mode) direction of intra prediction mode', '(mode) number of intra prediction direction', '(mode) index of intra prediction direction', '(mode) value of intra prediction direction', '(mode) angle of intra prediction direction'

[0103] - 'Merge Mode', 'Movement Merge Mode'

[0104] - 'Geometric Partitioning Mode (GPM)', 'Triangle Partitioning Mode'

[0105] In addition to the terms exemplified above, terms having the same meaning according to common knowledge in the technical field may be used interchangeably in the embodiments.

[0106]

[0107] The range of information and values ​​of information described in the examples

[0108] In embodiments, information may include constants, flags, indices, variables, coding parameters, elements, syntax elements, motion information, attributes, entities, objects, and data. That is, the term 'information' may be replaced with 'data', 'flag', 'index', 'variable', 'element', 'syntax element', 'motion information', 'attribute', or 'object'.

[0109] Information can have one of multiple values. 'n-th value' can mean the nth value among multiple values.

[0110] For example, the first value could represent '0' or (logical) false. The second value could represent '1' or (logical) true. Alternatively, the first value could represent '1' or (logical) true. The second value could represent '0' or (logical) false.

[0111] A flag may be information having a value of either '0' or '1'. In embodiments, the flag values ​​'0' and '1' may be replaced with '1' and '0', respectively. For example, information indicating whether a specific process is performed or whether a specific process is applied may be considered a flag.

[0112] When a variable such as i or j is used to represent a row, column, or index, the variable can be an integer greater than or equal to 0 and less than or equal to n - 1. Alternatively, the variable can be an integer greater than or equal to 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 pointed to by the index.

[0113]

[0114] Coding related concepts

[0115] Below, concepts related to coding are described. The descriptions disclosed below can be applied to embodiments.

[0116] Predefined value: A predefined value may refer to a value commonly used in an encoding device and a decoding device. For example, a predefined value may be interpreted as a fixed value. Alternatively, the predefined value may be a value shared by an encoding device and a decoding device through signaling. Alternatively, the predefined value may be a value derived through the same procedure in an encoding device and a decoding device so that the encoding device and the decoding device have a common value. Alternatively, the predefined value may be a common value in an encoding device and a decoding device. The above description of a predefined value may also be applied to predefined information. In the above descriptions, 'value' may be replaced with 'information'.

[0117] Availability: The availability of certain modes for a specific target may mean that a selected mode among the specific modes is used for the specific target. Other modes within the specific mode category may be unavailable. Unavailable modes may not be used for the specific target. The description of a specific mode above may also apply to other specific information. In the descriptions above, "mode" may be replaced with "information."

[0118] Adjacency: The 'direction' of the 'second entity' with respect to the 'first entity' may refer to the 'second entity' that is adjacent to the 'direction' corner / face of the first entity. For example, the 'top left block' with respect to the 'target block' may be a block adjacent to the top left of the target block. Here, the 'first entity' may be a target unit, a target block, or a target sample. The 'direction' may be one of left-above, above, right-above, left, right, left-below, below, and right-below. The 'second entity' may be a unit, a block, or a sample. For the directions of left-top, right-top, left-bottom, and right-bottom, the corners of the first entity and the corners of the second entity may be diagonally adjacent. For the directions of top, left, right and bottom, one side of the first object and one side of the second object can be in contact with each other.

[0119] - For example, the block adjacent to the upper left of the target block may be the block adjacent to the upper left of the block adjacent to the target block. The block adjacent to the upper right of the target block may be the block adjacent to the right of the block adjacent to the upper right of the target block. The block adjacent to the lower left of the target block may be the block adjacent to the lower left of the block adjacent to the target block.

[0120] Coding: Coding can mean encoding and / or decoding of images.

[0121] Signal: A signal can represent information about an image, unit, or block. A specific signal can represent a specific image, a specific unit, or a specific block.

[0122] Video: A video can refer to a single picture that constitutes a video, or it can refer to the video itself. For example, "encoding and / or decoding a video" can mean "encoding and / or decoding a video," or it can mean "encoding and / or decoding one of the pictures that constitute the video."

[0123] - A picture can mean the entire picture, or it can mean a part of a picture, such as a block.

[0124] Target Image: The target image may be an encoding target image, which is the target of encoding, and / or a decoding target image, which is the target of decoding. Furthermore, the target image may be an input image processed by an encoding device, or a restored image processed by a decoding device. The target image may be an image including a target block.

[0125] Subpicture: A picture can be divided into one or more subpictures.

[0126] - A subpicture may be a square or rectangular area within a picture. A subpicture may contain one or more CTUs.

[0127] - A subpicture may include one or more slices and / or one or more tiles. For example, a subpicture may consist of one or more slice rows and one or more slice columns. Alternatively, each subpicture may consist of one or more tile rows and one or more tile columns.

[0128] - A subpicture may include one or more slices that collectively cover a rectangular area within the picture. Accordingly, the boundary of each subpicture may always be the boundary of a slice. Additionally, each vertical subpicture boundary may always be a vertical tile boundary.

[0129] Slice: A slice may contain one or more tiles within a picture. A slice may consist of one or more rows of tiles and one or more columns of tiles.

[0130] Tile: A tile can be a square or rectangular area within a picture. A tile can contain one or more CTUs. A picture can be divided into one or more tile rows and one or more tile columns.

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

[0132] - A CTU may include one Y coding tree block (CTB) and at least one of a Cb CTB and a Cr CTB related to the Y CTB, and may include information about each CTB. The information may include syntax elements.

[0133] - Each CTU can be partitioned using one or more partitioning methods to form sub-units such as coding units (CUs), prediction units (PUs), and transform units (TUs). The one or more partitioning methods can include quad tree (QT) partitioning, binary tree (BT) partitioning, and ternary tree (TT) partitioning. Additionally, each CTU can be partitioned using multi-type tree (MTT) partitioning that uses a combination of multiple partitioning methods.

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

[0135] Unit: A unit can be determined for specific processing in coding. A unit can contain information about a specific region within an image. For specific coding processing, an image can be recursively divided into multiple parts. A unit can represent the region to which a specific processing is applied and information about the region.

[0136] - The type of a unit may indicate a specific processing to be applied to the unit. Depending on the type of the unit, a specific processing may be applied to the unit. A 'specific' unit may be a unit for processing designated as 'specific' in coding. For example, the unit may be at least one of an original unit, a CTU, a coding unit, a prediction unit, a residual unit, a reconstructed residual unit, a transformation unit, and a reconstructed unit.

[0137] - A unit may include samples having a two-dimensional shape or arrangement. In this respect, a 'unit' may also mean a 'block'. For example, a block may be at least one of an original block, a CTB, a coding block (CB), a prediction block (PB), a residual block, a reconstructed residual block, a transform block (TB), and a reconstructed block. For example, a division of a unit may mean a division of a block corresponding to the unit.

[0138] - A unit can contain syntax elements. In other words, a block and its syntax elements can be combined to form a unit.

[0139] - A block is an MxN array of samples. Here, M and N can represent positive integer values, and a block can commonly represent a two-dimensional sample array. The current block can represent an encoding target block that is the target of encoding during encoding, and a decoding target block that is the target of decoding during decoding. In addition, the current block can be at least one of a coding block, a prediction block, a residual block, a transform block, and a restoration block. The block can have various sizes and shapes. For example, the shape of the block can be one or more of a tetragon, a rectangular block, a square block, a rectangle whose width is different from its height (that is, an oblong block), a trapezoid, a triangle, a right-angled triangle, and a pentagon. Here, the width and height of the rectangle can be different from each other. In addition, the shape of the block can include other geometric shapes that can be expressed in two dimensions. For example, the shape of a block may be a quadrilateral or a pentagon, which is defined by excluding the area of ​​a right triangle from the area of ​​a rectangle. Here, the right vertex of the right triangle may be one of the vertices of the rectangle. Furthermore, the shape of a block may be a combination of two or more of the aforementioned shapes. Furthermore, the shape of a block may be the remainder of one of the aforementioned shapes after excluding another shape.

[0140] - In embodiments, a rectangle may be limited to a non-square rectangle. When the shape of a particular object is described as a rectangle in an embodiment, such description may additionally imply that the width and height of the particular object are different from each other.

[0141] - In embodiments, a block may be limited to at least one of a vertically oriented block and a horizontally oriented block. A vertically oriented block may mean a block whose vertical length is greater than its horizontal length. A horizontally oriented block may mean a block whose horizontal length is greater than its vertical length.

[0142] - A unit may include a luma component block (i.e., a Y block) and two chroma component blocks (i.e., at least one of a Cb block and a Cr block), and may include information about each block. The information may include syntax elements.

[0143] - Unit information may include unit type, unit size, unit depth, unit encoding order, and unit decoding order.

[0144] Target Unit: A target unit may be a block, an encoding target unit, which is a target of encoding, and / or a decoding target unit, which is a target of decoding. A target unit may be a specific area within a target picture to which one or more specific coding processes are applied. A unit of a specific type may be generated by applying a specific process to a target unit. Alternatively, a target unit may represent a unit having a specific type for a specific coding process.

[0145] Depth: A block can be hierarchically divided into multiple sub-blocks, each with its own depth, according to a tree structure. The multiple sub-blocks created by block division can be called partitions.

[0146] - The depth of a block can indicate the level of the node corresponding to the block when the blocks that make up the image are expressed in a tree structure. Alternatively, the depth of a block can indicate the number of partitions applied until the block is determined. The depth of a block can increase by 1 as the block is further partitioned.

[0147] - In a tree structure, the root node can be considered to have the smallest level, and the leaf node can be considered to have the largest level. The root node can be the topmost node in the tree structure and corresponds to the first undivided block. The level of the root node can be 0 or 1. When the level of the root node is 0, a node with a level of 1 can represent a block determined by dividing the first block once. A node with a level of n can represent a block determined by dividing the first block n times. A leaf node can be the lowest node in the tree structure. A leaf node can be a node that cannot be further divided. 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 mean a CTU. A leaf node can mean at least one of a CU, a PU, and a TU.

[0148] - Depth can have a type depending on the type of partition. QT depth can represent the depth for quadtree partitioning. BT depth can represent the depth for binary partitioning. TT depth can represent the depth for ternary partitioning.

[0149] Sample: A sample can be a base unit that constitutes a block. A sample can be composed of one or more bits. The bit depth can be the number of bits that constitute a sample. A sample can be numbered from 0 to 2 depending on the bit depth. Bd It can be expressed as values ​​up to -1.

[0150] PU: PU may denote a basic unit for prediction-related processing. For example, prediction-related processing may include inter-prediction, intra-prediction, intra-block copy (IBC) prediction, intra-compensation, and motion compensation.

[0151] - A PU can be divided into multiple sub-PUs, each of which has a smaller size than the PU itself. These multiple sub-PUs can also serve as the basis for prediction-related processing. In other words, a prediction unit partition generated by splitting a prediction unit can also be a prediction unit.

[0152] TU: A TU may be a basic unit for processing related to a residual block. The processing related to the residual block may include at least one of a transform, an inverse transform, quantization, inverse quantization, transform coefficient encoding, transform coefficient decoding, entropy encoding, and entropy decoding. - One TU may be split into a plurality of sub-transform units having a size smaller than the size of the TU. The plurality of sub-TUs may also be basic units for processing related to the residual block. In other words, a transform unit partition generated by splitting a transform unit may also be a transform unit.

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

[0154] Parameter set: A parameter set may correspond to header information among the structures within a bitstream.

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

[0156] - Information signaled through a parameter set can be applied to pictures referencing the parameter set. For example, information within a VPS can be applied to pictures referencing the VPS. Information within an SPS can be applied to pictures referencing the SPS. Information within a PPS can be applied to pictures referencing the PPS. A parameter set can refer to a higher-order parameter set. For example, a PPS can refer to an SPS. An SPS can refer to a VPS.

[0157] - Additionally, the parameter set may include tile group information, slice header information, and tile header information. A tile group may mean a group or slice including multiple tiles.

[0158] MPM (Most Probable Mode): MPM can indicate the intra prediction mode that is likely to be used for intra prediction for the target block.

[0159] - One or more different MPMs can be determined based on coding parameters related to the target block and properties of objects related to the target block.

[0160] - One or more MPMs may be determined based on the intra prediction mode of a reference block. There may be multiple reference blocks. Depending on which intra prediction modes are used for one or more reference blocks, one or more different MPMs may be determined. The reference blocks may include spatial neighboring blocks.

[0161] MPM List: An MPM list may contain one or more MPMs. The number of MPMs in an MPM list may be predefined.

[0162] MPM Index: The MPM index can indicate an MPM among one or more MPMs in the MPM list to be used for intra prediction for the target block.

[0163] MPM Usage Directive: The MPM usage directive can indicate whether the MPM list is used for prediction on the target block.

[0164] Prediction mode: The prediction mode may be information indicating a prediction method for a target block, such as a mode used for intra prediction or a mode used for inter prediction. The prediction mode may refer to one of the prediction-related modes described in the embodiments. In addition, the prediction mode may include at least one of an intra mode, an inter mode, and an intra block copy mode.

[0165] Reference image list: The reference image list may be a list containing one or more reference images used for prediction for the target block.

[0166] - There may be multiple reference image lists. Multiple reference image lists may include List 0 (L0), List 1 (L1), etc.

[0167] - One or more reference image lists may be used for inter prediction for a target block. Parts such as 'L0' and 'L1' in the names of information related to inter prediction may refer to reference image lists related to the information.

[0168] Reference picture: A reference picture may be an image referenced for prediction of a target block. Alternatively, the reference picture may be an image containing a reference block. The reference picture may include a previous image of the target image, a target image, and a subsequent image of the target image.

[0169] Reference image index: The reference image index may be an index indicating one reference image among one or more reference images in the reference image list that is used for prediction of the target block.

[0170] Reference Block: A reference block may be a block referenced for encoding / decoding a target block, such as prediction or filtering. For example, a reference block may include reference samples used to derive prediction samples, and may also refer to a block that provides information used for decoding the target block.

[0171] Reference sample: A reference sample may be a sample that is referenced for encoding / decoding of a target block, such as prediction and filtering.

[0172] Inter prediction indicator: The inter prediction indicator can indicate the direction of inter prediction for the target block. The inter prediction can be one of uni-directional prediction and bi-directional prediction. Alternatively, the inter prediction indicator can indicate the number of reference pictures used when generating a prediction block of the target block. Alternatively, the inter prediction indicator can indicate the number of prediction blocks used for inter prediction for the target block. The reference direction can mean the inter prediction indicator. For example, the inter prediction indicator can indicate one of uni-directional and bi-directional. Alternatively, the inter prediction indicator can have a first value of '0' for an inter mode that uses only reference pictures in the L0 reference picture list, a second value of '1' for an inter mode that uses only reference pictures in the L1 reference picture list, and a third value of '2' for an inter mode that uses at least two of the reference pictures in the L0 reference picture list and the reference pictures in the L1 reference picture list.

[0173] Prediction List Utilization Flag: The prediction list utilization flag for a specific reference image list may indicate whether at least one reference image within the specific reference image list is used to generate a prediction block of the target block. For example, a value of the prediction list utilization flag for a specific reference image list of '0' may indicate that a prediction block is not generated using a reference image within the specific reference image list. A value of the prediction list utilization flag for a specific reference image list of '1' may indicate that a prediction block is generated using a reference image within the specific reference image list.

[0174] - An inter prediction indicator can be derived using a prediction list utilization flag. Conversely, a prediction list utilization flag can be derived using an inter prediction indicator. For example, an inter prediction indicator can be derived using prediction list utilization flags for a plurality of reference image lists. If an inter prediction indicator indicates that specific reference lists among a plurality of reference image lists are used, the prediction list utilization flags of the specific reference lists indicated by the inter prediction indicator among the prediction list utilization flags of the plurality of reference image lists can be set to '1', and the prediction list utilization flags of the remaining reference image lists not indicated by the inter prediction indicator can be set to '0'.

[0175] Reference Direction: The reference direction may point to a list of reference images used for prediction of the target block. For example, the reference direction may point to one or more of the reference image list L0 and the reference image list L1.

[0176] - The reference direction may not indicate that the directions of the reference images in the reference image list are limited to the forward direction or the backward direction, but only indicates the reference image list used for prediction of the target block. That is, each of the reference image list L0 and the reference image list L1 may include forward images and backward images. Here, the forward direction may indicate the direction from the target image to the previous image of the target image. Forward inter prediction may be inter prediction that uses the previous image of the target image as a reference image. Backward direction may indicate the direction from the target image to the subsequent image of the target image. Backward inter prediction may be inter prediction that uses the subsequent image of the target image as a reference image.

[0177] - A unidirectional reference direction may mean that one reference image list is used. A bidirectional reference direction may mean that two reference image lists are used. For example, the reference direction may indicate that only the reference image list L0 is used, that only the reference image list L1 is used, or that two reference image lists are used. Additionally, the reference direction may be indicated by an inter prediction indicator.

[0178] Picture Order Count (POC): The POC of a picture can indicate the display order or output order of the picture.

[0179] Motion information: Motion information may be information used to specify a reference block. Motion information may include information used for inter prediction, such as a motion vector (MV), a reference picture index, a reference picture, an inter prediction indicator, and a prediction list utilization flag. Additionally, motion information may include information used in a specific inter prediction mode, such as an MV candidate, an MV candidate index, a merge candidate, and a merge index.

[0180] - For inter prediction of a target block, multiple motion information for multiple reference image lists can be used, respectively. Motion information for a specific reference image list can be used for prediction using the specific reference image list. Multiple (intermediate) prediction blocks can be derived from the multiple motion information. A (final) prediction block for the target block can be generated using statistical values ​​for the multiple (intermediate) prediction blocks.

[0181] MV: MV can be a two-dimensional vector used in inter prediction. It can represent the offset between a target block and a reference block. Alternatively, it can represent the difference between the locations of a target block and a reference block.

[0182] - For example, MV is (mv x , mv y ) can be expressed in the form of mv x can represent the horizontal component, and mv y can represent vertical components.

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

[0184] Block Vector (BV): A BV can be a two-dimensional vector used in intra-block copy prediction. A BV can represent the offset between a target block within a target image and a reference block within the target image. In other words, a BV can represent the displacement between the target block and the reference block within the target image.

[0185] - For example, BV is similar to MV (bv x , bv y ) can be expressed in the form of bv x can represent the horizontal component, bv y can represent vertical components.

[0186] -The zero vector can be (0, 0) BV.

[0187] Motion Information Candidate: In a specific prediction, the motion information of the target block can be selected from among motion information candidates determined by a specific method. The motion information candidate may refer to the motion information of a reference block, or it may refer to the reference block itself containing the motion information. Here, the reference block may be a block determined by a specific method for selecting a motion information candidate.

[0188] Candidate List: A candidate list may 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 may be generated in the same manner by the encoding device and the decoding device. In other words, the candidate list used by the encoding device and the candidate list used by the decoding device may be the same, and the same candidate list may be shared by the encoding device and the decoding device. The encoding device may select a candidate to be used for processing the target block from among the candidates in the candidate list. An indicator indicating the selected candidate may be signaled from the encoding device to the decoding device. The decoding device may use the indicator to specify a candidate to be used for processing the target block from among the candidates in the candidate list. Alternatively, the encoding device and the decoding device may specify a candidate to be used for processing the target block from among the candidates in the candidate list according to the same rule.

[0189] Motion information candidate list: The motion information candidate list may mean a list constructed using one or more motion information candidates.

[0190] Motion information candidate index: The motion information candidate index may be an identifier or indicator that indicates a motion information candidate used for prediction of a target block among the motion information candidates in the motion information candidate list.

[0191] - In a specific inter prediction mode, motion information of other reconstructed blocks may be used to derive motion information of the target block. The other blocks may include neighboring blocks. In this specific inter prediction mode, the motion information for the target block itself is not individually signaled, but other information used to derive motion information of the target block based on the motion information of other reconstructed blocks may be signaled. In this case, the other information may include information indicating which of the other reconstructed blocks' motion information is used to derive motion information of the target block, such as a motion information candidate index.

[0192] - For example, these inter prediction modes may include AMVP mode, merge mode, and skip mode. The motion information candidate index may be a merge index or an MV candidate index.

[0193] - In embodiments, MV may be part of motion information. In embodiments, information about motion information, such as motion information candidates, motion information candidate lists, and motion information candidate indices, may be replaced with information about MVs, such as MV candidates, MV candidate lists, and MV candidate indices, and the description of motion information may also be applied to MVs.

[0194] Merge: Merge can refer to the merging of motion information across multiple blocks, or it can refer to applying motion information from another block to the target block. In other words, merge mode can refer to a mode in which the motion information of the target block is derived from the motion information of neighboring blocks.

[0195] Merge Candidate: A merge candidate may refer to a specific (restored) block used for merging the target block, or may refer to motion information for the specific block. Alternatively, the merge candidate may include motion information for the specific block.

[0196] - Merge candidates for the target block may include spatial merge candidates, temporal merge candidates, history-based candidates, average candidates based on the average of two merge candidates, and zero merge candidates.

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

[0198] Merge Index: A merge index may be an indicator that points to a merge candidate among the merge candidates in the merge candidate list, which is used for prediction of the target block. The motion information of the merge candidate indicated by the merge index among the merge candidates in the merge candidate list may be used as motion information of the target block.

[0199] Neighboring block: A neighboring block can refer to a block adjacent to the target block. Neighboring blocks can include spatial and temporal neighboring blocks. A neighboring block can also refer to a reconstructed neighboring block within a reference image.

[0200] Spatial neighboring blocks: Spatial neighboring blocks can be blocks that are spatially adjacent to the target block.

[0201] - The target block and spatial neighboring blocks can be included within the target image.

[0202] - A spatial neighboring block may include a block whose boundary is at least partially adjacent to a boundary of the target block. Alternatively, a spatial neighboring block may include a block whose distance from the target block is less than or equal to a specific value.

[0203] - A spatial neighboring block may include a block diagonally adjacent to a vertex of the target block.

[0204] - Spatial neighboring blocks may include an upper left block adjacent to the upper left of the target block, an upper block adjacent to the upper right of the target block, an upper right block entered at the upper right of the target block, a left block adjacent to the left of the target block, a right block adjacent to the right of the target block, a lower left block adjacent to the lower left of the target block, a lower block adjacent to the lower bottom of the target block, and a lower right block adjacent to the lower right of the target block.

[0205] Temporal neighboring blocks: Temporal neighboring blocks can be blocks that are temporally adjacent to the target block.

[0206] - A temporal neighboring block may include a collocated block (COL block). A collocated block may be a block within a reconstructed image within a reference image buffer. A collocated picture (col picture) may refer to an image that includes a collocated block. A collocated picture may be an image included in a reference image list.

[0207] - Call blocks can be determined based on the location of the target block within the target image. Two blocks being "temporally adjacent" can mean that the locations of the two blocks satisfy certain conditions.

[0208] - The position of a call block within a call image may be the same as the position of a target block within a target image. Alternatively, the position of a call block within a call image may correspond to the position of a target block within a target image. Here, the correspondence of the positions of blocks may mean that the areas of the blocks are identical, that an area of ​​one block is included in an area of ​​another block, or that one block occupies a specific position of another block.

[0209] - For example, the location of a call block within a call image may be identical to the location of a target block within the target image. Alternatively, a call block may be a block containing a call sample within a call image. A call sample may be a sample having coordinates identical to the coordinates of a specific sample in the target block.

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

[0211] Search range: The search range can refer to a two-dimensional region where MVs are searched during inter prediction. For example, when the optimal MV must be derived for processing a target block, the optimal MV can be selected from among the MVs pointing within the search range.

[0212] Transform coefficient: The transform coefficient may be a coefficient generated by performing a transformation on the residual block. Alternatively, the transform coefficient may be a coefficient value generated by performing dequantization on a quantized level.

[0213] Quantized level: A quantized level can be an integer quantity used as input to dequantization.

[0214] Quantization: Quantization can be the process of generating quantized levels for transform coefficients. Quantized levels can be generated by applying quantization to transform coefficients. The transform can also be considered part of quantization.

[0215] Dequantization: Dequantization can be the process of multiplying a quantized level by a factor. By applying dequantization to a quantized level, (restored) transform coefficients can be generated.

[0216] Quantization Parameter (QP): QP can refer to an argument used to generate quantized levels for transform coefficients in quantization. QP can also refer to an argument used to generate (restored) transform coefficients for quantized levels in dequantization. Alternatively, QP can be a value mapped to the quantization step size.

[0217] Delta QP: Delta QP can be the difference between the QP predicted by a specific process 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 delta QP.

[0218] Quantization matrix: A quantization matrix can be a matrix used in quantization or inverse quantization to improve the subjective or objective quality of an image.

[0219] Quantization matrix coefficients: Quantization matrix coefficients can be each element within a quantization matrix.

[0220] Scan: A scan can refer to the arrangement of values ​​within a block or matrix. The values ​​can be coefficients. For example, a scan can refer to arranging values ​​arranged in a two-dimensional form into a one-dimensional form, or it can refer to rearranging values ​​arranged in a one-dimensional form into a two-dimensional form. An inverse scan can be the opposite arrangement (or rearrangement) of the arrangement performed in a scan.

[0221] Non-zero transform coefficient: A non-zero transform coefficient can mean a transform coefficient with a non-zero value or a quantized level with a non-zero value.

[0222] Bitstream: A bitstream may refer to a sequence of bits containing encoded information generated by encoding an image. A bitstream may contain information according to specific syntax elements. For example, information may contain syntax elements. An encoding device may generate a bitstream containing information according to specific syntax elements. A decoding device may obtain information from the bitstream according to specific syntax elements.

[0223] Signaling: Signaling information may indicate that information is transmitted from an encoding device to a decoding device via a bitstream. For example, the information may include a syntax element. Alternatively, signaling may mean that the encoding device includes information in a bitstream. Information signaled by the encoding device may be used by the decoding device. In signaling, the bitstream may be transmitted via a network and may be included in a recording medium. In embodiments, description of information being signaled may include: 1) for signaling information, the encoding device determines and generates information; 2) the encoding device encodes the information to generate encoded information; 3) (encoded) information is transmitted from the encoding device to the decoding device via a bitstream; 4) the decoding device decodes the encoded information to obtain information; and 5) for signaling information, the decoding device determines and generates information via signaling.

[0224] - An encoding device can perform encoding on information to generate encoded information. The encoded information can be signaled via a bitstream. A decoding device can obtain information by decoding the encoded information.

[0225] - When information is signaled for a specific target, it can mean that the information is used for each specific target, and the processing indicated by the information is applied to each specific target. For example, when information is signaled at a specific unit level, it can mean that the information is used / processed for each specific unit.

[0226] - The information being signaled may include one or more sub-information. Signaling a specific piece of information may mean that each piece of information within one or more sub-information pieces contained within the specific information is signaled.

[0227] Selective Signaling: Signaling of information may be performed selectively. Selective signaling of information may mean that the encoding device selectively includes information in the bitstream (under certain conditions). Selective signaling of information may mean that the decoding device selectively obtains information from the bitstream (under certain conditions).

[0228] Omission of signaling: Signaling for information may be omitted. Omission of signaling for information may mean that the encoding device (under certain conditions) does not include the information in the bitstream. Omission of signaling for information may mean that the decoding device (under certain conditions) does not obtain the information from the bitstream. The decoding device may derive the information for which signaling is omitted using other information of the embodiments.

[0229] Symbol: may mean at least one piece of information of a target unit, such as a syntax element of a target unit or target block, a coding parameter, a quantized level, and a transform coefficient. In addition, a symbol may mean a target of entropy encoding or a result of entropy decoding.

[0230] Entropy encoding: Entropy encoding can allocate fewer bits to symbols with a high probability of occurrence, and more bits to symbols with a low probability of occurrence. This allocation reduces the size of the bitstream representing the symbols as they are represented.

[0231] - Entropy coding can use methods such as Variable Length Coding (VLC) and Context-Adaptive Binary Arithmetic Coding (CABAC). For example, in variable length coding, entropy coding can be performed using a variable length table. For example, in CABAC, a binarization method for symbols and a probability model of symbols / bins can be derived for entropy coding, and arithmetic coding using context can be performed.

[0232] Entropy decoding: Entropy decoding can reverse the processes performed in entropy encoding. Symbols can be generated by entropy decoding a bitstream.

[0233] Parsing: Parsing can mean determining the values ​​of syntactic elements by performing entropy decoding on the encoded information in the bitstream. Alternatively, parsing can mean entropy decoding itself.

[0234] Statistical Value: The values ​​of information related to specific entities described in the embodiments may be used as inputs to specific operations. The statistical value may be a value derived by a specific operation on the values ​​related to these specific entities. For example, the statistical value for specific information may be one or more of an average value, a weighted average value, a weighted sum value, a minimum value, a maximum value, a mode, a median value, an interpolated value, a sum of products, and a product of sums of values ​​of the specific information. Additionally, information of the embodiments having specific values ​​determined by operations, such as constants, variables, and coding parameters, may have specific statistical values ​​according to the embodiments.

[0235]

[0236] Coding parameters

[0237] In embodiments, coding parameters may be information required for coding. The coding parameters may include information signaled from an encoding device to a decoding device, information calculated / derived during the coding process described in the embodiments, and information used for the coding process described in the embodiments.

[0238] In embodiments, the coding parameters include a size of a CTU, a size of a unit, a form of a unit, a shape of a unit, a depth of a unit, a minimum unit size, a maximum unit size, a maximum unit depth, a minimum unit depth, a partition information of a unit, QT partition information, BT partition information, a partition direction of a BT partition, a partition shape of a BT partition, TT partition information, a partition direction of a TT partition, a partition shape of a TT partition, MTT partition information, a combination of MTT partitions, a partition direction of an MTT partition, a partition shape of an MTT partition, a prediction mode, an intra prediction mode, a luma intra prediction mode, a chroma intra prediction mode, an intra partition information, an inter partition information, a coding block partition information, a prediction block partition information, a transform block partition information, a reference sample line index, a reference sample filtering method, a reference sample filter tap, a reference sample filter coefficient, a prediction block filter method, a prediction block filter tap, a prediction block filter coefficient, a prediction block boundary filtering method, a prediction block boundary filter tap, a prediction block boundary filter coefficient, an inter prediction mode, motion information, MV, a motion vector difference (MV). Difference (MVD), MVD resolution, MV size, MV representation accuracy, reference picture list, reference picture, reference picture index, inter prediction direction, inter prediction indicator, prediction list utilization flag, POC, MV candidate, MV candidate index, MV candidate list, AMVP mode usage information, merge candidate, merge index, merge candidate list, merge mode usage information, motion information compensation information, skip mode usage information, intra block copy mode usage information, BV (Block Vector), Block Vector Difference (BVD), BVD resolution, BV size, BV representation accuracy, BV candidate, BV candidate index, BV candidate list, filter tap of interpolation filter, filter coefficient of interpolation filter, transformation type, transformation size, transformation selection information, primary transformation usage information,Secondary transform usage information, primary transform selection information, secondary transform selection information, residual block presence information, coded block pattern, coded block flag, QP, delta QP, quantization matrix, deblocking filter usage information, coefficients of the deblocking filter, filter taps of the deblocking filter, strength of the deblocking filter, shape / shape of the deblocking filter, adaptive sample offset usage information, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, adaptive loop filter usage information, coefficients of the adaptive loop filter, filter taps of the adaptive loop filter, shape / shape of the adaptive loop filter, binarization / debinarization method, context model, context model determination method, context model update method, regular mode usage information, bypass mode usage information, significant coefficient flag, last significant coefficient flag, coefficient group unit coding flag, last significant coefficient position, flag indicating whether the coefficient value is greater than 1, whether the coefficient value is greater than 2 A flag indicating whether the coefficient value is greater than 3, a flag indicating whether the coefficient value is greater than 3, remaining coefficient value information, sign information, context bin, bypass bin, reconstructed sample, reconstructed luma sample, reconstructed chroma sample, residual sample, residual luma sample, residual chroma sample, transform coefficient, luma transform coefficient, chroma transform coefficient, transform coefficient level, luma transform coefficient level, chroma transform coefficient level, transform coefficient level scanning method, quantized level, luma quantized level, chroma quantized level, size of MV search region on the side of the decoding device, shape of MV search region on the side of the decoding device, number of MV search on the side of the decoding device, picture type, slice identification information, slice type, slice partitioning information, tile group identification information, tile group type, tile group partitioning information, tile identification information, tile type, tile partitioning information, bit depth,It may include one or more of input sample bit depth, reconstructed sample bit depth, residual sample bit depth, transform coefficient bit depth, quantized level bit depth, mapping availability information, information about luma signal, information about chroma signal, color space of target block, color space of residual block, and temporal layer information.

[0239] In addition, the coding parameter may further include 1) a value of information that may be included in the coding parameter, 2) a combination of multiple pieces of information that may be included in the coding parameter, 3) a statistical value for information that may be included in the coding parameter, 4) information related to the coding parameter, 5) information used to calculate / derive the coding parameter, and 6) information calculated / derived using the coding parameter.

[0240] In embodiments, "X usage information" may be "information indicating whether X is used / applied / performed." Alternatively, "X usage information" may be "information indicating whether X is available." For example, "specific mode usage information" may be information indicating whether a specific mode is used. The mode information may indicate a mode used for a target block among the modes described in the embodiments. In embodiments, the specific mode usage information may be replaced with mode information, and the description of the specific mode usage information may also be applied to the mode information. "X usage information" and "X indicator" may be used interchangeably.

[0241] In embodiments, coding parameters and syntax elements may correspond to each other. For example, syntax elements of an embodiment may be used as coding parameters, and coding parameters may be signaled as syntax elements.

[0242] In embodiments, “X presence information” may be considered as “information indicating whether X exists” or “information indicating whether information indicating X exists in the bitstream.”

[0243] In embodiments, the “X selection information” may be information indicating one of the candidates or methods for X. The “X selection information” may be considered an “X index.”

[0244] In embodiments, the splitting form of a particular tree may represent one of symmetric splitting and asymmetric splitting, and may represent one of QT, BT, TT, and non-split. The splitting direction of a particular tree may represent one of horizontal and vertical directions.

[0245] In embodiments, when a coding parameter has one of multiple values, “coding parameter” may be replaced with “whether the coding parameter has a specific value among the multiple values ​​available to the coding parameter.”

[0246] In embodiments, when a coding parameter points to one of a plurality of objects, “coding parameter” may be replaced with “whether the coding parameter points to a specific object among the plurality of objects.”

[0247]

[0248] System for video coding

[0249] Figure 1 illustrates a system for video coding according to one embodiment.

[0250] The system (100) may include at least one of an encoding device (110) and a decoding device (150).

[0251] Each of the encoding device (110) and the decoding device (150) may be a computer or an electronic apparatus.

[0252]

[0253] Structure of the encoding device

[0254] The encoding device (110) may include a processor (120), storage (140), and a communicator (149).

[0255] The processor (120), storage (140), and communication device (149) can be connected via a bus.

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

[0257] The processor (120) can perform generation and processing of information input to the encoding device (110), output from the encoding device (110), or used within the encoding device (110) in the embodiments, and can perform comparisons and judgments related to such information.

[0258] The processor (120) may include a plurality of components. The plurality of components may include a partitioner (122), a subtractor (124), a transformer (125), a quantizer (126), an inverse quantizer (127), an inverse transformer (128), an adder (129), a filter (130), and an entropy encoder (139).

[0259] At least some of the aforementioned components may be program modules. The program modules may be included in the encoding device (110) in the form of an operating system, applications, and other program modules. The program modules may be instructions or computer-executable codes stored in the storage (140) and executed by the processor (120).

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

[0261] The storage (140) can store instructions and computer-executable codes used for the operation of the encoding device (110), and can store information and bitstreams described in the embodiments. The storage (140) can include a reference picture buffer (141).

[0262] The communication device (149) can perform functions related to the communication of information in the encoding device (110). For example, the communication device (149) can transmit a bitstream to the decoding device (150).

[0263] Among the names of components of the encoding device (110), “-er” or “-or” may be replaced with “-unit”. The storage (140) may also be named a storage unit.

[0264]

[0265] Operation of the encoding device

[0266] The encoding device (110) can sequentially encode one or more images of a video.

[0267] The storage (140) can store the original image. The original image can be used as a target image in the encoding device (110).

[0268] 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 storage (140). The generated bitstream can be stored in a computer-readable recording medium, and can be transmitted to the communication device (189) of the decoding device (150) via a wired and / or wireless transmission medium by the communication device (149).

[0269] The segmenter (122) can determine a target block by performing segmentation on the target image.

[0270] The predictor (123) can determine the prediction mode of the target block. The predictor (123) can generate a prediction block of the target block by performing prediction according to the prediction mode.

[0271] The prediction mode of the target block may be one of the available prediction modes. For example, the available prediction modes may include intra prediction, inter prediction, and IBC prediction.

[0272] For example, if the prediction mode is intra prediction, the predictor (123) can perform intra prediction on the target block to generate a prediction block of the target block.

[0273] For example, if the prediction mode is inter prediction, the predictor (123) can perform inter prediction on the target block to generate a prediction block of the target block.

[0274] For example, when the prediction mode is IBC, the predictor (123) can perform IBC prediction on the target block to generate a prediction block of the target block.

[0275] The subtractor (124) can generate a residual block of the target block. The residual block may be the difference between the original block and the predicted block. The original block may be the area pointed to by the target block in the original image. Alternatively, the residual block may refer to a block generated by applying one or more of transformation and quantization to the difference between the original block and the predicted block.

[0276] The transformer (125) can perform a transformation on the residual block to generate transformation coefficients.

[0277] The converter (125) can perform the conversion using one of a plurality of conversion methods.

[0278] For example, the multiple transform methods may include a Discrete Cosine Transform (DCT), a Discrete Sine Transform (DST), a Karhunen-Loeve Transform (KLT), and transforms based on each transform.

[0279] Transform skip mode may be a mode for generating a reconstructed block using a reconstructed residual block and a prediction block for which transformation and inverse transformation have not been performed. When transform skip mode is applied to a target block, transformation and inverse transformation for the target block may be omitted, and only quantization and inverse quantization for the target block may be performed.

[0280] A quantizer (126) can generate quantized levels by applying quantization using quantization parameters to transform coefficients. In embodiments, the quantized levels may also be referred to as transform coefficients.

[0281] An entropy encoder (139) can generate encoded information by performing entropy encoding based on a probability distribution on information for decoding an image. The bitstream can include encoded information.

[0282] Information for decoding an image may include quantized levels and syntax elements produced by a quantizer (126).

[0283] The probability distribution can be determined based on the quantized levels and coding parameters.

[0284] The entropy encoder (139) can use scanning to change the quantized levels in the form of two-dimensional blocks into the form of one-dimensional vectors in order to perform encoding on the quantized levels. In scanning, which scan among the upper right diagonal scan, vertical scan, and horizontal scan will be used can be determined based on coding parameters such as the block size and the block intra prediction mode.

[0285] When encoding is performed on a target image / block, the predictor (123) uses a reference image / block for prediction. The encoded target image / block can be used as a reference image / block for other images / blocks to be processed later. Accordingly, the processor (120) can perform restoration on the encoded target block, and store a restored image including the restored target block generated by the restoration as a reference image in the reference picture buffer (141). Inverse quantization and inverse transformation can be performed on the encoded target block for restoration.

[0286] The dequantizer (127) can generate dequantized transform coefficients by performing dequantization on the quantized level.

[0287] The inverse transformer (128) can generate inverse quantized and inversely transformed coefficients by performing inverse transformation on the inverse quantized transform coefficients. In embodiments, the inverse quantized and / or inversely transformed coefficients may refer to coefficients to which at least one of inverse quantization and inverse transformation has been applied. The inverse quantized and inversely transformed coefficients may be a restored residual block.

[0288] The adder (129) can generate a restored block by combining a predicted block and a restored residual block.

[0289] The restoration block may pass through a filter (130). The filter (130) may apply one or more of a plurality of filters to the target. Each filter of the plurality of filters may be an in-loop filter. The target may be a restoration sample, a restoration block, or a restoration image.

[0290] The reference picture buffer (141) can store a restored block / image provided from the filter (130). The restored image may be an image including a restored block. Alternatively, the restored image may be an image composed of restored blocks.

[0291] The reference picture buffer (141) can provide the stored restored image as a reference image to the predictor (123). In terms of storing the decoded (i.e., restored) picture, the reference picture buffer (141) may also be referred to as a decoded picture buffer (DPB).

[0292]

[0293] Structure of the decryption device

[0294] The decryption device (150) may include a processor (160), a storage (180), and a communication device (189).

[0295] The description of the processor (120), storage (140), and communication device (149) related to the encoding device (110) can also be applied to the processor (160), storage (180), and communication device (189) related to the decoding device (150). Duplicate descriptions are omitted.

[0296] The processor (160) may include a plurality of components. The plurality of components may include an entropy decoder (161), a divider (162), a predictor (163), an inverse quantizer (167), an inverse transformer (168), an adder (169), and a filter (170).

[0297] The storage (180) may include a reference picture buffer (181).

[0298] The communication device (189) can perform functions related to communication of information in the decryption device (150). For example, the communication device (189) can receive a bitstream from the encoding device (110).

[0299] Among the names of components of the decryption device (150), “-er” or “-or” may be replaced with “-unit”. The storage (180) may also be named a storage unit.

[0300]

[0301] Operation of the decryption device

[0302] The communication device (149) of the encoding device (110) can transmit the bitstream generated by the encoding device (100) to the decoding device (150). Alternatively, a computer-readable recording medium storing the bitstream can transmit the bitstream generated by the encoding device (100) to the decoding device (150).

[0303] The communication device (189) can receive a bitstream from the encoding device (110) via a wired and / or wireless transmission medium. The received bitstream can be stored in the storage (180).

[0304] The processor (160) can obtain a bitstream from a storage (180) or a computer-readable recording medium.

[0305] A bitstream may contain encoded information.

[0306] An entropy decoder (161) can generate information for decoding an image by performing entropy decoding based on a probability distribution on the encoded information of a bitstream.

[0307] Information for decoding an image may include quantized levels and syntax elements.

[0308] The entropy decoder (161) can use scanning to change the quantized levels in the form of a one-dimensional vector into the form of a two-dimensional block to perform decoding on the quantized levels. In scanning, which scan among the upper right diagonal scan, vertical scan, and horizontal scan will be used can be determined based on coding parameters such as the block size and the block intra prediction mode.

[0309] The entropy decoder (161) can provide syntax elements to other components of the processor (160), such as the segmenter (162).

[0310]

[0311] A common description of the relationship between the components of the encoding device and the components of the decoding device.

[0312] The decoding device (150) performs decoding using the bitstream generated by the encoding device (110). The encoding device (110) can perform encoding on the target block using a restored image derived within the decoding device (150), rather than an original image that is not provided to the decoding device (150). Therefore, the encoding device (110) and the decoding device (150) may need to generate restored blocks / images in the same manner. In this respect, the descriptions of the divider (122), predictor (123), inverse quantizer (127), inverse transformer (128), adder (129), filter (130), and reference picture buffer (141) of the encoding device (110) disclosed in the embodiments can also be applied to the divider (162), predictor (163), inverse quantizer (167), inverse transformer (168), adder (169), filter (170), and reference picture buffer (181) of the decoding device (150). Duplicate descriptions are omitted.

[0313] Additionally, each of the divider (122), predictor (123), inverse quantizer (127), inverse transformer (128), adder (129), and filter (130) of the encoding device (110) can generate syntax element information that specifies processing for the target. Each of the divider (162), predictor (163), inverse quantizer (167), inverse transformer (168), adder (169), and filter (170) of the decoding device (150) can perform processing for the target (same as that performed in the encoding device (110)) using the syntax element information.

[0314] As described above, corresponding components of the encoding device (110) and the decoding device (150) may perform the same or corresponding functions. In embodiments, the processor may represent the processor (120) of the encoding device (110) and / or the processor (160) of the decoding device (150). For example, in the function related to prediction, the processor may represent a predictor (123), a subtractor (124), and an adder (129), and may represent a predictor (163) and an adder (169). In the function related to transformation, the processing unit may represent a transformer (125) and an inverse transformer (128), and may represent an inverse transformer (168). In the function related to quantization, the processor may represent a quantizer (126) and an inverse quantizer (127), and may represent an inverse quantizer (167). In the function related to entropy encoding / decoding, the processing unit may represent an entropy encoder (139) and / or an entropy decoder (161). In the function related to filtering, the processing unit may represent a filter (130) and / or a filter (170). The storage may represent a storage (140) of an encoding device (110) and / or a storage (180) of a decoding device (150). The reference picture buffer may represent a reference picture buffer (141) of an encoding device (110) and / or a reference picture buffer (181) of a decoding device (150). The communication unit may represent a communication unit (149) of an encoding device (110) and / or a communication unit (189) of a decoding device (150).

[0315]

[0316] Division of the units that make up the image

[0317] Figure 2 shows a segmentation structure of an image according to one embodiment.

[0318] Figure 2 can schematically represent an example in which one unit is divided into multiple sub-units.

[0319] A CU can be used as a basic unit for encoding and decoding images. In addition, a CU can be a basic unit for prediction, transformation, quantization, inverse quantization, inverse transform entropy encoding, and entropy decoding.

[0320] A CU can be used as a unit to which a prediction mode is applied. In other words, during coding, it can be determined which prediction mode among the available prediction modes will be applied to each CU. For example, available prediction modes may include intra prediction, inter prediction, and intra-block copy prediction (IBC).

[0321] The target image (200) can be sequentially divided into units of CTUs. A division structure can be determined for each CTU. The CTU can be divided into CUs according to the division structure. Alternatively, a single CTU can be used as a CU. The size of the CTU can be the maximum CU size.

[0322] Each CU can have depth information. The depth information can indicate the depth of the CU and the size of the CU. The depth of a CTU can be 0. The depth of a CU generated by splitting a CTU can be 1. When a parent CU is split into child CUs, the depth of the child CU can be 1 greater than the depth of the parent CU. The number of split CUs can be a positive integer greater than or equal to 2, including 2, 4, 8, and 16. At least one of the horizontal size and the vertical size of the child CU generated by splitting the parent CU can be smaller than at least one of the horizontal size and the vertical size of the parent CU, depending on the number of child CUs.

[0323] A partitioned CU can be recursively partitioned in the same manner up to a predefined maximum depth or a predefined minimum size. The depth of the smallest coding 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 size of the minimum CU.

[0324] For example, the depth of a CU can range from 0 to 3. Depending on the depth of the CU, the CU can have a size from 64x64 to 8x8. A CTU with a depth of 0 can be a 64x64 block. 0 can be the minimum depth. An SCU with a depth of 3 can be an 8x8 block. 3 can be the maximum depth. A depth of 0 can represent a CTU that is a 64x64 block. A depth of 1 can represent a CU that is a 32x32 block. A depth of 2 can represent a CU that is a 16x16 block. A depth of 3 can represent an SCU that is an 8x8 block.

[0325] The partition information of a CU can indicate whether the CU is 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 the first value, '0', and the partition information of a CU that is being partitioned can be the second value, '1'.

[0326] Quad Tree (QT) partitioning may mean that one CU is partitioned into four CUs. When a parent CU is partitioned into four child CUs, the width and height of each child CU may be half the width and half the height of the parent CU, respectively.

[0327] A binary tree (BT) split may mean that one CU is split into two CUs. For example, if a parent CU is split into two child CUs, the width or height of each child CU may be half the width or half the height of the parent CU.

[0328] A Ternary Tree (TT) partition may mean that a single CU is partitioned into three CUs. For example, if a parent CU is partitioned into three child CUs, the three child CUs can be created by partitioning the width or height of the parent CU in a ratio of 1:2:1. The width or height of the child CUs may be 1 / 4, 1 / 2, and 1 / 4 of the width or height of the parent CU, respectively.

[0329] In Fig. 2, QT type segmentation was applied to the first CTU. QT segmentation, BT segmentation, and TT segmentation were applied to the second CTU.

[0330] To partition a CTU, at least one of different types of partitions, such as QT partitioning, BT partitioning, and TT partitioning, may be applied to the CTU. Different types of partitions may be applied based on specific priorities.

[0331] For example, QT partitioning may be preferentially applied to a CTU. A CU to which QT partitioning can no longer be applied may correspond to a leaf node of QT. A CU that is a leaf node of QT may be a root node of BT and / or TT. A CU that is a leaf node of QT may be partitioned into a BT or TT form, or may not be partitioned any further. In this case, QT partitioning may not be applied again to a CU that is created by applying a BT or TT partition to a CU that is a leaf node of QT.

[0332] The partitioning of a CU corresponding to each node of QT can be signaled using QT partitioning information. The QT partitioning information can be a flag. The QT partitioning information of a unit can be information indicating whether the unit is partitioned in a QT form. A first value of the QT partitioning information, '0', can indicate that the CU is not partitioned in a QT form. The QT partitioning information having a first value can indicate a multi-type tree (MTT) partitioning. The MTT partitioning can include a BT partitioning and a TT partitioning. A second value of the QT partitioning information, '1', can indicate that the CU is partitioned in a QT form.

[0333] There may be no priority between BT and TT splits. That is, a CU corresponding to a leaf node of QT may be split into either BT or TT forms. Furthermore, a CU generated by BT or TT splits may be split again into BT or TT forms, or may not be split any further.

[0334] A CU corresponding to a leaf node of QT can become the root node of MTT. For each CU corresponding to an MTT node, the CU may further include MTT-type split direction information and split type information.

[0335] Split direction information can indicate the split direction of MTT splitting. The first value of the split direction information, '0', can indicate that the CU is split horizontally. The second value of the split direction information, '1', can indicate that the CU is split vertically.

[0336] The partition type information can indicate the partition type used for multi-type tree partitioning. The first value of the partition type information, '0', can indicate that the CU is partitioned in the TT form. The second value of the partition type information, '1', can indicate that the CU is partitioned in the BT form.

[0337] Here, each of the aforementioned split direction information and split type information may be a flag having a specific length (e.g., 1 bit).

[0338] The CU's partition information may also include QT partition information, partition direction information, and partition shape information.

[0339] CUs that are no longer split by QT splitting, BT splitting, and TT splitting can be used as units for specific processing, such as prediction, transformation, quantization, inverse quantization, inverse transform, entropy encoding, and entropy decoding. That is, for specific processing, CUs may no longer be split. Therefore, splitting information for splitting such CUs into PUs and / or TUs, etc., may not exist in the bitstream.

[0340] On the other hand, if the size of a CU is larger than the maximum TU size, the CU can be recursively split until the size of the CU becomes smaller than or equal to the maximum TU size. For example, if the size of a CU is 64x64 and the maximum TU size is 32x32, the CU can be split into four 32x32 TUs for transformation. For example, if the size of a CU is 32x64 and the maximum TU size is 32x32, the CU can be split into two 32x32 TUs for transformation.

[0341] In such cases, information regarding whether a CU is split for transformation may not be separately signaled. Whether a CU is split may be determined by comparing the size of the CU (width / height) with the maximum TU size (width / height), without signaling. For example, if the width of the CU is greater than the width of the maximum TU size, the CU may be split into two vertically. Additionally, if the height of the CU is greater than the height of the maximum TU size, the CU may be split into two horizontally.

[0342] For example, the minimum size of a CU may be 4x4. For example, the maximum size of a transform block may be 64x64. For example, the minimum size of a transform block may be 4x4. The QT minimum size may be the minimum size of a CU corresponding to a leaf node of the QT. The MTT maximum depth may be the maximum depth of the path from the root node to the leaf node of the MTT.

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

[0344] If the depth within the MTT of a CU corresponding to a node of the MTT is equal to the maximum depth of the MTT, the CU may not be split into BT shape and / or TT shape.

[0345] Based on the various sizes and depths of the CUs described above, each piece of information described in the embodiments may or may not be present in the bitstream.

[0346] Information about the maximum or minimum size described in the embodiments may be signaled at a higher level of the CU. In the embodiments, the higher level of the CU may include a video level, a sequence level, a picture level, a subpicture level, a tile group level, a tile level, and a slice level.

[0347] The information described in the embodiments may be signaled separately for different types of slices. The different types of slices may include intra-slices and inter-slices.

[0348]

[0349] Processing blocks according to their properties

[0350] Whether a specific process described in the embodiments is applied / performed may be determined based on the properties of a block related to the specific process. Whether a specific process described in the embodiments is applied / performed may be determined based on whether the properties of a block related to the specific process satisfy a specific condition. For example, a block may include a target block, a neighboring block, and a reference block. A block may include other blocks described in the embodiments. A block may be one of the blocks and units described in the embodiments.

[0351] The blocks to which the specific processing described in the examples is applied may have a square shape or a non-square shape.

[0352] In one embodiment, the block's attributes may include the block's size. Certain processing described in the embodiments may be applied / performed when certain conditions regarding the block's size are met.

[0353] In one embodiment, the specific conditions may include a minimum block size condition and a maximum block size condition. The blocks to which the minimum block size condition applies and the blocks to which the maximum block size condition applies may be different.

[0354] In one embodiment, a minimum block size and / or a maximum block size for a particular process may be predefined.

[0355] In one embodiment, the processing of the embodiment may be applied / performed when the size of the block is greater than or equal to the minimum block size and / or when the size of the block is less than or equal to the maximum block size. Alternatively, in one embodiment, the processing of the embodiment may be applied / performed when the size of the block is greater than the minimum block size and / or when the size of the block is less than the maximum block size.

[0356] In one embodiment, the processing of the embodiment may be applied / performed only when the block size is greater than or equal to the minimum block size and less than or equal to the maximum block size. Alternatively, the processing of the embodiment may be applied / performed only when the block size is greater than or equal to the minimum block size and less than or equal to the maximum block size. Alternatively, the processing of the embodiment may be applied / performed only when the block size is greater than or equal to the minimum block size and less than or equal to the maximum block size. The processing of the embodiment may be applied / performed only when the block size is greater than or equal to the minimum block size and less than or equal to the maximum block size.

[0357] In one embodiment, the processing of the embodiment may be applied / performed only when the block size is a predefined block size.

[0358] In embodiments, the size of a block may be determined in various ways. For example, the size of a block may refer to the width or height of the block. The size of a block may refer to both the width and height of the block. The size of a block may refer to the area of ​​the block. The size of a block may refer to 1) a result value of a known formula using the width and height of the block, 2) a result value of a formula of the embodiment, or 3) a statistical value.

[0359] Additionally, for the first size, the processing of the first embodiment among the embodiments may be applied / performed, and for the second size, the processing of the second embodiment among the embodiments may be applied / performed.

[0360] In embodiments, the block size may be 2x2, 4x4, 8x8, 16x16, 32x32, 64x64 or 128x128, etc. Alternatively, in embodiments, the block size may be (2*SIZE X )x(2*SIZE Y ) etc. SIZE X can be one of the integers greater than or equal to 1. SIZE Y can be one of the integers greater than or equal to 1.

[0361]

[0362] Predictive information for prediction

[0363] Prediction information can be used to generate a prediction block for the target block.

[0364] The encoding device (110) can generate prediction information required for prediction and can generate a bitstream including the prediction information. The prediction information can be signaled from the encoding device (110) to the decoding device (150) via the bitstream. The decoding device (150) can obtain the prediction information from the bitstream and perform prediction on the target block using the prediction information, thereby generating a prediction block.

[0365] Prediction information may include intra-prediction information, inter-prediction information, and IBC prediction information. In embodiments, prediction information may be replaced with intra-prediction information, inter-prediction information, and / or IBC information. Intra-prediction information may include information used for intra-prediction as described in embodiments. Inter-prediction information may include information used for inter-prediction as described in embodiments. IBC information may include information used for IBC prediction as described in embodiments.

[0366]

[0367] Intra prediction

[0368] Figure 3 illustrates the structure of intra prediction according to one embodiment.

[0369] Intra prediction can be performed using reference samples and coding parameters of the target block. The reference sample can be a (restored) sample within the (restored) reference block. Alternatively, an intermediate prediction sample can be generated using a sample described in the embodiment, such as a reconstructed sample, and a reference sample can be generated again using the intermediate prediction sample. Processing described in the embodiment, such as filtering, can be applied when generating the reference sample.

[0370] A reference block may be a (spatial) neighboring block of the target block. The coding parameters may be coding parameters for the target block and / or coding parameters for the reference block. In intra prediction, a reference sample may mean a neighboring sample.

[0371] A prediction block can be generated by performing intra prediction on a target block according to an intra prediction mode based on reference samples within a target image and information related to the reference samples. The size of the target block and the size of the prediction block can be the same.

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

[0373] An intra prediction mode can be expressed by at least one of a mode number, a mode value, a mode angle, and a mode direction. The prediction directions of a plurality of intra prediction modes for a target block are illustrated in the lower right corner of Fig. 3. Among the plurality of intra prediction modes, the remaining intra prediction modes excluding the DC and planar modes may be directional modes. A directional mode may be an intra prediction mode having a specific direction or a specific angle. The intra prediction mode for the target block may be selected from among directional modes and non-directional modes.

[0374] In the lower right rectangle representing the target block, the number '0' may represent the planar mode, which is a non-directional intra prediction mode. The number '1' may represent the DC mode, which is a non-directional intra prediction mode. In the lower right rectangle representing the target block, the arrows from the center to the periphery of the rectangle may represent the prediction directions of the directional intra prediction modes. In addition, the number indicated close to the arrow may represent an example of the mode value assigned to the intra prediction mode or the prediction direction of the intra prediction mode.

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

[0376] The number of intra prediction modes available to a target block may be a predefined value. Alternatively, the number of intra prediction modes available to a target block may be determined based on the properties of the prediction block. For example, the properties of the prediction block may include coding parameters such as shape, size, and color components.

[0377] For example, in Figure 3, the directional modes depicted by the dotted lines (i.e., the directional modes numbered between -14 and -1, or between 67 and 80) can only be applied to predictions for non-square blocks. Therefore, the number of intra prediction modes available for predictions for square blocks can be 67 (planar mode, DC mode, and 65 directional modes).

[0378] For example, the number of available intra prediction modes may vary depending on whether the color component of the block is a luma signal or a chroma signal. The number of available intra prediction modes for a block containing a luma component may be greater than the number of available intra prediction modes for a block containing a chroma component.

[0379] Intra prediction modes may include horizontal-below mode, horizontal mode, vertical mode, and vertical-right mode. The horizontal-below mode may be an intra prediction mode located below the horizontal mode. The vertical-right mode may be a mode located to the right of the vertical mode. For example, in FIG. 3, the mode value of the horizontal mode may be 18. The mode value of the vertical mode may be 50. Intra prediction modes whose mode values ​​are one of 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, and 66 may be vertical-right modes. Intra prediction modes whose mode value is one of 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, and 17 can be horizontal bottom modes.

[0380] The number of intra prediction modes and the mode number of each intra prediction mode described above may be merely exemplary. The number of intra prediction modes and the mode number of each intra prediction mode described above may be defined differently depending on the embodiment, implementation, and / or needs.

[0381] When the intra prediction mode is the planar mode, when generating a prediction block of a target block, a sample value of the prediction sample can be generated using a weighted sum (weighted sum) of an upper reference sample of the target sample, a left reference sample of the target sample, an upper right reference sample of the target block, and a lower left reference sample of the target block, depending on the position of the prediction sample within the prediction block.

[0382] When the intra prediction mode is DC mode, a prediction block may be generated based on an average of sample values ​​of a plurality of reference samples. The plurality of reference samples may include upper reference samples and left reference samples of the target block. The value of the prediction sample of the prediction block may be determined based on an average of the sample values ​​of the plurality of reference samples. In addition, filtering using the values ​​of the reference samples may be performed for specific rows and / or specific columns within the target block. The specific rows may be one or more upper rows adjacent to the upper reference samples. The specific columns may be one or more left columns adjacent to the left reference samples.

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

[0384] The intra prediction mode of the target block may be determined based on the intra prediction mode of a neighboring block of the target block. Information for determining the intra prediction mode of the target block may be signaled.

[0385] For example, if the intra prediction modes of the target block and the neighboring block are the same, an indicator indicating that the intra prediction modes of the target block and the neighboring block are the same can be signaled.

[0386] For example, an indicator may be signaled that indicates an intra prediction mode that is the same as the intra prediction mode of the target block among the intra prediction modes of multiple neighboring blocks.

[0387] For example, if the intra prediction modes of the target block and neighboring blocks are different, an indicator indicating the intra prediction mode of the target block may be signaled. Alternatively, information used to derive the intra prediction mode of the target block based on the intra prediction mode of the neighboring block may be signaled.

[0388] Reference samples used for intra prediction for the target block may include lower left reference samples, left reference samples, upper left reference samples, upper reference samples, and upper right reference samples.

[0389] For example, the left reference samples may be reconstructed reference samples adjacent to the left side of the target block. The top reference samples may be reconstructed reference samples adjacent to the top side of the target block. The top left reference sample may be a reconstructed reference sample diagonally adjacent to the top left side of the target block. The bottom left reference samples may be reference samples located below the left reference samples among samples located on the same line as the left sample line composed of the left reference samples. The top right reference samples may be reference samples located on the right side of the top reference samples among samples located on the same line as the top sample line composed of the top reference samples.

[0390] Reference samples used for intra prediction for a 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 value of a prediction sample of a prediction block. In FIG. 3, the direction of the intra prediction mode indicated by the arrow can represent the direction from the prediction sample to the reference sample. The direction of the intra prediction mode can represent the dependency relationship between the reference samples and the prediction samples. For example, depending on the intra prediction mode, the sample value of a specific reference sample can be used as the sample value of at least one sample of the prediction block. Here, the specific reference sample and the at least one sample of the prediction block can be samples designated by a straight line in the direction of the intra prediction mode. In other words, the sample value of the specific reference sample can be copied as the sample value of the prediction sample located in the reverse direction of the direction of the intra prediction mode. Alternatively, the sample value of the prediction sample of 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 prediction sample.

[0391] The reference samples used for intra prediction may not be limited to samples immediately adjacent to the target block. As illustrated in FIG. 3, at least one of reference sample lines 0 to 3 may be used for intra prediction of the target block.

[0392] Each reference sample line of FIG. 3 may include one or more reference samples. A smaller number of a reference sample line may be a line of reference samples closer to the target block. Reference sample line 0 may be a line of reference samples immediately adjacent to the target block. When the upper left coordinates of the target block are (X, Y), the horizontal length is W, and the vertical length is H, the reference samples of reference sample line 0 may be samples whose x-coordinate is X-1 or whose y-coordinate is Y-1. Here, the y-coordinates of the reference samples whose x-coordinate is X-1 may be Y-1 to Y+2H. The x-coordinates of the reference samples whose y-coordinate is Y-1 may be X-1 to X+2W. The reference samples of reference sample line A may be samples whose x-coordinate is XA-1 or whose y-coordinate is YA-1. Here, the y-coordinates of the reference samples whose x-coordinate is XA-1 may be YA-1 to Y+2H+A. The x-coordinates of reference samples whose y-coordinate is YA-1 can be XA-1 to X+2W+A. A can be 1, 2, or 3.

[0393] Instead of obtaining samples from the reconstructed neighboring blocks, the samples of segment A and segment F can be derived using padding using the nearest samples of segment B and segment E, respectively.

[0394] A reference sample line index may indicate a reference sample line among multiple reference sample lines used for intra prediction of a target block. For example, the reference sample line index may have a value of one of 0 to 3. The reference sample line index may be signaled.

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

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

[0397] For example, the template may include a top reference sample and / or a left reference sample of the target block, and may include a top reference sample and / or a left reference sample of the restoration block of the first color component corresponding to these reference samples.

[0398] Once the parameters are derived, a prediction block of the second color component for the target block can be generated by applying the reconstructed block of the first color component to a linear model. Depending on the image format or the type of intra prediction between color components, subsampling / downsampling can be performed on the surrounding samples of the reconstructed block of the first color component and the reconstructed block of the first color component. When subsampling is performed, the derivation of the parameters and intra prediction between color components can be performed using the corresponding samples derived by the subsampling.

[0399] Intra Sub-Partitions (ISP) prediction may refer to sequential intra prediction for multiple sub-blocks generated by dividing a target block. In ISP prediction, a target block may be divided into two or four sub-blocks in the horizontal and / or vertical directions. The divided sub-blocks may be sequentially reconstructed. As intra prediction is performed on a sub-block, a sub-prediction block for the sub-block may be generated. Additionally, as inverse quantization and / or inverse transformation is performed on the sub-block, a sub-residual block for the sub-block may be generated. A reconstructed sub-block may be generated by adding the sub-prediction block to the sub-residual block. The reconstructed sub-block may be used as a reference sample for intra predictions for other sub-blocks to be processed subsequently.

[0400] In performing prediction on a target block, it can be determined whether samples included in a reconstructed neighboring block can be used as reference samples of the target block. If there is an unavailable sample among the samples of the neighboring block that cannot be used as a reference sample of the target block, a value generated by copying and / or interpolating using the sample value of at least one sample among the samples included in the reconstructed neighboring block can replace the sample value of the unavailable sample. If the value generated by copying and / or interpolating is replaced with the sample value of the sample, the sample can be used as a reference sample of the target block.

[0401] In intra prediction, the sample value of a prediction sample of a prediction block can be determined by the sample value of a reference sample. The position of the reference sample can be specified by the position of the prediction sample and the direction of the intra prediction mode. If the position specified by the position of the prediction sample and the direction of the intra prediction mode is an integer position, the sample value of one reference sample pointed to by the integer position can be used to determine the sample value of the prediction sample of the prediction block. If the position specified by the position of the prediction sample and the direction of the intra prediction mode is not an integer position, an interpolated reference sample can be generated based on two reference samples closest to the specified position. The sample value of the interpolated reference sample can be used to determine the sample value of the prediction sample. That is, when the position specified by the position of the prediction sample and the direction of the intra prediction mode indicates a gap between two reference samples, an interpolated sample value can be generated based on the sample values ​​of the two samples.

[0402]

[0403]

[0404] Inter prediction

[0405] Figure 4 shows the structure of inter prediction to explain the inter prediction process according to one embodiment.

[0406] The rectangle illustrated in Fig. 4 can represent an image. Additionally, the arrow in Fig. 4 can represent a prediction direction.

[0407] Each picture composing a video can be classified into an I picture (i.e., an intra picture), a P picture (i.e., a uni-prediction picture), and a B picture (i.e., a bi-prediction picture) according to its coding type. Coding can be performed for each picture according to its coding type.

[0408] If the target picture is an I-picture, coding for the target picture can be performed using information within the target picture without inter prediction referring to other images. For example, coding for the I-picture can be performed using intra prediction and / or IBC prediction.

[0409] Coding for P pictures and B pictures can be performed by at least one of intra prediction, IBC prediction, and inter prediction using a reference picture.

[0410] If the target picture is a P picture, coding for the target picture can be performed using unidirectional inter prediction using one reference picture list.

[0411] When the target picture is a B picture, coding for the target picture can be performed using unidirectional inter prediction or bidirectional inter prediction using two reference picture lists.

[0412] Below, inter prediction for a target block in inter mode according to an embodiment is specifically described.

[0413] When the prediction mode of the target block is inter mode, inter prediction can be performed on the target block. The target block can be a prediction block or a split prediction block.

[0414] Inter prediction can be performed using reference images and motion information. In inter prediction, a reference image can be selected using a reference image index, and a reference block corresponding to a target block within the reference image can be determined using motion information. A prediction block for the target block can be generated using the determined reference block.

[0415] Motion information can be derived using coding parameters, etc. For example, motion information can be derived using motion information of a reconstructed neighboring block, motion information of a call block, and / or motion information of a block adjacent to a call block.

[0416] In embodiments, a candidate list may be used for inter prediction. The candidate list may include multiple candidates. An index indicating a candidate used for inter prediction for a target block among the candidates in the candidate list may be signaled. The candidate list may be derived in the same manner based on the same information in the encoding device (110) and the decoding device (150). Here, the same information may include a restored image and a restored block. Furthermore, in order to specify a candidate by index, the order of the candidates within the candidate list may need to be consistent.

[0417] In one embodiment, prediction of a target block can be performed by using motion information of a spatial candidate or a temporal candidate as motion information of the target block. The motion information of the spatial candidate may be referred to as spatial motion information. The motion information of the temporal candidate may be referred to as temporal motion information.

[0418] A spatial candidate may be a restored spatial neighboring block that is spatially adjacent to the target block.

[0419] A spatial candidate may be a block that 1) exists within the target image, 2) has already been restored through decryption, and 3) is adjacent to the target block.

[0420] Spatial candidates may include the left block, the top block, the bottom left block, the top right block, and the top left block of the target block.

[0421] A temporal candidate may be a restored temporal neighboring block corresponding to a target block in a restored COL image.

[0422] In embodiments, the motion information of a spatial candidate may be motion information of a block containing the spatial candidate. The motion information of a temporal candidate may be motion information of a block containing the temporal candidate.

[0423] In inter prediction, a call (COL) block for a target block can be identified. The area of ​​the target block within the target image and the area of ​​the call block within the call image may be identical. In other words, a call block may be a block occupying a specific area within the call image. The specific area may correspond to the area of ​​the target block within the call image.

[0424] A temporal candidate may be a location inside and / or outside a call block within a call image.

[0425] For example, a call block may include a first call block and a second call block. When the upper left coordinates of a call block are (xP, yP) and the size of the call block is (nPSW, nPSH), the first call block may be a block occupying coordinates (xP + nPSW, yP + nPSH). The second call block may be a block occupying coordinates (xP + (nPSW >> 1), yP + (nPSH >> 1)). The second call block may be optionally used as a call block when the first call block is unavailable.

[0426] The MV of the target block can be determined based on the MV of the call block. Scaling can be performed on the MV of the call block. The scaled MV of the call block can be used as the MV of the target block or as the predicted MV. Alternatively, the MV of the temporal candidate stored in the candidate list associated with inter prediction can be a scaled MV.

[0427] The ratio of the scaled MV and the MV of the call block may be equal to the ratio of the first temporal distance and the second temporal distance. The first temporal distance may be the distance between the reference image and the target image of the target block. The second temporal distance may be the distance between the reference image and the call image of the call block.

[0428] The method by which motion information is derived can be determined by the inter prediction mode of the target block. For example, as the inter prediction mode, AMVP mode, merge mode, skip mode, merge mode with MVD, subblock merge mode, GPM, Combined Inter Intra Prediction (CIIP) mode, and affine inter mode can be used. In the embodiments below, each of the inter prediction modes is described.

[0429]

[0430] AMVP mode

[0431] When the AMVP mode is used as a prediction mode, an MV candidate list including one or more MV candidates can be generated using the MV of the spatial candidate, the MV of the temporal candidate, the history-based MV candidate, and the zero vector. At least one of the MV of the spatial candidate, the MV of the temporal candidate, and the zero vector can be determined and used as an MV candidate.

[0432] A spatial candidate may include a reconstructed spatial neighboring block. The MV of the reconstructed spatial neighboring block may be referred to as a spatial MV candidate (spatial motion vector candidate). A temporal candidate may include a called block and a block adjacent to the called block. The MV of the called block or the MV of a block adjacent to the called block may be referred to as a temporal MV candidate (temporal motion vector candidate). A history-based MV candidate may be an MV in a list including MVs of other blocks that were previously encoded / decoded prior to encoding / decoding of the target block.

[0433] The encoding device (110) can use the MV candidate list to determine an MV to be used for encoding the target block within the search range. The maximum number of MV candidates in the MV candidate list can be predefined. N can represent a predefined maximum number. For example, N can be 2. Alternatively, the maximum number of candidates can be signaled from the encoding device to the decoding device or derived from the decoding device. The encoding device (110) can determine an MV candidate to be used as a prediction MV of the target block among the MV candidates in the MV candidate list. The MV to be used for encoding the target block can be an MV that can be encoded at the minimum cost. The encoding device (110) can determine whether to use the AMVP mode in encoding the target block, and can generate AMVP mode usage information indicating whether the AMVP mode is used.

[0434] Inter prediction information may include 1) AMVP mode usage information, 2) MV candidate index, 3) MVD, 4) MVD resolution information, 5) reference direction, and 6) reference image index, and may include a residual block. The inter prediction information may be signaled from the encoding device (110) to the decoding device (150) in the form of a bitstream.

[0435] The decoding device (150) can obtain AMVP mode usage information from the bitstream. If the AMVP mode usage information indicates that the AMVP mode is used, the decoding device (150) can obtain an MV candidate index, an MVD, MVD resolution information, a reference direction, and a reference image index from the bitstream. Among the MV candidates included in the MV candidate list, an MV candidate indicated by the MV candidate index can be selected as the prediction MV of the target block.

[0436] The MVD may represent the difference between the MV to be actually used for inter prediction of the target block and the predicted MV. The encoding device (110) may derive a predicted MV that is close to the MV to be actually used for inter prediction of the target block in order to use an MVD with the smallest possible size. The decoding device (150) may derive the MV of the target block by combining the MVD and the predicted MV. In other words, the MV of the target block derived by the decoding device (150) may be the sum of the MVD and the predicted MV candidate.

[0437] Additionally, the encoding device (110) can generate MVD resolution information. The MVD resolution information may be information used to adjust the resolution of the MVD. The decoding device (150) can adjust the resolution of the MVD using the MVD resolution information.

[0438] Meanwhile, the encoding device (110) can calculate the MVD based on the affine model. The affine control point MV of the target block can be derived based on the sum of the affine control point MV candidate and the MVD. The MV of each subblock within the target block can be derived using the affine control point MV.

[0439]

[0440] Merge mode

[0441] When merge mode is used, a merge candidate list including multiple merge candidates can be generated using motion information of spatial candidates and motion information of temporal candidates. The motion information can include 1) MV, 2) reference image index, and 3) reference direction. The merge candidate can be motion information.

[0442] Merge candidates may include 1) a spatial merge candidate generated based on a spatial candidate, 2) a temporal merge candidate generated based on a temporal candidate, 3) a history-based merge candidate, 4) an average merge candidate, and 5) a zero merge candidate.

[0443] A history-based merge candidate may be motion information within a list that includes motion information of other blocks that were previously encoded / decoded prior to encoding / decoding of the target block.

[0444] An average merge candidate may be a merge candidate generated based on the average of two merge candidates in the merge candidate list.

[0445] A zero merge candidate may be zero vector motion information. Zero vector motion information may be motion information whose MV is a zero vector.

[0446] Merge candidates can be added to the merge candidate list according to a predefined method and a predefined order so that the merge candidate list has a set number of merge candidates. The same merge candidate list can be constructed in the encoding device (110) and the decoding device (150) through the predefined method and the predefined order.

[0447] The encoding device (110) can select a merge candidate to be used for encoding a target block from among the merge candidates in the merge candidate list. The encoding device (110) can determine whether to use a merge mode in encoding the target block, and can generate merge mode usage information indicating whether the merge mode is used.

[0448] Inter prediction information may include 1) merge mode usage information, 2) merge index, and 3) correction information, and may include a residual block. Inter prediction information may be signaled from an encoding device (110) in bitstream form to a decoding device (150) in bitstream form.

[0449] The decoding device (150) can obtain merge mode usage information from the bitstream. If the merge mode usage information indicates that the merge mode is being used, the decoding device (150) can obtain information related to the merge mode, such as a merge index, from the bitstream.

[0450] The encoding device (110) can select an optimal merge candidate from among the merge candidates included in the merge candidate list, and set the value of the merge index to point to the selected merge candidate.

[0451] Correction information may be information used for correcting an MV. The encoding device (110) may generate the correction information. The decoding device (150) may perform correction on the MV of the merge candidate selected by the merge index based on the correction information, thereby deriving a corrected MV. The corrected MV may be used as the MV of the target block.

[0452] In one embodiment, the correction information may include an MVD. 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 is used for the MV. A merge mode that performs correction for the MV based on the correction information may be referred to as a merge mode with an MVD.

[0453] In merge mode, prediction for a target block can be performed using a merge candidate pointed to by a merge index among the merge candidates included in the merge candidate list.

[0454] Motion information of the target block can be derived from 1) MV, 2) reference image index, and 3) reference direction of the merge candidate pointed to by the merge index.

[0455] In one embodiment, the merge candidates in the merge candidate list may be specific modes that derive inter-prediction information. The merge candidate may be information indicating a specific mode that derives inter-prediction information. Inter-prediction information of the target block may be derived according to the specific mode indicated by the merge candidate. From this perspective, a specific mode may be considered a specific inter-prediction information derivation mode or a specific motion information derivation mode. A specific mode may include a series of processes that derive inter-prediction information.

[0456] Inter prediction information of a target block can be derived based on a specific mode indicated by a merge candidate selected by a merge index among the merge candidates in the merge candidate list. For example, the specific modes may include a subblock-level motion information derivation mode and an affine motion information derivation mode, and may include other modes for deriving motion information described in the embodiments.

[0457] Skip mode may be a mode that does not use residual blocks. That is, when skip mode is used, the reconstructed block may be identical to the predicted block. The description of merge mode in the embodiments may also apply to skip mode. The difference between merge mode and skip mode may be whether or not residual blocks are signaled and used. That is, skip mode may be similar to merge mode except that residual blocks are not transmitted / used, and the description of merge mode may also apply to skip mode.

[0458] The subblock merge mode may be a mode in which motion information of a target subblock is derived for a target subblock within a target block. When the subblock merge mode is applied, a list of subblock merge candidates may be generated using affine control point motion vector merge candidates and / or subblock-based temporal merge candidates. The subblock-based temporal merge candidates may be motion information of a call subblock of the target subblock.

[0459] In GPM, a first prediction block and a second prediction block can be generated using two pieces of motion information for a target block. For each coordinate of the target block, a final prediction sample of a final prediction block can be generated using a weighted sum of the first prediction sample of the first prediction block and the second prediction sample of the second prediction block.

[0460] Here, the first weight for the weighted consensus first prediction sample and the second weight for the weighted consensus second prediction sample can be determined based on the boundary of the GPM. The boundary can represent a dividing line that divides the target block. Based on the boundary, the target block can be divided into a first divided region and a second divided region.

[0461] If the distance between the final prediction sample and the boundary is less than or equal to a reference value, the value of the final prediction sample of the final prediction block may be determined using a weighted sum of the first prediction sample of the first prediction block and the second prediction sample of the second prediction block. If the distance between the final prediction sample and the boundary is greater than the reference value, one of the first weight and the second weight may be 1, and the other may be 0.

[0462] Combined Inter-Intra Prediction (CIIP) mode may be a mode that derives a prediction sample of a target block using a weighted sum of prediction samples generated by inter prediction and prediction samples generated by intra prediction.

[0463] In the aforementioned modes, self-improvement of the derived motion information can be performed, and the improved motion information can be used as 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 smallest sum of absolute differences (SAD) value among the searched 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.

[0464] In the aforementioned modes, compensation for prediction samples derived through inter prediction can be performed using optical flow.

[0465]

[0466] Figure 5 shows the order in which spatial candidates are added to the candidate list according to one embodiment.

[0467] In Fig. 5, the locations of spatial candidates are shown.

[0468] The large block in the center can represent the target block. The five smaller blocks adjacent to the target block can represent spatial candidates.

[0469] The coordinates of the target block can be (xP, yP), and the size of the target block can be (nPSW, nPSH).

[0470] A spatial candidate A0 may be a block adjacent to the lower left of the target block. A0 may be a block that occupies samples at coordinates (xP - 1, yP + nPSH).

[0471] A spatial candidate A1 may be a block adjacent to the left of the target block. A1 may be the bottommost block among the blocks adjacent to the left of the target block. Alternatively, A1 may be a block adjacent to the top of A0. A1 may be a block that occupies a sample at coordinates (xP - 1, yP + nPSH - 1).

[0472] A spatial candidate B0 may be a block adjacent to the upper right of the target block. B0 may be a block that occupies a sample at coordinates (xP + nPSW, yP - 1).

[0473] A spatial candidate B1 may be a block adjacent to the top of the target block. B1 may be the rightmost block among the blocks adjacent to the top of the target block. Alternatively, B1 may be a block adjacent to the left of B0. B1 may be a block that occupies a sample at coordinates (xP + nPSW - 1, yP - 1).

[0474] A spatial candidate B2 may be a block adjacent to the upper left of the target block. B2 may be a block that occupies a sample at coordinates (xP - 1, yP - 1).

[0475] As shown in Figure 5, when adding spatial candidates to the candidate list, B1, A1, The order of B0, A0 and B2 can be used, i.e. B1, A1, Available spatial candidates can be added to the candidate list in the order of B0, A0, and B2. The order in which the spatial candidates are added to the merge candidate list illustrated in Fig. 5 may be merely an example.

[0476] The above candidate list may include a motion information candidate list, a merge candidate list, an MV candidate list, a BV candidate list, and an MPM list.

[0477] To include a spatial or temporal candidate in the candidate list, its availability can be determined. If the candidate block is outside the boundaries of an image, slice, or tile, the candidate block's availability can be set to false. The phrase "availability is set to false" can mean "it is set to non-availability."

[0478] The maximum number of candidates in a candidate list can be set. N can represent the set maximum number. The set maximum number can be signaled through a parameter set or header, etc. For example, the maximum number of candidates in the candidate list for a target block within a slice can be set by the slice header. For example, the default value of N can be 5.

[0479]

[0480] IBC mode

[0481] IBC mode may be an intra-block copy prediction mode that generates prediction blocks for target blocks by referencing already-restored regions within the target image. In this respect, IBC mode may also be referred to as a current image reference mode. A block vector (BV) may be used to specify the already-restored region.

[0482] Whether the target block is encoded / decoded in IBC mode can be determined using IBC mode usage information. The encoding device (110) can determine whether to use IBC mode in encoding the target block and can generate IBC mode usage information indicating whether IBC mode is used. The decoding device (150) can obtain IBC mode usage information from the bitstream.

[0483] In IBC mode, a prediction block of a target block can be generated based on a block vector (BV). The BV can specify a reference block. The BV can indicate displacement between the target block and the reference block. The reference block can be a block within the target image. The description of the MV in the embodiments can also be applied to the BV.

[0484] The IBC mode may include skip mode, merge mode, and AMVP mode. The description of the AMVP mode, merge mode, and skip mode of the embodiments may also be similarly applied to the AMVP mode, merge mode, and skip mode of the IBC mode.

[0485] In skip mode or merge mode, a merge candidate list can be constructed, and a merge index can specify one merge candidate among 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.

[0486] In AMVP mode, BVD can be used. The description of MVD in the embodiments can also be applied to BVD.

[0487] The reference block in IBC mode may be limited to a block within an already reconstructed region of the target image. Alternatively, the reference block may be contained within at least one of the target CTU or the left CTUs. For example, the value of BV may be limited so that the reference block is located within a specific region. The specific region may be an area of ​​three blocks of a specific size that are encoded / decoded before the block of a specific size that contains the target block. The specific size may be 64x64.

[0488]

[0489] Transformation and quantization

[0490] A quantized level can be generated by performing transformation and / or quantization on a residual block. The residual block can represent the difference between the original block and the predicted block. A reconstructed residual block can be generated by performing inverse quantization and / or inverse transformation on the quantized level. The reconstructed residual block can represent the difference between the reconstructed block and the predicted block.

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

[0492] The transform kernels used for the transformation may include various DCT kernels such as DCT type 2 (DCT-II), 1) DST kernels, and 3) kernels induced by training. For 1D transform, the DCT type and DST type may include DCT-V, DCT-VIII, DST-I, and DST-VII in addition to DCT-II.

[0493] A set of transforms may be used to determine the DCT type, DST type, or learning-induced kernel to be used for the transformation. Each transform set may include multiple transform candidates. Each transform candidate may be a DCT type, a DST type, or a learning-induced kernel.

[0494] The encoding device (110) can perform transformation and inverse transformation using transformation candidates included in the transformation set. The decoding device (150) can perform inverse transformation using transformation candidates included in the transformation set. Transform selection information indicating which transformation candidate among a plurality of transformation candidates included in the transformation set applied to the residual block is used can be signaled. The transformation selection information can include vertical transformation selection information and horizontal transformation selection information. The vertical transformation selection information can indicate which transformation among the transformations included in the transformation set is used for vertical transformation. The horizontal transformation selection information can indicate which transformation among the transformations included in the transformation set is used for horizontal transformation.

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

[0496] The primary transformation may mean Multiple Transform Selection (MTS), which applies different transformations for each of the 1D directions (i.e., vertical and horizontal directions).

[0497] A secondary transform may be a transform for improving the energy concentration of the transform coefficients generated by the primary transform. The secondary transform may be 1) a separable transform like the primary transform, or 2) a 2D non-separable transform. The 2D non-separable transform may refer to a low frequency non-separable transform (LFNST) or a non-separable primary transform (NSPT).

[0498] NSPT can be applied to specific block sizes such as 4x4, 4x8, 8x4, 4x16, 16x4, 8x8, 8x16, and 16x8 for intra coding.

[0499] The primary transform can be performed using at least one of a plurality of predefined transform methods. For example, the plurality of predefined transform methods can include DCT, DST, and KLT. In addition, the primary transform can be a transform having various transform types according to a transform kernel function defining DCT and DST. For example, the primary transform can include a plurality of transforms such as DCT-2, DCT-4, DCT-5, DCT-7, DCT-8, DST-1, DST-2, DST-4, DST-7, and DST-8 according to a plurality of transform kernels.

[0500] In one embodiment, the transform type may be determined based on coding parameters associated with the target block. For example, the transform type may be determined based on one or more of: 1) a prediction mode of the target block (e.g., one of intra prediction and inter prediction), 2) a size of the target block, 3) a shape of the target block, 4) an intra prediction mode of the target block, 5) a component of the target block (e.g., one of a luma component and a chroma component), and 6) a split type applied to the target block (e.g., one of QT, BT, TT, and non-split).

[0501] As with the first-order transformation, a set of transformations can also be defined for the second-order transformation. The methods for deriving and / or determining the set of transformations of the embodiments can be applied to both the first-order transformation and the second-order transformation.

[0502] In one embodiment, a primary transformation and / or a secondary transformation may be determined for a specific target. The transformation selection information may include transformation target information. The transformation target information may indicate the target to which the primary transformation and / or the secondary transformation is applied.

[0503] For example, a first-order transform and / or a second-order transform may be applied to one or more of the signal components, including the luma component and the chroma component.

[0504] In one 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.

[0505] In one embodiment, whether a primary transform and / or a secondary transform is applied may be determined based on coding parameters for the target / neighboring blocks, such as the size and shape of the target / neighboring blocks.

[0506] In one embodiment, the transform selection information may include primary transform selection information and secondary transform selection information. The primary transform selection information may indicate a transform method to be applied to a residual block among a plurality of transform methods that may be used in the primary transform. The primary transform selection information may be a primary transform index. The secondary transform selection information may indicate a transform method to be applied to a transform coefficient among a plurality of transform methods that may be used in the secondary transform. The secondary transform selection information may be a secondary transform index.

[0507] In one embodiment, the transformation methods of the first and second transformations may each be derived based on specific information such as coding parameters. For example, the coding parameters may include coding parameters for target / neighboring blocks.

[0508] In embodiments, information related to transformation, such as transformation selection information, and sub-information of the transformation selection information may be signaled for a specific target. For example, the specific target may be a CU.

[0509] Information related to transformation, such as transformation selection information, and sub-information of transformation selection information can be derived for a specific target. For example, the specific target may be a CU.

[0510] Quantized levels can be generated by performing quantization on the result or residual block generated by performing the first transform and / or the second transform.

[0511] The description of the transformation described above can also be applied to the inverse transformation. In this application, the reverse processing of the processing described for the transformation can be performed in the inverse transformation. The term "transformation" in the name related to the transformation can be changed to "inverse transformation." Furthermore, the input of the transformation can be considered the output of the inverse transformation. The output of the transformation can be considered the input of the inverse transformation. The decoding device (150) can obtain information related to the transformation, such as transformation selection information, and can perform the reverse processing of the processing related to the transformation indicated by the information related to the transformation using the information related to the transformation.

[0512] A target block may include multiple subblocks. Each subblock may be defined according to a minimum block size or a minimum block shape. The target block may be divided into multiple subblocks, and each subblock may include coefficients of sizes such as 4x4, 2x8, and 8x2. The target block may be a transform block. Transform coefficients or quantized levels may be expressed in the form of a block. The transform coefficients may be quantized transform coefficients.

[0513] The transform coefficients or quantized levels can be scanned according to at least one of the scanning types, such as diagonal scanning, vertical scanning, and horizontal scanning. The diagonal scanning can be right-upper diagonal scanning or left-lower diagonal scanning.

[0514] For example, coefficients can be transformed or arranged into a one-dimensional vector by scanning the coefficients of a block using diagonal scanning. Vertical scanning can scan coefficients in the form of two-dimensional blocks in the column direction. Horizontal scanning can scan coefficients in the form of two-dimensional blocks in the row direction.

[0515] The scanning type for coefficients can be determined based on coding parameters such as the intra prediction mode, block size, and block shape. For example, whether diagonal scanning, vertical scanning, or horizontal scanning is used can be determined based on coding parameters such as the intra prediction mode, block size, and block shape. A block can be a transform unit.

[0516] Scanning for each scanning type can start at a specific starting point and end at a specific ending point.

[0517] In scanning, a scanning order based on the scanning type may first be applied between subblocks. Next, a scanning order based on the scanning type may be applied to transform coefficients or quantized levels within the subblock.

[0518] The encoding device (110) can perform entropy encoding on transform coefficients or quantized levels to generate a bitstream including entropy-encoded transform coefficients or entropy-encoded quantized levels.

[0519] The decoding device (150) can obtain entropy-encoded transform coefficients or entropy-encoded quantized levels from a bitstream and perform entropy decoding to generate transform coefficients or quantized levels. The coefficients can be arranged in the form of two-dimensional blocks through inverse scanning. The arrangement of the inverse scanning can be a rearrangement opposite to the arrangement of the scanning.

[0520] Inverse scanning of coefficients can generate inversely scanned transform coefficients or inversely scanned quantized levels. At this time, the inverse scanning types of the inverse scanning can include diagonal scanning, vertical scanning, and horizontal scanning, and the inverse scanning type of the inverse transformation corresponding to the scanning type of the transformation can be selected.

[0521] In the decoding device (150), inverse quantization can be performed on (inversely scanned) coefficients. Depending on whether a second inverse transform is performed, a second inverse transform can be performed on the result generated by performing inverse quantization. In addition, depending on whether a first inverse transform is performed, a first inverse transform can be performed on the result generated by performing the second inverse transform. A restored residual block can be generated by selectively performing the second inverse transform and the first inverse transform on the coefficients.

[0522]

[0523] Filtering

[0524] To improve the image quality, filtering may be performed on blocks. The values ​​of target samples may be determined or updated through filtering.

[0525] The target sample may be one of the samples described in the embodiments. For example, the target sample may be one or more of the samples described in the embodiments, such as a prediction sample, a reference sample, a residual sample, a restored sample, and a restored sample with filtering applied.

[0526] The target sample may be a sample within one or more of a target picture, a target slice, a target CTB, a target block, a reference sample line, and a template. The target block may be one of the blocks described in the embodiments. For example, the target block may be one or more of the blocks described in the embodiments, such as a transform block, a prediction block, a reference block, a residual block, and a reconstruction block.

[0527] In embodiments, the filtering process described as being applied to one object may also be applied to other objects. For example, the filtering process described in a specific in-loop filtering may also be applied to transform blocks, prediction blocks, reference blocks, and residual blocks.

[0528] A specific type of filtering may be used for the filters of the embodiments. The type of filtering may include filter taps (or filter tap lengths), filter shapes, filter strengths, filter coefficients (or weights), and offsets.

[0529] The filter tab may indicate the number of input samples used for the filter. The input samples may include the target sample. Alternatively, the input samples may include a specific value determined for the target sample. The input samples may include one or more reference samples. The one or more reference samples may be determined based on an attribute of the target block described in the embodiments. The attribute may include a coding parameter. For example, an attribute of the target sample may include a position of the target sample. One or more reference samples may be specified based on a relative position with respect to the position of the target sample.

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

[0531] The number of samples whose values ​​are determined by filtering may be multiple. The filter strength may indicate the range of samples whose values ​​are determined by filtering. The filter strength may be either a strong filtering strength or a weak filtering strength. The number of samples whose values ​​are determined by a strong filtering strength may be greater than the number of samples whose values ​​are determined by a weak filtering strength. Alternatively, the filter strength may indicate the range of values ​​that are changed by filtering. The range of sample values ​​that are changed by a strong filtering strength may be wider than the range of sample values ​​that are changed by a weak filtering strength.

[0532] The filter coefficients can be coefficients or weights of the input samples.

[0533] An offset can be a specific value that is added to the result calculated using the values ​​and coefficients of the input samples, such as a weighted sum.

[0534] Filtering, interpolation, and sampling may have in common that they update the values ​​of samples. Therefore, the description of any one of filtering, interpolation, and sampling in the embodiments may also apply to any other of filtering, interpolation, and sampling. Here, sampling may include at least one of upsampling, downsampling, and subsampling.

[0535] For example, after performing upsampling, downsampling, and subsampling on a reference sample or reference line used for gradient derivation, the gradient can be calculated to derive a gradient histogram and a corresponding prediction mode. At this time, the reference sample or reference line can include at least one of a surrounding restored sample (or restored block), a predicted sample (or predicted block), or a residual sample (or residual block). The derived prediction mode information can be used not only as a prediction mode for generating a predicted sample, but also as a virtual intra-prediction mode for determining a transform kernel or a transform kernel set.

[0536] Filtering may include filtering performed by predictor (123) and predictor (163), etc.

[0537] In encoding a target block, a prediction error may exist between the original samples of the original block and the prediction samples of the prediction block. To reduce the prediction error, filtering may be performed on at least one of the prediction samples of the prediction block and the reference samples referenced for prediction.

[0538] For example, in intra prediction, the reference sample may include one or more of the upper left reference sample, the upper reference sample, the upper right reference sample, the left reference sample, and the lower left reference sample. Filtering on the predicted sample may be performed by applying specific weights to the predicted sample, the left reference sample, the upper reference sample, and / or the upper left reference sample, respectively.

[0539] Filtering of at least one of the prediction sample and the reference sample may be performed based on the attributes of the target block and the attributes of the prediction sample. For example, whether filtering is performed, the type of filter, the area to which the filtering is applied, the filtering weights, the reference sample, the range of the reference sample, and the location of the reference sample may each be determined based on the attributes of the target block and the attributes of the prediction sample.

[0540] For example, the properties of the target block may include information related to the target block described in the embodiments, such as 1) size of the target block, 2) prediction mode, 3) intra prediction mode, 4) reference sample line, 5) sample value, and 6) coding parameter.

[0541] For example, the attributes of a prediction sample may include information related to the prediction sample described in the embodiments, such as 1) a sample value of the prediction sample and 2) a location within a target block, and may include coding parameters related to the prediction sample.

[0542] Filtering may include in-loop filtering performed by filter (130) and filter (170), etc.

[0543]

[0544] Figure 6 illustrates multiple in-loop filters according to an example.

[0545] The plurality of in-loop filters of the in-loop filtering may include one or more of Luma Mapping with Chroma Scaling (LMCS), a deblocking filter, a Sample Adaptive Offset (SAO), and an Adaptive Loop Filter (ALF).

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

[0547] As illustrated in FIG. 6, an input image may be input to the first filter. The input image may be a block described in the embodiments. For example, the input image may be a reconstructed block generated by an adder (129) or an adder (169). The output from one filter may be input to the next filter. An output image may be generated by the last filter. The output image may be a filtered block described in the embodiments. For example, the output image may be a filtered reconstructed image generated by a filter (130) or a filter (170).

[0548] The target block can represent an image input to the filter. The filtered target block can represent an image output from the filter.

[0549] LMCS may include luma signal mapping to a luma signal of a target block and chroma signal scaling to a chroma signal of the target block.

[0550] Luma signal mapping can perform codeword redistribution for the luma signal.

[0551] Luma signal mapping can include forward mapping and reverse mapping. In forward mapping, the existing dynamic range can be divided into multiple intervals. The mapped dynamic range can be determined by performing codeword redistribution on the input image using a linear model for each interval. In reverse mapping, reverse mapping is performed from the mapped dynamic range to the existing dynamic range.

[0552] Chroma scaling can correct chroma signals based on the correlation between a luma signal and a corresponding chroma signal.

[0553] Forward mapping can be performed between inter prediction for a luma signal and reconstruction for the luma signal, and between inter prediction for the luma signal and chroma scaling. Backward mapping can be performed between reconstruction for the luma signal and in-loop filtering for the luma signal. Chroma scaling can be performed between inverse transformation and reconstruction for the chroma signal.

[0554] According to this structure, inverse quantizations for luma and chroma signals, inverse transformations for luma and chroma signals, prediction for luma signals, and restoration for luma signals can be performed within the mapped dynamic range. In-loop filterings for luma and chroma signals, inter predictions for luma and chroma signals, intra prediction for chroma signals, and restoration for chroma signals can be performed within the existing dynamic range.

[0555] A deblocking filter can remove block distortion occurring at boundaries between blocks within a restored image. For example, the blocks may be transform blocks. Furthermore, the blocks may be subblocks of a specific block described in the embodiments. Here, the boundaries between blocks may refer to samples adjacent to the boundaries between blocks.

[0556] Deblocking filters can be applied to vertical and horizontal boundaries between blocks. After filtering the vertical boundaries of blocks, filtering can be performed again on the horizontal boundaries of the filtered blocks.

[0557] A deblocking filter may be applied selectively. Whether to apply a deblocking filter to a target block may be determined based on at least one of the sample(s) contained within a specific number of columns or rows within the target block and the sample(s) contained within a specific number of columns or rows within a neighboring block adjacent to a specific boundary.

[0558] When a deblocking filter is applied to a target block, the filter to be applied may be determined based on the strength of the required deblocking filtering. In other words, among multiple other filters, a filter determined based on the strength of the deblocking filtering may be applied to the target block. The multiple filters may include one of a long-tap filter, a strong filter, a weak filter, and a Gaussian filter.

[0559] 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, components of the target block, and coding parameters.

[0560] SAO can compensate for distortion between the original and reconstructed images on a sample-by-sample basis. To compensate, SAO can apply an appropriate offset to the sample values ​​of each sample. That is, the offset can be added to the sample values.

[0561] An offset can be determined for the target block. For example, an offset can be determined for each component of the CTB. The determined offset can be applied to samples within a specific component of the CTB.

[0562] SAO may include SAO using Edge Offset (EO) and SAO using Band Offset (BO). Depending on the characteristics of samples within a specific block, such as a CTU, whether SAO using EO or SAO using BO may be performed may be determined.

[0563] In SAO using EO, distortion correction of samples can be performed based on the direction of the edge within the target block. Pattern classes of EO can include horizontal patterns, vertical patterns, 135 degree diagonal patterns, and 45 degree diagonal patterns. For a target block, information indicating a pattern class applied to the target block and multiple offsets of the pattern class can be signaled. There can be four offsets. For a target sample within the target block, adjacent samples of the target sample can be determined based on the direction of the pattern class. An offset to be applied to the target sample can be determined based on the pattern of the adjacent samples.

[0564] In an offset using BO, distortion of a sample can be corrected by classifying the brightness values ​​of samples within a target block into specific bands. The bit depth of an input image can be divided into m sections. For example, m can be 32. The specific bands can be n consecutive sections among the m sections. For example, n can be 4. N offsets for the n sections can be signaled. Additionally, information indicating a first section selected as one of the n sections among the m sections can be signaled. The offset of the section to which the target sample corresponds can be added to the sample value of the target sample of the target unit.

[0565] ALF can compensate for distortion between the restored image and the original image.

[0566] The filter coefficients of ALF can be signaled via the bitstream.

[0567] The filter shape of ALF can be determined by the components of the target block. For example, a 7x7 diamond-shaped filter can be used for the luma component. A 5x5 diamond-shaped filter can be used for the chroma component.

[0568] In ALF, the characteristics of a specific block can be determined for a specific block, and the class of the specific block can be determined based on the characteristics. In other words, the determination of characteristics and class of ALF can be performed in units of 4x4 blocks. Filter coefficients can be calculated based on the class. A specific block can be a 4x4 block.

[0569] One of 25 classes can be determined as the class of a specific block based on the direction and activity determined using the gradient of the specific block. Rotation, vertical symmetry, and / or diagonal symmetry transformations can be applied to the filter based on the gradient of the specific block.

[0570] Information regarding whether ALF applies can be signaled for specific units, such as CTB.

[0571] An index indicating a filter to be applied to a specific unit among available filters may be signaled. 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). The fixed filters may be identically predefined in the encoding device (110) and the decoding device (150). The filter coefficients of the filters configured using the parameter set may be determined based on coding parameters.

[0572]

[0573] Entropy encoding and entropy decoding

[0574] Figure 7 illustrates entropy encoding and entropy decoding according to an example.

[0575] The processes of entropy encoding by the entropy encoder (139) are illustrated at the top of Fig. 7.

[0576] The entropy encoder (139) may include a context modeler, a binarization unit, and an entropy encoder. The context modeler may include a context selection unit and a context memory.

[0577] The binarization unit can generate bins for syntactic elements by performing binarization on the syntactic elements of the target block. Binarization may be a process of converting syntactic elements into the form of bins.

[0578] Information about syntactic elements and bins can be provided from the binarization unit to the context selection unit.

[0579] A context modeler can perform context updates.

[0580] Context can mean occurrence probability information for each bin for syntactic elements that have already been encoded.

[0581] The context modeler can update the context to apply current probability information to the entropy encoding of the bins of the syntactic elements of the target block. The updated context can be stored in the context memory. At this time, the updated context corresponding to the syntactic elements of the target block (or bins within the syntactic elements of the target block) can be derived by the context modeler.

[0582] The context selector can select a context corresponding to a bin of a syntactic element of a target block. The selected context can be loaded from the context memory and used as an updated context for entropy encoding of the bins of the syntactic element of the target block.

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

[0584] The entropy encoding unit can generate encoded information about syntactic elements of a target block by performing entropy encoding using the generated bins and the updated context, and can generate a bitstream including the encoded information. The entropy encoding unit can use at least one of an arithmetic encoding method and a bypass encoding method.

[0585] The processes of entropy decryption by the entropy decoder (161) are shown at the bottom of Fig. 7.

[0586] The entropy decoder (161) may include a context modeler, an entropy decoder, and an inverse binarizer. The context modeler may include a context selection unit and a context memory.

[0587] A context modeler can perform context updates.

[0588] Context can mean the occurrence probability information of each bin for syntactic elements that have already been decoded.

[0589] The context modeler can update the context to apply the currently decoded probability information to entropy decoding for the bins of the syntactic elements of the target block. The updated context can be stored in the context memory. At this time, the updated context corresponding to the syntactic elements of the target block (or the bins within the syntactic elements of the target block) can be derived by the context modeler.

[0590] The context selector can select a context corresponding to a blank of a syntactic element of a target block. The selected context can be loaded from the context memory and used as an updated context for entropy decoding of the syntactic element of the target block.

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

[0592] The entropy decoding unit can generate bins for the delimiting elements of the target block by performing entropy decoding on the encoded information of the bitstream based on the updated context. The entropy decoding unit can use at least one of an arithmetic decoding method and a bypass decoding method.

[0593] The debinarization unit can obtain a syntactic element of the target block by performing debinarization on at least one of the generated bins. The debinarization may be a process of converting at least one of the bins into a form of a syntactic element.

[0594] Information about syntactic elements and bins can be provided from the de-binarization unit to the context selection unit.

[0595] A syntax element may be one of the coding parameters described in the embodiments.

[0596]

[0597] Methods for binarization, debinarization, entropy encoding, and entropy decoding

[0598] In embodiments, one or more of the binarization methods, inverse binarization methods, entropy encoding methods and entropy decoding methods listed below may be used to perform signaling for specific information.

[0599] - Signed 0-th order Exponential Golomb binarization / debinarization method (abbreviated as se(v))

[0600] - k-order exponential-Golomb binarization / inverse binarization method with sign (abbreviated as sek(v))

[0601] - 0-order exponent-Golomb binarization / inverse binarization method for unsigned positive integers (abbreviated as ue(v))

[0602] - k-order exponential-Golomb binarization / inverse binarization method for unsigned positive integers (abbreviated as uek(v))

[0603] - Fixed-length binarization / debinarization method (abbreviated as f(n))

[0604] - Truncated Rice binarization / debinarization method or truncated unary binarization / debinarization method (abbreviated as tu(v))

[0605] - Truncated binary binarization / debinarization method (abbreviated as tb(v))

[0606] - Context-adaptive arithmetic encoding / decoding method (abbreviated as ae(v))

[0607] - bit string in bytes (abbreviated as b(8))

[0608] - Signed integer binarization / debinarization method (abbreviated as i(n))

[0609] - Unsigned positive integer binarization / debinarization method (abbreviated as u(n)) ('u(n)' can also mean fixed-length binarization / debinarization method.)

[0610] - Unary binarization / inverse binarization method

[0611]

[0612] Adaptive execution of the processes of the embodiments

[0613] The processing of the embodiments can be performed in the same and / or corresponding manner in the encoding device (110) and the decoding device (150). In addition, a combination of one or more of the above embodiments can be used in encoding and / or decoding of an image.

[0614] The order in which the embodiments are applied may be different in the encoding device (110) and the decoding device (150). Alternatively, the order in which the embodiments are applied may be (at least partially) the same in the encoding device (110) and the decoding device (150).

[0615] The processing of the embodiments may be performed for each specific object. The processing of the embodiments may be performed identically for specific objects. For example, a specific object may include a luma signal and a chroma signal.

[0616] The processing of the embodiments can be selectively applied / performed based on specific conditions or specific targets.

[0617] In one embodiment, the processing of the embodiment may be selectively applied / performed according to a temporal layer. Temporal layer information for a specific processing may be information indicating a temporal layer to which the processing may be applied / performed. Temporal layer information may be signaled for a specific processing. The temporal layer information may indicate the lowest layer and / or highest layer to which the specific processing may be applied, and may indicate a specific layer to which the specific processing is applied / performed. Alternatively, a fixed temporal layer to which the processing of the embodiment is applied / performed may be defined.

[0618] In one embodiment, a type to which processing of the embodiments is applied / performed may be defined, and whether processing of the embodiment is applied / performed may be determined based on the defined type. The type may include a picture type, a slice type, a tile group type, etc.

[0619] According to the description of the embodiments, when applying / performing a specific process to a specific object, a specific condition may be required, and the specific process may be processed under a specific decision. If it is determined whether a specific condition is met based on a specific coding parameter, or a specific decision is made based on a specific coding parameter, it can be interpreted that such a specific coding parameter can be replaced with another coding parameter. In other words, the coding parameters that affect a specific condition or a specific decision described in the embodiments can be considered merely exemplary, and in addition to the specified coding parameter, one or more other coding parameters, or a combination of one or more other coding parameters, can be understood to perform the role of the specified coding parameter.

[0620] The processing of the embodiments may be applied / performed based on the size of at least one of the blocks described in the embodiments. For example, the blocks may include a coding block, a prediction block, a transform block, a reference block, a current block, and a target block. Alternatively, the blocks may include adjacent blocks of the embodiments. Here, the size may be defined as a minimum size and / or a maximum size for the processing of the embodiments, or may be defined as a fixed size for the processing of the embodiments. In addition, for the processing of the embodiments, the first embodiment may be applied to a first size, and the second embodiment may be applied to a second size. In other words, the processing of the embodiments may be applied in a complex manner depending on the size. In addition, the processing of the embodiments may be applied only when the size of the block is greater than or equal to the minimum size and less than or equal to the maximum size. In other words, the processing of the embodiments may be applied only when the size of the block is within a specific range.

[0621]

[0622] In the embodiments, the methods may be described based on a flowchart comprising a series of steps or units. The methods of the embodiments are not limited to the described order of the steps, and some steps may be performed in a different order than the described order or may be performed concurrently with other steps. Furthermore, the steps described by the flowchart or the like may not be exclusive. Other steps may be included between the steps described by the flowchart or the like. One or more steps described by the flowchart or the like may be deleted or omitted.

[0623] The embodiments may include examples of various aspects. While not all possible combinations to illustrate various aspects can be described, those skilled in the art will recognize that other combinations are possible in addition to those explicitly described. Accordingly, the present invention encompasses all other alterations, modifications, and variations that fall within the scope of the following claims.

[0624] The embodiments may be implemented in the form of program instructions that can be executed through various computer components and recorded on a computer-readable recording medium.

[0625] The computer-readable recording medium may include a non-transitory computer-readable recording medium. The computer-readable recording medium may include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and hardware devices specifically configured to store and execute program instructions such as ROMs, RAMs, flash memories, and the like. The hardware devices may be configured to operate as one or more software modules to perform processes according to the embodiments, and vice versa.

[0626] A computer-readable recording medium may contain program commands, data files, data structures, etc., either singly or in combination. The program commands recorded on the computer-readable recording medium may be specially designed and configured for the embodiments, or may be known and available to those skilled in the art of computer software.

[0627] Program instructions may include machine language code, such as that generated by a compiler, or may include high-level language code that can be executed by a computer using an interpreter or the like. Program instructions may also be referred to as computer-executable code or a program. In embodiments, program instructions, computer-executable code, and a program may be interchangeable.

[0628] A computer-readable recording medium may contain information used in the embodiments. For example, the computer-readable recording medium may contain a bitstream, and the bitstream may contain information described in the embodiments. The information described in the embodiments may include syntax elements. The information described in the embodiments, such as syntax elements, may be understood as computer-executable code in that it drives an encoding device and a decoding device to perform specific processing.

[0629] A bitstream may contain computer-executable code. The computer-executable code may include information described in the embodiments, such as syntax elements. In other words, information described in the embodiments, such as syntax elements, may be considered computer-executable code within the bitstream or a part of the computer-executable code.

[0630] Although the present invention has been described above with specific details such as specific components and limited embodiments and drawings, such descriptions are provided only to help a more general understanding of the present invention, and the present invention is not limited to the described embodiments, and those with ordinary knowledge in the technical field to which the present invention pertains can make various modifications and variations from this description.

[0631] Therefore, the spirit of the present invention should not be limited to the described embodiments, and all modifications equivalent to or equivalent to the claims described below, as well as the claims, are considered to fall within the scope of the spirit of the present invention.

[0632]

[0633] In this specification, the decoder-side intra-mode derivation (DIMD) method may refer to a method of improving MPM prediction efficiency by adding a prediction mode derived by calculating the gradient of surrounding pixels in intra-screen prediction to the MPM list. At this time, the decoder side may also add a prediction mode derived by calculating the gradient of surrounding pixels when constructing the MPM list, just like in the encoder.

[0634] In this specification, the intra-template matching method may mean a method of constructing a template using surrounding pixels during intra-screen prediction, and using the area most similar to the current template from the restored area in the current image as a prediction block for the current block.

[0635] In this specification, the Template-based Intra Mode Derivation (TIMD) method may mean a method of creating a template for prediction modes in an MPM list, calculating an error cost (e.g., SAD, SATD) for each prediction mode, and deriving a prediction mode based on the calculated error cost.

[0636]

[0637] Figure 8 illustrates a flowchart of the video encoding / decoding method and device of the present disclosure.

[0638] [E1 / D1] Step for deriving prediction signals for prediction / decoding

[0639] In generating (or deriving) a prediction signal for prediction encoding / decoding, a prediction signal can be generated through a decoder-side intra mode derivation (DIMD) method.

[0640] The method for deriving a prediction mode and a prediction signal through the above “decoder-side screen prediction mode derivation method” may include (STEP 1) a step of deriving a histogram of gradients (HoG) for a current block (or a target block), and (STEP 2) a step of generating a prediction block for each of the determined prediction modes and performing prediction encoding / decoding.

[0641] Figure 9 illustrates an example of a window for calculating HoG and the occurrence frequency of a directional prediction mode (or directional element) corresponding to the HoG.

[0642] (STEP 1) The step of deriving the Histogram of Gradient (HoG) for the current block (or target block).

[0643] By using at least one restored sample (or line, block, or region) adjacent to or around the current block as a template, the gradient value (slope value) for the samples within the template region can be obtained.

[0644] At this time, the gradient value for the corresponding sample can be obtained for each of the horizontal (Gx) and vertical (Gy) directions.

[0645] Figure 10 illustrates examples of various forms of template configuration.

[0646] The template area for calculating the gradient histogram (HoG) can be configured as shown in Fig. 10.

[0647] For example, as shown in FIG. 10, multiple templates can be generated using at least one of the upper left area, upper area, and left area of ​​a predetermined size around the current block (or target block).

[0648] At this time, the first template can create a template using the upper left area, upper area, and left area of ​​a predetermined size.

[0649] At this time, the second template can create a template using an upper left area of ​​a predetermined size.

[0650] At this time, the third template can create a template using the upper left area and upper area of ​​a predetermined size.

[0651] At this time, the fourth template can create a template using the upper left area and the left area of ​​a predetermined size.

[0652] At this time, the fifth template can create a template using an upper area of ​​a predetermined size.

[0653] At this time, the 6th template can create a template using a left area of ​​a predetermined size.

[0654] At this time, the 7th template can create a template using an upper area and a left area of ​​a predetermined size.

[0655] Template matching can be performed using at least one of the above templates. In this case, the template information used for template matching can be a value preset in the encoder / decoder, or a value signaled from the encoder to the decoder.

[0656] The size and shape of the template can be determined using the sub / decryption information of the current block or surrounding blocks.

[0657] At this time, the size and shape of the template can be changed depending on the size of the current block or surrounding blocks.

[0658] For example, if the size of the current block or surrounding blocks is smaller than a threshold, the template can be configured by reducing lines or pixels or the size of the template can be reduced.

[0659] For example, if the size of the current block or surrounding blocks is smaller than a threshold, the template can be configured by increasing the lines or pixels or the size of the template can be increased.

[0660] For example, if the size of the current block or surrounding blocks is larger than a threshold, the template can be configured by reducing lines or pixels or the size of the template can be reduced.

[0661] For example, if the size of the current block or surrounding blocks is larger than a threshold, the template can be configured by increasing the lines or pixels or the size of the template can be increased.

[0662] The size of the current block or surrounding blocks can be determined based on the statistical values ​​of the width and height of the block.

[0663] Alternatively, the size of the current block or surrounding blocks can be determined by max(width, height), min(width, height), or average.

[0664] In determining the template size based on encoding information, the template size can be different depending on the block division information.

[0665] For example, the size of the template located on the larger surface of the split block can be increased. For example, if the upper surface of the split block is a larger rectangle, the size of the template in the upper area can be larger than that of the template in the left area when the template is generated using the upper area and the left area.

[0666] Figure 11 illustrates an example of a juxtaposition block.

[0667] When constructing a template, the template can be constructed using the motion vector or block vector of the surrounding or collocated blocks (Fig. 11).

[0668] For example, a template can be constructed based on the position indicated by the motion vector or block vector. For example, a template can be constructed around the position. In another example, a template can be constructed with the position as the upper left corner of the template.

[0669] The orientation based on the gradient value or the angular mode corresponding to the orientation can be derived as follows.

[0670] Orient = G y / G x

[0671] Derivation of the directional prediction mode can be performed by mapping the directional prediction mode having the same or similar directionality as the directionality calculated by the above equation.

[0672] Figures 12 and 13 illustrate examples of surrounding blocks used for inheritance of histogram (HoG).

[0673] The Gradient Histogram (HoG) can be used not only by calculating the current block's template, but also by inheriting the Gradient Histogram (HoG) calculated from at least one neighboring block. (Figures 11-13)

[0674] For example, one can inherit the gradient histogram from a block that is spatially adjacent to the current block.

[0675] For example, one can inherit gradient histograms from blocks that are spatially non-adjacent to the current block.

[0676] For example, the gradient histogram can be inherited from a block in the temporal adjacent or juxtaposed position of the current block.

[0677] For example, you can inherit the gradient histogram from a block at the current block's history-based position.

[0678] At this time, the block of the history-based position can be determined based on a list in the form of FIFO (First In First Out). At this time, according to FIFO, that is, according to the order in which the gradient histogram (HoG) is stored in the list in the order of encoding / decoding, the block of the history-based position obtained from the list can be used.

[0679] For example, one can inherit gradient histograms from blocks of temporally / spatially adjacent / non-adjacent positions, adjusted using the block vector / motion vector of the current block.

[0680] At this time, the positions of blocks within the same picture as the block from which the block vector / motion vector is derived can be adjusted.

[0681] At this time, the positions of blocks within a picture other than the block from which the block vector / motion vector is derived can be adjusted.

[0682] At this time, the positions of all available candidate blocks can be readjusted regardless of the picture to which the block from which the block vector / motion vector is derived belongs.

[0683] At this time, the gradient histogram (HoG) for the current block can be inherited and used from the surroundings without calculating it.

[0684] At this time, the gradient histogram (HoG) derived from the current block and the gradient histogram inherited from the surroundings can be combined and used. Here, the sum may include a weighted sum.

[0685] At least one prediction mode can be derived from the gradient histogram (HoG) inherited from the positions of the above examples to generate a prediction signal.

[0686] The gradient histogram (HoG) information calculated in the current block can be stored and used.

[0687] At this time, the gradient histogram (HoG) information stored in the current block may include gradient histogram values ​​(cumulative occurrence frequency (or magnitude) for each directional element or corresponding directional prediction mode), template information from which the corresponding gradient value was obtained, etc.

[0688] The cumulative occurrence frequency of HoGs for each corresponding directional prediction mode can be specifically determined based on the number of samples encoded with a specific intra prediction mode.

[0689] At this time, the gradient values ​​can be stored separately according to the type or location of the template that calculated the gradient.

[0690] For example, gradient histograms can be computed using gradient values ​​derived from the left, top, and left and top (L-shaped) sides, respectively, and stored separately (storing them by template position / direction).

[0691] At this time, if there are directions where there are no available restoration samples, the gradient histogram stored for each template location can be used.

[0692] For example, if there are no available restoration samples on the left side of the current block or a template cannot be constructed, gradient histogram (HoG) information can be inherited and used from surrounding blocks. In this case, only the gradient histogram information calculated from the left template can be inherited and used.

[0693] At this time, at least one of the orientation elements or corresponding angular mode information on the gradient histogram can be selected and stored.

[0694] For example, the values ​​included in the directional element or corresponding directional mode (angular mode) information on the gradient histogram may be the directional mode value (index) and the histogram value (occurrence frequency) for each element (directional mode).

[0695] When storing directional element information or corresponding directional mode information, the directional element or directional mode to be stored can be determined based on the cumulative number of occurrences (occurrence frequency) on the histogram.

[0696] For example, after sorting in descending order of accumulated counts, N elements (or directional prediction modes) with the highest accumulated counts can be selected and stored. In this case, the number of elements N to be stored can be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0697] For example, only elements whose cumulative count exceeds a certain threshold can be selected and stored. The threshold can be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0698] When storing directional element information on a gradient histogram or the (cumulative) occurrence frequency by corresponding directional mode, it can be stored in units of a specific size, such as upper-size block units / CTU units / pictures / tiles / slices.

[0699] For example, in CTU units, the gradient histogram computed in sub-partitions or the occurrence frequency values ​​for each element (by directional mode) can be summed and stored.

[0700] For example, in MxN block units, the occurrence frequency values ​​for each element (by directional mode) can be summed and stored. At this time, the width and height M and N to be stored can be values ​​preset in the encoder / decoder or values ​​signaled from the encoder to the decoder.

[0701] When storing directional element information on a gradient histogram or (cumulative) occurrence frequency by corresponding directional mode, the maximum accumulated number of occurrence frequencies by each directional element (by directional mode) can be limited.

[0702] At this time, the maximum accumulated number of occurrences per prediction mode (directional element) can be limited to M. For example, it can be limited to a maximum of 32 / 64 / 128 / 256. At this time, the number M can be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0703] When storing gradient histogram information, the size of the sum of occurrence frequencies on the entire gradient histogram can be limited.

[0704] When storing directional element information on a gradient histogram or the (cumulative) occurrence frequency by corresponding directional mode, the occurrence frequency by each directional element (by directional mode) can be scaled and used.

[0705] At this time, scaling can be expressed in the form of adding, subtracting, dividing, or multiplying a specific value to the occurrence frequency.

[0706] For example, you can store the accumulated count value for each directional element (for each directional mode) after dividing it by N (e.g. 2).

[0707] For example, you can store the accumulated count value for each directional element (for each directional mode) after multiplying it by M (for example, 0.5).

[0708] For example, the cumulative count value for each directional element (directional mode) can be stored by subtracting the average value of the entire histogram. In this case, the average value of the entire histogram can be the average of the occurrence frequencies for each directional element (directional mode).

[0709] (STEP 2) Step of generating prediction blocks for each determined prediction mode and performing prediction decoding / decoding.

[0710] At least one directional prediction mode can be derived using a Histogram of Gradients (HoG). Using the derived prediction mode information, a prediction block can be generated and prediction encoding / decoding performed.

[0711] Multiple prediction modes can be derived through the Histogram of Gradients (HoG), and a new prediction block (signal) can be generated through weighted sum / fusion / blending of these.

[0712] At this time, the prediction mode to be used for the weighted sum can be determined based on the cumulative number of occurrences (frequency of occurrence) for each directional mode on the histogram.

[0713] For example, after sorting in descending order of accumulated counts, N prediction modes with higher accumulated counts can be selected and used. In this case, the number of selected prediction modes N can be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0714] For example, only directional prediction modes (directional elements) with a cumulative count greater than a certain threshold can be selected and used. The threshold can be a value preset in the encoder / decoder or a value signaled from the encoder to the decoder.

[0715] At this time, the prediction mode to be used for weighted sum can be determined based on the encoding cost.

[0716] Here, the encoding cost refers to the cost calculated for calculating the difference between the original block (signal) and the prediction block generated using the directional prediction mode derived through the gradient histogram (HoG), or for encoding the residual signal generated thereby. Examples include SAD, SSE, and SATD, which represent the error value between two signals, and the rate-distortion cost, which adds the cost required to encode the residual signal to the error value.

[0717] In the above, in the prediction mode determination based on the encoding cost, after generating a prediction block for each prediction mode, the encoding cost can be calculated through prediction encoding, and the prediction modes to be used for the weighted sum can be determined according to the encoding cost.

[0718] For example, after sorting the encoding costs in descending order, at least one prediction mode with a lower encoding cost can be selected and used. At this time, information about the selected prediction mode can be signaled from the encoder to the decoder.

[0719] For example, only prediction modes (directional elements) with an encoding cost lower than a certain threshold can be selected and used. In this case, information about the selected prediction mode can be signaled from the encoder to the decoder.

[0720] Generation of a prediction signal using the above weighted sum can be performed optionally.

[0721] For example, it may not apply to color difference signals.

[0722] For example, from a rate-distortion optimization perspective, one can compare methods using weighted sums with methods that do not, determine the optimal method, and signal information about the optimal method from the encoder to the decoder.

[0723] At this time, after generating a prediction block for each prediction mode in the prediction mode decision based on the encoding cost, the encoding cost can be calculated through prediction encoding, and the prediction modes to be used for the weighted sum can be determined according to the encoding cost.

[0724] At this time, information about whether a weighted sum method is used and the prediction mode used for weighting can be signaled from the encoder to the decoder.

[0725] At this time, the prediction mode to be used for the weighted sum can be determined based on the error value between prediction blocks generated using multiple prediction modes derived through the gradient histogram (HoG).

[0726] For example, if there are five prediction modes derived through the Histogram of Gradients (HoG), a prediction block can be generated for each of the five predictions and the error values ​​(SAD, SSE, SATD) between each prediction block can be obtained.

[0727] Here, it can be composed of a total of 10 errors, including the error between each of prediction block 1 and prediction blocks 2-5, the error between each of prediction block 2 and prediction blocks 3-5, the error between each of prediction block 3 and prediction blocks 4-5, and the error between prediction block 4 and prediction block 5.

[0728] Among the above prediction modes, at least one pair with a small error value can be selected and determined as the prediction mode to be used for weighted sum.

[0729] At this time, a pair having an error value smaller than a certain threshold can be selected and determined as the prediction mode to be used for the weighted sum.

[0730] At this time, pairs with error values ​​greater than a certain threshold can be selected and excluded from the prediction mode to be used in the weighted sum.

[0731] Prediction blocks can be generated for each of the above-determined directional prediction modes and weighted to generate a new prediction block.

[0732] In generating a prediction block through the above weighted sum, the prediction block can be generated through a weighted sum of a prediction block determined through the gradient histogram (HoG) and a prediction block generated through a different prediction method.

[0733] At this time, other prediction methods may include inter-screen prediction, intra-screen template matching (Intra TMP), intra-block copy (IBC) prediction, Matrix-weighted Intra Prediction (MIP), non-directional prediction including Planar and DC, in addition to “decoder-side intra-screen prediction mode induction (DIMD).”

[0734] At this time, in the prediction block generation through the above weighted sum, not only the directional prediction mode (angular mode) determined through DIMD but also non-directional prediction modes such as DC, Planar, IntraTMP, and IBC can be used. In addition, in the case of chrominance signals, a new prediction block can be generated through a weighted sum with a prediction block generated through inter-component prediction (CCLM, GLM, CCCM, etc.).

[0735] For example, a new prediction block can be generated by weighting the N (e.g., 5) prediction modes derived from the above DIMD process and one prediction mode determined based on the template matching cost among the non-directional prediction modes. At this time, a new prediction block can be generated by weighting two prediction blocks derived through a gradient histogram and a prediction block generated through planar prediction.

[0736] In the above weighted sum process, the weights can be equal or differential.

[0737] The weights to be used in the above weighted sum process may be predefined weights.

[0738] At this time, multiple weight sets can be defined and used, and the optimal weights in terms of encoding cost can be selected for each weight set. At this time, information (set index) of the selected weight set can be signaled from the encoder to the decoder.

[0739] For example, when the weights for two prediction blocks are w0 and w1 respectively, the weight sets can be determined as 1: {w0,w1}={1 / 4, 3 / 4}, 2: {w0,w1}={3 / 4, 1 / 4}, 3: {w0,w1}={1 / 2, 1 / 2}.

[0740] At this time, the weight set can be distinguished and used according to the prediction mode information of the surrounding blocks.

[0741] For example, if both the left and top blocks are blocks encoded in component-by-component prediction mode, set 1 can be used.

[0742] For example, if both the left and top blocks are blocks encoded in a prediction mode other than the component-by-component prediction mode, set 2 can be used.

[0743] In determining the above weight, it can be determined based on the frequency of occurrence of the histogram for each directional element (for each directional prediction mode).

[0744] At this time, a higher weight can be given to the prediction block generated through the prediction mode with a high occurrence frequency.

[0745] For example, if the occurrence frequency of prediction mode 1 is amplitude(pred1), the occurrence frequency of prediction mode 2 is amplitude(pred2), and the respective weights are w1 and w2, each weight can be defined as follows.

[0746] W1= amplitude(pred1) / (amplitude(pred1) + amplitude(pred2))

[0747] W2=amplitude(pred2) / (amplitude(pred1) +amplitude(pred2))

[0748] At this time, the weights between the prediction block determined through the gradient histogram (HoG) and the prediction block generated using a different prediction method can be different.

[0749] At this time, the weights for the prediction blocks generated by different prediction methods are fixed, and the weights for the prediction modes (blocks) determined through the gradient histogram (HoG) can be determined based on the occurrence frequency.

[0750] For example, when performing weighting on a block determined through planar prediction and two predicted blocks derived through a gradient histogram, the weight of the block determined through planar prediction can be fixed to 1 / 3, and the weights for the remaining predicted blocks can be determined based on the occurrence frequency for each prediction mode on the gradient histogram (HoG).

[0751] In determining the above weights, the weights can be different depending on the size of the gradient histogram (HoG) for each template.

[0752] Here, the weight W for the sample at sample location (x, y) within the prediction block induced by prediction mode i i (x, y) can be defined as follows (where i can be the index of the prediction mode).

[0753] Formula 1) W i (x,y)=wDIMD i +a i -2*a i *(y / (H-1)) or

[0754] Equation 2) W i (x,y)=wDIMD i +a i -2*a i *(y / (W-1))

[0755] wDIMDi refers to the weight according to the occurrence frequency of prediction mode i on the gradient histogram (HoG) defined above, and is the weight according to the occurrence frequency of prediction mode i.

[0756] H is the vertical size of the block (Height), W is the horizontal size of the block (Width)

[0757] a i is a constant value, where a i can be 10 days.

[0758] When selecting Equations 1) and 2) to determine a weight for a sample located at coordinates (x, y) within a prediction block derived by the above prediction mode i, if the size of the gradient histogram (HoG) of the upper template is N times larger than the size of the gradient histogram (HoG) of the left template, the weight for the pixel location (x, y) can be determined using Equation 1). Conversely, if the size of the gradient histogram (HoG) of the left template is N times larger, the weight for the pixel location (x, y) can be determined using Equation 2). In this case, N can be 2.

[0759] In chrominance signal prediction, the chrominance prediction mode can be derived using a gradient histogram (HoG) derived from a surrounding template, as in the luminance signal.

[0760] At this time, a prediction signal (block) can be generated using at least one prediction mode derived through a gradient histogram (HoG).

[0761] At this time, multiple prediction modes can be derived to generate at least one prediction signal (block).

[0762] If the above-described derived predicted prediction mode is identical to the prediction mode determined as the integrated mode (DM: Direct Mode) in the color difference prediction, the prediction mode having the second-highest occurrence frequency on the gradient histogram (HoG) can be used as a candidate mode for the color difference prediction.

[0763] A new prediction block can be generated by adding the weights of a prediction block generated using the above-described induced prediction mode and a prediction block generated through component-to-component prediction (CCLM, GLM, CCCM, etc.).

[0764] In performing the decoder-side in-screen prediction mode derivation (DIMD), a plurality of templates can be configured to derive a gradient histogram (HoG).

[0765] At this time, prediction blocks can be generated by going through the above (STEP1) / (STEP2) process for each template, and prediction encoding can be performed using each prediction block.

[0766] During the above predictive encoding process, encoding costs can be compared to determine the optimal template. At this time, information about the optimal template can be signaled from the encoder to the decoder.

[0767] In performing the above decoder-side screen prediction mode derivation (DIMD), merge prediction for gradient histogram (HoG) can be performed.

[0768] A merge candidate list can be constructed by inheriting the gradient histogram (HoG) from the block positions that can inherit the previously defined gradient histogram (HoG).

[0769] An angular mode can be derived through a gradient histogram (HoG) in the above merge list, and a prediction block (signal) can be generated using the derived prediction mode.

[0770] At this time, the prediction block can be generated not only using a single prediction mode, but also through a weighted sum of prediction blocks generated through multiple prediction modes.

[0771] After performing prediction encoding using the prediction block generated through the above-described induced prediction mode, the encoding cost for each candidate in the merge list can be calculated.

[0772] The above-calculated encoding costs can be compared to determine the optimal candidate within the merge list. At this time, index information for the corresponding gradient histogram (HoG) within the merge list (the optimal candidate index within the list) can be signaled from the encoder to the decoder.

[0773] Whether or not the decoder-side screen prediction mode induction (DIMD) method is performed can be signaled from the encoder to the decoder.

[0774]

[0775] [E1 / D1] Step for deriving prediction signals for prediction / decoding

[0776] In generating prediction signals for prediction encoding / decoding, prediction signals can be generated through a template-based intra mode derivation (TIMD) method.

[0777] Derivation of a prediction mode and a prediction signal through the above template-based screen prediction mode derivation method can be performed through the following steps.

[0778] (STEP 1) Step to construct the MPM (most probable mode) list for the current block (or target block)

[0779] For example, the block location for inheriting the intra prediction mode (IPM) information required to construct the MPM list may include the spatial adjacent location of the current block (or target block).

[0780] For example, the block location for inheriting intra prediction mode (IPM) information required for constructing an MPM list may include a spatial non-adjacent location of the current block (or target block).

[0781] For example, the block position for inheriting intra prediction mode (IPM) information required for constructing an MPM list may include a temporal adjacent position or collocated position of the current block (or target block).

[0782] For example, the block position for inheriting intra prediction mode (IPM) information required to construct the MPM list may include the history-based position of the current block (or target block).

[0783] At this time, the history-based position can be determined based on a list in the form of FIFO (First In First Out). At this time, according to FIFO, that is, the history-based position obtained from the list can be used according to the order in which the prediction mode information is stored in the list in the order in which it was encoded / decoded.

[0784] For example, the block positions for inheriting the intra prediction mode (IPM) information required to construct the MPM list may include temporal / spatial adjacent / non-adjacent positions adjusted using the block vector / motion vector of the current block (or target block).

[0785] At this time, the positions of blocks within the same picture as the block from which the block vector / motion vector is derived can be adjusted.

[0786] At this time, the positions of blocks within a picture other than the block from which the block vector / motion vector is derived can be adjusted.

[0787] At this time, the positions of all available candidate blocks can be readjusted regardless of the picture to which the block from which the block vector / motion vector is derived belongs.

[0788] Among the above positions, a block at a temporal position can be used as a block position for inheriting an intra-picture prediction mode when performing intra-picture prediction in an inter-picture (B-picture, P-picture).

[0789] The MPM list, including the block positions for inheriting the intra prediction mode (IPM) information within the above screen, can be constructed using a combination of the following methods. (Figs. 11-13) (i.e., this can be performed using some or all of the methods below.)

[0790] Method (1) MPM_LIST[0] = PLANAR_IDX

[0791] That is, the first candidate in the MPM list can be added in planar mode.

[0792] Alternatively, a prediction mode derived using block vectors can be used instead of the Planar mode.

[0793] At this time, the prediction mode of the block pointed to by the block vector inherited from the surrounding block or the juxtaposed block can be used.

[0794] Method (2) The best prediction mode stored in the spatial adjacent block can be added to the MPM list.

[0795] At this time, the order of addition may be L (Left), A (Above), BL (Bottom Left), AR (Above Right), AL (Above Left).

[0796] Method (3) The prediction mode derived through DIMD in the current block can be added to the MPM list.

[0797] At this time, among the prediction modes derived through DIMD, at least one prediction mode can be added to the MPM list.

[0798] For example, a best mode (or first mode) and a secondary mode can be added to the MPM list.

[0799] Method (4) A prediction mode derived (inherited) from a spatial non-adjacent location can be added to the MPM list.

[0800] Method (5) A prediction mode derived (inherited) from temporal adjacent + collocated positions can be added to the MPM list.

[0801] Method (6) A prediction mode derived (inherited) from a history-based location can be added to the MPM list.

[0802] Method (7) Temporal / spatial adjacent / non-adjacent locations adjusted using block vectors / motion vectors can be added to the MPM list.

[0803] Method (8) After adding candidates to the list in the method 1 -7 process, list sorting using template matching cost can be performed.

[0804] Method (9) A prediction mode from -4 to +4 included in the above MPM list can be added to the MPM list.

[0805] Figure 14 illustrates an example of partial MPM reordering.

[0806] Method (10) Partial MPM reordering (Fig. 14)

[0807] Perform the process of adding the prediction mode in the reserved list to the MPM list (add content)

[0808] Method (11) At least one prediction mode included in the MPM list can be selected and a prediction mode from -4 to +4 can be added to the MPM list.

[0809] For example, when the prediction mode number added to the second MPM list is 6, the prediction modes added to the MPM list can be {2, 3,4,5,7,8,9,10}.

[0810] Method (12) { 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} can be added to the MPM list.

[0811] Here, -4 - +4 could mean adding or subtracting -4, -3, -2, -1, +1, +2, +3, +4 to the prediction mode.

[0812] The above methods can be performed in the numerical order described above. For example, the methods can be performed in the order of methods (1)-(12). For convenience of explanation, the following description assumes that methods (1)-(12) are performed in that order.

[0813] However, in contrast, the above methods may be performed in a different order. For example, the template matching cost-based list sorting process defined in method (8) may be performed anywhere between the steps performed in methods (1) through (12). For example, the template matching cost-based list sorting process of method (8) may be performed after performing methods (1) through (4). For example, the “partial MPM reordering” process defined in method (10) may be performed anywhere between the steps performed in methods (1) through (12). For example, the partial MPM reordering process of method (10) may be performed after performing methods (1) through (4).

[0814] <Partial MPM reordering 기법>

[0815] The prediction mode to be added to the MPM list can be called "pred_mode_idx".

[0816] If pred_mode_idx satisfies the "conditions" below, it is added directly to the MPM list. If it does not satisfy the conditions, it is added to the Reserved list separately and can be added to the MPM list later.

[0817] Condition 1: lower bound < pred_mode_idx < upper bound;

[0818] Condition 2: Lower bound: DC_IDX(2) + nbRemovedFirst

[0819] Condition 3: Upper bound: NUM_LUMA_MODE (Number of luminance prediction modes: 67) - nbRemovedLast

[0820] "nbRemovedFirst" and "nbRemovedFirst" for determining the upper bound and lower bound can be different depending on the width, height ratio or size of the current block.

[0821] For example, you can derive deltaSize with the width and height sizes as follows, and change the "nbRemovedFirst" and "nbRemovedFirst" values ​​according to deltaSize.

[0822] deltaSize = abs(floorLog2(W) - abs(floorLog2(H))

[0823] As shown below, the "nbRemovedFirst" "nbRemovedFirst" value may vary depending on where the adjacent block is unavailable.

[0824]

[0825]

[0826]

[0827] Up to N candidates can be selected and added to the MPM list through template matching cost-based list sorting.

[0828] For example, if 30 candidates are included in the sorted list during the process of performing method (1) - method (7), the list can be sorted in ascending order of template matching cost, and then 6 candidates can be selected from the top and added to the MPM list.

[0829] When adding the on-screen prediction modes derived from the above defined methods (1) - (12) to the MPM list, the template cost for the on-screen prediction modes derived for each method can be calculated, and then the on-screen prediction modes can be sorted and added in ascending order of template cost.

[0830] The template cost can be a computed SAD, SSE or SATD value between the template of the current block and the prediction template generated based on it.

[0831] At this time, template matching cost-based prediction mode alignment can be performed for at least one method among methods (1) - (12). This can be performed sequentially for each method.

[0832] For example, in method (1), the MPM list can be added by sorting the available prediction modes - in method (2), the MPM list can be added by sorting the available prediction modes - … can be performed for each method in that order.

[0833] Alternatively, template matching cost-based sorting can be performed only in each of methods (2), (3), and (4). At this time, the predicted modes within the screen derived for each method can be sorted in ascending order of template matching cost (sorted in descending order of template matching cost), and N candidates can be selected from the top and added to the MPM list. At this time, N can be 12. At this time, all candidate modes available in the method can be added to the MPM list without defining N.

[0834] In the above template matching cost-based MPM list sorting, sorting can be performed after filling all candidates in the MPM list.

[0835] For example, after the steps of method (1) - method (12) are all completed, sorting can be performed and up to N prediction modes can be selected and added to the MPM list.

[0836] For example, after setting the maximum number of candidates included in the MPM list (or the size of the MPM list), when the maximum number of candidates is reached in the above method (1) - method (12), adding candidates to the MPM list can be stopped and sorting can be performed.

[0837] (STEP 2) A step of generating a prediction template and determining the prediction mode using the prediction mode information in the configured MPM (most probable mode) list.

[0838] A prediction template can be created using the prediction mode information in the MPM list.

[0839] Figures 15 and 16 illustrate examples of template areas of the current block and reference templates of templates.

[0840] At this time, when a template for the current block (or target block) such as in Fig. 10 is configured, a prediction template can be configured using a reference template or a sample within the reference template that is adjacent to the template of the current block or is composed of samples or lines adjacent to the current block, as in Fig. 15 / Fig. 16.

[0841] At this time, the reference template may consist of at least one sample or line.

[0842] Figure 17 illustrates an example of multiple reference lines.

[0843] In order to determine a sample or line for configuring a reference template, it can be configured using a line determined by the Multiple Reference Line (MRL) method as in Fig. 17.

[0844] When generating a prediction template using a reference template, the prediction mode information in the MPM list and the samples within the reference template can be used to generate the prediction template. At this time, the prediction samples within the prediction template can be derived using the same method as the intra-angular prediction method.

[0845] By using the prediction modes in the MPM list, a prediction template can be derived for each mode and the template matching cost with the template of the current block can be calculated.

[0846] At this time, after sorting the prediction modes in the MPM list in ascending order of template matching cost, N prediction modes can be selected from the top of the list and used as candidate prediction modes for TIMD prediction.

[0847] For example, the prediction mode with the smallest template matching cost can be selected as the optimal prediction mode (best mode, first mode) for a template-based on-screen prediction mode derivation method.

[0848] For example, when deriving multiple prediction modes, the prediction mode with the smallest template matching cost can be defined as the best mode or primary mode, and the prediction mode with the next-highest template matching cost can be defined as the secondary mode.

[0849] The above-described derived prediction mode information can be stored for use in the process of constructing an MPM list in blocks other than the current block.

[0850] The above derived prediction mode information can be signaled in the encoder / decoder or derived using surrounding templates.

[0851] Template matching costs can be calculated using the SAD, SSE, and SATD methods.

[0852] (STEP 3) A step of generating a prediction block using the above-determined prediction mode information and performing prediction decoding / decoding.

[0853] Using the prediction mode derived through STEP 2 and the restored surrounding samples, a prediction block for the current block can be generated and prediction / decoding can be performed.

[0854] At this time, whether to use template-based intra mode derivation (TIMD) can be signaled from the encoder to the decoder.

[0855] If multiple prediction modes are derived in the STEP 2 process, multiple prediction blocks can be generated for each derived prediction mode.

[0856] At this time, prediction encoding can be performed using multiple prediction blocks, and the prediction mode with the lowest encoding cost can be determined as the optimal prediction mode.

[0857] The above optimal prediction mode information can be signaled from the encoder to the decoder.

[0858] In the case where multiple prediction modes are derived in the STEP 2 process, multiple prediction blocks can be generated for each derived prediction mode, and a new prediction block can be generated by weighted sum / fusion / blending them.

[0859] Multiple prediction modes can be selected from the MPM list to generate prediction blocks through the above weighted sum.

[0860] For example, after sorting the MPM list based on template matching cost, prediction blocks can be created by deriving the best mode and the secondary prediction mode, and then weighting and combining them to create a new prediction block.

[0861] At this time, whether to use the prediction block generation method through weighted sum / fusion / blending can be signaled from the encoder to the decoder.

[0862] At this time, whether to use a prediction block generation method through weighted sum / fusion / blending can be derived from the encoder / decoder.

[0863] At this time, the prediction block generation method through weighted sum / fusion / blending can be used only under certain conditions.

[0864] For example, when the template matching cost of the next-order prediction mode is less than twice the minimum template matching cost (template cost of the optimal prediction mode), a prediction block generation method through weighted sum / fusion / blending can be performed.

[0865] In generating prediction blocks through weighted sum, not only the directional prediction mode (angular mode) determined through TIMD but also non-directional prediction modes such as DC, Planar, IntraTMP, and IBC can be used.

[0866] For example, a new prediction block can be generated by weighting prediction blocks generated using one prediction mode determined based on the template matching cost among the best prediction mode, secondary prediction mode, and non-directional prediction mode derived from the above TIMD process.

[0867] Line information determined through the multiple reference line (MRL) method can be used to determine reference samples (reference lines) required for generating prediction blocks.

[0868] For example, if a line determined through the multiple reference line (MRL) method is called “line L,” a prediction block can be generated using line L.

[0869] At this time, prediction blocks can be generated using different lines for each prediction mode.

[0870] For example, a block created with the optimal prediction mode (primary, best) may use L lines, and a block created with the next-highest prediction mode (secondary) may use L + 1 lines.

[0871] At this time, MRL information can be calculated in the current block or inherited from related information in surrounding blocks.

[0872] In determining the prediction block to be used for generating a weighted sum / fusion / blending-based prediction block, the decision can be made based on the error value (SAD / SSE / SATD) between the prediction blocks.

[0873] For example, if four prediction modes are selected using the template matching cost and four prediction blocks are generated using these, the error value between each prediction block can be calculated and the prediction block pair with the smallest error value can be determined as the prediction block to be used for the weighted sum.

[0874] For example, the prediction block with the smallest error value compared to the prediction block with the smallest template matching cost (the prediction block generated using the best mode) can be determined as the prediction block to be used in the weighted sum.

[0875] For example, based on the L line determined through the multiple reference line (MRL) method, multiple prediction blocks can be generated through extended lines such as the L + 1 line, the L + 2 line, etc., and the error value between each prediction block can be calculated to determine the prediction block pair with the smallest error value as the prediction block to be used for the weighted sum.

[0876] For example, if there are multiple prediction blocks, if the difference in error value with the prediction block with the smallest template matching cost is greater than a certain threshold, the block can be excluded from the weighted sum.

[0877] When generating prediction blocks based on weighted sum / fusion / blending, the weights can be determined based on the template matching cost.

[0878] At this time, let TMcost1: minimum template matching cost, TMcost2: next-rank template matching cost, W1: weight applied to prediction block with minimum template matching cost, W2: weight applied to prediction block with next-rank template matching cost.

[0879] The weights W1 / W2 can be derived through the following equation.

[0880] W1 = TMcost2 / (TMcost1 + TMcost2)

[0881] W2 = 1 - W1

[0882] In performing template-based intra mode derivation (TIMD), predictive encoding can be performed using at least one template.

[0883] At this time, multiple templates can be used to derive prediction modes and prediction blocks and perform prediction encoding.

[0884] In the above, in the template-based screen prediction mode derivation based on multiple templates, a prediction block is generated for each configured template, prediction encoding is performed, and then the most optimal template in terms of encoding cost is determined and signaled.

[0885] For example, each prediction block can be generated using templates 5, 6, and 7 of Fig. 10 using a template-based screen prediction mode derivation method, and then prediction encoding can be performed. At this time, the template used to generate the prediction block with the lowest encoding cost can be determined as the optimal template.

[0886] In deriving a template-based on-screen prediction mode based on multiple templates, the optimal template can be determined based on the template matching cost per template.

[0887] For example, let the template matching cost between the predicted template generated using template 5 (above) and the template of the current block be TMcost_A, the template matching cost calculated using template 6 (left) be TMcost_L, and the template matching cost calculated using template 7 (left + above) be TMcost_LA.

[0888] The above template matching cost can be the SAD / SSE / SATD values ​​between two templates.

[0889] At this time, if TMcost_LA < a * (TMcost_A + TMcost_L), (a is a constant value), prediction encoding can be performed using template 7 (left + above) as the optimal template.

[0890] At this time, the optimal template information can be derived by the above equation without being signaled.

[0891] In the above example, if it is optimal to use template 5 (above) and template 6 (left), a new prediction block can be generated by weighted sum / fusion / blending the prediction blocks generated through template 5 (above) and template 6 (left).

[0892] At this time, the weight can be determined based on the template matching cost as in the previous example.

[0893] At this time, the weight can be determined based on the template matching cost as well as the location of the temple (top, left) and the distance from the template.

[0894] Figure 18 shows an example of the weights of the current block.

[0895] For example, let the size of the current block be H x W and w A Weight w applied to the sample at position (x, y) within the prediction block derived from template 5 (above) LWhen (x, y) is a weight applied to a sample located at coordinates (x, y) within a prediction block derived from template 6 (left), the weight can be derived as follows. (Fig. 18)

[0896] W A (x,y) = 32 + 32x / W - 32y / H

[0897] W L (x,y) = 64 - W A (x,y)

[0898] W A (x,y) = Clip3 ( 0, 64, 32 + 32x / W - 64y / H ), (if TMcost_L < TMcost_A)

[0899] W A (x,y) = Clip3 ( 0, 64, 32 + 64x / W - 32y / H ), (if TMcost_L > TMcost_A)

[0900] For example, a new template can be created by using the difference between the template of the current block (TMP_c) and the predicted template (TMP_best) generated in the mode with the smallest template matching cost, and the template with the smallest template matching cost among the remaining multiple templates with the new template (TMP_new) can be selected.

[0901] New template (TMP_new) = TMPc - TMPbest or absolute value (TMP_c - TMP_best)

[0902] At this time, a prediction block for each template derived using the above template TMP_best and template TMP_new can be generated, and a new prediction block can be generated by weighting the two blocks.

[0903] [E1 / D1] Step for deriving prediction signals for prediction / decoding

[0904] In generating a prediction signal for prediction / decoding, the prediction signal can be generated through the intra sub-partitions (ISP) method.

[0905] Figure 19 illustrates an example of sub-partition (ISP) division within the screen.

[0906] The intra-screen sub-partition (ISP) prediction method is a method of performing intra-screen prediction by dividing a block into sub-partitions, creating a prediction block for each sub-partition with the same intra-screen prediction mode, as shown in FIG. 19. At this time, intra-screen prediction is performed sequentially for each divided sub-partition, and the restored sample in the partition where prediction / decoding is completed first among the divided sub-partitions can be used for prediction for the next sub-partition. In other words, the prediction mode and predicted block for the target sub-partition can be derived using the restored sample of the previously restored sub-partition.

[0907] In performing the intra-screen sub-partition (ISP) prediction above, the prediction for each divided sub-partition can be performed using the “template-based intra-mode derivation (TIMD)” method or the “decoder-side intra-mode derivation (DIMD)” method. In other words, the prediction mode or prediction block for each divided sub-partition can be derived through the TIMD / DIMD.

[0908] Figures 20 and 21 illustrate examples of available sub-partition templates when sequential intra-screen sub-partition (ISP) prediction is performed.

[0909] For example, when sequential intra-screen sub-partition (ISP) prediction is performed as in FIG. 20-21, TIMD / DIMD can be performed by first constructing a template for the sub-partition where the restoration sample is available by decoding / encoding.

[0910] When performing the TIMD / DIMD defined above, blocks can be organized into sub-partition units to perform TIMD / DIMD. (That is, blocks in sub-partition units can be viewed as the current block (or target block) of the TIMD / DIMD defined above and the methods defined above can be performed.)

[0911] At this time, TIMD / DIMD prediction / decoding for each sub-partition can be performed sequentially in the same manner as for the sub-partition (ISP) within the screen.

[0912] Figure 22 illustrates an example of a template configuration by sub-partition.

[0913] At this time, TIMD / DIMD can be performed by configuring each template for each sub-partition as shown in Fig. 22.

[0914] At this time, the prediction mode derived for each partition can be added to the MPM list.

[0915] At this time, after performing TIMD / DIMD prediction / decoding by configuring it into various sub-partitions such as 2-partition, 4-partition, 6-partition, and 8-partition, the encoding cost can be compared to determine the optimal sub-partition shape.

[0916] In deriving prediction modes and generating prediction signals for prediction decoding / decoding, an optimal prediction mode can be derived by applying a template-based intra-picture prediction mode derivation (TIMD) method to prediction modes derived through decoder-side intra-picture prediction mode derivation (DIMD).

[0917] At this time, a prediction mode list can be constructed in the same way as the MPM list in TIMD is constructed for the prediction modes induced through DIMD.

[0918] At this time, a prediction template corresponding to each prediction mode can be generated using each prediction mode information.

[0919] The template matching cost between the above prediction template and the template of the current block can be calculated and the prediction mode list can be sorted in ascending order of cost.

[0920] At this time, prediction / decoding can be performed by using the prediction mode with the minimum template matching cost as the optimal prediction mode.

[0921] At this time, prediction decoding / prediction can be performed for all prediction modes in the prediction mode list to determine the optimal prediction mode. At this time, information about the optimal prediction mode can be signaled from the encoder to the decoder.

[0922] The index for the above optimal prediction mode may be the same as the index within the list of prediction modes sorted through template matching.

[0923] In the above, multiple prediction modes can be selected from the top of the list of prediction modes sorted by template matching cost and weighted to generate a new prediction block (signal, sample).

[0924] In generating a prediction signal for prediction encoding / decoding, a new prediction block can be generated by weighting a prediction block generated using an optimal prediction mode derived from angular prediction and a prediction block generated using a prediction mode having an index that scales the index value of the optimal prediction mode.

[0925] For example, when the index of the optimal screen directional prediction mode is 10, a new prediction block can be generated by weighting the prediction block generated using prediction mode 10 and the prediction blocks generated using prediction modes 9 and 11 with +1 and -1 added to the corresponding index.

[0926] In cases where the angular mode or the prediction mode information within the screen is not derived through the prediction, such as the IBC (intra block copy), Intra TMP (intra template matching), or MIP (Matrix-weighted Intra Prediction) methods, the prediction mode information can be derived using DIMD / TIMD.

[0927] At this time, the prediction mode can be derived by performing DIMD / TIMD on the target block restored through IBC (intra block copy), Intra TMP, and MIP prediction / decoding as well as the template area.

[0928] At this time, the gradient histogram (HoG) of DIMD for the restored block can be calculated and the prediction mode can be derived from this.

[0929] The above predicted prediction mode can be saved, and the saved prediction mode can be utilized when configuring the MPM list in the next block.

[0930] When performing DIMD on prediction samples generated through MIP, the prediction mode for the target block can be derived by performing DIMD before the up-sampling process for the prediction samples.

[0931] Directional prediction mode information or virtual intra-screen prediction mode (VIPM) information can be derived for the prediction signal (sample, block), residual signal, and restored signal generated during the inter-screen prediction process using DIMD or TIMD.

[0932] Using the above-described intra-virtual screen prediction mode information, a transformation / inverse transformation can be performed by applying a transformation method that requires intra-screen prediction mode information in the transformation process, such as LFNST (Low-frequency non-separable transform) or NSPT (Non-Separable Primary Transform), to the residual signal generated in the inter-screen prediction process.

[0933] At this time, transformation / inverse transformation can be performed by selecting the LFNST or NSPT kernel corresponding to the prediction mode within the virtual screen.

[0934] In deriving the prediction mode within the above virtual screen, at least one prediction mode within the virtual screen can be derived.

[0935] For example, prediction modes within multiple virtual screens can be derived. At this time, a specific number of prediction modes within the virtual screens can be selected based on the size of the gradient histogram (HoG) among the derived prediction modes within the multiple virtual screens.

[0936] In one embodiment, N items can be selected from the top sizes by sorting HoG sizes in ascending order. Here, N is a natural number greater than 2, and can be a value explicitly signaled, pre-defined in the device, or implicitly determined. For example, two items can be selected from the top sizes by sorting HoG sizes in descending order.

[0937] In one embodiment, after sorting prediction modes within a plurality of virtual screens in order of increasing HoG sizes, a first group and a second group including some of the prediction modes within the plurality of virtual screens may be created, and a first prediction mode obtained through a representative value (weighted sum, average value, etc.) of the prediction modes within the first group and a second prediction mode obtained through a representative value of the prediction modes within the second group may be selected. Here, the first group may be composed of two prediction modes having the largest HoG sizes, and the second group may be composed of two prediction modes having the second largest HoG sizes after the prediction modes of the first group.

[0938] When deriving prediction modes within the above multiple virtual screens, the number of virtual screen prediction modes derived and used can be varied depending on the block size (or the number of samples constituting the block).

[0939] For example, if the number of samples constituting a block is more than 256 samples, three (virtual) intra-screen prediction modes can be derived and used (the remaining two). Or, if the number of samples constituting a block is less than 128 samples, one derived prediction mode (1 st Transformation and inverse transformation can be performed using a prediction mode) and a corresponding transformation kernel (or set of kernels). At this time, the prediction mode within the (virtual) screen can be derived not only from the configured MPM list but also through the gradient histogram.

[0940] At this time, different transformations (kernels, sets of transformation kernels) can be applied to each prediction mode within the induced plurality of virtual screens. For example, if prediction modes within two virtual screens are induced, transformation and inverse transformation can be performed using the corresponding transformation kernels for each prediction mode within each virtual screen.

[0941] At this time, if at least one virtual screen prediction mode cannot be derived from the prediction signal or residual signal of the current block (if there is no derived mode), the virtual screen prediction mode can be derived using surrounding restoration samples.

[0942] In applying multiple transformation kernels (or kernel sets) corresponding to the prediction modes within the above-described multiple virtual screens, it is possible to determine whether to apply multiple transformation kernels based on the block size or the number of samples constituting the block. For example, if the number of samples constituting the block is less than 128, instead of using multiple transformation kernels, a single prediction mode and a single transformation kernel (or transformation kernel set) corresponding to it can be used.

[0943] The process of deriving a prediction mode within a virtual screen by applying DIMD / TIMD to the prediction signal (sample, block), residual signal, and restoration signal generated in the above inter-screen prediction process can be performed in the same manner as the process of deriving an optimal prediction mode from the DIMD and TIMD defined above.

[0944] At this time, the gradient histogram (HoG) for the restored block (residual signal + prediction signal) as well as the template region can be calculated, and the prediction mode can be derived from this.

[0945] The on-screen prediction mode can be inherited from surrounding pre-coded blocks and used as the virtual on-screen prediction mode of the target block.

[0946] At this time, the method for inheriting the prediction mode within the screen can be the same as constructing the previously defined MPM list. At this time, the prediction mode list within the virtual screen can be constructed in the same way as constructing the MPM list.

[0947] In the above DIMD process, instead of calculating the gradient histogram (HoG), the optimal virtual screen prediction mode for the target block can be derived using the above-configured virtual screen prediction mode list.

[0948] In generating a prediction signal for the above prediction / decoding, one or more prediction modes derived through DIMD and TIMD in the current block (or target block) can be stored and used for prediction in the current block or the next block.

[0949] For example, the best mode and secondary mode can be derived through template-based intra mode derivation (TIMD) and the derived prediction modes can be used to construct an MPM list for intra-screen prediction in the current block or the next block.

[0950] For example, the best mode and secondary mode can be derived through decoder-side intra mode derivation (DIMD) and the derived prediction modes can be used to construct an MPM list for intra-picture prediction in the current block or the next block.

[0951] The optimal intra-screen prediction mode derived through intra-screen prediction in the current block (or target block) can be saved and used for intra-screen prediction in the next block.

[0952] Based on the above derived prediction modes, new prediction modes can be generated and added to the MPM list.

[0953] At this time, when configuring the MPM list, at least two prediction modes among the modes at the top of the MPM list can be selected to create a new prediction mode using the pairwise average method.

[0954] For example, when MPM[1] = 16, MPM[2] = 8, and MPM[3] = 4, the new prediction mode generated using the pairwise average method is as follows.

[0955] average(MPM[1] , MPM[2])= 12

[0956] average(MPM[1] , MPM[3])= 10

[0957] average(MPM[2] , MPM[3])= 6

[0958] At this time, a new prediction mode can be created using the pairwise average method using the best mode and prediction modes other than the best mode derived through TIMD or DIMD.

[0959]

[0960] Let the prediction mode to be added to the MPM list be called “pred_mode_idx”

[0961] Only when pred_mode_idx satisfies the “conditions” below, it is added directly to the MPM list. If it does not satisfy the conditions, it is added to the Reserved list separately and can be added to the MPM list later.

[0962] - lower bound < pred_mode_idx < upper bound;

[0963] - Lower bound: DC_IDX(2) + nbRemovedFirst

[0964] - Upper bound: NUM_LUMA_MODE (Number of luminance prediction modes: 67) - nbRemovedLast

[0965] “nbRemovedFirst”, “nbRemovedFirst” for determining the upper bound and lower bound can be different depending on the width, height ratio or size of the current block.

[0966] For example, you can derive deltaSize with the width and height sizes as follows, and change the “nbRemovedFirst” and “nbRemovedFirst” values ​​according to deltaSize.

[0967] deltaSize = abs(floorLog2(W) - abs(floorLog2(H))

[0968] As shown below, the “nbRemovedFirst”, “nbRemovedFirst” values ​​may vary depending on where the adjacent block is unavailable.

[0969]

[0970] In the embodiments, the methods may be described based on a flowchart comprising a series of steps or units. The methods of the embodiments are not limited to the described order of the steps, and some steps may be performed in a different order than the described order or may be performed concurrently with other steps. Furthermore, the steps described by the flowchart or the like may not be exclusive. Other steps may be included between the steps described by the flowchart or the like. One or more steps described by the flowchart or the like may be deleted or omitted.

[0971] The embodiments may include examples of various aspects. While not all possible combinations to illustrate various aspects can be described, those skilled in the art will recognize that other combinations are possible in addition to those explicitly described. Accordingly, the present invention encompasses all other alterations, modifications, and variations that fall within the scope of the following claims.

[0972] The embodiments may be implemented in the form of program instructions that can be executed through various computer components and recorded on a computer-readable recording medium.

[0973] The computer-readable recording medium may include a non-transitory computer-readable recording medium. The computer-readable recording medium may include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and hardware devices specially configured to store and execute program instructions such as ROMs, RAMs, flash memories, and the like. The hardware devices may be configured to operate as one or more software modules to perform processes according to the embodiments, and vice versa.

[0974] A computer-readable recording medium may contain program commands, data files, data structures, etc., either singly or in combination. The program commands recorded on the computer-readable recording medium may be specially designed and configured for the embodiments, or may be known and available to those skilled in the art of computer software.

[0975] Program instructions may include machine language code, such as that generated by a compiler, or may include high-level language code that can be executed by a computer using an interpreter or the like. Program instructions may also be referred to as computer-executable code or a program. In embodiments, program instructions, computer-executable code, and a program may be interchangeable.

[0976] A computer-readable recording medium may contain information used in the embodiments. For example, the computer-readable recording medium may contain a bitstream, and the bitstream may contain information described in the embodiments. The information described in the embodiments may include syntax elements. The information described in the embodiments, such as syntax elements, may be understood as computer-executable code in that it drives an encoding device and a decoding device to perform specific processing.

[0977] A bitstream may contain computer-executable code. The computer-executable code may include information described in the embodiments, such as syntax elements. In other words, information described in the embodiments, such as syntax elements, may be considered computer-executable code within the bitstream or a part of the computer-executable code.

[0978] Although the present invention has been described above with specific details such as specific components and limited embodiments and drawings, such descriptions are provided only to help a more general understanding of the present invention, and the present invention is not limited to the described embodiments, and those with ordinary knowledge in the technical field to which the present invention pertains can make various modifications and variations from this description.

[0979] Therefore, the spirit of the present invention should not be limited to the described embodiments, and all modifications equivalent to or equivalent to the claims described below, as well as the claims, are considered to fall within the scope of the spirit of the present invention.

[0980] The present disclosure relates to a method and device for encoding / decoding an image, and more particularly, to a method and device for encoding / decoding an image using a template matching block vector, which may be applicable to the industry.

Claims

1. A step of obtaining a first gradient histogram for the current block; A step of deriving a directional prediction mode of the current block based on the first slope histogram; and An image decoding method, comprising a step of generating a prediction block of the current block based on the directional prediction mode.

2. In paragraph 1, An image decoding method, characterized in that the first gradient histogram is obtained based on a gradient value calculated from a template composed of surrounding samples of the current block or a second gradient histogram of a surrounding block calculated from a surrounding block of the current block.

3. In paragraph 2, An image decoding method, characterized in that the template is generated based on at least one of the upper area, the upper left area, or the left area of the current block.

4. In paragraph 2, An image decoding method, characterized in that the current block is generated using a motion vector or a block vector of a juxtaposed block.

5. In paragraph 2, An image decoding method, characterized in that the surrounding blocks include blocks at the history-based location of the current block.

6. In paragraph 5, A video decoding method, characterized in that the block of the above history-based location is a block of a location obtained from a list in the form of a First-in First-Out (FIFO).

7. In paragraph 1, An image decoding method, characterized in that the above directional prediction mode is a mode obtained by weighting and adding a plurality of prediction modes obtained based on the cumulative occurrence number of each directional mode of the first slope histogram.

8. In paragraph 1, An image decoding method, characterized in that the above directional prediction mode is a mode obtained by weighting a plurality of prediction modes obtained based on error values of prediction blocks generated using a plurality of prediction modes induced through the first slope histogram.

9. In paragraph 1, An image decoding method, characterized in that the above prediction block is obtained through a weighted sum of a first prediction block obtained based on the directional prediction mode and a second prediction block obtained based on a prediction mode different from the directional prediction mode.

10. In paragraph 9, A method for decoding an image, characterized in that the other prediction mode is an inter-screen prediction mode, an intra-screen template matching mode, an intra-screen block copy mode, a matrix-weighted intra-screen prediction mode or a non-directional mode.

11. In paragraph 9, An image decoding method, characterized in that the weights applied to the weighted sum of the first prediction block and the second prediction block are determined based on the first gradient histogram.

12. In paragraph 1, The above current block is a block obtained by dividing the upper block of the above current block, A method for decoding an image, characterized in that the above division is any one of 2 divisions, 4 divisions, 6 divisions or 8 divisions.

13. In paragraph 12, An image decoding method, characterized in that the prediction modes of the divided blocks including the current block obtained by dividing the upper block are different from each other.

14. Step of obtaining the first gradient histogram for the current block; A step of deriving a directional prediction mode of the current block based on the first slope histogram; and An image encoding method, comprising the step of generating a prediction block of the current block based on the directional prediction mode.

15. In a method of transmitting a bitstream, The method comprises the steps of: obtaining a first gradient histogram for a current block; A step of deriving a directional prediction mode of the current block based on the first slope histogram; A step of generating a prediction block of the current block based on the above directional prediction mode; and A method for transmitting a bitstream, comprising the step of transmitting a bitstream generated by encoding the above prediction block.

Citation Information

Patent Citations

  • Cleaning, washing, blasting, coating, painting, treatment, lining method, equipment, measure, agent, facility

    KR1020230025808A

  • Device and method for checking policy conflict on SDN

    KR1020230136078A

  • Energy saving system and method for Cargo Hold within ventilation system

    KR1020240045630A