Intra prediction method, device, and recording medium using reference sample

WO2026197785A1PCT designated stage Publication Date: 2026-09-24ELECTRONICS & TELECOMM RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2026/004340
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-06-12
Filing Date
2026-03-17
Publication Date
2026-09-24

Smart Images

  • Figure KR2026004340_24092026_PF_FP_ABST
    Figure KR2026004340_24092026_PF_FP_ABST
Patent Text Reader

Abstract

An image encoding / decoding method, device, and recording medium of the present disclosure may comprise the steps of: generating a gradient histogram by analyzing a reference sample of a current block; constructing a candidate mode list on the basis of the gradient histogram; and deriving a prediction mode through template cost analysis of candidates in the candidate mode list.
Need to check novelty before this filing date? Find Prior Art

Description

In-frame prediction method, device, and recording medium using a reference sample

[0001] The present disclosure relates to a method for encoding / decoding an image, an apparatus, and a bitstream storage medium, and more specifically, may relate to in-frame prediction.

[0002] Recently, the demand for high-resolution, high-quality video, such as HD (High Definition) and UHD (Ultra High Definition) video, has been increasing across various application fields. As video data becomes higher in resolution and quality, the relative volume of data increases compared to conventional video data; consequently, transmission and storage costs increase when video data is transmitted using existing wired or wireless broadband lines or stored using existing storage media. To address these issues arising from the increase in video data resolution and quality, high-efficiency video encoding and decoding technologies for video with higher resolution and quality are required.

[0003] Various video compression technologies exist, such as inter-frame prediction technology that predicts pixel values ​​in the current picture from previous or subsequent pictures, intra-frame prediction technology that predicts pixel values ​​in the current picture using pixel information within the current picture, transformation and quantization technology for compressing the energy of residual signals, and entropy coding technology that assigns short codes to values ​​with high frequency and long codes to values ​​with low frequency; by utilizing these video compression technologies, video data can be effectively compressed for transmission or storage.

[0004] Conventional video encoding / decoding methods and devices construct an MPM or IPM (Intra Prediction Mode) list without considering candidates that are not selectable, which has limitations in that it increases signaling overhead and performs unnecessary operations.

[0005] Conventional video encoding / decoding methods and devices apply a fixed candidate list construction method, which has limitations in constructing optimal MPM and IPM candidate lists because it does not consider samples and block information surrounding the current block.

[0006] Conventional video encoding / decoding methods and devices derive one or more candidates using histograms obtained from specific reference regions when constructing MPM and IPM candidate lists; however, this approach has limitations in deriving optimal candidates because it does not distinguish between reference regions with different characteristics around the current block.

[0007] In the encoding / decoding of in-frame coding units through conventional in-frame prediction, there are problems in that the achievable encoding performance is limited when applied to various video signals due to the configuration of extrapolation filter merge candidates that do not reflect the area surrounding the current block, the absence of a method for deriving non-directional in-frame prediction modes, the derivation of in-frame prediction modes that does not consider the position within the prediction block, and the method of deriving in-frame prediction modes through cost comparison of a single type.

[0008] The image encoding / decoding method, apparatus, and recording medium of the present disclosure may include the steps of: generating a gradient histogram by analyzing a reference sample of a current block; constructing a candidate mode list based on the gradient histogram; and deriving a prediction mode through template cost analysis of candidates in the candidate mode list.

[0009] In the image encoding / decoding method, apparatus, and recording medium of the present disclosure, the reference sample analysis can be performed by configuring a template of the current block.

[0010] In the image encoding / decoding method, apparatus, and recording medium of the present disclosure, the template may include two or more restored lines according to the size of the current block.

[0011] In the image encoding / decoding method, apparatus, and recording medium of the present disclosure, the candidate mode list may include a first candidate obtained from a reference sample analysis of a first reference region of the current block, a second candidate obtained from a reference sample analysis of a second reference region of the current block, and a third candidate obtained from a reference sample analysis of a third reference region of the current block.

[0012] In the image encoding / decoding method, apparatus, and recording medium of the present disclosure, the first reference area may be the upper reference area of ​​the current block, and the second reference area may be the left reference area of ​​the current block.

[0013] In the image encoding / decoding method, apparatus, and recording medium of the present disclosure, the number of candidates in the candidate mode list may be 8.

[0014] In the image encoding / decoding method, apparatus, and recording medium of the present disclosure, the template cost analysis can be performed using an L-shaped peripheral line adjacent to the current block.

[0015] In the image encoding / decoding method, apparatus, and recording medium of the present disclosure, the prediction mode may be excluded when configuring the Most Probable Modes (MPM).

[0016] In the image encoding / decoding method, apparatus, and recording medium of the present disclosure, the MPM may include at least one of a Planar mode, an in-frame prediction mode of a block adjacent to the current block, or an in-frame prediction mode of a block not adjacent to the current block.

[0017] In the image encoding / decoding method, apparatus, and recording medium of the present disclosure, all or part of the MPM may be realigned according to a template-based error cost.

[0018] In the image encoding / decoding method, apparatus, and recording medium of the present disclosure, the template-based error cost may be calculated using one or more of the methods of Sum of Absolute Difference (SAD), Mean-Removal Sum of Absolute Difference (MR-SAD), and Sum of Absolute Transformed Difference (SATD).

[0019] In the image encoding / decoding method, apparatus, and recording medium of the present disclosure, the MPM can be separated into a plurality of lists and each can be decoded.

[0020] In the image encoding / decoding method, apparatus, and recording medium of the present disclosure, the MPM comprises PMPM (Primary MPM) and SMPM (Secondary MPM), and in relation to the SMPM, an SMPM indicator specifying one of a plurality of SMPMs and an SMPM index specifying one candidate mode within the specified SMPM can be obtained from a bitstream.

[0021] The present disclosure can improve prediction performance and increase encoding efficiency by inducing modes that are judged to be unlikely to be encoded when configuring the MPM and IPM for the current block during encoding / decoding, and by removing said modes.

[0022] The present disclosure can increase coding efficiency by distinguishing multiple reference regions within the current block's surrounding region, distinguishing modes derived from each reference region, and utilizing all of these modes to add them to MPM and IPM candidates.

[0023] The present disclosure can improve prediction performance and increase encoding efficiency by adding a non-directional mode when configuring a candidate list for an in-frame prediction mode using reference sample analysis and prediction.

[0024] The present disclosure can improve prediction performance and increase encoding efficiency by supplementing the previously utilized extrapolation filter when constructing a merge candidate list based on an extrapolation filter in encoding / decoding by referring to a reference region where the restoration around the current block has been completed.

[0025] The present disclosure has the effect of improving prediction performance and encoding efficiency by replacing and adding a method for inducing a non-directional mode in a technique or step for inducing an intra-frame prediction mode during video encoding / decoding, a multi-cost combination method, and generating a prediction block through matrix operations to induce an optimal intra-frame prediction mode.

[0026] The present disclosure can increase the diversity of conversion kernel selection and thereby improve encoding efficiency by dividing the prediction block in the conversion step of video encoding / decoding to induce different intra-frame prediction modes.

[0027] FIG. 1 shows a system for video coding according to one embodiment.

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

[0029] Figure 3 shows the structure of an intra prediction according to one embodiment.

[0030] FIG. 4 shows the structure of an inter prediction to explain an inter prediction process according to one embodiment.

[0031] FIG. 5 shows the order of addition of spatial candidates to the candidate list according to one embodiment.

[0032] Figure 6 shows a plurality of in-loop filters according to one example.

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

[0034] FIG. 8 is a configuration diagram of the in-screen prediction decoding / coding steps related to the present disclosure.

[0035] FIG. 9 illustrates an example of an in-frame prediction mode execution step using reference sample analysis and prediction.

[0036] FIG. 10 illustrates one example of a reference area for reference sample analysis.

[0037] Figure 11 illustrates flowcharts of an intra-frame prediction method with an extrapolation filter applied in terms of encoding.

[0038] Figure 12 illustrates a flowchart of an intra-frame prediction method with an extrapolation filter applied in terms of decoding.

[0039] FIG. 13 illustrates various forms of an extrapolation filter.

[0040] Figure 14 is an example of a formula related to the use of an N-tap filter.

[0041] Figure 15 illustrates a formula related to the coefficients of an extrapolation filter.

[0042] FIG. 16 illustrates a specific embodiment of an extrapolation filter.

[0043] FIG. 17 illustrates a specific embodiment of an extrapolation filter.

[0044] FIG. 18 illustrates an example in which an extrapolation filter is applied based on the current block.

[0045] FIG. 19 illustrates an example of formulas related to reference sample slopes.

[0046] FIG. 20 illustrates an example of performing gradient analysis by multiplying a 3x3 matrix.

[0047] FIG. 21 illustrates an example of matrix values.

[0048] FIGS. 22 and FIGS. 23 illustrate an example of a matrix for slope analysis.

[0049] FIG. 24 illustrates an embodiment of dividing a block into two or more regions.

[0050] FIGS. 25 and 26 illustrate an example of a prediction technique utilizing multiple error cost combinations.

[0051] Figure 27 illustrates the restored surrounding blocks and the formulas for the error cost using them.

[0052] FIG. 28 illustrates an example of an in-screen prediction mode using matrix calculation-based template prediction.

[0053] Figures 29 and 30 illustrate the shape of a template for calculating the template cost.

[0054] Various modifications may be applied to the present invention. Additionally, the present invention may have various embodiments. Specific embodiments are described by the drawings and the detailed description.

[0055] Specific embodiments are not intended to limit the invention to specific embodiments, and it should be understood that all modifications, equivalents, and substitutions that fall within the spirit and scope of the invention are included as embodiments of the invention.

[0056] The embodiments are described in sufficient detail to enable those skilled in the art to practice the embodiments. It should be understood that the various embodiments are different but need not be mutually exclusive. For example, it should be understood that the shapes, structures, and characteristics described in relation to one embodiment may be applied to or implemented in other embodiments without departing from the spirit and scope of the invention. It should also be understood that the location or arrangement of components within one embodiment may be changed without departing from the spirit and scope of the invention. Accordingly, the following detailed description is not intended to be limiting, and the scope of the exemplary embodiments is limited only by the appended claims and all equivalents to the scope claimed by such claims, provided that they are appropriately described.

[0057] The detailed description of the embodiments described below may refer to the drawings relating to the embodiments. Descriptions described in the drawings or descriptions represented by the drawings may be considered part of the detailed description. In the drawings, similar reference numerals may refer to the same or similar functions for various aspects. Dependencies between components may not be limited to those depicted in the drawings.

[0058] In the embodiments, singular expressions may include plural expressions and may be limited to and / or limited to plural expressions unless the context clearly excludes plural expressions. That is to say, in the embodiments, expressions such as 'at least one' and 'one or more' may be replaced with 'plural'. Terms such as ' / ', 'and / or', 'at least one of' and 'one or more of' described for plural items may mean 1) one of the plural items, 2) some of the plural items, 3) a combination of some of the plural items, or 4) a combination of the plural items. Additionally, plural expressions may be replaced with singular expressions. Plural may mean an integer of 1, 2, 3, 4, or 5 or more.

[0059] In the embodiments, numbered terms such as 'first' and 'second' may be used to describe various components. These terms are used solely for the purpose of distinguishing one component from another and do not limit the components. For example, without departing from the scope of the present invention, the first component may be named the second component, and similarly, the second component may be named the first component.

[0060] The statement that a first component transmits (or provides) information to a second component may mean that the first component directly transmits information to the second component, or it may mean that the first component transmits information to the second component through another third component. Here, the information received (or acquired) by the second component may be information transmitted by the first component, or information generated by applying a specific processing to information transmitted by the first component.

[0061] The components of the embodiments may be illustrated independently to represent different characteristic functions, and this does not imply that each component corresponds to a separate hardware or a single software unit. That is, the components of the embodiments may be classified and enumerated 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 said component separately. Embodiments in which such components are integrated and embodiments in which components are separated are also included within the scope of the present invention, provided that they do not depart from the essence of the invention.

[0062] The terms used in the embodiments are used merely to describe specific embodiments and are not intended to limit the invention. In the embodiments, terms such as "comprising" or "having" indicate the presence of features, numbers, steps, actions, components, parts, or combinations thereof described in the embodiments. The existence or addition of other features, numbers, steps, actions, components, parts, or combinations thereof not explicitly described in the embodiments is not excluded by these terms. That is, the description of a specific component of an embodiment as "comprising" does not exclude components other than the specific component, and means that additional components may also be included within the scope of the embodiments or the technical concept of the invention.

[0063] Some of the components of the embodiments may be optional components that are not essential for performing the essential functions of the invention. Such optional components may be used to enhance performance. The embodiments may be implemented as a structure comprising only the essential components required to realize the essence of the embodiments, excluding the optional components. Such a structure is also included within the scope of the embodiments.

[0064] In the following, embodiments are described in detail with reference to the attached drawings so that a person skilled in the art can easily implement the embodiments. In describing the embodiments, if it is determined that a detailed description of related known configurations or known functions could obscure the gist of this specification, such detailed description is omitted. Additionally, the same reference numerals are used for identical components within the drawings, and redundant descriptions of identical components are omitted.

[0065]

[0066] Replacement of terms in the examples

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

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

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

[0070] - 'Information', 'Signal'

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

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

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

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

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

[0076] - 'Entropy encoding', 'encoding', 'encoding'

[0077] - 'Entropy decoding', 'decoding', 'decoding'

[0078] - 'Coding', 'Encoding and / or decoding'

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

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

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

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

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

[0084] - 'square', 'square shape'

[0085] - 'pixel', 'pixel', 'sample', 'pel'

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

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

[0088] - 'quad', 'quadronary'

[0089] - 'Luma component', 'Luma', 'luminance component', 'luminance', 'Y'

[0090] - 'Chroma component', 'Chroma', 'chrominance', 'chrominance component', 'Cb and Cr', 'Cb or Cr', 'Cb', 'Cr', 'U and V', 'U or V', 'U', 'V'

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

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

[0093] - 'collocated', 'COL'

[0094] - 'reconstruction', 'reconstruction', 'decoding'

[0095] - 'reconstructed', 'reconstructed', 'decoded'

[0096] - 'Difference', 'Difference', 'Difference', 'Error', 'Residual', 'Residual'

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

[0098] - 'inter', 'inter-screen'

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

[0100] - 'Inter Mode', 'Inter Prediction Mode', 'Inter-frame Mode', 'Inter-frame Prediction Mode'

[0101] - 'Motion Vector', 'Predicted Motion Vector', 'Advanced Motion Vector Prediction (AMVP)'

[0102] - 'List', 'Candidate List'

[0103] - 'spatial candidate', 'spatial merge candidate'

[0104] - 'temporal candidate', 'temporal merge candidate'

[0105] - 'prediction motion vector candidate', 'motion vector predictor'

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

[0107] - 'Intra', 'Inside the screen'

[0108] - 'Intra prediction', 'Intra prediction'

[0109] - 'Intra Mode', 'Intra Prediction Mode'

[0110] - 'Dequantization', 'Scaling'

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

[0112] - 'Quantization matrix coefficients', 'Matrix coefficients'

[0113] - 'transform coefficient level', 'quantized level', 'quantized coefficient', 'quantized transform coefficient', 'quantized transform coefficient level'

[0114] - 'dequantized coefficient', 'dequantized transform coefficient'

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

[0116] - 'directional mode', 'angle mode', 'angular mode', 'intra-prediction mode'

[0117] - 'Intra-prediction mode (mode) number', 'Intra-prediction mode (mode) index', 'Intra-prediction mode (mode) value', 'Intra-prediction mode (mode) angle', 'Intra-prediction mode (mode) direction', 'Intra-prediction direction (mode) number', 'Intra-prediction direction (mode) index', 'Intra-prediction direction (mode) value', 'Intra-prediction direction (mode) angle'

[0118] - 'Merge Mode', 'Motion Merge Mode'

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

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

[0121]

[0122] Information and range of values ​​of information described in the embodiments

[0123] In the embodiments, information may include a constant, a flag, an index, a variable, a coding parameter, an element, a syntax element, motion information, an attribute, an entity, an object, and data, etc. That is to say, the term 'information' may be interchangeable with 'data', 'flag', 'index', 'variable', 'element', 'syntax element', 'motion information', 'attribute', or 'entity'.

[0124] Information can have one of multiple values. 'The nth value' can mean the nth value among multiple values.

[0125] For example, the first value can represent '0' or (logical) false. The second value can represent '1' or (logical) true. Or, the first value can represent '1' or (logical) true. The second value can represent '0' or (logical) false.

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

[0127] When a variable such as i or j is used to represent a row, column, or index, the variable may be an integer between 0 and n - 1 inclusive. Or, the variable may be an integer between 1 and n inclusive. Here, n may be the number of rows, the number of columns, or the number of entities pointed to by the index.

[0128]

[0129] Concepts related to coding

[0130] Concepts related to coding are explained below. The descriptions disclosed below may be applied to embodiments.

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

[0132] Availability: The availability of specific modes for a specific target may mean that a selected mode among the specific modes is used for that specific target. Other modes belonging to the category of specific modes may be non-available modes. Non-available modes may not be used for a specific target. The above description of specific modes may also apply to other specific information. In the above descriptions, 'mode' may be replaced with 'information'.

[0133] Adjacency: 'Direction' for 'First Object'. 'Second Object' may refer to a 'Second Object' adjacent to the 'Direction' corner / face of the First Object. For example, the 'Top-left Block' for a 'Target Block' may be a block adjacent to the top-left of the Target Block. Here, the 'First Object' may be a Target Unit, Target Block, or Target Sample. 'Direction' may be one of left-above, above, right-above, left, right, left-below, below, and right-below. The 'Second Object' may be a Unit, Block, or Sample. For the directions of top-left, top-right, bottom-left, and bottom-right, the corner of the First Object and the corner of the Second Object may be diagonally adjacent. For the directions of top, left, right, and bottom, one face of the First Object and one face of the Second Object may be in contact with each other.

[0134] - For example, the block adjacent to the top-left of the target block may be the block adjacent to the top of the block adjacent to the left of the target block. The block adjacent to the top-right of the target block may be the block adjacent to the right of the block adjacent to the top of the target block. The block adjacent to the bottom-left of the target block may be the block adjacent to the bottom of the block adjacent to the left of the target block.

[0135] Coding: Coding can refer to encoding and / or decoding of an image.

[0136] 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.

[0137] Image: An image can refer to a single picture that constitutes a video, or it can represent the video itself. For example, "encoding and / or decoding of an image" can mean "encoding and / or decoding of a video," or it can mean "encoding and / or decoding of one of the images that constitute a video."

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

[0139] Target image: The target image may be an encoding target image that is the subject of encoding and / or a decoding target image that is the subject of decoding. Additionally, the target image may be an input image processed by an encoding device and a restored image processed by a decoding device. The target image may be an image containing a target block.

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

[0141] - A subpicture may be a square or rectangular area within the picture. A subpicture may include one or more CTUs.

[0142] - 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.

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

[0144] Slice: A slice may include 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.

[0145] 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.

[0146] CTU: An image can be divided into multiple Coding Tree Units (CTUs).

[0147] - A CTU may include one Y Coding Tree Block (CTB) and at least one of a Cb CTB and a Cr CTB associated with the Y CTB, and may include information for each CTB. The information may include syntax elements.

[0148] - Each CTU may be partitioned using one or more partitioning methods to form sub-units such as Coding Units (CU), Prediction Units (PU), and Transform Units (TU). One or more partitioning methods may include Quad Tree (QT) partitioning, Binary Tree (BT) partitioning, and Ternary Tree (TT) partitioning. Additionally, each CTU may be partitioned using Multi-Type Tree (MTT) partitioning, which uses a combination of multiple partitioning methods.

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

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

[0151] - The unit type may represent a specific process applied to the unit. Depending on the unit type, a specific process may be applied to the unit. The 'specific' unit may be a unit for the process named 'specific' in the coding. For example, the unit may be at least one of the source unit, CTU, coding unit, prediction unit, residual unit, restored residual unit, transformation unit, and restored unit.

[0152] - A unit may include samples having a two-dimensional form or arrangement. In this respect, a 'unit' may 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 restored residual block, a transform block (TB), and a restored block. For example, a partition of a unit may mean a partition of a block corresponding to the unit.

[0153] - A unit may include syntactic elements. In other words, a block and the syntactic elements for the block can be combined and referred to as a unit.

[0154] - 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 array of samples. The current block can represent the encoding target block that is the subject of encoding during encoding, or the decoding target block that is the subject of decoding during decoding. Additionally, the current block can be at least one of a coding block, a prediction block, a residual block, a transformation block, or a restoration block. Blocks can have various sizes and shapes. For example, the shape of a block can be one or more of a tetragon, a rectangular, a square, a rectangle where the width differs from the height (i.e., an oblong), a trapezoid, a triangle, a right-angled triangle, and a pentagon. Here, the width and height of the rectangle can differ from each other. Additionally, the shape of a block may include other geometric figures that can be represented in two dimensions. For example, the shape of the block may be a square or a pentagon defined by subtracting the area of ​​a right triangle from the area of ​​a rectangle. Here, the right-angled vertex of the right triangle may be one of the vertices of the rectangle. Additionally, the shape of the block may be a combination of two or more of the aforementioned shapes. Additionally, the shape of the block may be the remainder of one of the aforementioned shapes after another shape has been subtracted.

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

[0156] - In the embodiments, the 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 in which the vertical length is greater than the horizontal length. A horizontally oriented block may mean a block in which the horizontal length is greater than the vertical length.

[0157] - The 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 for each block. The information may include syntax elements.

[0158] - The unit information may include the unit type, unit size, unit depth, unit encoding order, and unit decoding order.

[0159] Target Unit: The target unit may be a block that is the target of encoding, an encoding target unit, and / or a decoding target unit that is the target of decoding. The target unit may be a specific region within the target picture to which one or more specific processing steps of coding are applied. By applying a specific processing step to the target unit, a unit of a specific type may be generated. Alternatively, the target unit may represent a unit having a specific type for a specific processing step of coding.

[0160] Depth: A block can be hierarchically divided into multiple sub-blocks with depth according to a tree structure. The multiple sub-blocks created by the division of a block can be referred to as partitions.

[0161] - The block depth can represent the level of the node corresponding to the block when the blocks constituting the image are represented as a tree structure. Alternatively, the block depth can represent the number of divisions applied until the block is determined. The block depth can increase by 1 as the block is further divided.

[0162] - In a tree structure, the root node can be considered to have the smallest level, and the leaf node the largest level. The root node may be the top node of the tree structure and may correspond to the first undivided block. The level of the root node may be 0 or 1. When the level of the root node is 0, a node with level 1 may represent the block determined by the first block being divided once. A node with level n may represent the block determined by the first block being divided n times. A leaf node may be the lowest node of the tree structure. A leaf node may be a node that cannot be further divided. The depth of a leaf node may be a predefined maximum depth. For example, the maximum depth may be a positive integer such as 3. The root node may represent a CTU. A leaf node may represent at least one of a CU, PU, ​​or TU.

[0163] - 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.

[0164] Sample: A sample can be a base unit that constitutes a block. A sample can consist of one or more bits. Bit depth can be the number of bits that make up the sample. Samples range from 0 to 2 depending on the bit depth. Bd It can be expressed as values ​​up to -1.

[0165] PU: PU may refer to a base unit for processing related to prediction. For example, processing related to prediction may include inter-prediction, intra-prediction, intra-block copy (IBC) prediction, intra-compensation, and motion compensation.

[0166] A single PU can be divided into multiple sub-PUs that are smaller in size than the PU. These multiple sub-PUs can also serve as base units for processing related to prediction. In other words, a prediction unit partition created by the division of the prediction unit can also be a prediction unit.

[0167] TU: A TU may be a base unit for processing related to a residual block. Processing related to a residual block may include at least one of transform, inverse transform, quantization, inverse quantization, transform coefficient encoding, transform coefficient decoding, entropy encoding, and entropy decoding. A single TU may be divided into a plurality of sub-transform units having a size smaller than that of the TU. The plurality of sub-TUs may also be base units for processing related to a residual block. That is to say, a transform unit partition generated by the division of the transform unit may also be a transform unit.

[0168] - 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.

[0169] Parameter set: The parameter set can correspond to header information within the structure of the bitstream.

[0170] - 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).

[0171] Information signaled through a parameter set can be applied to pictures that reference the parameter set. For example, information within a VPS can be applied to pictures that reference the VPS. Information within an SPS can be applied to pictures that reference the SPS. Information within a PPS can be applied to pictures that reference the PPS. A parameter set can reference a higher-level parameter set. For example, a PPS can reference an SPS. An SPS can reference a VPS.

[0172] - Additionally, the parameter set may include tile group information, slice header information, and tile header information. A tile group may refer to a group or slice containing multiple tiles.

[0173] MPM (Most Probable Mode): MPM may represent an intra prediction mode that is likely to be used for intra prediction of a target block.

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

[0175] - One or more MPMs may be determined based on the intra prediction mode of a reference block. There may be multiple reference blocks. One or more different MPMs may be determined depending on which intra prediction modes are used for one or more reference blocks. Reference blocks may include spatial neighbor blocks.

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

[0177] MPM Index: The MPM index can indicate one or more MPMs in the MPM list that are used for intra prediction for the target block.

[0178] MPM Usage Indicator: The MPM Usage Indicator can indicate whether an MPM list is used for prediction regarding a target block.

[0179] 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. Additionally, the prediction mode may include at least one of an intra-mode, an inter-mode, and an intra-block copy mode.

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

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

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

[0183] Reference picture: The reference picture may be an image referenced for prediction regarding the target block. Alternatively, the reference picture may be an image containing the reference block. The reference picture may include an image prior to the target image, the target image, and an image following the target image.

[0184] 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.

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

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

[0187] Inter prediction indicator: The inter prediction indicator may indicate the direction of inter prediction for the target block. Inter prediction may be one of unidirectional prediction and bidirectional prediction. Alternatively, the inter prediction indicator may indicate the number of reference images used when generating prediction blocks for the target block. Alternatively, the inter prediction indicator may indicate the number of prediction blocks used for inter prediction for the target block. The reference direction may refer to the inter prediction indicator. For example, the inter prediction indicator may indicate either unidirectional or bidirectional. Alternatively, for an inter mode that uses only reference images within the L0 reference image list, the inter prediction indicator may have a first value of '0'; for an inter mode that uses only reference images within the L1 reference image list, the inter prediction indicator may have a second value of '1'; and for an inter mode that uses at least two of the reference images within the L0 reference image list and the L1 reference image list, the inter prediction indicator may have a third value of '2'.

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

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

[0190] 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 reference image list L0 and reference image list L1.

[0191] - The reference direction merely refers to the list of reference images used for prediction of the target block, and does not indicate that the directions of the reference images within the list are restricted to a forward direction or a backward direction. That is to say, each of the reference image list L0 and the reference image list L1 may include forward images and backward images, respectively. Here, the forward direction may indicate a direction from the target image to the image preceding the target image. Forward inter-prediction may be an inter-prediction that uses the image preceding the target image as a reference image. The backward direction may indicate a direction from the target image to the image following the target image. Backward inter-prediction may be an inter-prediction that uses the image following the target image as a reference image.

[0192] - A unidirectional reference direction may mean that a single 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 one of the following: that only reference image list L0 is used, that only reference image list L1 is used, or that two reference image lists are used. Additionally, the reference direction may be indicated by an inter-predictor.

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

[0194] 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), reference image index, reference image, inter prediction indicator, prediction list utilization flag, etc. Additionally, motion information may include information used in a specific inter prediction mode, such as an MV candidate, MV candidate index, merge candidate, and merge index.

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

[0196] MV: MV can be a 2-dimensional vector used in inter-prediction. MV can represent the offset between the target block and the reference block. Alternatively, MV can represent the difference between the location of the target block and the location of the reference block.

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

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

[0199] 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 a target image. In other words, a BV can represent the displacement between a target block and a reference block within a target image.

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

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

[0202] Motion Information Candidates: In a specific prediction, motion information of the target block can be selected from motion information candidates determined by a specific method. A motion information candidate may refer to the motion information of a reference block, or it may refer to the reference block itself that possesses motion information. Here, the reference block may be a block determined by a specific method to select motion information candidates.

[0203] Candidate List: A candidate list may be a list containing one or more candidates. For example, a candidate list may include a motion information candidate list, a merge candidate list, an MV candidate list, an MPM list, etc. A candidate list may be generated in the same manner in both the encoding device and the decoder. That is to say, the candidate list used in the encoding device and the candidate list used in the decoder may be identical, and the same candidate list may be shared between the encoding device and the decoder. The encoding device may select a candidate from among the candidates in the candidate list to be used for processing the target block. An indicator pointing to the selected candidate may be signaled from the encoding device to the decoder. The decoder may use the indicator to identify the candidate from among the candidates in the candidate list to be used for processing the target block. Alternatively, the encoding device and the decoder may identify the candidate from among the candidates in the candidate list to be used for processing the target block by the same rule.

[0204] Motion Information Candidate List: A motion information candidate list may refer to a list constructed using one or more motion information candidates.

[0205] Motion Information Candidate Index: The motion information candidate index may be an identifier or indicator pointing to a motion information candidate among the motion information candidates in the motion information candidate list that is used for prediction regarding the target block.

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

[0207] - 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.

[0208] - In the embodiments, MV may be part of the motion information. In the embodiments, information about motion information, such as motion information candidates, a list of motion information candidates, and an index of motion information candidates, may be replaced with information about MV, such as MV candidates, a list of MV candidates, and an index of MV candidates, and descriptions of motion information may also be applied to MV.

[0209] Merge: Merge can refer to the merging of motion information for multiple blocks, or it can refer to applying the motion information of one block to a target block as well. In other words, merge mode can refer to a mode where the motion information of a target block is derived from the motion information of a neighboring block.

[0210] Merge Candidate: A merge candidate may refer to a specific (restored) block used for merging with a target block, or it may refer to movement information of a specific block. Alternatively, a merge candidate may include movement information of a specific block.

[0211] - 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.

[0212] Merge candidate list: The merge candidate list may be a list composed of one or more merge candidates.

[0213] Merge Index: The merge index may be an indicator pointing to a merge candidate among the merge candidates in the merge candidate list that is used for prediction regarding the target block. Among the merge candidates in the merge candidate list, the movement information of the merge candidate indicated by the merge index may be used as movement information for the target block.

[0214] Neighbor block: A neighbor block may refer to a block adjacent to the target block. Neighbor blocks may include spatial neighbor blocks and temporal neighbor blocks. A neighbor block may also refer to a reconstructed neighbor block within the reference image.

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

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

[0217] - Spatial neighbor blocks may include blocks whose boundaries, at least a portion of which abuts at least a portion of the target block's boundary. Alternatively, spatial neighbor blocks may include blocks whose distance from the target block is less than or equal to a specific value.

[0218] - Spatial neighbor blocks may include blocks diagonally adjacent to the vertices of the target block.

[0219] - Spatial neighbor blocks may include a top-left block adjacent to the top-left of the target block, a top block adjacent to the top of the target block, a top-right block entered at the top-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 bottom-left block adjacent to the bottom of the target block, and a bottom-right block adjacent to the bottom-right of the target block.

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

[0221] - Temporal neighbor blocks may include a collocated block (COL block). A collocated block may be a block within a restored image in a reference image buffer. A collocated picture (col picture) may refer to an image containing a collocated block. A collocated picture may be an image included in a reference image list.

[0222] - Call blocks can be determined based on the location of target blocks within the target image. Two blocks being 'temporarily adjacent' may mean that the locations of the two blocks satisfy certain conditions.

[0223] - The position of the call block within the call image may be the same as the position of the target block within the target image. Alternatively, the position of the call block within the call image may correspond to the position of the target block within the target image. Here, the correspondence of the block positions may mean that the regions of the blocks are identical, that the region of one block is included within the region of another block, or that one block occupies a specific location within another block.

[0224] - For example, the location of a call block within a call image may be the same as the location of a target block within a target image. Alternatively, the call block may be a block containing call samples 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.

[0225] - Temporal neighbor blocks may be blocks that are temporally adjacent to the spatial neighbor blocks of the target block.

[0226] Search range: The search range may refer to a two-dimensional area where a search for an MV is performed during inter-prediction. For example, when an optimal MV needs to be derived for processing a target block, the optimal MV can be selected from among the MVs pointing inside the search range.

[0227] 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 inverse quantization on the quantized level.

[0228] Quantized level: A quantized level can be an integer quantity used as an input for inverse quantization.

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

[0230] Inverse Quantization: Inverse quantization can be a process of multiplying a quantized level by a factor. By applying inverse quantization to the quantized level, (restored) transformation coefficients can be generated.

[0231] Quantization Parameter (QP): QP may refer to the argument used to generate quantized levels for transform coefficients in quantization. Additionally, QP may refer to the argument used to generate (restored) transform coefficients for quantized levels in inverse quantization. Alternatively, QP may be a value mapped to the quantization step size.

[0232] 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 Delta QP.

[0233] Quantization matrix: A quantization matrix may be a matrix used in quantization or inverse quantization to improve the subjective or objective image quality.

[0234] Quantization matrix coefficients: Quantization matrix coefficients can be each element within the quantization matrix.

[0235] Scan: Scan can refer to a method of arranging values ​​within a block or matrix. The values ​​can be coefficients. For example, a scan can mean arranging values ​​arranged in a 2D form into a 1D form, or rearranging values ​​arranged in a 1D form into a 2D form. An inverse scan can be the opposite arrangement (or rearrangement) of the arrangement performed in a scan.

[0236] Non-zero transformation coefficients: Non-zero transformation coefficients may refer to transformation coefficients that have a non-zero value or quantized levels that have a non-zero value.

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

[0238] Signaling: Signaling of information may indicate that information is transmitted from an encoding device to a decoding device via a bitstream. For example, the information may include syntactic elements. Alternatively, signaling may mean that the encoding device includes information within the bitstream. Information signaled by the encoding device may be used by the decoding device. In signaling, the bitstream may be transmitted over a network and may be contained within a recording medium. In embodiments, the description that information is signaled may include: 1) the encoding device determining and generating information for signaling of information; 2) the encoding device performing encoding on the information to generate encoded information; 3) the (encoded) information being transmitted from the encoding device to the decoding device via a bitstream; 4) the decoding device performing decoding on the encoded information to obtain information; and 5) the decoding device determining and generating information through signaling of information.

[0239] - An encoding device can generate encoded information by performing encoding on the information. The encoded information can be signaled through a bitstream. A decoding device can obtain information by performing decoding on the encoded information.

[0240] - The fact that information is signaled to a specific target may mean that the information is used for each specific target, and that the processing represented by the information is applied to each specific target. For example, the fact that information is signaled at a specific unit level may indicate that the information is used or processed for each specific unit.

[0241] - The signaled information may include one or more sub-information. That specific information is signaled may mean that each piece of information of the one or more sub-information included in the specific information is signaled.

[0242] Optional Signaling: Signaling for information may be performed optionally. Optional signaling for information may mean that an encoding device optionally includes information within a bitstream (depending on specific conditions). Optional signaling for information may mean that a decoder optionally obtains information from a bitstream (depending on specific conditions).

[0243] Omission of Signaling: Signaling for information may be omitted. Omission of signaling for information may mean that the encoding device does not include information in the bitstream (depending on specific conditions). Omission of signaling for information may mean that the decoding device does not obtain information from the bitstream (depending on specific conditions). The decoding device may derive information with omitted signaling using other information of the embodiments.

[0244] Symbol: May represent at least one piece of information of a target unit, such as syntactic elements, coding parameters, quantized levels, and transform coefficients of a target unit or target block. Additionally, the symbol may represent the target of entropy encoding or the result of entropy decoding.

[0245] Entropy encoding: Entropy encoding can allocate a small number of bits to symbols with a high probability of occurrence and a large number of bits to symbols with a low probability of occurrence. Through this allocation, the size of the bitstream representing the symbols can be reduced.

[0246] Entropy coding can utilize 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 variable-length tables. For instance, in CABAC, a binaryization method for symbols and a probabilistic model of symbols / bins can be derived for entropy coding, and context-based arithmetic coding can be performed.

[0247] Entropy Decoding: In entropy decoding, the processes performed in entropy encoding can be performed in reverse. Symbols can be generated by entropy decoding of a bitstream.

[0248] Parsing: Parsing can refer to determining the values ​​of syntactic elements by performing entropy decoding on the encoded information of a bitstream. Alternatively, parsing can refer to entropy decoding itself.

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

[0250]

[0251] Coding parameters

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

[0253] In the embodiments, the coding parameters include the size of the CTU, the size of the unit, the form of the unit, the shape of the unit, the depth of the unit, the minimum unit size, the maximum unit size, the maximum unit depth, the minimum unit depth, the unit splitting information, QT splitting information, BT splitting information, the splitting direction of the BT splitting, the splitting form of the BT splitting, TT splitting information, the splitting direction of the TT splitting, the splitting form of the TT splitting, MTT splitting information, the combination of MTT splittings, the splitting direction of the MTT splitting, the splitting form of the MTT splitting, the prediction mode, the intra prediction mode, the luminance intra prediction mode, the chroma intra prediction mode, the intra prediction mode, the inter splitting information, the coding block splitting information, the prediction block splitting information, the transformation block splitting information, the reference sample line index, the reference sample filtering method, the reference sample filter tab, the reference sample filter coefficients, the prediction block filtering method, the prediction block filter tab, the prediction block filter coefficients, the prediction block boundary filtering method, the prediction block boundary filter tab, the prediction block boundary filter coefficients, the inter prediction mode, motion information, MV, and Motion Vector Difference; MVD), MVD resolution, MV size, MV representation accuracy, reference image list, reference image, reference image 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 correction 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, interpolation filter filter tab, interpolation filter filter coefficients, transform type, transform size, transform selection information, primary transform usage information,Secondary transform usage information, primary transform selection information, secondary transform selection information, residual block presence information, coded block pattern, coded block flag, QP, delta QP, quantization matrix, deblocking filter usage information, deblocking filter coefficients, deblocking filter filter tab, deblocking filter strength, deblocking filter shape / form, adaptive sample offset usage information, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, adaptive loop filter usage information, adaptive loop filter coefficients, adaptive loop filter filter tab, adaptive loop filter shape / form, 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 coding flag, last significant coefficient position, flag indicating whether the coefficient value is greater than 1, whether the coefficient value is greater than 2 Flag indicating presence, flag indicating whether the coefficient value is greater than 3, remaining coefficient value information, sign information, context bin, bypass bin, restored sample, restored luminance sample, restored chroma sample, residual sample, residual luminance sample, residual chroma sample, transform coefficient, luminance transform coefficient, chroma transform coefficient, transform coefficient level, luminance transform coefficient level, chroma transform coefficient level, transform coefficient level scanning method, quantized level, luminance quantized level, chroma quantized level, size of the MV seek area on the decoder side, shape of the MV seek area on the decoder side, number of MV seeks on the decoder side, picture type, slice identification information, slice type, slice splitting information, tile group identification information, tile group type, tile group splitting information, tile identification information, tile type, tile splitting information, bit depth,It may include one or more of input sample bit depth, restored sample bit depth, residual sample bit depth, transform factor bit depth, quantized level bit depth, mapping availability information, information about the luminance signal, information about the chroma signal, the color space of the target block, the color space of the residual block, and temporal layer information.

[0254] 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 of 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.

[0255] In the embodiments, "X usage information" may be "information indicating whether X is used / applied / executed." 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. Mode information may indicate a mode used for a target block among the modes described in the embodiments. In the embodiments, specific mode usage information may be replaced with mode information, and the description of specific mode usage information may also apply to mode information. "X usage information" and "X indicator" may be used interchangeably.

[0256] In the embodiments, coding parameters and syntax elements may correspond to each other. For example, a syntax element of the embodiment may be used as a coding parameter, and a coding parameter may be signaled as a syntax element.

[0257] In the embodiments, "X existence information" may be considered as "information indicating whether X exists" or "information indicating whether information indicating X exists within the bitstream".

[0258] In the embodiments, "X selection information" may be information indicating one of the candidates or methods for X. "X selection information" may be considered as an "X index".

[0259] In the embodiments, the splitting form of a specific 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 specific tree may represent one of horizontal direction and vertical direction.

[0260] In the embodiments, when the coding parameter has one of a plurality of values, "coding parameter" may be replaced with "whether the coding parameter has a specific value among the plurality of values ​​available to the coding parameter".

[0261] In the embodiments, when the coding parameter refers to one of a plurality of targets, the "coding parameter" may be replaced with "whether the coding parameter refers to a specific target among the plurality of targets."

[0262]

[0263] System for video coding

[0264] FIG. 1 shows a system for video coding according to one embodiment.

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

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

[0267]

[0268] Structure of the encoding device

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

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

[0271] The processor (120) may be a semiconductor device that executes instructions or computer-executable code, such as a Central Processing Unit (CPU). The processor (120) may be at least one hardware processor.

[0272] The processor (120) can perform generation and processing of information that is input to the encoding device (110) in the embodiments, output from the encoding device (110), or used inside the encoding device (110), and can perform comparison and judgment related to such information.

[0273] 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).

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

[0275] 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.

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

[0277] 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).

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

[0279]

[0280] Operation of the encoding device

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

[0282] The storage (140) can store the original image. In the encoding device (110), the original image can be used as the target image.

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

[0284] The splitter (122) can determine the target block by performing a split on the target image.

[0285] 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 a prediction according to the prediction mode.

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

[0287] 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.

[0288] 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.

[0289] For example, if the prediction mode is IBC, the predictor (123) can perform an IBC prediction for the target block to generate a prediction block of the target block.

[0290] 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 prediction block. The original block may be the region of the original image pointed to by the target block. 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 prediction block.

[0291] The converter (125) can perform a conversion on the residual block to generate conversion coefficients.

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

[0293] For example, multiple transformation methods may include the Discrete Cosine Transform (DCT), Discrete Sine Transform (DST), Karhunen-Loeve Transform (KLT), and transformations based on each transformation.

[0294] The transform skip mode may be a mode that generates a restored block using the restored residual block and prediction block, for which transform and inverse transform have not been performed. When the transform skip mode is applied to a target block, the transform and inverse transform for the target block may be omitted, and only quantization and inverse quantization for the target block may be performed.

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

[0296] The entropy encoder (139) can generate encoded information by performing entropy encoding based on a probability distribution on information for decoding an image. The bitstream may contain the encoded information.

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

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

[0299] The entropy encoder (139) can convert quantized levels, which have the form of a two-dimensional block, into the form of a one-dimensional vector by using scanning to perform encoding for the quantized levels. In the scanning, it can be determined which scan to use among an upper-right diagonal scan, a vertical scan, and a horizontal scan based on coding parameters such as the size of the block and the intra-prediction mode of the block.

[0300] 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 that are subsequently processed. Accordingly, the processor (120) can perform restoration on the encoded target block and can store the restored image containing the restored target block generated by the restoration in the reference picture buffer (141) as a reference image. Inverse quantization and inverse transform can be performed on the encoded target block for restoration.

[0301] The inverse quantizer (127) can generate inverse quantized conversion coefficients by performing inverse quantization on the quantized level.

[0302] The inverse converter (128) can generate inversely quantized and inversely converted coefficients by performing an inverse conversion on the inversely quantized conversion coefficients. In embodiments, the inversely quantized and / or inversely converted coefficients may refer to coefficients to which at least one of the inverse quantization and inverse conversion has been applied. The inversely quantized and inversely converted coefficients may be restored residual blocks.

[0303] The adder (129) can generate a recovery block by combining the prediction block and the recovered residual block.

[0304] 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 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.

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

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

[0307]

[0308] Structure of the decoding device

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

[0310] The description of the processor (120), storage (140), and communication device (149) associated with the encoding device (110) may also apply to the processor (160), storage (180), and communication device (189) associated with the decoding device (150). Redundant descriptions are omitted.

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

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

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

[0314] Among the names of the components of the decoding device (150), "-gi" ("-er" or "-or") may be replaced with "-bu" (- unit). The storage unit (180) may also be named a storage unit.

[0315]

[0316] Operation of the decoding device

[0317] 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).

[0318] 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 a storage device (180).

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

[0320] A bitstream can contain encoded information.

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

[0322] Information for decoding an image may include quantized levels and syntax elements, etc.

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

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

[0325]

[0326] Common explanation based on the relationship between the components of the encoding device and the components of the decoding device

[0327] The decoding device (150) performs decoding using the bitstream generated by the encoding device (110). The encoding device (110) may perform encoding for 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). Accordingly, the encoding device (110) and the decoding device (150) may need to generate the restored block / image in the same way. In this regard, the descriptions of the divider (122), predictor (123), inverse quantizer (127), inverse converter (128), adder (129), filter (130), and reference picture buffer (141) of the encoding device (110) disclosed in the embodiments may also be applied to the divider (162), predictor (163), inverse quantizer (167), inverse converter (168), adder (169), filter (170), and reference picture buffer (181) of the decoding device (150), respectively. Redundant descriptions are omitted.

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

[0329] 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, regarding the function of 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). Regarding the function of conversion, the processor may represent a converter (125) and an inverse converter (128), and may represent an inverse converter (168). Regarding the function of quantization, the processor may represent a quantizer (126) and an inverse quantizer (127), and may represent an inverse quantizer (167). In terms of functions related to entropy encoding / decoding, the processing unit may represent an entropy encoder (139) and / or an entropy decoder (161). In terms of functions related to filtering, the processing unit may represent a filter (130) and / or a filter (170). The storage unit may represent a storage unit (140) of the encoding device (110) and / or a storage unit (180) of the decoding device (150). The reference picture buffer may represent a reference picture buffer (141) of the encoding device (110) and / or a reference picture buffer (181) of the decoding device (150). The communication unit may represent a communication unit (149) of the encoding device (110) and / or a communication unit (189) of the decoding device (150).

[0330]

[0331] Partitioning of the units that constitute the image

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

[0333] Figure 2 schematically illustrates an example in which a single unit is divided into multiple sub-units.

[0334] CU can be used as a base unit for encoding and decoding of images. Additionally, CU can be a base unit for prediction, transformation, quantization, inverse quantization, inverse transformation, entropy encoding, and entropy decoding.

[0335] A CU can be used as a unit to which a prediction mode is applied. That is to say, in coding, it can be determined which of the available prediction modes will be applied to each CU. For example, available prediction modes may include intra prediction, inter prediction, and IBC intra block copy prediction.

[0336] 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, one CTU can be used as a CU. The size of the CTU can be the maximum size of the CU.

[0337] Each CU may have depth information. The depth information may represent the depth of the CU and the size of the CU. The depth of the CTU may be 0. The depth of the CU created by dividing the CTU may be 1. When a parent CU is divided into child CUs, the depth of the child CU may be 1 greater than the depth of the parent CU. The number of divided CUs may be a positive integer greater than or equal to 2, including 2, 4, 8, and 16. At least one of the width and height of the child CU created by dividing the parent CU may be smaller than at least one of the width and height of the parent CU, depending on the number of child CUs.

[0338] A partitioned CU can be recursively partitioned in the same way up to a predefined maximum depth or a predefined minimum size. The depth of a Smallest Coding Unit (SCU) can be the predefined maximum depth, and the size of an SCU can be the predefined minimum size. The size of an SCU can be the minimum CU size.

[0339] For example, the depth range of a CU can be values ​​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 64x64 blocks. 0 can be the minimum depth. An SCU with a depth of 3 can be 8x8 blocks. 3 can be the maximum depth. Depth 0 can represent a CTU that is 64x64 blocks. Depth 1 can represent a CU that is 32x32 blocks. Depth 2 can represent a CU that is 16x16 blocks. Depth 3 can represent an SCU that is 8x8 blocks.

[0340] The partition information of a CU may indicate whether the CU is partitioned. The partition information may be a 1-bit flag. All CUs except the SCU may include partition information. For example, the partition information of a CU that is not further partitioned may be a first value of '0', and the partition information of a CU that is partitioned may be a second value of '1'.

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

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

[0343] Ternary tree (TT) partitioning can mean that a single CU is divided into three CUs. For example, when a parent CU is divided into three child CUs, the three child CUs can be created by dividing the width or height of the parent CU in a ratio of 1:2:1. The width or height of the child CUs can be 1 / 4, 1 / 2, and 1 / 4 of the width or height of the parent CU, respectively.

[0344] In FIG. 2, QT-type splitting was applied to the first CTU. QT splitting, BT splitting, and TT splitting were applied to the second CTU.

[0345] To split a CTU, at least one of different types of splits, such as QT splitting, BT splitting, and TT splitting, may be applied to the CTU. Different types of splits may be applied based on specific priorities.

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

[0347] The splitting of a CU corresponding to each node of QT can be signaled using QT splitting information. The QT splitting information may be a flag. The QT splitting information of a unit may be information indicating whether the unit is split into a QT form. A first value of the QT splitting information, '0', may indicate that the CU is not split into a QT form. QT splitting information having a first value may signify a Multi-Type Tree (MTT) split. MTT splitting may include BT splitting and TT splitting. A second value of the QT splitting information, '1', may indicate that the CU is split into a QT form.

[0348] There may be no priority between BT splitting and TT splitting. That is, CUs corresponding to the leaf nodes of QT can be split into BT form or TT form. Additionally, CUs generated by BT splitting or TT splitting can be split again into BT form or TT form, or they may not be split any further.

[0349] A CU corresponding to a leaf node of QT can be a root node of MTT. For a CU corresponding to each node of MTT, the CU may further include partition direction information and partition type information in the form of MTT.

[0350] The splitting direction information can indicate the splitting direction of the MTT split. The first value of the splitting direction information, '0', can indicate that the CU is split in the horizontal direction. The second value of the splitting direction information, '1', can indicate that the CU is split in the vertical direction.

[0351] The split type information may indicate the split type used for multi-type tree splitting. The first value of the split type information, '0', may indicate that CU is split into TT form. The second value of the split type information, '1', may indicate that CU is split into BT form.

[0352] Here, each of the aforementioned division direction information and division shape information may be a flag having a specified length (e.g., 1 bit).

[0353] The partitioning information of CU may also include QT partitioning information, partitioning direction information, and partitioning shape information.

[0354] A CU that is no longer divided by QT division, BT division, and TT division can be used as a unit for specific processing such as prediction, transformation, quantization, inverse quantization, inverse transformation, entropy encoding, and entropy decoding. That is, for a specific processing, the CU may no longer be divided. Therefore, division information for dividing such a CU into PU and / or TU, etc., may not exist within the bitstream.

[0355] On the other hand, if the size of a CU is larger than the maximum TU size, such a CU can be recursively partitioned until the size of the CU becomes less than or equal to the maximum TU size. For example, if the size of the CU is 64x64 and the maximum TU size is 32x32, the CU can be partitioned into 4 32x32 TUs for transformation. For example, if the size of the CU is 32x64 and the maximum TU size is 32x32, the CU can be partitioned into 2 32x32 TUs for transformation.

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

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

[0358] 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 as the minimum size of the CU.

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

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

[0361] Information regarding the maximum or minimum size described in the embodiments may be signaled at the upper level of the CU. In the embodiments, the upper 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, etc.

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

[0363]

[0364] Processing of blocks based on block attributes

[0365] Whether a specific process described in the embodiments is applied or performed may be determined based on the attributes of the block associated with the specific process. Whether a specific process described in the embodiments is applied or performed may be determined based on whether the attributes of the block associated with the specific process satisfy specific conditions. For example, a block may include a target block, a neighbor 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.

[0366] The block to which the specific treatment described in the embodiments is applied may have a square shape or a non-square shape.

[0367] In one embodiment, the attributes of the block may include the size of the block. The specific processing described in the embodiments may be applied / performed when specific conditions regarding the size of the block are met.

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

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

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

[0371] 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 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 the minimum block size and less than the maximum block size. The processing of the embodiment may be applied / performed only when the block size is greater than the minimum block size and less than the maximum block size.

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

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

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

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

[0376]

[0377] Prediction information for prediction

[0378] Predictive information can be used to generate a predicted block for a target block.

[0379] The encoding device (110) can generate prediction information required for prediction and can generate a bitstream containing the prediction information. The prediction information can be signaled from the encoding device (110) to the decoding device (150) through the bitstream. The decoding device (150) can obtain the prediction information from the bitstream and can generate a prediction block by performing a prediction on a target block using the prediction information.

[0380] Prediction information may include intra prediction information, inter prediction information, and IBC prediction information. In the 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 the embodiments. Inter prediction information may include information used for inter prediction as described in the embodiments. IBC information may include information used for IBC prediction as described in the embodiments.

[0381]

[0382] Intra prediction

[0383] Figure 3 shows the structure of an intra prediction according to one embodiment.

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

[0385] The reference block may be a (spatial) neighbor block of the target block. The coding parameter may be a coding parameter for the target block and / or a coding parameter for the reference block. In intra-prediction, the reference sample may refer to a neighbor sample.

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

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

[0388] An intra prediction mode can be represented 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 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. An intra prediction mode for a target block may be selected from directional modes and non-directional modes.

[0389] In the bottom-right rectangle representing the target block, the number '0' may represent Planner mode, which is a non-directional intra prediction mode. The number '1' may represent DC mode, which is a non-directional intra prediction mode. In the bottom-right rectangle representing the target block, arrows extending from the center of the rectangle outwards may represent the prediction directions of directional intra prediction modes. Additionally, the number displayed near the arrow may represent an example of a mode value assigned to an intra prediction mode or a prediction direction of an intra prediction mode.

[0390] Intra prediction can be performed according to the intra prediction mode for the target block. One of the intra prediction modes available for the target block can be used as the intra prediction mode for the target block.

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

[0392] For example, in FIG. 3, the directional modes illustrated by dashed lines (i.e., directional modes with numbers from -14 to -1 or numbers from 67 to 80) can be applied only to predictions for non-square blocks. Therefore, the number of available intra-prediction modes for predictions for square blocks may be 67. (Planner mode, DC mode, and 65 directional modes)

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

[0394] Intra-prediction modes may include a horizontal-below mode, a horizontal mode, a vertical mode, and a vertical-right mode. The horizontal-below mode may be an intra-prediction mode located at the bottom of 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 with a mode value 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 with a mode value of 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 and 17 may be horizontal bottom modes.

[0395] The number of the aforementioned intra-prediction modes and the mode number of each intra-prediction mode may be exemplary only. The number of the aforementioned intra-prediction modes and the mode number of each intra-prediction mode may be defined differently depending on the embodiment, implementation, and / or as necessary.

[0396] When the intra prediction mode is a planner mode, when generating a prediction block of a target block, the sample value of the prediction sample can be generated using a weighted sum (weighted sum) of the top reference sample of the target sample, the left reference sample of the target sample, the right top reference sample of the target block, and the left bottom reference sample of the target block, depending on the position of the prediction sample within the prediction block.

[0397] When the intra prediction mode is DC mode, a prediction block can be generated based on the average of the sample values ​​of multiple reference samples. The multiple reference samples may include top reference samples and left reference samples of the target block. The value of the prediction sample of the prediction block can be determined based on the average of the sample values ​​of the multiple reference samples. Additionally, filtering using the values ​​of the reference samples can be performed on specific rows and / or specific columns within the target block. The specific rows may be one or more top rows adjacent to the top reference samples. The specific columns may be one or more left columns adjacent to the left reference samples.

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

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

[0400] For example, if the intra prediction modes of the target block and the neighbor block are the same, an indicator indicating that the intra prediction modes of the target block and the neighbor block are the same may be signaled.

[0401] For example, an indicator indicating an intra prediction mode such as the intra prediction mode of the target block among the intra prediction modes of multiple neighboring blocks may be signaled.

[0402] For example, if the intra prediction modes of the target block and neighboring blocks are different from each other, an indicator indicating the intra prediction mode of the target block 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.

[0403] Reference samples used for intra-prediction of a target block may include bottom-left reference samples, left reference samples, top-left reference samples, top reference samples, and top-right reference samples, etc.

[0404] For example, left reference samples may be restored reference samples adjacent to the left side of the target block. Top reference samples may be restored reference samples adjacent to the top side of the target block. Top-left reference samples may be restored reference samples diagonally adjacent to the top-left side of the target block. 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 left reference samples. Top-right reference samples may be reference samples located to the right of the top reference samples among samples located on the same line as the top sample line composed of top reference samples.

[0405] 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 may be used to determine the sample values ​​of the prediction samples of the prediction block. In FIG. 3, the direction of the intra-prediction mode indicated by the arrow may represent the direction from the prediction sample to the reference sample. The direction of the intra-prediction mode may 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 may be used as the sample value of at least one sample of the prediction block. Here, the specific reference sample and at least one sample of the prediction block may be samples designated by a straight line of the direction of the intra-prediction mode. That is to say, the sample value of the specific reference sample may be copied to 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 may be the sample value of the reference sample located in the direction of the intra-prediction mode relative to the location of the prediction sample.

[0406] 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 line 0 to reference sample line 3 may be used for intra-prediction of the target block.

[0407] Each reference sample line in FIG. 3 may contain one or more reference samples. The smaller the number of the reference sample line, the closer the line of reference samples may be to the target block. Reference sample line 0 may be a line of reference samples immediately adjacent to the target block. When the top-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 with an x-coordinate of X-1 or a y-coordinate of Y-1. Here, the y-coordinates of the reference samples with an x-coordinate of X-1 may be Y-1 to Y+2H. The x-coordinates of the reference samples with a y-coordinate of Y-1 may be X-1 to X+2W. The reference samples of reference sample line A may be samples with an x-coordinate of XA-1 or a y-coordinate of YA-1. Here, the y-coordinates of the reference samples with an x-coordinate of XA-1 may be YA-1 to Y+2H+A. The x-coordinates of reference samples with y-coordinate YA-1 can be XA-1 to X+2W+A. A can be 1, 2, or 3.

[0408] Samples of segments A and F can be derived using padding that uses the nearest samples of segments B and E, respectively, instead of being obtained from restored neighbor blocks.

[0409] The 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 from 0 to 3. The reference sample line index may be signaled.

[0410] When intra-color component prediction is used for a target block, a prediction block for a second color component can be generated based on a reconstruction block of a first color component for the target block. For example, the first color component may be a luminance component, and the second color component may be a chroma component.

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

[0412] 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.

[0413] Once the parameters are derived, a prediction block for a second color component for a target block can be generated by applying the reconstruction 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 or downsampling may be performed on the surrounding samples of the reconstruction block of the first color component and on the reconstruction block of the first color component. If subsampling is performed, the derivation of parameters and the intra-prediction between color components may be performed using corresponding samples derived by subsampling.

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

[0415] In performing a prediction for a target block, it may be determined whether samples included in a restored neighbor block can be used as reference samples for the target block. If there are non-available samples among the samples in the neighbor block that cannot be used as reference samples for the target block, a value generated by copying and / or interpolation using the sample value of at least one sample among the samples included in the restored neighbor block may replace the sample value of the non-available sample. If the value generated by copying and / or interpolation replaces the sample value of the sample, the sample may be used as a reference sample for the target block.

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

[0417]

[0418] Inter prediction

[0419] FIG. 4 shows the structure of an inter prediction to explain an inter prediction process according to one embodiment.

[0420] The rectangle shown in Fig. 4 can represent an image. Additionally, the arrow in Fig. 4 can represent the predicted direction.

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

[0422] 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 referencing other images. For example, coding for the I picture can be performed using intra-prediction and / or IBC prediction.

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

[0424] If the target picture is a P picture, coding for the target picture can be performed using unidirectional inter-prediction using a single reference image list.

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

[0426] Below, the inter prediction for the target block in the inter mode according to the embodiment is described in detail.

[0427] 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 partitioned prediction block.

[0428] 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.

[0429] Motion information can be derived using coding parameters, etc. For example, motion information can be derived using motion information of restored neighbor blocks, motion information of call blocks, and / or motion information of blocks adjacent to call blocks.

[0430] In the embodiments, a candidate list may be used for inter prediction. The candidate list may include multiple candidates. An index pointing to a candidate among the candidates in the candidate list that is used for inter prediction for a target block 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. Additionally, in order to specify a candidate by an index, the order of candidates within the candidate list may be constant.

[0431] In one embodiment, a prediction for 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. Motion information of a spatial candidate may be referred to as spatial motion information. Motion information of a temporal candidate may be referred to as temporal motion information.

[0432] Spatial candidates may be restored spatial neighbor blocks that are spatially adjacent to the target block.

[0433] Spatial candidates may be blocks that 1) exist within the target image, 2) have already been restored through decoding, and 3) are adjacent to the target block.

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

[0435] Temporal candidates may be restored temporal neighbor blocks corresponding to the target block within the restored call (COL) image.

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

[0437] In inter prediction, a call block for a target block can be identified. The region of the target block within the target image and the region of the call block within the call image may be the same. That is to say, the call block may be a block that occupies a specific region within the call image. The specific region may be a region corresponding to the region of the target block within the call image.

[0438] Temporal candidates may be locations inside and / or outside the call block within the call image.

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

[0440] 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 the prediction MV. Alternatively, the MV of the temporal candidate stored in the candidate list associated with the inter-prediction can be the scaled MV.

[0441] 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 of the target block and the target image. The second temporal distance may be the distance between the reference image of the call block and the call image.

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

[0443]

[0444] AMVP mode

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

[0446] Spatial candidates may include restored spatial neighbor blocks. The MV of a restored spatial neighbor block may be referred to as a spatial motion vector candidate. Temporal candidates may include a call block and a block adjacent to the call block. The MV of a call block or the MV of a block adjacent to the call block may be referred to as a temporal motion vector candidate. History-based MV candidates may be MVs in a list containing MVs of other blocks that were encoded / decoded before the encoding / decoding of the target block.

[0447] The encoding device (110) can determine the MV to be used for encoding a target block within a search range using an MV candidate list. The maximum number of MV candidates in the MV candidate list may be predefined. N may represent the predefined maximum number. For example, N may be 2. Alternatively, the maximum number of such candidates may 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 the predicted MV of the target block among the MV candidates in the MV candidate list. The MV to be used for encoding the target block may be an MV that can be encoded at the minimum cost. The encoding device (110) may determine whether to use the AMVP mode in encoding the target block and may generate AMVP mode usage information indicating whether the AMVP mode is used.

[0448] 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 residual blocks. Inter prediction information may be signaled from the encoding device (110) to the decoding device (150) in the form of a bitstream.

[0449] 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 being 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, the MV candidate pointed to by the MV candidate index can be selected as the predicted MV of the target block.

[0450] The MVD may represent the difference between the MV that will actually be 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 that will actually be used for inter-prediction of the target block in order to use an MVD of the smallest possible size. The decoding device (150) may derive the MV of the target block by summing the MVD and the predicted MV. That is to say, the MV of the target block derived by the decoding device (150) may be the sum of the MVD and the predicted MV candidates.

[0451] 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.

[0452] Meanwhile, the encoding device (110) can calculate the MVD based on an affine model. The affine control point MV of the target block can be derived based on the sum of the affine control point MV candidates and the MVD. Using the affine control point MV, the MV of each sub-block within the target block can be derived.

[0453]

[0454] Merge Mode

[0455] When merge mode is used, a merge candidate list containing multiple merge candidates can be generated using motion information of spatial candidates and motion information of temporal candidates, etc. Motion information may include 1) MV, 2) reference image index and 3) reference direction, etc. A merge candidate may be motion information.

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

[0457] A history-based merge candidate may be movement information within a list containing movement information of other blocks that were encoded / decoded earlier than the encoding / decoding of the target block.

[0458] The average merge candidate may be a merge candidate generated based on the average of two merge candidates within the merge candidate list.

[0459] Zero merge candidates can be zero vector motion information. Zero vector motion information can be motion information where MV is a zero vector.

[0460] 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 configured in the encoding device (110) and the decoding device (150) through the predefined method and a predefined order.

[0461] 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.

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

[0463] 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 merge mode-related information, such as a merge index, from the bitstream.

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

[0465] Correction information may be information used for correcting the MV. The encoding device (110) may generate correction information. The decoding device (150) may derive a corrected MV by performing correction on the MV of a merge candidate selected by a merge index based on the correction information. The corrected MV may be used as the MV of the target block.

[0466] 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 magnitude information. The correction usage information may indicate whether to use correction 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 having an MVD.

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

[0468] Movement 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.

[0469] In one embodiment, the merge candidates in the merge candidate list may be specific modes that induce inter-prediction information. A merge candidate may be information pointing to a specific mode that induces inter-prediction information. Inter-prediction information of a target block may be induced according to the specific mode pointed to by the merge candidate. In this regard, the specific mode may be regarded as a specific inter-prediction information inducing mode or a specific movement information inducing mode. The specific mode may include a series of processes that induce inter-prediction information.

[0470] Inter-prediction information of the target block can be derived according to a specific mode pointed to by a merge candidate selected by a merge index among the merge candidates in the merge candidate list. For example, specific modes may include a mode for deriving motion information at the sub-block level and a mode for deriving motion information at the affine level, and may include other modes for deriving motion information as described in the embodiments.

[0471] Skip mode may be a mode that does not use residual blocks. That is to say, when skip mode is used, the restoration block may be identical to the prediction block. The description of the 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 to say, 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.

[0472] The subblock merge mode may be a mode in which motion information of a target subblock is induced 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 the call subblock of the target subblock.

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

[0474] Here, the first weight for the first prediction sample of the weighted consensus and the second weight for the second prediction sample can be determined based on the boundaries of the GPM. The boundaries may represent dividing lines that divide the target block. Depending on the boundaries, the target block may be divided into a first divided region and a second divided region.

[0475] 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 the 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.

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

[0477] In the aforementioned modes, self-improvement of the derived motion information may be performed, and the improved motion information may be used as motion information for the target block. For example, blocks within a specific region determined based on the derived motion information may be searched, and the motion information of the block having the smallest Sum of Absolute Differences (SAD) value among the searched blocks may be used as the improved motion information for the target block. The specific region may be a square region within the reference image specified by the motion information. The point indicated by the motion information may be the center of the specific region.

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

[0479]

[0480] FIG. 5 shows the order of addition of spatial candidates to the candidate list according to one embodiment.

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

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

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

[0484] Spatial candidate A0 may be a block adjacent to the bottom-left of the target block. A0 may be a block occupying a sample of coordinates (xP - 1, yP + nPSH).

[0485] 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. Or, A1 may be a block adjacent to the top of A0. A1 may be a block occupying a sample of coordinates (xP - 1, yP + nPSH - 1).

[0486] Spatial candidate B0 may be a block adjacent to the top right of the target block. B0 may be a block occupying a sample of coordinates (xP + nPSW, yP - 1).

[0487] 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. Or, B1 may be a block adjacent to the left of B0. B1 may be a block occupying a sample of coordinates (xP + nPSW - 1, yP - 1).

[0488] Spatial candidate B2 may be a block adjacent to the top-left corner of the target block. B2 may be a block occupying a sample of coordinates (xP - 1, yP - 1).

[0489] As illustrated in Fig. 5, in adding spatial candidates to the candidate list, B1, A1, The order B0, A0, and B2 can be used. That is, B1, A1, Available spatial candidates can be added to the candidate list in the order of B0, A0, and B2. The order in which spatial candidates illustrated in FIG. 5 are added to the merge candidate list may be just one example.

[0490] 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, etc.

[0491] To include a spatial or temporal candidate in the candidate list, it may be determined whether the spatial or temporal candidate is available. If a candidate block is outside the boundaries of an image, slice, or tile, the availability of the candidate block may be set to false. The description "availability is set to false" may mean "it is set to non-available."

[0492] The maximum number of candidates in the 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 value of N can be 5 by default.

[0493]

[0494] IBC mode

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

[0496] 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.

[0497] In IBC mode, the predicted block of the target block can be generated based on the BV. The BV can specify the reference block. The BV can indicate the 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 of the embodiments can also be applied to the BV.

[0498] The IBC mode may include a skip mode, a merge mode, and an AMVP mode, etc. The descriptions of the AMVP mode, merge mode, and skip mode of the embodiments may be similarly applied to the AMVP mode, merge mode, and skip mode of the IBC mode, respectively.

[0499] In skip mode or merge mode, a merge candidate list may be configured, and a merge index may specify one merge candidate from among the merge candidates in the merge candidate list. The BV of the specified merge candidate may be used as the BV of the target block.

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

[0501] The reference block in IBC mode may be limited to a block within an already restored 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 restricted 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 containing the target block. The specific size may be 64x64.

[0502]

[0503] Transformation and Quantization

[0504] Quantized levels can be generated by performing a transformation and / or quantization on the residual block. The residual block can represent the difference between the original block and the prediction block. A restored residual block can be generated by performing inverse quantization and / or inverse transformation on the quantized levels. The restored residual block can represent the difference between the restored block and the prediction block.

[0505] When a transformation or inverse transformation is performed, a separable transform or a 2D non-separable transform may be performed on the residual block. A separable transform may be a transformation that performs 1D transformations on the residual block in the horizontal and vertical directions, respectively.

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

[0507] A transformation set may be used to determine the DCT type, DST type, or learning-derived kernel to be used for the transformation. Each transformation set may include multiple transformation candidates. Each transformation candidate may be a DCT type, a DST type, or a learning-derived kernel, etc.

[0508] The encoding device (110) can perform conversion and inverse conversion using conversion candidates included in the conversion set. The decoding device (150) can perform inverse conversion using conversion candidates included in the conversion set. Conversion selection information indicating which conversion candidate is used among the plurality of conversion candidates included in the conversion set applied to the residual block may be signaled. The conversion selection information may include vertical conversion selection information and horizontal conversion selection information. The vertical conversion selection information may indicate which conversion among the conversions belonging to the conversion set is used for the vertical conversion. The horizontal conversion selection information may indicate which conversion among the conversions belonging to the conversion set is used for the horizontal conversion.

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

[0510] A first-order transformation may mean a Multiple Transform Selection (MTS) that applies different transformations to each of the 1D directions (i.e., vertical and horizontal directions).

[0511] A second-order transformation may be a transformation intended to improve the energy concentration of the transformation factors generated by a first-order transformation. A second-order transformation may be 1) a separable transformation like the first-order transformation, or 2) a 2D non-separable transformation. A 2D non-separable transformation may refer to a Low Frequency Non-Separable Transform (LFNST) or a Non-Separable Primary Transform (NSPT).

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

[0513] A first-order transformation may be performed using at least one of a plurality of predefined transformation methods. For example, the plurality of predefined transformation methods may include DCT, DST, and KLT, etc. Additionally, the first-order transformation may be a transformation having various transformation types according to transformation kernel functions that define DCT and DST. For example, the first-order transformation may include a plurality of transformations 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 transformation kernels.

[0514] In one embodiment, the transformation type may be determined based on coding parameters related to the target block. For example, the transformation type may be determined based on one or more of 1) the prediction mode of the target block (e.g., one of intra prediction and inter prediction), 2) the size of the target block, 3) the shape of the target block, 4) the intra prediction mode of the target block, 5) the components of the target block (e.g., one of luminance components and chroma components), and 6) the splitting type applied to the target block (e.g., one of QT, BT, TT, and non-split).

[0515] As in the first transformation, a set of transformations can be defined in the second transformation as well. Methods for deriving and / or determining the set of transformations of the embodiments can be applied to the second transformation as well as the first transformation.

[0516] In one embodiment, the first transformation and / or second 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 first transformation and / or second transformation is applied.

[0517] For example, first-order transformation and / or second-order transformation may be applied to one or more signal components among the luminance component and the chroma component.

[0518] In one embodiment, the transformation selection information may include first transformation usage information and second transformation usage information. The first transformation usage information may indicate whether a first transformation is applied to the residual block of the target block. The second transformation usage information may indicate whether a second transformation is applied to the residual block of the target block.

[0519] In one embodiment, whether a first transformation and / or a second transformation is applied may be determined based on coding parameters for the target / neighbor block, such as the size and shape of the target / neighbor block.

[0520] In one embodiment, the transformation selection information may include first transformation selection information and second transformation selection information. The first transformation selection information may indicate a transformation method applied to a residual block among a plurality of transformation methods that can be used in the first transformation. The first transformation selection information may be a first transformation index. The second transformation selection information may indicate a transformation method applied to a transformation coefficient among a plurality of transformation methods that can be used in the second transformation. The second transformation selection information may be a second transformation index.

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

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

[0523] Information related to transformations, 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.

[0524] Quantized levels can be generated by performing quantization on the result or residual block generated by performing a first-order transformation and / or a second-order transformation.

[0525] The description of the transformation described above may also be applied to the inverse transformation. In such application, the inverse processing of the processing described for the transformation may be performed in the inverse transformation. "Transformation" within the name related to the transformation may be changed to "inverse transformation." Additionally, the input of the transformation may be considered as the output of the inverse transformation. The output of the transformation may be considered as the input of the inverse transformation. The decoding device (150) may obtain information related to the transformation, such as transformation selection information, and may use the information related to the transformation to perform the inverse processing of the processing related to the transformation indicated by the information related to the transformation.

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

[0527] Transform coefficients or quantized levels may be scanned according to at least one scanning type among diagonal scanning, vertical scanning, and horizontal scanning. Diagonal scanning may be top-right diagonal scanning or bottom-left diagonal scanning.

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

[0529] The scanning type for the coefficients can be determined based on coding parameters such as intra prediction mode, block size, and block shape. For example, based on coding parameters such as intra prediction mode, block size, and block shape, it can be determined which scanning method—diagonal scanning, vertical scanning, and horizontal scanning—will be used. A block may be a transformation unit.

[0530] Scanning according to each scanning type can start at a specific starting point and end at a specific ending point.

[0531] In scanning, the scanning order according to the scanning type can first be applied between subblocks. Next, the scanning order according to the scanning type can be applied to the transformation coefficients or quantized levels within the subblocks.

[0532] The encoding device (110) can perform entropy encoding on the conversion coefficients or quantized levels to generate a bitstream containing entropy-encoded conversion coefficients or entropy-encoded quantized levels.

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

[0534] Backscanned transform coefficients or backscanned quantized levels can be generated through backscanning of the coefficients. In this case, the backscanning types of backscanning may include diagonal scans, vertical scans, and horizontal scans, and a backscanning type of the inverse transform corresponding to the scanning type of the transform may be selected.

[0535] In the decoding device (150), inverse quantization can be performed on the (backscanned) coefficients. Depending on whether a second inverse transform is performed, a second inverse transform can be performed on the result generated by the performance of inverse quantization. Also, depending on whether a first inverse transform is performed, a first inverse transform can be performed on the result generated by the performance of the second inverse transform. By selectively performing a second inverse transform and a first inverse transform on the coefficients, a restored residual block can be generated.

[0536]

[0537] Filtering

[0538] To improve the image quality, filtering may be performed on the blocks. The value of the target sample may be determined or updated by the filtering.

[0539] 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 reconstructed sample, and a reconstructed sample to which filtering has been applied.

[0540] The target sample may be a sample within one or more of the target picture, target slice, target CTB, target block, reference sample line, and 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 transformation block, prediction block, reference block, residual block, and restoration block.

[0541] In the embodiments, the filtering process described as being applied to one target may also be applied to other targets. For example, the filtering process described in a specific in-loop filtering may also be applied to a transformation block, a prediction block, a reference block, and a residual block, etc.

[0542] For the filtering of the embodiments, a specific type of filtering may be used. The type of filtering may include a filter tap (or filter tap length), a filter shape, a filter strength, filter coefficients (or weights), and an offset.

[0543] The filter tab may indicate the number of input samples used for the filter. The input samples may include target samples. Alternatively, the input samples may include specific values ​​determined for the target samples. The input samples may include one or more reference samples. One or more reference samples may be determined based on the attributes of the target block described in the embodiments. The attributes may include coding parameters. For example, the attributes of the target sample may include the location of the target sample. One or more reference samples may be specified based on their relative position to the location of the target sample.

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

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

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

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

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

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

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

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

[0552] Filtering of at least one of the predicted sample and the reference sample may be performed based on the attributes of the target block or surrounding block and the attributes of the predicted sample. For example, whether filtering is performed, the type of filter, the area to which filtering is applied, the weights of the filtering, 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 predicted sample.

[0553] For example, the filtering may be an intra edge filter process performed to smooth the edges of reference samples before performing intra prediction, and the process may be performed based on the directionality of the reference samples and the attributes of the prediction samples of adjacent blocks.

[0554] For example, the filter type can be determined based on the intra prediction mode of the surrounding block. Specifically, the filter type applied to the upper reference samples can be determined based on the attributes (e.g., intra prediction mode) of the prediction samples of the upper adjacent block, which can correspond to the process of determining the filter type applied to the upper reference samples.

[0555] For example, depending on whether the intra prediction mode of a restoration block adjacent to the current block is a planner mode, at least one of a filter tab or a filter coefficient for a reference sample may be determined, and the filter type applied to the left reference samples and the filter type applied to the top reference samples may be determined individually.

[0556] The above planner mode may be a prediction mode that generates prediction samples by applying weights to reference samples including an upper reference sample and a left reference sample, respectively.

[0557] Additionally, the strength of the filter applied to the reference samples can be selected based on the size of the target block, the directionality of the prediction mode, or the degree of boundary variation between reference samples, and accordingly, different filter strengths may be applied. For example, a relatively strong filter may be selected when the boundary variation is large, while a weak filter or no filter may be applied when the boundary variation is small.

[0558] Furthermore, the filtering process may be a process of selecting a different set of filter coefficients depending on the boundary direction of the left reference sample or the top reference sample, which may correspond to a process of determining the strength of the edge filter depending on the directionality of the reference sample.

[0559] For example, when performing filtering on a prediction sample, if the intra prediction mode of the target block is a non-directional mode, the area to which filtering is applied or the reference sample used may be determined based on the width or height of the target block. For example, the filtering application area may be determined based on an area corresponding to 1 / 4 of the width or height of the target block from the reference sample. The reference sample used for filtering the said area may be determined based on the width and height of the target block.

[0560] For example, attributes of a target block or surrounding blocks may include information related to the target block described in the embodiments, such as 1) size, 2) prediction mode, 3) intra prediction mode, 4) reference sample line, 5) sample value, and 6) coding parameters.

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

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

[0563]

[0564] Figure 6 shows a plurality of in-loop filters according to one example.

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

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

[0567] As illustrated in FIG. 6, an input image may be input to the first filter. The input image may be a block as described in the embodiments. For example, the input image may be a restored 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 as described in the embodiments. For example, the output image may be a filtered restored image generated by a filter (130) or a filter (170).

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

[0569] LMCS may include luminance signal mapping for the luminance signal of the target block and chroma signal scaling for the chroma signal of the target block.

[0570] Luminous signal mapping can perform codeword redistribution for the luminous signal.

[0571] Luma signal mapping may include forward mapping and inverse mapping. In forward mapping, the existing dynamic range may 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 inverse mapping, inverse mapping from the mapped dynamic range to the existing dynamic range is performed.

[0572] Chroma scaling can correct the chroma signal based on the interrelationship between the luminance signal and the corresponding chroma signal.

[0573] Forward mapping can be performed between inter-prediction of the luminance signal and restoration of the luminance signal, and between inter-prediction of the luminance signal and chroma scaling. Inverse mapping can be performed between restoration of the luminance signal and in-loop filtering of the luminance signal. Chroma scaling can be performed between inverse transform and restoration of the chroma signal.

[0574] According to this structure, inverse quantizations for the luminance and chroma signals, inverse transforms for the luminance and chroma signals, prediction for the luminance signal, and restoration for the luminance signal can be performed within a mapped dynamic domain. In-loop filtering for the luminance and chroma signals, inter-predictions for the luminance and chroma signals, intra-predictions for the chroma signal, and restoration for the chroma signal can be performed within the existing dynamic domain.

[0575] A deblocking filter can remove block distortion occurring at the boundaries between blocks within the reconstructed image. For example, the blocks may be transformed blocks. Additionally, 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.

[0576] A deblocking filter can be applied to the vertical and horizontal boundaries between blocks. After filtering is performed on the vertical boundaries of the blocks, filtering can be performed again on the horizontal boundaries of the filtered blocks.

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

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

[0579] The maximum length of the deblocking filter can be determined based on attributes of the target block, such as the size of the target block, the components of the target block, and coding parameters.

[0580] SAO can compensate for distortion between the original image and the reconstructed image on a sample basis. For compensation, SAO can apply an appropriate offset to the sample values. In other words, the offset can be added to the sample values.

[0581] An offset can be determined for the target block. For example, the 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.

[0582] SAO may include an SAO using an edge offset (EO) and an SAO using a band offset (BO). Depending on the characteristics of samples within a specific block, such as a CTU, whether to perform an SAO using EO and whether to perform an SAO using BO may be determined, respectively.

[0583] In an SAO using EO, correction for distortion of samples can be performed based on the direction of edges within the target block. The pattern classes of the EO may include horizontal patterns, vertical patterns, 135-degree diagonal patterns, and 45-degree diagonal patterns. For the target block, information indicating the pattern class applied to the target block and multiple offsets of the said pattern class may be signaled. There may be four offsets. For a target sample within the target block, adjacent samples of the target sample may be determined according to the direction of the pattern class. An offset to be applied to the target sample may be determined by the pattern of the adjacent samples.

[0584] In an offset using BO, correction for sample distortion can be performed by classifying the brightness values ​​of samples within the target block into specific bands. The bit depth of the input image can be divided into m intervals. For example, m can be 32. The specific bands can be n consecutive intervals among the m intervals. For example, n can be 4. n offsets for the n intervals can be signaled. Additionally, information indicating the first interval selected as the n intervals among the m intervals can be signaled. The offset of the interval corresponding to the target sample can be added to the sample value of the target sample of the target unit.

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

[0586] The filter coefficients of the ALF can be signaled through the bitstream.

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

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

[0589] 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. Depending on the gradient of the specific block, a rotation transformation, a vertical reflection transformation, and / or a diagonal reflection transformation may be applied to the filter.

[0590] Information regarding whether ALF is applied can be signaled to specific units such as CTBs.

[0591] An index indicating a filter to be applied to a specific unit among the 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 predefined identically 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 the coding parameters.

[0592]

[0593] Entropy Encoding and Entropy Decoding

[0594] Figure 7 shows entropy encoding and entropy decoding according to one example.

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

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

[0597] The binarization unit can generate binaries 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 binaries.

[0598] Information about syntax elements and beans can be provided from the binarization unit to the context selection unit.

[0599] The context modeler can perform context updates.

[0600] Context can refer to occurrence probability information for each bin regarding syntactic elements that have already been encoded.

[0601] The context modeler may perform a context update to apply current probability information to the entropy encoding of the bins of the syntactic elements of the target block. The updated context may be stored in 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) may be derived by the context modeler.

[0602] 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 context memory and used as an updated context for entropy encoding of the bins of the syntactic element of the target block.

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

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

[0605] At the bottom of Fig. 7, the entropy decoding process by the entropy decoder (161) is illustrated.

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

[0607] The context modeler can perform context updates.

[0608] The context can refer to the probability information of occurrence for each bin regarding syntactic elements that have already been decoded.

[0609] The context modeler may perform a context update to apply the currently decoded probability information to the entropy decoding for the bins of the syntactic elements of the target block. The updated context may be stored in 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) may be derived by the context modeler.

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

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

[0612] The entropy decoding unit can generate bins for the segmentation 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 may use at least one of an arithmetic decoding method and a bypass decoding method.

[0613] The debinaryization unit can obtain syntactic elements of a target block by performing debinaryization on at least one of the generated beans. Debinaryization may be a process of converting at least one of the beans into the form of a syntactic element.

[0614] Information about syntax elements and beans can be provided from the inverse binary unit to the context selector.

[0615] The syntax element may be one of the coding parameters described in the examples.

[0616]

[0617] Methods for binarization, inbinarization, entropy encoding, and entropy decoding

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

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

[0620] - Signed k-order exponential-Golomb binarization / debinarization method (abbreviated as sek(v))

[0621] - 0-order exponentiation-Golomb binarization / debinarization method for unsigned positive integers (abbreviated as ue(v))

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

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

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

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

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

[0627] - Bit string in bytes (abbreviated as b(8))

[0628] - Signed integer binary / debinary conversion method (abbreviated as i(n))

[0629] - Unsigned positive integer binarization / debinarization method (abbreviated as u(n)) ('u(n)' may also refer to a fixed-length binarization / debinarization method.)

[0630] - Unary Binary / Debinary Method

[0631]

[0632] Adaptive execution of the processing of the examples

[0633] The processing of the embodiments may be performed in the same and / or corresponding way in the encoding device (110) and the decoding device (150). Additionally, a combination of one or more of the above embodiments may be used for encoding and / or decoding of the image.

[0634] The order in which the embodiments are applied may differ from one another in the encoding device (110) and the decoding device (150). Alternatively, the order in which the above embodiments are applied may be the same (at least partially) in the encoding device (110) and the decoding device (150).

[0635] The processing of the embodiments may be performed for each of the specific targets. The processing of the embodiments may be performed identically for the specific targets. For example, the specific targets may include a luminance signal and a chroma signal.

[0636] The processes of the embodiments may be selectively applied / performed based on specific conditions or specific targets.

[0637] 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 the temporal layer where the processing can be applied / performed. Temporal layer information may be signaled for a specific processing. Temporal layer information may indicate the lowest layer and / or the highest layer where the specific processing can be applied, and may indicate the specific layer where the specific processing is applied / performed. Alternatively, a fixed temporal layer where the processing of the embodiment is applied / performed may be defined.

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

[0639] According to the description of the embodiments, when applying / performing a specific process on a specific target, specific conditions may be required, and the specific process may be performed under a specific decision. Where it is determined whether a specific condition is satisfied based on a specific coding parameter, or where a specific decision is made based on a specific coding parameter, such specific coding parameter may be interpreted as being replaceable with another coding parameter. That is to say, the coding parameter affecting the specific condition or specific decision described in the embodiments may 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 may be understood to perform the role of the specified coding parameter.

[0640] 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 transformation 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 as a fixed size for the processing of the embodiments. Additionally, for the processing of the embodiments, a first embodiment may be applied at a first size, and a second embodiment may be applied at a second size. That is, the processing of the embodiments may be applied in combination depending on the size. Additionally, the processing of the embodiments may be applied only when the block size is greater than or equal to the minimum size and less than or equal to the maximum size. That is, the processing of the embodiments may be applied only when the block size falls within a specific range.

[0641]

[0642] FIG. 8 is a configuration diagram of the in-screen prediction decoding / coding steps related to the present disclosure.

[0643] The present disclosure may provide embodiments for image encoding / decoding using an intra-frame prediction mode induction (e.g., MDIP: Most Dominant Intra Prediction) utilizing reference sample analysis and prediction, and for a method, apparatus, and a recording medium storing a bit stream that can use the mode derived by said technique in at least one of the image encoding / decoding processes. In this case, the template may refer to a restored area around the current block. In this case, the reference sample analysis for the current block may be a directional analysis of a reference sample that has already been decoded for the template of the current block.

[0644] The intra-frame prediction mode using [D1-7] of Fig. 8, which includes MDIP mode, may include all techniques that represent the mode with the smallest error with the restored sample by forming a candidate list of N intra-frame prediction modes based on the analysis of reference samples within the surrounding area and performing prediction in the template area.

[0645] FIG. 9 illustrates an example of an in-frame prediction mode execution step using reference sample analysis and prediction.

[0646] Each step of Fig. 9 may be applied in its entirety or in part only.

[0647] [E1] Reference Sample Analysis Step

[0648] Reference sample analysis for [E1] in Fig. 9 can extract orientation and magnitude information by analyzing the vertical and horizontal gradients between the reference sample and surrounding samples. This information can be used to generate a histogram of oriented gradient (HoG).

[0649] In one embodiment, a sample for reference sample analysis may be composed of one or more restored samples or a combination of samples from the surroundings, and filtering may be applied to the composed reference sample.

[0650] At this time, the reference sample may include 2 or more M restored lines depending on the size of the current block. At this time, each restored sample on multiple restored sample lines may be used as is, or samples for analysis may be configured after filtering between samples on the same restored sample line or between samples on different restored sample lines.

[0651] The sample for analysis configured above can be represented as ref[m, n], the surrounding restored sample or the sample filtered therefrom can be represented as rec[m, n], and m or n can be a predetermined integer value. When the width (W) and height (H) of the current block are (W x H), and the top-left sample position within the current block is (0, 0), the relative position of the closest top-left reference sample to that sample position can be set to (-1, -1).

[0652] In one embodiment, a sample for reference sample analysis can be composed of a sample for analysis using restored sample lines around the current block.

[0653] At this time, at least one of samples within a line adjacent to the current block or samples within a line not adjacent to the current block can be used as restoration sample lines around the current block.

[0654] In one embodiment, after configuring a reference template for reference sample analysis, all samples within the template can be used for reference sample analysis.

[0655] In one embodiment, after configuring a reference template for reference sample analysis, some samples within the template can be used for reference sample analysis.

[0656] In one embodiment, the number of lines K of a reference template for reference sample analysis may vary depending on the size of the block. For example, if the block size is less than 256, K may be 3, otherwise K may be 4. K may be a predefined natural number.

[0657] In one embodiment, average fusion can be performed in the sample composition for analysis. Here, average fusion may be a method of averaging at least two different reconstructed sample lines on a sample-by-sample basis.

[0658] Here, average fusion can be performed on two restored sample lines.

[0659] For example, the average fusion of reconstructed sample line 1 and reconstructed sample line 1+k can be performed. Here, k is a positive integer greater than or equal to 1 and has a maximum value of M.

[0660] For example, the average fusion of the reconstructed sample line 1+p and the reconstructed sample line 1+q can be performed. Here, p and q are positive integers greater than or equal to 1 and can have different values ​​with a maximum value of M.

[0661] Here, average fusion can be performed on three restored sample lines.

[0662] For example, the average fusion of reconstructed sample line 1, reconstructed sample line 1+k, and reconstructed sample line 1+l can be performed. Here, k can be a positive integer greater than or equal to 1, and l can be a positive integer greater than or equal to k, provided that both k and l have a maximum value of M.

[0663] For example, the average fusion of reconstructed sample line Ak, reconstructed sample line A, and reconstructed sample line A+l can be performed. Here, k and l can be positive integers greater than or equal to 1. Also, Ak can be a positive integer greater than or equal to 1, and A+l can be a positive integer less than or equal to M.

[0664] In one embodiment, weighted sum fusion can be performed in the composition of samples for analysis. Here, weighted sum fusion may be a method of summing at least two or more reconstructed sample lines by applying weights on a sample-by-sample basis. Here, the reconstructed samples that constitute the samples for analysis that can be used for weighted sum fusion may be the same as the reconstructed samples for the samples for analysis composed through the average fusion method.

[0665] For example, weighted sum fusion can be performed on two restored sample lines and can be obtained using the following formula.

[0666] Reference Sample = Weight 1 × Restored Sample of Line A + Weight 2 × Restored Sample of Line B

[0667] At this time, {weight1, weight2} can be one of {0.6, 0.4}, {0.7, 0.3}, {0.8, 0.2} and {0.9, 0.1}.

[0668] For example, weighted sum fusion can be performed on three restored sample lines and can be obtained using the following formula.

[0669] Predicted Fusion Sample = Weight 1 × Reconstructed Sample (Sample from Line A) + Weight 2 × Reconstructed Sample (Sample from Line B) + Weight 3 × Reconstructed Sample (Sample from Line C)

[0670] At this time, {weight1, weight2, weight3} may be one of {0.4, 0.3, 0.3}, {0.5, 0.25, 0.25}, {0.6, 0.2, 0.2}, {0.7, 0.15, 0.15} and {0.8, 0.1, 0.1}.

[0671] Here, weights can be defined differently depending on the slice type (I / P / B slice), signal components (Y / U / V), QP, block size, and block shape.

[0672] In one embodiment, the reference sample configuration method at the top of the current block and the reference sample configuration method on the left may be different.

[0673] Here, the top and left reference samples can be constructed from two different restoration sample lines among multiple restoration sample lines.

[0674] For example, the reference sample on the left may use restoration sample line A, and the reference sample at the top may use restoration sample line B. In this case, A and B may be different integers greater than or equal to 1.

[0675] Here, the reference sample on the left and the reference sample at the top can be configured by selecting one of the above average fusion and weighted sum fusion.

[0676] For example, for the reference samples at each location, reference samples through average fusion and reference samples through weighted sum fusion can be used.

[0677] For example, for the reference samples at each location, a reference sample with average fusion and a reference sample that has not undergone fusion can be used.

[0678] For example, for the reference samples at each location, a reference sample through weighted sum fusion and a reference sample that has not been fused can be used.

[0679] In one embodiment, a reference sample can be constructed using at least one of the above methods.

[0680] Here, the SAD values ​​of the reference sample candidates and the restored sample line 1 can be calculated, and the candidate with the larger value can be placed first to reconstruct.

[0681] Here, the SAD values ​​of the reference sample candidates and the restored sample line 1 are calculated, and the candidates can be reconstructed by excluding reference sample lines that have the same SAD value or are below a certain value.

[0682] In one embodiment, the method of constructing a sample for reference template analysis during the encoding and decoding process for the current block may be applied differently depending on the slice type (I / P / B slice), prediction step, signal component (Y / U / V), QP, block size, and block shape.

[0683] [E2] Step to configure the candidate mode list based on analysis

[0684] FIG. 10 illustrates one example of a reference area for reference sample analysis.

[0685] Through the generated HoG, a list of N in-screen prediction mode candidates for the corresponding mode can be constructed. Here, N can be 1 or a positive integer greater than or equal to 2. For example, it can be 8.

[0686] The candidate list may include A samples from the analysis of reference samples within the upper reference area, B samples from the analysis of reference samples within the left reference area, C samples from the analysis of reference samples within the adjacent reference area, and D samples from the analysis of reference samples within the non-adjacent reference area. In addition, E samples from the analysis of reference samples in an undefined area may be included. Here, positive integers A, B, C, D, and E may represent values ​​between 0 and N. The sum of A, B, C, D, and E may be N or less than or equal to N.

[0687] In one embodiment, the adjacent reference area may include an adjacent top reference area, a left reference area, and a top-left reference area. That is, it may be an L-shaped reference area.

[0688] In one embodiment, the candidate list may include 2 reference samples in the upper reference area analysis, 2 reference samples in the left reference area analysis, and 4 reference samples in the adjacent reference area analysis.

[0689] In one embodiment, as shown in FIG. 10, when the top-left position of the current block is (0,0), the upper reference area may refer to a part of the area where the y-coordinate value is less than 0, and the left reference area may refer to a part of the area where the x-coordinate value is less than 0.

[0690] In one embodiment, the adjacent reference area may refer to an area that includes both the upper reference area and the left reference area. The non-adjacent reference area may refer to a portion of an area that is not adjacent to the current block within the upper area and the left reference area.

[0691] For example, the candidate modes (of the above candidate list) may be the in-frame prediction modes with the highest cumulative size value in the HoG obtained from the upper or left reference area of ​​the current block.

[0692] For example, the above candidate modes may be A, B, C, D, and E, which have relatively high cumulative size values ​​in the HoG obtained in each region.

[0693] In one embodiment, if the candidate is in a mode where a predefined matrix value for intra-frame prediction does not exist, it may be replaced with an adjacent mode where a matrix value exists. A mode where a matrix value exists may refer to a matrix-based intra-frame prediction mode, i.e., a PDP (Position dependent intra prediction mode) mode or a Matrix-based intra prediction replacing existing conventional intra mode. This may be performed only under conditions where intra-frame prediction can be performed by the above method. The above conditions may be determined based on at least one of the availability of the upper and left reference samples of the current block, the size of the current block, and the intra-frame prediction mode number. In one embodiment, if both the upper and left reference samples of the current block exist, the matrix-based intra-frame prediction may be performed if the intra-frame prediction mode is a non-directional prediction mode or an even-numbered directional prediction mode. The reference samples used for the matrix-based intra-frame prediction may be reconstructed reference samples. For example, they may be derived based on at least one of a reference sample, the average of the reference samples, and a downsampled reference sample.

[0694] Here, the candidate list can be constructed through the analysis of reference samples within different reference regions, and duplicate modes can be removed.

[0695] Here, a new candidate mode can be added to the candidate list configured by the above method using an offset for each candidate mode value.

[0696] Here, if there is a candidate mode in the candidate list configured by the above method that does not have a predefined matrix value for in-screen prediction, a mode among adjacent modes that has a matrix value may be added.

[0697] In one embodiment, the in-screen prediction mode candidate list may or may not include M non-directional modes. In this case, M may mean a positive integer greater than or equal to 1.

[0698] For example, the non-directional mode may be at least one of Planar, DC, MIP, EIP, and block vector-based modes.

[0699] For example, it could be a fusion mode.

[0700] In one embodiment, if the induced prediction mode is Planar, a Directional Planar may be allowed.

[0701] By encoding / decoding the In-Frame Prediction Mode (MDIP) indicator using reference sample analysis and prediction for the current block, it is possible to indicate whether the current In-Frame Prediction Mode is an In-Frame Prediction Mode derived from MDIP.

[0702] When the MDIP indicator is 1, the Planar indicator can be encoded / decoded to indicate whether the derived mode is Planar. Here, when the Planar indicator is 1, the Directional Planar indicator (PlIdx: Planar index) can be encoded / decoded to indicate which Planar prediction method the derived mode used for prediction.

[0703] When the MDIP indicator is 1, it may not indicate whether the derived mode is Planar. Here, if the derived mode is Planar, it can be determined through the template cost which Planar prediction method was used for the prediction without additional signaling.

[0704] [E3] Step to induce prediction mode through template cost analysis of the candidate list

[0705] Among the configured in-screen prediction mode candidate list, the candidate mode with the lowest template cost can be guided to the in-screen prediction mode using reference sample analysis and prediction. In this case, the template may be a predefined area around the current block.

[0706] Templates for each candidate mode can be predicted using surrounding reference samples of the template.

[0707] For example, if a predefined matrix value for directional prediction exists for each mode, the above prediction can be performed through operations with that matrix value. (e.g., PDP)

[0708] For example, the above prediction may not perform operations with the matrix values ​​even if predefined matrix values ​​exist for each mode.

[0709] Here, the error between templates can be called the template cost. In this case, the template cost can be calculated using one or more of the calculation methods that utilize the difference between pixels at the same location, such as SAD (Sum of Absolute Difference), MR-SAD (Mean-Removal Sum of Absolute Difference), and SATD (Sum of Absolute Transformed Difference).

[0710] The N in-screen prediction modes derived in [E2] can be candidates for the list to calculate the template cost.

[0711] In this case, N is an integer greater than 0 and can be, for example, 8.

[0712] The surrounding lines of the current block for calculating the template cost may be M or more L-shaped lines surrounding the current block.

[0713] The surrounding lines of the current block for calculating the template cost may be M or more surrounding left lines or top lines of the current block.

[0714] Here, M can be a predefined number. For example, M can be 1.

[0715] [E4] Step to remove the above-mentioned induced mode when configuring MPM (Most Probable Modes)

[0716] In one embodiment, an in-frame prediction mode (e.g., MDIP) using reference sample analysis and prediction may or may not be included in the MPM candidates. For example, the candidate mode may be excluded from at least one of the MPM list, SMPM list, and non-MPM list.

[0717] An example of a case where the first mode of the MPM is fixed to Planar can be as follows.

[0718] For example, the in-frame prediction mode using reference sample analysis and prediction is Planar, and MPM[0] may not be Planar.

[0719] For example, the in-frame prediction mode using reference sample analysis and prediction is Planar, and MPM[0] can be Planar.

[0720] For example, the in-frame prediction mode using reference sample analysis and prediction is not planar, and MPM[0] can be planar.

[0721] For example, the in-frame prediction mode using reference sample analysis and prediction is not Planar, and MPM[0] may not be Planar.

[0722] Here, the above MPM[N] may refer to the Nth included in-screen prediction mode of the list.

[0723] An example where the first mode of the MPM is not fixed to Planar could be as follows.

[0724] For example, an intra-frame prediction mode using reference sample analysis and prediction may be a K mode and may not be included in MPM and Non-MPM.

[0725] In one embodiment, N modes of small size, 1 or more, can be excluded through the HoG created for the analysis.

[0726] In one embodiment, modes determined to have low relevance through analysis may or may not be included in MPM or non-MPM candidates.

[0727]

[0728] The present disclosure may provide embodiments of a method, apparatus, and a recording medium storing a bit stream that can be used in at least one of the encoding / decoding processes of an image, wherein a list of intra-frame prediction candidate modes (e.g., IPM, MPM) is configured among intra-frame prediction or inter-frame prediction technologies, and one or more intra-frame prediction modes are selected from the list.

[0729] Here, IPM may refer to constructing intra-frame prediction mode candidates and one or more derived final intra-frame prediction modes among them. Techniques for constructing the above IPM candidate list may include Template-based Intra Mode Derivation (TIMD), Template-based multiple reference line intra prediction (TMRL), Spatial Geometric Partitioning Mode (SGPM), Inter-frame Partitioning Prediction Mode combined with intra-frame prediction (GPM-Intra), Block Copy-based Replication Technique combined with intra-frame prediction (IBC-Intra), Combined Inter-Intra Prediction (CIIP), and the like.

[0730] The process of constructing an MPM or IPM (Intra Prediction Mode) list may utilize the intra-frame prediction mode of neighboring blocks to use information from multiple reference blocks or include at least one of the following information.

[0731] i) PLANAR prediction mode, DC prediction mode

[0732] ii) One or more in-frame prediction modes of adjacent blocks (spatial neighbors) to the current block

[0733] One or more in-screen prediction modes of non-adjacent blocks in the current block

[0734] iii) Decoder-side Intra Mode Derivation (DIMD) derived through gradient analysis of samples within a template composed of the surrounding restored regions of the current block

[0735] In this case, when decoded in fusion mode, one or more prediction modes used in the fusion mode of DIMD

[0736] iv) In-screen prediction mode derived through gradient analysis of template samples at different locations within the surrounding restored area of ​​the current block

[0737] At this time, the methods of step [E2] of Fig. 9 may be included.

[0738] v) In-frame prediction mode derived from the decoder side

[0739] At this time, the intra-frame prediction mode derived from the decoder side may include an intra-frame prediction mode derived through gradient analysis of multiple different templates, an intra-frame prediction mode using reference template gradient analysis (DIMD), and an intra-frame prediction mode frequency-based derivation of reference blocks (OBIC: Occurrence-based intra coding).

[0740] At this time, one or more in-screen prediction modes that are induced may be included in the above list.

[0741] The MPM or IPM list can be composed of M non-zero integers including the above prediction modes.

[0742] The order of configuring the MPM or IPM list can be configured differently depending on the block size, block shape, slice type, and prediction mode information, and may include at least one or more.

[0743] For example, the list can be configured in the order of the PLANAR prediction mode for the current block, the in-frame prediction mode for adjacent blocks, and the mode derived through the template gradient analysis of the current block.

[0744] For example, the list can be configured in the order of the PLANAR prediction mode for the current block, the in-frame prediction mode for adjacent blocks, the mode derived through template gradient analysis of the current block, and the in-frame prediction mode derived through gradient analysis of restored blocks surrounding the current block.

[0745] For example, the list can be configured in the order of PLANAR prediction mode for the current block, in-frame prediction mode for adjacent blocks, mode derived through template gradient analysis of the current block, in-frame prediction mode derived through gradient analysis of restored blocks surrounding the current block, and in-frame prediction mode for non-adjacent blocks.

[0746] For example, if the width of the current block is greater than its height, the list can be configured prioritizing the in-screen prediction mode of the adjacent block to the left, and if the width of the current block is less than or equal to its height, the list can be configured prioritizing the in-screen prediction mode of the adjacent block to the top.

[0747] The MPM or IPM list composed of the above prediction modes can be reordered according to the template-based prediction error cost.

[0748] At this time, the template cost can be calculated using a calculation method that utilizes the difference between pixels at the same location, such as SAD, SATD, and MR-SAD (Mean Removal SAD).

[0749] MPM or IPM lists can be reordered in the following ways.

[0750] For example, construct K, perform reordering, and construct the remaining MK.

[0751] For example, M items are configured and reordered. Here, M can represent the size of the entire MPM or IPM list.

[0752] In one embodiment, the process of constructing an MPM or IPM list may utilize multiple reference blocks by utilizing the in-frame prediction mode of adjacent blocks.

[0753] In one embodiment, an MPM or IPM list can be encoded by dividing it into S parts.

[0754] In one embodiment, the MPM can be encoded by dividing it into a first MPM list and a second MPM list.

[0755] In one embodiment, the MPM can be encoded by dividing it into a first MPM list, a second MPM list, and a third MPM list.

[0756] For example, the first MPM list may be a list of in-frame prediction mode candidates including at least one of an in-frame prediction mode of spatial neighbor blocks, a derived mode which is the result of subtracting or adding a specific value to the in-frame prediction mode of spatial neighbor blocks, and a basic in-frame prediction mode.

[0757] Additionally, the second MPM list may be a list of in-screen prediction mode candidates consisting of in-screen prediction modes not included in the preceding first MPM list.

[0758] Additionally, the third MPM list may be a list of intra-frame prediction mode candidates consisting of intra-frame prediction modes not included in at least one of the preceding first and second MPM lists. For example, the third MPM list may represent non-MPM.

[0759] MPM or IPM lists can be reordered using any of the following methods.

[0760] i) Reorder only the first MPM list, and then construct the next list using an offset.

[0761] ii) Reorder M items, fill the 1st MPM list, and add the remaining candidates to the 2nd MPM list.

[0762] iii) Reorder all candidates and construct a list

[0763] Modes determined through analysis to have little relevance to the current block may or may not be included in the MPM or IPM list.

[0764] For example, N modes of size 1 or more can be excluded through HoG created in DIMD.

[0765] For example, through the HoG created in MDIP, one or more N modes of small size can be excluded.

[0766] For example, you can exclude modes that differ significantly from adjacent or non-adjacent modes.

[0767] When configuring MPM or IPM lists, specific modes may be removed or excluded from addition based on whether they are specific modes before adding candidate modes, through analysis of the restored area around the current block.

[0768] For example, when configuring the IPM candidate list for TIMD, the candidate list can be configured by excluding the specific modes mentioned above.

[0769] For example, when configuring MPM, a candidate list can be configured excluding the specific modes mentioned above.

[0770] For example, when configuring an IPM candidate list for an in-screen prediction technology using an IPM candidate list, the candidate list can be configured excluding the aforementioned specific modes.

[0771] The above specific modes may consist of N. They may be configured by applying at least one of the methods below.

[0772] i) A method of selecting at least one of the lower N modes of odd-indexed values ​​and the lower N modes of even-indexed values ​​from the HoG of the gradient analysis of samples within a template composed of the surrounding restored region of the current block.

[0773] ii) Method for selecting the bottom N samples from the HoG for slope analysis of samples within the template at different locations within the surrounding restored region of the current block

[0774] iii) A method of configuring an in-frame prediction mode (e.g., MDIP) derived through gradient analysis of samples within templates at different locations within the surrounding restored area of ​​the current block.

[0775] iv) A method of configuring an in-frame prediction mode derived through gradient analysis of samples within a template of the surrounding restored area of ​​the current block.

[0776] If N is not filled when configuring the specific mode above, it can be filled using an offset value.

[0777] The above specific mode may not include some of the modes representing Planar, DC, Vertical, and Horizontal.

[0778] In deriving the intra-frame prediction mode for the current block, the intra-frame prediction mode information can be entropy-encoded by constructing MPM (PMPM (Primary MPM), SMPM (Secondary MPM)) and non-MPM lists.

[0779] In constructing the above PMPM list, one or more in-frame prediction modes may be used to construct the list. In this case, the number of PMPM lists may be M, and the number of candidate modes constituting the MPM list may be N. Here, M or N may be an integer greater than or equal to 1.

[0780] By decoding / encoding PMPM indicators for the current block, it is possible to indicate whether the in-frame prediction mode of the current block belongs to the PMPM list.

[0781] At this time, the number of PMPM indicators may be M according to the M PMPM list above. For example, if the number of M is 2, the first PMPM indicator and the second PMPM indicator can be encoded / decoded.

[0782] When the above PMPM indicator is 1, a PMPM index indicating which of the candidate modes in the PMPM list corresponding to the above PMPM indicator is identical to the in-frame prediction mode of the current block can be encoded / decoded. The mode corresponding to the above PMPM index can be guided to the in-frame prediction mode of the current block.

[0783] When the above PMPM indicator is 0, the in-frame prediction mode of the current block can be derived by encoding / decoding the SMPM list excluding the mode that constitutes the above predetermined mode and the PMPM list, and the mode corresponding to the in-frame prediction mode excluding the SMPM list. In constructing the above SMPM list, the list can be constructed using one or more in-frame prediction modes of surrounding blocks. In this case, the number of SMPM lists may be L, and the number of candidate modes constituting the list may be P. Here, L or P may be an integer greater than or equal to 1.

[0784] At this time, the number of SMPM indicators may be L according to the above L MPM list. For example, if the number of L is 2, the first SMPM indicator and the second SMPM indicator can be encoded / decoded.

[0785] At this time, the SMPM list consists of 16 elements, and can induce an in-screen prediction mode from surrounding blocks, and may include predefined modes.

[0786] When the above SMPM indicator is 1, the index of the group containing the candidate mode within the SMPM list corresponding to the above SMPM indicator can be encoded / decoded. Subsequently, the SMPM index indicating which mode is identical to the in-frame prediction mode of the current block can be encoded / decoded. The mode corresponding to the above SMPM index can be guided to the in-frame prediction mode of the current block.

[0787] When the SMPM indicator is 0, the in-frame prediction mode of the current block can be derived by decoding / encoding the mode corresponding to the in-frame prediction mode of the current block among the in-frame prediction modes (non-MPM) excluding the predetermined mode and the mode that constitutes the PMPM and SMPM list and specific modes derived through analysis in the restored area around the current block.

[0788] For example, the number of PMPM lists above may be 6, the number of SMPM lists above may be 8, and the number of non-MPM lists may be 32.

[0789] For example, the number of PMPM lists above may be 4, the number of SMPM lists may be 16, and the number of non-MPM lists may be 26.

[0790]

[0791] Figure 11 illustrates flowcharts of an intra-frame prediction method with an extrapolation filter applied in terms of encoding.

[0792] Figure 12 illustrates a flowchart of an intra-frame prediction method with an extrapolation filter applied in terms of decoding.

[0793] The extrapolation filter-based prediction mode may include an Extrapolation filter-based intra prediction (EIP) mode. Additionally, this mode uses an N-tap filter-based prediction method, and the filter type (e.g., at least one of filter shape, width / height, and number of tabs) can be adaptively determined based on the information of the block to be predicted (size, shape, location, etc.). Various filter shapes may be included in the candidate list, and multiple filters may be applied in parallel.

[0794] An extrapolation filter can be composed of coefficients for multiple different purposes (types).

[0795] The types of coefficients of the extrapolation filter may include one or more of spatial coefficients, normalization coefficients, brightness correction coefficients, or weighting coefficients.

[0796] Spatial coefficients may represent spatial coefficients for specific locations for sample value operations where restoration or prediction is performed, or coefficients that can emphasize or reduce samples at specific locations.

[0797] A normalization coefficient can refer to a coefficient that limits predicted values ​​to a specific range.

[0798] The brightness correction factor can refer to a factor that can improve prediction performance by taking into account the brightness difference of the image.

[0799] A weighting factor can refer to a coefficient that adjusts the sample weights of a specific region or adjusts the weights of a specific type of coefficient.

[0800] In one embodiment, the extrapolation filter can be derived through surrounding restored samples.

[0801] In one embodiment, the extrapolation filter can be derived through samples of the reference region and surrounding region pointed to by the derived block vector.

[0802] In one embodiment, the extrapolation filter may inherit filter information of a block encoded in the previous mode.

[0803] In one embodiment, the extrapolation filter may inherit filter coefficients used in the previous frame after decoding is complete.

[0804] FIG. 13 illustrates various forms of an extrapolation filter.

[0805] Extrapolation filters can have various shapes. Figure 13A is an example in which the locations of 14 pixel values ​​to be processed for the white block (or sample) to be predicted are represented by blue blocks (or samples). Similar to the figure, they can be configured in various ways, such as square shapes, vertically or horizontally elongated shapes, or diamond shapes.

[0806] At this time, you can add an area that expands the region around the location to be predicted.

[0807] For example, the extrapolation filter can be configured in the shape of B in Fig. 13.

[0808] For example, the extrapolation filter can be configured in the shape of C in Fig. 13.

[0809] In one embodiment, one or more filters may be used when performing extrapolation filter-based mode prediction.

[0810] In one embodiment, when performing extrapolation filter-based mode prediction, two or more filters configured with the same filter shape may be used.

[0811] In one embodiment, when performing extrapolation filter-based mode prediction, two or more filters configured with different filter shapes may be used.

[0812] In one embodiment, the extrapolation filter-based prediction mode may mean in-frame prediction.

[0813] In one embodiment, the extrapolation filter-based prediction mode can be applied as an intra-frame prediction mode of a prediction mode that is predicted by a combination of inter-frame prediction and intra-frame prediction.

[0814] For example, it can be applied as an intra-frame prediction mode that fuses intra-frame predictors and inter-frame predictors.

[0815] For example, extrapolation filter-based prediction modes may be included in CIIP, GPM, IBC-GPM, etc.

[0816] In addition, the extrapolation filter-based prediction mode can be applied to all modes that use intra-frame predictors.

[0817] The present disclosure may provide embodiments of a method, apparatus, and a recording medium storing a bit stream that can be used in at least one of the processes of performing intra-frame prediction during video encoding / decoding using intra-frame or inter-frame prediction techniques. In this case, the process of performing intra-frame prediction may include an intra-frame prediction mode (EIP) with an extrapolation filter applied.

[0818] The above intra-frame prediction technology may include non-directional modes (DC, PLANAR, block vector-based prediction), directional prediction modes, chrominance component prediction modes, sub-block unit prediction, intra-frame segmentation prediction modes (SGPM), intra-frame prediction mode derivation using reference sample prediction (TIMD), intra-frame block copy mode (IBC), etc.

[0819] Here, the intra-frame block copy mode may include the intra-frame block copy split mode (IBC-GPM), the intra-frame block copy combined mode (IBC-CIIP: IBC-Combined Intra and Inter Prediction), etc.

[0820] The above-mentioned inter-frame prediction technology may include a combined inter-frame and intra-frame prediction mode (CIIP) and an inter-frame block partitioning prediction mode (GPM: Geometric Partitioning Mode).

[0821] The in-screen prediction mode with the extrapolation filter applied can make predictions by proceeding from the top-left to the bottom-right of the block currently to be predicted. The extrapolation filter can be applied once or multiple filters can be applied two or more times to generate predictors.

[0822] Figure 14 is an example of a formula related to the use of an N-tap filter.

[0823] To this end, an N-tap filter is used, and one or more of the formulas shown in Fig. 14 can be used adaptively. Here, N is a natural number greater than or equal to 2.

[0824] In one embodiment, when applying the filter, a predetermined sample unit may be determined and applied to each determined sample unit. For example, samples located diagonally within the current block may be determined as the predetermined unit. The predetermined sample unit or the samples located diagonally may be determined differently depending on the size or shape of the current block. In this case, the application of the filter and the calculation of predicted samples for the samples included in the predetermined sample unit may be processed simultaneously in parallel.

[0825] In one embodiment, the filter for the mode may be derived from a surrounding restored sample or inherited from a block previously encoded / decoded in the mode.

[0826] At this time, the filter shape can be a fixed filter or various shapes of filters can be applied depending on the information of the block to be predicted (horizontal and vertical size, shape, position, etc.) or the position of the slice / tile / QP / current block and surrounding blocks.

[0827] Here, the number of filter shape candidates can vary depending on the size of the current block.

[0828] For example, if the current block size is smaller than a specific value, K filter shapes can be used as candidates, and if it is relatively larger, S shapes can be used as candidates. (1 <= K < S, K and S are both natural numbers)

[0829] For example, if the current block size is smaller than a specific value, an A-tap filter can be used, and if the current block size is larger than a specific value, a B-tap filter can be used. (1 < A < B, both A and B are natural numbers)

[0830] In one embodiment, prediction can be performed using two or more filters based on predefined values. (e.g., multi-model (MM) EIP)

[0831] The present disclosure can perform coefficient value correction of a filter derived from surrounding blocks or a merge candidate filter when performing intra-frame prediction by applying an extrapolation filter.

[0832] Figure 15 illustrates a formula related to the coefficients of an extrapolation filter.

[0833] [Formula 1-1], [Formula 1-2], [Formula 1-3], and [Formula 1-4] of the present disclosure may be [Formula 1-1], [Formula 1-2], [Formula 1-3], and [Formula 1-4] included in FIG. 15.

[0834] The coefficients of the extrapolation filter can be corrected using an integer K having the range N < K < M (N, M = integer). In this case, K can be defined as one of the values ​​of [Equation 1-1] or [Equation 1-2] in FIG. 15.

[0835] For example, the coefficients of the extrapolation filter can be defined as c0, c1, … , c14, and K can be defined as 7 when correcting c0 and K can be defined as 4 when correcting c1. Also, K can be defined as -1 when correcting the remaining coefficients c2, c3, … , c14.

[0836] The coefficients of the extrapolation filter can be corrected using gradient information from surrounding restored blocks.

[0837] For example, the horizontal and vertical slopes of surrounding reconstructed blocks can be extracted using a Sobel filter. Then, a structure matrix can be constructed using the sum of squared horizontal slopes, the sum of horizontal x vertical slopes, and the sum of squared vertical slopes as in [Equation 1-3] to obtain the eigenvalues ​​of the reconstructed blocks as in [Equation 1-4], and an anisotropy index A can be defined using these eigenvalues. In this case, A can be a real number such that 0 <= A <= 1.

[0838] If A is a value close to 0, the surrounding restoration block can be defined as a flat or textured area.

[0839] If A is a value close to 1, it can be defined as an area where the surrounding restoration blocks have a distinct direction.

[0840] In this case, the filter coefficient values ​​can be corrected using the real number B=1-A (0<=B<=1).

[0841] As the value of A increases, the directionality of the original block can be maintained without strongly extrapolating from the surrounding restored blocks.

[0842] The smaller the value of A, the more strongly it extrapolates from surrounding restored blocks, which can increase the influence of the extrapolation filter.

[0843] When correcting coefficients using the correction value of the above formula, a correction value with a lower error cost can be found using template matching. Template matching prediction may use a portion of the recovery region around the current block to be encoded / decoded as a template, and the number of template lines used may be an integer N greater than or equal to 0. In this case, N can be defined as 1 or 2.

[0844] FIG. 16 illustrates a specific embodiment of an extrapolation filter.

[0845] The correction values ​​for the coefficients of the extrapolation filter can be applied differently depending on the magnitude of the coefficients. For example, if the magnitude of the coefficient to be corrected is greater than the average value of the extrapolation filter coefficients, the correction value of [Equation 1-1] can be used.

[0846] If the magnitude of the coefficient to which correction is performed is smaller than the average value of the extrapolated filter coefficient, the correction value of [Equation 1-2] can be used.

[0847] Even when the number of extrapolation filters is two or more, different correction values ​​may be applied to each filter. For example, the average value of the first filter coefficients can be defined as Avg0, the average value of the second filter as Avg1, and the overall average value of the first and second filter coefficients as Avg2. The following illustrates an example in which different correction values ​​are applied depending on the average value of each filter and the magnitude of the coefficients being corrected. In addition to the example below, various average values ​​and correction values ​​may be used depending on the number of extrapolation filters.

[0848] Correction can be performed by comparing the coefficients of the first or second filter with the average value of at least one of Avg0, Avg1, and Avg2.

[0849] For example, if the coefficient size of the filter above is greater than a predetermined average value, the correction value of [Equation 1-1] or [Equation 1-2] can be used to perform the correction.

[0850] Conversely, if the coefficient size of the above filter is smaller than a predetermined average value, correction can be performed using the correction value of [Equation 1-1] or [Equation 1-2].

[0851] The coefficients of the extrapolation filter may have different correction values ​​applied depending on the order in which they are derived, and can be defined as c0, c1, c2, …, c14 in the order in which the coefficients are derived. In this case, c0, c1, …, c14 in FIG. 16 may represent the coefficients of the filter according to the order in which they are derived, and c14 may represent the brightness correction coefficient. The following illustrates an example of searching for a final correction value when the number of extrapolation filters is one. In addition to the example below, the final correction value can be searched in various ways depending on the number and shape of the extrapolation filters and the applied correction values. In this case, the search may refer to the process of determining a correction value that has the lowest template matching cost when correcting the coefficients of the extrapolation filter.

[0852] For example, as shown in FIG. 16, the correction value having the lowest error cost can be defined as the final correction value by using the value of [Equation 1-1] or [Equation 1-2] for c0 and performing template matching. After the correction of c0 is completed, for the remaining coefficients c1, c2, …, c14, the value of either [Equation 1-1] or [Equation 1-2] can be applied equally to define the correction value having the lowest error cost as the final correction value for the remaining coefficient values.

[0853] At this time, different correction values ​​may be applied to the remaining coefficients c1, c2, … , c14 excluding c0 to find the final correction value.

[0854] For example, after completing the correction using different correction values ​​for c0 and c1, the final correction values ​​for the remaining coefficients c2, c3, ..., c14 can be explored.

[0855] For example, after completing the correction using different correction values ​​for c0, c1, and c2, the final correction values ​​for the remaining coefficients c3, ..., c14 can be explored.

[0856] At this time, the above method can be applied in the reverse order of the derived sequence as well.

[0857] For example, for c14, the values ​​of [Equation 1-1] or [Equation 1-2] are used to correct, and after performing template matching to complete the correction to the final correction value, the final correction values ​​for the remaining coefficients c0, c1, ..., c13 can be explored.

[0858] For example, after completing the correction using different correction values ​​for c14 and c13, the final correction values ​​for the remaining coefficients c0, c1, ..., c12 can be explored.

[0859] FIG. 17 illustrates a specific embodiment of an extrapolation filter.

[0860] Even when the number of extrapolation filters is two or more, the correction values ​​may be applied differently depending on the derived order. In this case, the first filter coefficients can be defined as a0, a1, a2,…, a14 and the second filter coefficients as b0, b1, b2,…, b14 in the derived order. In FIG. 17, a0, a1, a2,…, a14, b0, b1, b2,…, b14 may represent the filter coefficients according to the derived order, and a14 and b14 may represent brightness correction coefficients. The following is an example of searching for the final correction value when the number of extrapolation filters is two or more. In addition to the example below, the final correction value can be searched in various ways depending on the number and shape of the extrapolation filters and the applied correction values.

[0861] For example, if coefficients are derived as in the sequence of Fig. 17, the final correction value can be sought for filter A and filter B respectively using the above method.

[0862] For example, if the coefficients are derived in the order of Fig. 17, different correction values ​​can be applied to a0 and b0 to search for the final correction value and perform the correction. After the correction of a0 and b0 is completed, the same correction value can be applied to the remaining coefficients a1, a2, … , a14, b1, b2, … , b14 to search for the final correction value and perform the correction.

[0863] For example, if the coefficients are derived in the order of Fig. 17, the final correction value can be sought by applying different correction values ​​to a0 and b0 and a1 and b1, and the final correction value can be sought by applying the same correction value to the remaining coefficients a2, …, a14, b2, …, b14.

[0864] For example, if the coefficients are derived in the order of Fig. 17, different correction values ​​can be applied to a14 and b14 to search for the final correction value and perform the correction. After the correction of a14 and b14 is completed, the same correction value can be applied to the remaining coefficients a0, a1, … , a13, b0, b1, … , b13 to search for the final correction value and perform the correction.

[0865] For example, if the coefficients are derived as in the sequence of Fig. 17, only filter A may search for the final correction value and perform correction, while filter B may not perform correction.

[0866] For example, if the coefficients are derived as in the sequence of Fig. 17, only filter B may search for the final correction value and perform correction, while filter A may not perform correction.

[0867] For example, if the coefficients are derived in the order of Fig. 17, the final correction value can be searched for and corrected only in the even-numbered coefficients in filter A, and the final correction value can be searched for and corrected only in the odd-numbered coefficients in filter B.

[0868] For example, if the coefficients are derived in the order of Fig. 17, the final correction value can be searched for and corrected only for the odd-numbered coefficients in filter A, and the final correction value can be searched for and corrected only for the even-numbered coefficients in filter B.

[0869] At this time, the above method can be applied in the reverse order of the derived sequence as well.

[0870] For example, Filter A can search for the final correction value by applying the above method in the derived order, and Filter B can search for the final correction value by applying the above method in the reverse order of the derived order.

[0871] For example, if the coefficients are derived in the order of Fig. 17, different correction values ​​can be applied to a0 and b14 to search for the final correction value and perform the correction. After the correction of a0 and b14 is completed, the same correction value can be applied to the remaining coefficients a1, a2, … , a14, b0, b1, b2, … , b13 to search for the final correction value and perform the correction.

[0872] For example, if the coefficients are derived in the order of Fig. 17, the final correction value can be sought by applying different correction values ​​to a0 and b14 and a1 and b13, and the final correction value can be sought and correction performed by applying the same correction value to the remaining coefficients a2, …, a14, b0, b1, b2, …, b12.

[0873] For example, if the coefficients are derived in the order of Fig. 17, the final correction value can be sought by applying different correction values ​​to a14 and b0, and the final correction value can be sought and correction performed by applying the same correction value to the remaining coefficients a0, …, a13, b1, b2, …, b14.

[0874] FIG. 18 illustrates an example in which an extrapolation filter is applied based on the current block.

[0875] The coefficients of the extrapolation filter may have different correction values ​​applied depending on the block size to which the filter is applied. The following illustrates an example of applying different correction values ​​according to the block size. In addition to the example below, the final correction value can be explored in various ways depending on the number and shape of the extrapolation filters and the block size to which the filter is applied.

[0876] For example, the area of ​​the block to which the extrapolation filter is applied can be defined as an integer r greater than or equal to 4, and integers m, k, n (m <k<n)를 정의할 수 있다.

[0877] Here, m, k, n may represent one of the values ​​in [Equation 1-1] or [Equation 1-2].

[0878] Here, for blocks where 4 <= r <= 32, the final correction value can be searched by applying the correction value of m.

[0879] Here, 32 <r<=64인 블록에 대해서는 k의 보정값을 적용하여 최종 보정값을 탐색할 수 있다.

[0880] Here, 64 <r<=1024인 블록에 대해서는 n의 보정값을 적용하여 최종 보정값을 탐색할 수 있다.

[0881] The coefficients of the extrapolation filter may have different correction values ​​depending on the location where the filter is applied. The following illustrates an example in which different correction values ​​are applied depending on whether each coefficient belongs to the current block or a neighboring block during the process of predicting the current block using the extrapolation filter. In addition to the example below, the final correction value can be explored in various ways depending on the number and shape of the extrapolation filters and the size of the block to which the filter is applied.

[0882] For example, as shown in Fig. 18, the coefficients belonging to the current block (CU) can be defined as c and the coefficients belonging to the restoration block as o, and integers m and n (m <n)를 정의할 수 있다.

[0883] Here, m, k, n may represent one of the values ​​in [Equation 1-1] or [Equation 1-2].

[0884] Here, c applies the correction value of m and o applies the correction value of n to find the final correction value.

[0885] Here, c applies the correction value of n and o applies the correction value of m to find the final correction value.

[0886] Here, for each pixel where prediction is performed, the average value of c and the average value of o can be calculated, and if the average value of c is greater than the average value of o, the correction value of m is applied to c and the correction value of n is applied to o to find the final correction value.

[0887] In this case, if the average value of c is smaller than the average value of o, the final correction value can be found by applying the correction value of n to c and the correction value of m to o.

[0888] The present disclosure may provide embodiments of a method, apparatus, and a recording medium storing a bitstream that can be used in at least one of the video encoding / decoding processes for video encoding / decoding using an intra-frame prediction mode and a technique for inducing an intra-frame prediction mode.

[0889] The prediction mode within the above screen may refer to non-directional mode (DC, PLANAR, block vector-based prediction) and directional prediction mode.

[0890] The above method for deriving an intra-frame prediction mode can be applied to one or more of the techniques requiring the derivation of an intra-frame prediction mode, such as intra-frame prediction mode derivation using reference sample gradient (e.g., DIMD), intra-frame prediction mode derivation using reference sample prediction (e.g., TIMD), intra-frame segmentation prediction mode (e.g., SGPM), extrapolation filter-based prediction mode (e.g., EIP), neural network-based prediction mode (e.g., PNN), matrix-based prediction mode (e.g., MIP), block vector-based prediction mode (e.g., IntraTMP, IBC), and kernel selection for transformation.

[0891] For example, if the current block is a technique that derives an in-frame prediction mode including reference sample gradient analysis, a method for deriving a non-directional prediction mode during reference sample analysis may be used, or it may be used in conjunction with a method for deriving a directional prediction mode.

[0892] The in-frame prediction mode derivation technique using the above reference sample gradient can derive the top N in-frame prediction modes having the largest gradient by extracting and accumulating the gradients of samples surrounding the current block (N = an integer greater than or equal to 0). In this case, the gradient may refer to the amplitude value corresponding to the extracted gradient (angle or directional mode). Additionally, the gradient-based in-frame prediction mode derivation technique can be applied to a block predicted by at least one of an in-frame segmentation prediction mode, an extrapolation filter-based prediction mode, a neural network-based prediction mode, a matrix-based prediction mode, and a block vector-based prediction mode to derive the top N in-frame prediction modes. The above reference sample may be at least one of a reconstructed sample and a prediction sample.

[0893] In this case, the top N intra-frame prediction modes may refer to directional prediction modes, DC, and PLANAR, and DC and PLANAR can be derived through the following method.

[0894] For example, for samples with a slope of 0, an average filter of size mxn is applied. If the absolute difference between the sample value with the average filter and the average value is 0, the number of DC operations can be increased; if the absolute difference between the sample value with the average filter and the average value is not 0, the number of PLANAR operations can be increased. Additionally, the number of operations for each specified direction can be increased while extracting the slope for each sample. Here, m and n can represent integers greater than or equal to 2.

[0895] FIG. 19 illustrates an example of formulas related to reference sample slopes.

[0896] [Equation 2-1], [Equation 2-2], [Equation 2-3], [Equation 2-4], and [Equation 2-5] of the present disclosure may be [Equation 2-1], [Equation 2-2], [Equation 2-3], [Equation 2-4], and [Equation 2-5] included in FIG. 19.

[0897] As shown in [Equation 2-1], the slope values ​​of DC and PLANAR can be defined using the number of DC and PLANAR cycles and the derived top two slopes and cycles. In this case, k, l, and s are l <k<s 또는 k<l<s의 범위를 가지는 1 이상의 정수를 의미할 수 있다.

[0898] For example, when extracting the slope of a sample, the number of DCs can be increased when the slope is 0, and the number of PLANARs can be increased when the slope is not 0 and the vertical slope and horizontal slope are smaller than the threshold. In this case, as shown in [Equation 2-2], if the mode with the larger number between the number of DCs and the number of PLANARs is greater than half of the total number of times slope extraction was performed, the DC or PLANAR can be used as an intra-frame prediction mode derived by the intra-frame prediction mode derivation technique using the reference sample slope.

[0899] For example, before extracting the slope for each sample, an average filter is applied to the surrounding restored samples. If the difference between the largest average value and the smallest average value is smaller than the threshold of the DC as in [Equation 2-3], the DC can be used as an intra-frame prediction mode derived by the intra-frame prediction mode derivation technique using the reference sample slope.

[0900] At this time, before extracting the slope for each sample, an average filter is applied to the surrounding restored samples. If the difference between the largest average value and the smallest average value is smaller than the threshold of PLANAR as shown in [Equation 2-4], PLANAR can be used as an in-frame prediction mode derived by the in-frame prediction mode derivation technique using the reference sample slope.

[0901] In this case, the threshold value of DC may be the average of the top N average values ​​among each average value calculated in the above method.

[0902] Here, the threshold value of PLANAR may be the average of the top M of each average value calculated in the above method.

[0903] In this case, N and M may represent integers greater than or equal to 0 with the range M>N.

[0904] For example, if the slope extracted from each sample is smaller than the threshold of DC, that slope can be used as the slope of DC.

[0905] In this case, if the difference between the absolute values ​​of the horizontal slope and the vertical slope extracted from each sample is smaller than the threshold value of PLANAR, the corresponding slope can be used as the slope of PLANAR. Here, when the above condition is satisfied, if the extracted slope is designated as a diagonal slope, the corresponding slope can be used as the diagonal slope.

[0906] At this time, the minimum and maximum values ​​of the slope can be defined differently depending on the current pixel bit depth, and the threshold value of PLANAR or DC can be defined according to the ratio of the difference between the maximum and minimum values ​​of the slope.

[0907] For example, as shown in [Equation 2-5], the threshold for PLANAR may represent M% of the difference between the maximum and minimum slope values ​​defined by the current pixel bit depth, and the threshold for DC may represent N% of the difference between the maximum and minimum slope values. In this case, M and N are N <M의 범위를 가지는 0 이상의 정수를 의미할 수 있다.

[0908]

[0909] The present disclosure may provide embodiments for image encoding / decoding that induces one or more intra-frame prediction modes in a transform step, a method and apparatus that can use the mode derived by said technique in at least one of the image encoding / decoding processes, and a recording medium storing a bitstream.

[0910] The above-mentioned intra-frame prediction mode derivation process may or may not be performed depending on the current block's slice type (I / P / B slice), signal components (Y / U / V), QP, block size, block shape, prediction type (inter-frame / intra-frame), and prediction tool. Alternatively, it may or may not be performed depending on a combination of the above conditions.

[0911] For example, if the current block is predicted as an in-frame prediction, the in-frame prediction mode induction may or may not be performed during the conversion step.

[0912] For example, when predicting the current block using a prediction technique that generates prediction blocks by dividing a single CU into two or more regions or blocks, the in-frame prediction mode induction described above may or may not be performed during the transformation step. (e.g., ISP, GPM, etc.)

[0913] For example, when predicting the current block using a prediction technique that does not perform prediction with one or more intra-frame prediction modes, the induction of the intra-frame prediction mode may or may not be performed during the transformation step. (e.g., IntraTMP, IBC, EIP, etc.)

[0914] FIG. 20 illustrates an example of performing gradient analysis by multiplying a 3x3 matrix.

[0915] In Fig. 20, the shaded area may represent the area where matrix operations are performed.

[0916] The method for deriving the prediction mode within the above screen may include a method for analyzing the slope of the sample.

[0917] At this time, the analysis can extract orientation and magnitude information by analyzing the vertical and horizontal slopes between the sample to be analyzed and surrounding samples. This information can be used to generate a Histogram of Oriented Gradient (HoG). For example, the amplitude values ​​corresponding to the analyzed slopes can be accumulated for each slope. At this time, the accumulated amplitude values ​​for each slope (or in-frame prediction mode) can represent the HoG, and the slope magnitude values ​​can represent the accumulated amplitude values.

[0918] At this time, the gradient analysis can be performed by multiplying the pixel (x) performing the analysis and the surrounding pixels by a matrix of size mxn with width (m) and height (n), as shown in FIG. 20, to analyze the gradient values. M and n may represent integers greater than or equal to 1. The values ​​within the matrix may include positive integers including 0 or negative integers.

[0919] FIG. 21 illustrates an example of matrix values.

[0920] A sample can be analyzed by including one or more of the matrix values ​​among the examples of matrix values ​​in Fig. 21.

[0921] Combinations of the same matrix values ​​can be applied to samples within the same block.

[0922] Combinations of different matrix values ​​can be applied to samples within the same block.

[0923] For example, analysis can be performed using matrix A in the horizontal direction and matrix B in the vertical direction.

[0924] For example, gradient values ​​can be analyzed by using both matrix A and matrix B in the region of the samples to be analyzed.

[0925] For example, gradient values ​​can be analyzed by using matrices A, B, and C all over the region of the samples to be analyzed.

[0926] The derived intra-frame prediction mode or the intra-frame prediction mode used for prediction can be used to select a transformation kernel (matrix) or a combination of transformation kernels. In this case, a kernel combination may refer to a combination of kernels used for each direction, where the kernel for the horizontal direction and the kernel for the vertical direction are the same or different.

[0927] For example, a predefined combination of transformation kernels can be selected according to the in-screen prediction mode.

[0928] If one of two or more candidate combinations of transformation kernels must be selected from two or more in-frame prediction modes, an index indicating the final candidate to be selected among the candidates can be encoded / decoded.

[0929] For example, when a conversion kernel candidate is configured with two conversion kernel combinations A and B, an index indicating the candidate can be transmitted or decoded.

[0930] For two or more in-frame prediction modes, if one of the candidates for two or more transformation kernel combinations must be selected, the candidate to be finally selected among the candidates can be derived from the decoder.

[0931] For example, if two or more intra-frame prediction modes are derived, and there is an intra-frame prediction mode with a relatively dominant value based on the gradient magnitude value used in the derivation process, a transformation kernel combination for that intra-frame prediction mode may be selected.

[0932] When two or more intra-frame prediction modes must form a candidate for two or more transformation kernel combinations, if the directional difference between two or more derived intra-frame prediction modes is not large, one intra-frame prediction mode can be replaced with a non-directional intra-frame prediction mode or a specific directional intra-frame prediction mode (e.g., Planar, DC, Directional Planar, Vertical, Horizontal, etc.).

[0933] For example, it can be determined based on a real multiple of the slope magnitude of the in-screen prediction mode with the highest slope magnitude.

[0934] When two or more intra-frame prediction modes must form a candidate for two or more transformation kernel combinations, if the directional difference between two or more derived intra-frame prediction modes is large, one intra-frame prediction mode may be replaced with a non-directional intra-frame prediction mode or a specific directional intra-frame prediction mode (e.g., Planar, DC, Directional Planar, Vertical, Horizontal, etc.).

[0935] For example, it can be determined based on a real multiple of the slope magnitude of the in-screen prediction mode with the highest slope magnitude.

[0936] One or more in-frame prediction modes can be derived by analyzing all or part of the samples within the final prediction block for the transformation block.

[0937] Whether to analyze the entire or partial sample above may be determined by the prediction technique (e.g., one of all techniques performed in the prediction stage including intra-frame prediction and inter-frame prediction, such as EIP, DIMD, TIMD, IntraTMP, merge, GPM, etc.), QP, slice type (I / P / B slice), block size, block shape and size (width x height).

[0938] The analysis of the entire sample above may include one or more of the following methods.

[0939] FIGS. 22 and FIGS. 23 illustrate an example of a matrix for slope analysis.

[0940] For example, when analyzing the entire sample as shown in Fig. 23, the matrix for analysis can be applied so that it does not exceed the current block size.

[0941] For example, when analyzing the entire sample as shown in Fig. 22, slope analysis can be performed using the sample where restoration around the current block is completed.

[0942] When analyzing some of the above samples, the method of selecting the sample or region to be analyzed may include one or more of the following methods.

[0943] For example, the prediction block can be downsampled to 1 / N to perform analysis on the number of samples of that size.

[0944] For example, by dividing the prediction block and performing slope analysis on each corresponding area, different HoGs can be derived.

[0945] FIG. 24 illustrates an embodiment of dividing a block into two or more regions.

[0946] The above division method can divide into two or more regions, as shown in A, B, C, D, and E of FIG. 24.

[0947] For example, in the case of A and C of Fig. 24, they can be divided horizontally or vertically by straight lines.

[0948] For example, in the case of B in Fig. 24, it can be divided diagonally.

[0949] When a prediction block is generated using a geometric partitioning prediction technique (e.g., GPM, SGPM, etc.), it can be partitioned for transformation according to the geometric partitioning and analysis can be performed.

[0950] For example, in the case of D in Fig. 24, it can be divided into two diagonal directions.

[0951] Different HoGs can be derived for all or some of the regions divided by the above division method.

[0952] When different HoGs are derived through the above partitioning, the in-frame prediction modes having the top N slope magnitudes in each HoG can be finally derived as follows.

[0953] The priority can be set differently depending on the location of the areas that make up different HoGs.

[0954] For example, when the upper-level intra-frame prediction modes of the HoG of the partition area adjacent to the top-left are {A_1, A_2, A_3, … A_N} and the upper-level intra-frame prediction modes of the HoG of the partition area adjacent to the bottom-right are {B_1, B_2, B_3, … B_N}, the candidates for the final derived intra-frame prediction modes can be composed of combinations of different intra-frame prediction modes.

[0955] For example, it can be configured in the following ways: {A_1, B_1}, {B_1, A_1}, {A_1, B_1, A_2}, {B_1, A_1, B_2}.

[0956] Whether to use a method to induce an intra-frame prediction mode by analyzing samples within the final prediction block for the above transformation block can be determined by the prediction technique (e.g., EIP, DIMD, TIMD, IntraTMP, merge, GPM, etc., one of all techniques performed in the prediction stage including intra-frame prediction and inter-frame prediction), QP, slice type (I / P / B slice), block size, block shape and size (width x height).

[0957] The present disclosure may provide embodiments for a method, apparatus, and a recording medium storing a bitstream that can use a combination of multiple error costs in image encoding / decoding.

[0958] FIGS. 25 and 26 illustrate an example of a prediction technique utilizing multiple error cost combinations.

[0959] Each step of FIGS. 25 and FIGS. 26 may be applied in its entirety or in part only.

[0960] In the present disclosure, error cost is a value derived from one or more pixel value differences between comparison targets, and can be calculated by at least one of, for example, SAD / SAE, SSD / SSE, MAD / MAD, MSD / MSE, MR-SAD, SATD, SSIM, PSNR.

[0961] - SAD (Sum of Absolute Difference) / SAE (Sum of Absolute Error)

[0962] - MAD (Mean Absolute Difference) / MAE (Mean Absolute Error)

[0963] - SSD (Sum of Squared Difference) / SSE (Sum of Squared Error)

[0964] - MSD (Mean Squared Difference) / MSE (Mean Squared Error)

[0965] - MR-SAD (Mean Removed Sum of Absolute Difference)

[0966] - SATD (Sum of Absolute Transformed Difference)

[0967] - SSIM (Structural Similarity Index Measure)

[0968] -PSNR (Peak signal-to-noise ratio)

[0969] Figure 27 illustrates the restored surrounding blocks and the formulas for the error cost using them.

[0970] When calculating the error cost, the final error cost can be calculated using N error costs among the above error costs.

[0971] When N is 2 (A error cost, B error cost), the final error cost can be calculated as follows.

[0972] For example, as shown in [Equation 4-1], it can be calculated as the average of error cost A and error cost B.

[0973] For example, it can be calculated as the weighted sum of error cost A and error cost B, as shown in [Equation 4-2].

[0974] For example, as shown in [Equation 4-3], it can be calculated as the weighted average of error cost A and error cost B.

[0975] When N is 3 (A error cost, B error cost, C error cost), the final error cost can be calculated as follows.

[0976] For example, as shown in [Equation 4-4], it can be calculated as the average of error costs A, B, and C.

[0977] For example, as shown in [Equation 4-5], it can be calculated as the weighted sum of error costs A, B, and C.

[0978] For example, as shown in [Equation 4-6], it can be calculated as the weighted average of error costs A, B, and C.

[0979] For example, it can be calculated as the weighted sum of error costs A and C.

[0980] For example, it can be calculated as the weighted sum of error costs B and C.

[0981] For example, it can be calculated as the weighted average of error costs A and C.

[0982] For example, let A be the error cost calculated by SATD, B be the error cost calculated by SAD, and C be the error cost calculated by MR-SAD. The two smallest error costs among them may be included in the final error cost calculation.

[0983] Here, at least one or more of the above error costs may be included in the calculation of the final error cost.

[0984] Multiple error cost combinations can be applied in various ways depending on the analysis of the surrounding restored blocks of the current block, the size of the current block and surrounding blocks, block shape, and slice type.

[0985] In one embodiment, the restored surrounding blocks used when analyzing the surrounding restored blocks of the current block may include the locations shown in FIG. 26.

[0986] At this time, the above analysis may include M non-zero integer positions.

[0987] For example, one or more of the surrounding blocks located at the top-left (AL), top (A), and left (L) may be used in the above analysis.

[0988] For example, the surrounding blocks of all locations depicted in Fig. 27 can be used in the analysis.

[0989] In one embodiment, the restored surrounding blocks may include restored blocks in a non-adjacent area.

[0990] In one embodiment, the slice type may include slices I, P, and B. For example, if the slice type is at least one of I, P, and B, multiple error costs may be used.

[0991] In one embodiment, when the surrounding restored block is encoded with a prediction technique using MR-SAD, an error cost combination including MR-SAD can be used in the calculation.

[0992] For example, it can be calculated as MR-SAD.

[0993] For example, it can be calculated as the average, weighted average, or weighted sum of N error costs and MR-SAD, and N can be an integer greater than or equal to 1.

[0994] In one embodiment, various combinations of error costs can be applied depending on the size of the current block and surrounding blocks.

[0995] Here, the size of the blocks can be compared based on length or width.

[0996] For example, you can compare based on the maximum or minimum horizontal length of the current block and surrounding blocks.

[0997] For example, you can compare based on the maximum or minimum vertical length of the current block and surrounding blocks.

[0998] For example, you can compare based on the area (width x height) of the current block and surrounding blocks.

[0999] For example, an error cost can be applied based on a predetermined threshold value X or Y.

[1000] For example, if the current block area is smaller than X, SAD can be used, and if it is larger than X, SATD can be used.

[1001] For example, if the current block area is smaller than X, use SAD, and if it is larger than X, use a combination of SAD and SATD.

[1002] For example, if the current block area is smaller than X, MRSAD can be used, and if it is larger than X, MRSATD can be used.

[1003] For example, if the current block area is smaller than X, STAD is used, and if it is larger than X, N combinations from the above error costs can be used.

[1004] For example, if the minimum width of the current block is less than Y, SAD can be used, and if it is greater than Y, SATD can be used.

[1005] For example, if the minimum width of the current block is less than Y, SAD is used, and if it is greater than Y, N combinations from the above error costs can be used.

[1006] For example, if the minimum vertical length of the current block is less than Y, SAD can be used, and if it is greater than Y, SATD can be used.

[1007] For example, if the minimum vertical length of the current block is less than Y, SAD is used, and if it is greater than Y, N combinations from the above error costs can be used.

[1008] By utilizing error costs, indexes and candidate modes can be reordered during encoding / decoding of intra-frame and inter-frame predictions.

[1009] In one embodiment, multiple candidate lists configured based on different error costs can be used.

[1010] At this time, the candidate used among the multiple candidate lists can be implicitly derived through signaling or conditions.

[1011] For example, a list of N candidate integers, each greater than or equal to 1, can be created using SATD and SAD error costs.

[1012] For example, a list of N candidate integers, each greater than or equal to 1, can be created using SAD and MR-SAD error costs.

[1013] In one embodiment, a candidate list can be sorted with different error costs from a single candidate list.

[1014] For example, the candidate list can be sorted using SAD-based template error calculation for candidates written with SATD error costs.

[1015] For example, the candidate list can be sorted by calculating the SATD-based template error for candidates created with MR-SAD error costs.

[1016] The techniques and steps to which error costs are applied in the encoding / decoding of images may include the following techniques.

[1017] In one embodiment, the technology and step to which the error cost is applied may be included in the process of sorting the in-screen prediction mode candidate list based on the magnitude of the error cost.

[1018] For example, it may be included in the process of performing at least one of TIMD, TIMD Merge, MDIP, intra-frame prediction mode list (MPM list or IPM list), SGPM, TMRL, and Chroma TMRL.

[1019] In one embodiment, the technology and step to which the error cost is applied may be included in the process of selecting the optimal block vector when generating a prediction sample based on surrounding block vector information.

[1020] For example, it may be included in the process of performing at least one of the block vector-based fusion process of DIMD, block vector-based DIMD, and block vector-based EIP.

[1021] In one embodiment, the technology and steps to which the error cost is applied may be included in the process of searching for the optimal motion vector.

[1022] The present disclosure may provide embodiments for image encoding / decoding using an intra-frame prediction mode based on matrix calculation template prediction, a method and apparatus capable of using a mode derived by said technique in at least one of the image encoding / decoding processes, and a recording medium storing a bit stream. In this case, the template may refer to a restored area around the current block.

[1023] The in-screen prediction candidate mode list may consist of multiple prediction modes, and in the present disclosure, the candidate mode list may be constructed or reconstructed using matrix operation-based template prediction.

[1024] In this case, for modes where matrix values ​​are defined, a template can be constructed through operations between the corresponding matrix values ​​and reference samples.

[1025] The mode in which matrix values ​​are defined may include a technology that means at least one of a matrix-based intra-frame prediction mode, namely MPDIP (matrix-based position dependent intra prediction) mode, PDP (position dependent intra prediction) mode, and MIP (matrix-based intra prediction) mode.

[1026] FIG. 28 illustrates an example of an in-screen prediction mode using matrix calculation-based template prediction.

[1027] Each step of Fig. 28 may be applied in its entirety or in part only.

[1028] In the candidate mode configuration step of [E1] in Fig. 28, modes for which matrix values ​​are not previously defined may be removed, or may be combined with or replaced with modes for which matrix values ​​are defined.

[1029] For example, in performing at least one of the following methods, the matrix calculation-based template prediction can be utilized.

[1030] i) A template-based in-screen prediction mode induction method (e.g., TIMD) that constructs an in-screen prediction mode candidate list and induces a mode through template cost comparison.

[1031] ii) A method for inducing an in-screen prediction mode (e.g., MDIP) using reference sample analysis and prediction, which constructs an in-screen prediction mode candidate list by analyzing reference samples and induces the mode through template cost comparison.

[1032] iii) A template-based intra-frame prediction mode and multi-reference line derivation (e.g., TMRL) method that constructs candidates from a list of intra-frame prediction mode candidates and combinations of multiple reference lines, and makes predictions through template cost comparison.

[1033] iv) Method for constructing at least one of the MPM list, SMPM list, and non-MPM list

[1034] v) A predetermined in-screen prediction method for constructing a list of candidate modes

[1035] vi) A predetermined method for constructing a candidate mode list for a color difference block

[1036] For a predetermined candidate mode included in the above predetermined candidate list, the matrix calculation-based template prediction can be performed by applying at least one of the following methods.

[1037] For example, if a given candidate mode is a mode where the matrix value is not defined, it may be replaced by an adjacent mode where the matrix value exists.

[1038] For example, if a given candidate mode is a mode where the matrix value is not defined, an adjacent mode where the matrix value exists can be added and used together as a candidate mode.

[1039] For example, if a given candidate mode is a mode where the matrix value is not defined, it can be excluded from the candidate modes.

[1040] For example, if a given candidate mode is a mode where matrix values ​​are not defined, the combination with an adjacent mode where matrix values ​​exist can be used as a candidate mode, and the combination of the two predictions can be used as the prediction value.

[1041] In the prediction mode induction step through the template cost analysis of the candidate list [E2] of FIG. 28, the candidate mode with the lowest template cost on the configured in-screen prediction mode candidate list may be guided as the in-screen prediction mode of the technique, or the candidate list may be reconfigured into N candidates with low template costs. At this time, the template may be a pre-defined area around the current block.

[1042] In this case, N can be an integer greater than 0.

[1043] Figures 29 and 30 illustrate the shape of a template for calculating the template cost.

[1044] The shape of the template for calculating the template cost may be any one of the L-shape, the straight shape, or the l-shape shown in FIGS. 29 and FIGS. 30.

[1045] The lines of the template for calculating the template cost can consist of M integer lines greater than or equal to 1.

[1046] Template costs can refer to the error between templates.

[1047] Template cost can use one or more of the calculation methods that use the difference between pixels at the same location, such as SAD (Sum of Absolute Difference), MR-SAD (Mean-Removal Sum of Absolute Difference), and SATD (Sum of Absolute Transformed Difference).

[1048] Alternatively, a template cost can be derived based on at least one of the above multiple error cost combination methods.

[1049] If the template prediction mode is a mode where matrix values ​​are defined, the template can be predicted through operations with the matrix values.

[1050] If the template prediction mode is a mode where matrix values ​​are defined, the template can be predicted by a weighted combination of prediction based on operations with matrix values ​​and prediction based on the corresponding directional mode.

[1051] For example, joint weights can increase the weight of matrix-based predictions when the block size is small.

[1052] For example, joint weights can increase the weight of matrix-based predictions when the block size is large.

[1053] For example, if the slice type is I-slice, the weights of matrix-based predictions can be increased or decreased.

[1054] For example, if the slice type is P / B slice, the weights of matrix-based predictions can be increased or decreased.

[1055] Even when the template prediction mode is a mode where matrix values ​​are defined, the template can be predicted based on a directional mode rather than through operations with matrix values, depending on the conditions (e.g., block size surrounding mode).

[1056]

[1057] In the above process, to apply the in-frame prediction method of the present disclosure to the current block, entropy-encoded syntax phrases can be entropy-encoded / decoded in at least one of a parameter set, header, brick, CTU, CU, PU, ​​TU, CB, PB, or TB.

[1058] At this time, at least one of the parameter set, header, brick, CTU, CU, PU, ​​TU, CB, PB, or TB may be at least one of the video parameter set, decoding parameter set, sequence parameter set, adaptation parameter set, picture parameter set, picture header, sub-picture header, slice header, tile group header, tile header, brick, CTU (coding tree unit), CU (coding unit), PU (Prediction Unit), TU (Transform Unit), CB (Coding Block), PB (Prediction Block), or TB (Transform Block).

[1059] In the embodiments, methods may be described based on a flowchart comprising a series of steps or units. The method of the embodiments is not limited to the described order of steps, and some steps may be performed in a different order than described and may be performed simultaneously with other steps. Additionally, the steps described by the flowchart, etc. may not be exclusive. Other steps may be included between the steps described by the flowchart, etc. One or more steps described by the flowchart, etc. may be deleted or omitted.

[1060] The embodiments may include examples of various aspects. While not all possible combinations for representing various aspects can be described, those skilled in the art will recognize that combinations other than those explicitly described are possible. Accordingly, the present invention includes all other substitutions, modifications, and changes falling within the scope of the following claims.

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

[1062] A computer-readable recording medium may include a non-transitory computer-readable recording medium. A 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 ROM, RAM, and flash memory. Hardware devices may be configured to operate as one or more software modules to perform the processes according to the embodiments, and vice versa.

[1063] A computer-readable recording medium may include program instructions, data files, data structures, etc., either alone or in combination. Program instructions recorded on the computer-readable recording medium may be those specifically designed and configured for the embodiments, or they may be those known and available to those skilled in the art of computer software.

[1064] Program instructions may include machine code, such as that generated by a compiler, and 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.

[1065] A computer-readable recording medium may contain information used in the embodiments. For example, a 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 syntactic elements. Information described in the embodiments, such as syntactic elements, may be understood as computer-executable code in that it drives an encoding device and a decoder to perform specific processing.

[1066] The bitstream may contain computer-executable code. The computer-executable code may contain information described in embodiments, such as syntactic elements. That is to say, the information described in embodiments, such as syntactic elements, may be regarded as computer-executable code within the bitstream or as part of computer-executable code.

[1067] Although the present invention has been described above with specific details such as specific components, limited embodiments, and drawings, this description is provided only to aid in a more comprehensive understanding of the invention and is not limited to the described embodiments, and a person skilled in the art to which the invention pertains can make various modifications and variations from this description.

[1068] Accordingly, the scope of the present invention should not be limited to the described embodiments, and all variations equivalent to or equivalent to the claims set forth below, as well as the claims themselves, shall be considered to fall within the scope of the concept of the present invention.

[1069] The present disclosure may be used in industrial fields related to codecs utilizing video encoding / decoding.

Claims

1. A step of generating a slope histogram by analyzing a reference sample of the current block; A step of constructing a candidate mode list based on the above gradient histogram; A video decoding method characterized by including a step of inducing a prediction mode through template cost analysis of candidates in the above candidate mode list.

2. In Paragraph 1, An image decoding method characterized in that the above reference sample analysis is performed by configuring a template of the above current block.

3. In Paragraph 2, An image decoding method characterized in that the above template includes two or more restored lines according to the size of the current block.

4. In Paragraph 1, An image decoding method characterized in that the above candidate mode list includes a first candidate obtained from a reference sample analysis of a first reference region of the current block, a second candidate obtained from a reference sample analysis of a second reference region of the current block, and a third candidate obtained from a reference sample analysis of a third reference region of the current block.

5. In Paragraph 4, An image decoding method characterized in that the first reference area is the upper reference area of ​​the current block and the second reference area is the left reference area of ​​the current block.

6. In Paragraph 5, An image decoding method characterized in that the number of candidates in the above candidate mode list is 8.

7. In Paragraph 1, An image decoding method characterized in that the above template cost analysis is performed using an L-shaped peripheral line adjacent to the current block.

8. In Paragraph 1, An image decoding method characterized in that the above prediction mode is excluded when configuring MPM (Most Probable Modes).

9. In Paragraph 8, An image decoding method characterized in that the above MPM includes at least one of a Planar mode, an intra-frame prediction mode of a block adjacent to the current block, or an intra-frame prediction mode of a block not adjacent to the current block.

10. In Paragraph 8, A video decoding method characterized in that all or part of the above MPM is rearranged according to a template-based error cost.

11. In Paragraph 10, An image decoding method characterized in that the above template-based error cost is calculated using one or more of the following methods: SAD (Sum of Absolute Difference), MR-SAD (Mean-Removal Sum of Absolute Difference), and SATD (Sum of Absolute Transformed Difference).

12. In Paragraph 8, The above MPM is characterized by being separated into multiple lists and each decoded, in a video decoding method.

13. In Paragraph 8, The above MPM includes PMPM (Primary MPM) and SMPM (Secondary MPM), and A video decoding method characterized by obtaining, in relation to the above SMPM, an SMPM indicator specifying one of a plurality of SMPMs from a bitstream and an SMPM index specifying one candidate mode within the specified SMPM.

14. A step of generating a slope histogram by analyzing a reference sample of the current block; A step of constructing a candidate mode list based on the above gradient histogram; A video encoding method characterized by including a step of deriving a prediction mode through template cost analysis of candidates in the above candidate mode list.

15. A non-transient computer-readable recording medium storing a bitstream generated by a video encoding method, The above image encoding method is, A step of generating a slope histogram by analyzing a reference sample of the current block; A step of constructing a candidate mode list based on the above gradient histogram; A non-transient computer-readable recording medium characterized by including a step of inducing a prediction mode through template cost analysis of candidates in the above-mentioned list of candidate modes.