Methods and devices for encoding / decoding images, and the recording medium in which the bit stream is stored.

VN127252APending Publication Date: 2026-07-15ELECTRONICS & TELECOMM RES INST +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
VN1202604586
Authority / Receiving Office
VN · VN
Patent Type
Applications
Current Assignee / Owner
Priority Date
2019-05-07
Filing Date
2019-07-05
Publication Date
2026-07-15

AI Technical Summary

Technical Problem

Current video encoding technologies face inefficiencies in encoding and decoding high-resolution, high-quality images due to increased data volume, particularly in intra-prediction mode signaling and prediction between color components, leading to higher transmission and storage costs.

Method used

The method involves using a Most Frequent Mode (MFM) indicator to determine the intra-prediction mode of a block, and constructing a Most Probable Mode (MPM) list based on neighboring blocks, excluding the predetermined intra-prediction mode, to optimize encoding and decoding efficiency and improve prediction performance between color components.

Benefits of technology

This approach enhances encoding/decoding efficiency and prediction performance by reducing bit overhead and improving the correlation between neighboring blocks, thereby reducing transmission and storage costs for high-resolution video data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure VN1202604586_0
    Figure VN1202604586_0
Patent Text Reader

Abstract

The invention relates to a method and apparatus for encoding / decoding images. The method for decoding images according to the invention may include the following steps: recovering the most frequent mode (MFM) indicator which indicates whether the current block's in-image prediction mode is a predetermined in-image prediction mode, inferring, on the basis of the MFM indicator, the current block's in-image prediction mode, and generating the current block's prediction block by performing an in-image prediction on the current block on the basis of the in-image prediction mode.
Need to check novelty before this filing date? Find Prior Art

Description

Video encoding / decoding method, device, and recording medium storing bitstream

[0001] The present invention relates to a method and device for encoding / decoding an image, and more particularly, to a method and device for encoding / decoding an image including intra-screen prediction mode encoding or color component inter-prediction.

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

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

[0004] As the number of intra-picture prediction modes increases, the bit overhead for signaling the prediction modes increases. Conventional codecs construct and utilize a Most Probable Mode (MPM) list to effectively signal the intra-picture prediction mode of the current block. The MPM list consists of candidate prediction modes that can probabilistically represent the intra-picture prediction mode of the current block. By allocating fewer bins to the intra-picture prediction modes in the MPM list, more efficient signaling is possible.

[0005] The MPM list includes the modes of surrounding blocks at a given location as candidate modes. However, as block partitioning becomes more diverse, the predicted modes of surrounding blocks also become more diverse. Therefore, the mode derived from a given location may not actually be the most probabilistically occurring mode.

[0006] Additionally, since the current MPM candidate induction location is derived from a relatively close surrounding block, the MPM candidate may not include a variety of candidates.

[0007] Additionally, as the resolution increases, the probability of occurrence of a specific mode increases, and the number of bins allocated to the remaining modes other than the specific mode increases, which may be inefficient for encoding.

[0008] When constructing the MPM list, since the index of the prediction mode is assigned differently depending on the size / shape of the surrounding blocks, the candidate list of the current block may be constructed in a mode with low correlation with the surrounding blocks.

[0009] In the prediction between color components, a linear prediction model is derived using fixed and limited reference samples regardless of the size, shape, and surrounding modes of the current block, and the chrominance signal is predicted from the luminance signal using this model, so the prediction performance between color components may be poor.

[0010] When estimating a linear model for prediction between color components, deriving a linear prediction model using only the minimum / maximum values ​​of the luminance component may result in poor prediction performance between color components.

[0011] The purpose of the present invention is to provide a video encoding / decoding method and device with improved encoding / decoding efficiency.

[0012] In addition, the present invention aims to provide a video encoding / decoding method and device that performs intra-screen prediction mode encoding with improved performance.

[0013] In addition, the present invention aims to provide an image encoding / decoding method and device that performs color component prediction with improved performance.

[0014] In addition, the present invention aims to provide a recording medium storing a bitstream generated by an image encoding method or device according to the present invention.

[0015] In addition, the present invention aims to provide a recording medium storing a bitstream received and decoded by an image decoding device according to the present invention and used for image restoration.

[0016] A video decoding method according to one embodiment of the present invention may include a step of restoring an MFM indicator indicating whether an intra-picture prediction mode of a current block is a predetermined intra-picture prediction mode, a step of deriving an intra-picture prediction mode of the current block based on the MFM indicator, and a step of generating a prediction block of the current block by performing intra-picture prediction on the current block based on the intra-picture prediction mode.

[0017] In the image decoding method according to the present invention, the predetermined intra-screen prediction mode may be a Planar mode.

[0018] In the image decoding method according to the present invention, when the MFM indicator has a first value, the intra-screen prediction mode of the current block can be derived as the predetermined intra-screen prediction mode.

[0019] In the image decoding method according to the present invention, when the MFM indicator has a second value, an MPM (Most Probable Mode) list can be constructed based on the intra-screen prediction mode of the surrounding blocks of the current block, and the intra-screen prediction mode of the current block can be derived based on the MPM list.

[0020] In the image decoding method according to the present invention, the MPM list may be configured not to include the predetermined intra-screen prediction mode.

[0021] In the image decoding method according to the present invention, the surrounding blocks of the current block may include at least one of the upper right block of the current block and the lower left block of the current block.

[0022] In the image decoding method according to the present invention, when the intra-screen prediction mode of the surrounding block is not available, the intra-screen prediction mode of the unavailable surrounding block can be set to Planar mode.

[0023] In the image decoding method according to the present invention, the MPM list may include five MPM candidates.

[0024] In the video decoding method according to the present invention, the method further includes a step of restoring an MPM indicator indicating whether the within-screen prediction mode of the current block is included in the MPM list, and the MFM indicator can be restored from the bitstream only when the MPM indicator has a first value.

[0025] In the image decoding method according to the present invention, one of a plurality of reference sample lines is selected to perform the intra-screen prediction, and filtering for the reference sample line can be performed only when the selected reference sample line is the first reference sample line.

[0026] A video encoding method according to another embodiment of the present invention may include a step of determining an intra-screen prediction mode of a current block, a step of generating a prediction block of the current block by performing intra-screen prediction on the current block based on the intra-screen prediction mode, a step of determining whether the intra-screen prediction mode of the current block is a predetermined intra-screen prediction mode, and a step of encoding an MFM indicator based on a result of the determination.

[0027] In the image encoding method according to the present invention, the predetermined intra-screen prediction mode may be a Planar mode.

[0028] In the image encoding method according to the present invention, if the screen prediction mode of the current block is the predetermined mode, the MFM indicator can be encoded as a first value.

[0029] In the video encoding method according to the present invention, if the intra-screen prediction mode of the current block is not the predetermined mode, the MFM indicator is encoded as a second value, an MPM (Most Probable Mode) list is constructed based on the intra-screen prediction modes of surrounding blocks of the current block, and the intra-screen prediction mode of the current block is encoded based on the MPM list.

[0030] In the image encoding method according to the present invention, the MPM list may be configured not to include the predetermined intra-screen prediction mode.

[0031] In the image encoding method according to the present invention, the surrounding blocks of the current block may include at least one of the upper right block of the current block and the lower left block of the current block.

[0032] In the image encoding method according to the present invention, when the intra-screen prediction mode of the surrounding block is not available, the intra-screen prediction mode of the unavailable surrounding block can be set to Planar mode.

[0033] In a video encoding method according to the present invention, the method further includes a step of encoding an MPM indicator indicating whether the within-screen prediction mode of the current block is included in the MPM list, and the MFM indicator can be encoded only when the MPM indicator has a first value.

[0034] According to another embodiment of the present invention, a computer-readable recording medium stores a bitstream that is received and decoded by an image decoding device and used to restore an image, wherein the bitstream includes an MFM indicator that indicates whether an intra-picture prediction mode of a current block is a predetermined intra-picture prediction mode, and the MFM indicator is used to derive the intra-picture prediction mode of the current block, and the intra-picture prediction mode can be used to perform intra-picture prediction on the current block to generate a prediction block of the current block.

[0035] A computer-readable recording medium according to another embodiment of the present invention can store a bitstream generated by an image encoding method and / or device according to the present invention.

[0036] According to the present invention, a video encoding / decoding method and device with improved encoding / decoding efficiency can be provided.

[0037] In addition, according to the present invention, a video encoding / decoding method and device for performing performance-enhanced intra-screen prediction mode encoding can be provided.

[0038] In addition, according to the present invention, an image encoding / decoding method and device that performs color component prediction with improved performance can be provided.

[0039] In addition, according to the present invention, a recording medium storing a bitstream generated by an image encoding method or device according to the present invention can be provided.

[0040] In addition, according to the present invention, a recording medium storing a bitstream received and decoded by an image decoding device according to the present invention and used for image restoration can be provided.

[0041] Figure 1 is a block diagram showing the configuration according to one embodiment of an encoding device to which the present invention is applied.

[0042] Figure 2 is a block diagram showing the configuration according to one embodiment of a decryption device to which the present invention is applied.

[0043] Figure 3 is a diagram schematically showing the division structure of an image when encoding and decoding an image.

[0044] Figure 4 is a diagram for explaining an embodiment of an on-screen prediction process.

[0045] Figure 5 is a diagram for explaining an embodiment of a screen-to-screen prediction process.

[0046] Figure 6 is a diagram for explaining the process of transformation and quantization.

[0047] Figure 7 is a diagram illustrating reference samples available for prediction within the screen.

[0048] FIG. 8 is a diagram for explaining intra-screen prediction encoding / decoding according to one embodiment of the present invention.

[0049] Figure 9 is a diagram for explaining a method for deriving an intra-screen prediction mode using a sub-block.

[0050] Fig. 10 is a drawing for explaining an embodiment of determining MFM.

[0051] Figure 11 is a drawing for explaining the spatial surrounding blocks of the current block.

[0052] Figure 12 is a diagram for explaining the temporal surrounding blocks of the current block.

[0053] Figure 13 is a diagram illustrating peripheral blocks available for configuring the MPM list.

[0054] Figure 14 is a drawing for explaining the partial positions of surrounding blocks.

[0055] FIG. 15 is a diagram illustrating an embodiment of replacing an unavailable sample using an available sample.

[0056] Figure 16 is a diagram for explaining a method for determining linear parameters of prediction between color components.

[0057] Figure 17 is a diagram illustrating an example of classifying the directionality of an on-screen prediction mode.

[0058] Figure 18 is a drawing for explaining a method of configuring a reference sample according to an on-screen prediction mode.

[0059] Figure 19 is a diagram for explaining a linear model configuration method according to the prediction mode of the surrounding blocks.

[0060] Figure 20 is a diagram for explaining a set of reference samples according to the on-screen prediction mode.

[0061] Figure 21 is a drawing for explaining an example in which the directionality changes according to the mode number of the current block and surrounding blocks.

[0062] Figure 22 is a diagram for explaining mode numbers indicating prediction modes for extended directional angles.

[0063] Fig. 23 is a diagram for explaining an embodiment of configuring an MPM list by changing the prediction mode of a surrounding block to match the current block.

[0064] FIG. 24 is a diagram illustrating another embodiment of configuring an MPM list by changing the prediction mode of a surrounding block to match the current block.

[0065] Figure 25 is a diagram illustrating one embodiment of the locations of neighboring blocks for inducing MPM candidates.

[0066] Figure 26 is a diagram illustrating another embodiment of the locations of neighboring blocks for inducing MPM candidates.

[0067] Figure 27 is a diagram for explaining an embodiment of determining an on-screen prediction mode using both MFM and MPM.

[0068] FIG. 28 is a diagram illustrating one embodiment of a method for determining an intra-screen prediction mode when an ISP is performed on MPM candidates and MFM candidates.

[0069] FIG. 29 is a diagram illustrating another embodiment of a method for determining an intra-screen prediction mode when an ISP is performed on MPM candidates and MFM candidates.

[0070] The present invention is susceptible to various modifications and embodiments. Therefore, specific embodiments are illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the present invention to specific embodiments, but rather to include all modifications, equivalents, and substitutes included within the spirit and scope of the present invention. In the drawings, similar reference numerals designate the same or similar functions throughout. The shape and size of elements in the drawings may be exaggerated for clarity. The detailed description of the exemplary embodiments described below refers to the accompanying drawings, which illustrate specific embodiments by way of example. These embodiments are described in sufficient detail to enable those skilled in the art to practice the embodiments. It should be understood that the various embodiments, while different, are not necessarily mutually exclusive. For example, specific shapes, structures, and characteristics described herein may be implemented in other embodiments without departing from the spirit and scope of the present invention. Furthermore, it should be understood that the location or arrangement of individual components within each disclosed embodiment may be changed without departing from the spirit and scope of the embodiment. Accordingly, the detailed description set forth below is not intended to be taken in a limiting sense, and the scope of the exemplary embodiments, if properly described, is defined only by the appended claims, along with the full scope equivalents to which such claims are entitled.

[0071] In the present invention, terms such as first, second, etc. may be used to describe various components, but the components should not be limited by these terms. These terms are used solely to distinguish one component from another. For example, without departing from the scope of the present invention, the first component may be referred to as the second component, and similarly, the second component may also be referred to as the first component. The term "and / or" includes a combination of multiple related described items or any of multiple related described items.

[0072] When a component of the present invention is referred to as being "connected" or "connected" to another component, it should be understood that it may be directly connected or connected to that other component, but that other components may also be present in between. Conversely, when a component is referred to as being "directly connected" or "directly connected" to another component, it should be understood that no other components are present in between.

[0073] The components shown in the embodiments of the present invention are independently depicted to represent different characteristic functions, and do not mean that each component is composed of separate hardware or a single software component. That is, each component is listed and included as a separate component for convenience of explanation, and at least two components among each component may be combined to form a single component, or a single component may be divided into multiple components to perform a function, and such integrated and separate embodiments of each component are also included in the scope of the present invention as long as they do not deviate from the essence of the present invention.

[0074] The terminology used in the present invention is only used to describe specific embodiments and is not intended to limit the present invention. The singular expression includes plural expressions unless the context clearly indicates otherwise. In the present invention, it should be understood that the terms "comprise" or "have" are intended to specify the presence of a feature, number, step, operation, component, part, or combination thereof described in the specification, but do not exclude in advance the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof. In other words, the description of a specific configuration in the present invention as "comprising" does not exclude configurations other than the specified configuration, and means that additional configurations may be included in the scope of the implementation of the present invention or the technical idea of ​​the present invention.

[0075] Some components of the present invention may not be essential components that perform essential functions of the present invention, but may be optional components merely for performance enhancement. The present invention may be implemented by including only components essential to realizing the essence of the present invention, excluding components used solely for performance enhancement. A structure that includes only essential components, excluding optional components used solely for performance enhancement, is also within the scope of the present invention.

[0076] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In describing the embodiments of this specification, if it is determined that a detailed description of a related known configuration or function may obscure the gist of this specification, the detailed description will be omitted. The same reference numerals will be used for identical components in the drawings, and duplicate descriptions of identical components will be omitted.

[0077] Hereinafter, the term "video" may refer to a single picture constituting a video, or may refer to the video itself. For example, "encoding and / or decoding of a video" may refer to "encoding and / or decoding of a video," or may refer to "encoding and / or decoding of one of the videos constituting the video."

[0078] Hereinafter, the terms “movie” and “video” may be used interchangeably and have the same meaning.

[0079] Hereinafter, the target image may be an encoding target image, which is the target of encoding, and / or a decoding target image, which is the target of decoding. Furthermore, the target image may be an input image input to an encoding device, or an input image input to a decoding device. Here, the target image may have the same meaning as the current image.

[0080] Hereinafter, the terms “image”, “picture”, “frame” and “screen” may be used interchangeably and have the same meaning.

[0081] Hereinafter, the target block may be an encoding target block that is the target of encoding and / or a decoding target block that is the target of decoding. Furthermore, the target block may be a current block that is the target of current encoding and / or decoding. For example, the terms "target block" and "current block" may be used interchangeably and have the same meaning.

[0082] Hereinafter, the terms "block" and "unit" may be used interchangeably and have the same meaning. Alternatively, "block" may refer to a specific unit.

[0083] Hereinafter, the terms “region” and “segment” may be used interchangeably.

[0084] Hereinafter, a specific signal may be a signal representing a specific block. For example, the original signal may be a signal representing a target block. The prediction signal may be a signal representing a predicted block. The residual signal may be a signal representing a residual block.

[0085] In the embodiments, each of the specified information, data, flags, indices, and elements, attributes, etc., can have a value. The value "0" of the information, data, flags, indices, and elements, attributes, etc., can represent logical false or a first predefined value. That is, the values ​​"0", false, logical false, and the first predefined value can be used interchangeably with each other. The value "1" of the information, data, flags, indices, and elements, attributes, etc., can represent logical true or a second predefined value. That is, the values ​​"1", true, logical true, and the second predefined value can be used interchangeably with each other.

[0086] When a variable such as i or j is used to represent a row, column, or index, the value of i can be an integer greater than or equal to 0, or an integer greater than or equal to 1. That is, in the embodiments, rows, columns, and indices can be counted from 0, or can be counted from 1.

[0087] Glossary of Terms

[0088] Encoder: refers to a device that performs encoding. In other words, it can mean an encoding device.

[0089] Decoder: Refers to a device that performs decoding. In other words, it can refer to a decoding device.

[0090] Block: An MxN array of samples. Here, M and N can represent positive integer values, and a block can commonly represent a two-dimensional sample array. A block can represent a unit. The current block can represent an encoding target block that is the target of encoding during encoding, and a decoding target block that is the target of decoding during decoding. In addition, the current block can be at least one of an encoding block, a prediction block, a residual block, and a transform block.

[0091] Sample: The basic unit that constitutes a block. Bit depth (B) d ) from 0 to 2 Bd - It can be expressed as a value up to 1. In the present invention, a sample can be used with the same meaning as a pixel or a pixel. That is, a sample, a pixel, and a pixel can have the same meaning.

[0092] Unit: This may refer to a unit of image encoding and decoding. In image encoding and decoding, a unit may be a region into which one image is divided. In addition, a unit may refer to a divided unit when one image is divided into detailed units and encoded or decoded. That is, one image may be divided into multiple units. In image encoding and decoding, predefined processing may be performed for each unit. One unit may be further divided into sub-units having a smaller size than the unit. Depending on the function, a unit may refer to a block, a macroblock, a coding tree unit, a coding tree block, a coding unit, a coding block, a prediction unit, a prediction block, a residual unit, a residual block, a transform unit, a transform block, etc. In addition, a unit may mean a luminance component block, a corresponding chroma component block, and a syntax element for each block to distinguish it from a block. The unit may have various sizes and shapes, and in particular, the shape of the unit may include a geometric shape that can be expressed in two dimensions, such as a square, a rectangle, a trapezoid, a triangle, a pentagon, etc. In addition, the unit information may include at least one or more of the type of the unit indicating an encoding unit, a prediction unit, a residual unit, a transformation unit, etc., the size of the unit, the depth of the unit, the encoding and decoding order of the unit, etc.

[0093] Coding Tree Unit: It consists of one luminance component (Y) coding tree block and two chrominance component (Cb, Cr) coding tree blocks related to it. It may also mean including the blocks and syntax elements for each block. Each coding tree unit may be split using one or more splitting methods such as a quad tree, a binary tree, a ternary tree, etc. to form lower units such as a coding unit, a prediction unit, a transformation unit, etc. It may be used as a term to refer to a sample block that becomes a processing unit in the process of decoding / encoding an image, such as splitting an input image. Here, a quad tree may mean a quarternary tree.

[0094] If the size of the coding block falls within a predetermined range, splitting may only be possible using a quadtree. Here, the predetermined range may be defined as at least one of the maximum size and the minimum size of the coding block that can be split using only a quadtree. Information indicating the maximum / minimum size of the coding block that allows splitting using a quadtree form may be signaled through a bitstream, and the information may be signaled in units of at least one of a sequence, a picture parameter, a tile group, or a slice (segment). Alternatively, the maximum / minimum size of the coding block may be a fixed size pre-set in the encoder / decoder. For example, if the size of the coding block is 256x256 to 64x64, splitting may only be possible using a quadtree. Alternatively, if the size of the coding block is larger than the size of the maximum transform block, splitting may only be possible using a quadtree. In this case, the block to be split may be at least one of the coding block or the transform block. In such cases, the information indicating the division of the coding block (e.g., split_flag) may be a flag indicating whether or not a quadtree is split. If the size of the coding block falls within a certain range, splitting may only be possible using a binary tree or a 3-split tree. In this case, the above description regarding the quadtree may be equally applicable to the binary tree or the 3-split tree.

[0095] Coding Tree Block: This term can be used to refer to any one of the Y coding tree block, Cb coding tree block, and Cr coding tree block.

[0096] Neighbor block: This may refer to a block adjacent to the current block. A block adjacent to the current block may refer to a block whose boundary is adjacent to the current block or a block located within a certain distance from the current block. A neighboring block may refer to a block adjacent to a vertex of the current block. Here, a block adjacent to a vertex of the current block may refer to a block vertically adjacent to a neighboring block horizontally adjacent to the current block, or a block horizontally adjacent to a neighboring block vertically adjacent to the current block. A neighboring block may also refer to a restored neighboring block.

[0097] Reconstructed Neighbor Block: This may refer to a neighboring block that has already been spatially / temporally encoded or decoded around the current block. In this case, the reconstructed neighboring block may refer to a reconstructed neighboring unit. The reconstructed spatial neighboring block may be a block within the current picture that has already been reconstructed through encoding and / or decoding. The reconstructed temporal neighboring block may be a reconstructed block or a neighboring block of a location corresponding to the current block of the current picture within the reference image.

[0098] Unit Depth: This can indicate the degree to which a unit has been divided. In a tree structure, the root node corresponds to the initial, undivided unit. This root node can be referred to as the root node. Furthermore, the root node can have the minimum depth. In this case, the root node can have a depth of level 0. A node with a depth of level 1 can represent a unit created by splitting the initial unit once. A node with a depth of level 2 can represent a unit created by splitting the initial unit twice. A node with a depth of level n can represent a unit created by splitting the initial unit n times. A leaf node can be the lowest node and cannot be further divided. The depth of a leaf node can be the maximum level. For example, the default value for the maximum level can be 3. The root node can be said to have the shallowest depth, and the leaf node can have the deepest depth. Additionally, when units are represented in a tree structure, the level at which a unit exists can indicate unit depth.

[0099] Bitstream: This can mean a string of bits containing encoded image information.

[0100] Parameter Set: Corresponds to header information among the structures in the bitstream. At least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set may be included in the parameter set. In addition, the parameter set may also include tile group, slice header, and tile header information. In addition, the tile group may mean a group including multiple tiles, and may have the same meaning as a slice.

[0101] Parsing: This can mean entropy decoding a bitstream to determine the values ​​of syntax elements, or it can mean entropy decoding itself.

[0102] Symbol: It can mean at least one of the syntax elements of the target unit for encoding / decoding, the coding parameter, the value of the transform coefficient, etc. In addition, the symbol can mean the target of entropy encoding or the result of entropy decoding.

[0103] Prediction Mode: This can be information indicating a mode in which encoding / decoding is performed with intra-screen prediction or a mode in which encoding / decoding is performed with inter-screen prediction.

[0104] Prediction Unit: This can refer to the basic unit used when performing predictions, such as inter-screen prediction, intra-screen prediction, inter-screen compensation, intra-screen compensation, and motion compensation. A single prediction unit can be divided into multiple partitions or multiple sub-prediction units of smaller sizes. Multiple partitions can also be the basic unit for performing prediction or compensation. Partitions created by dividing a prediction unit can also be prediction units.

[0105] Prediction Unit Partition: This can refer to the form in which the prediction unit is divided.

[0106] Reference Picture List: This may refer to a list containing one or more reference pictures used for inter-frame prediction or motion compensation. The types of reference picture lists may include LC (List Combined), L0 (List 0), L1 (List 1), L2 (List 2), L3 (List 3), etc., and one or more reference picture lists may be used for inter-frame prediction.

[0107] Inter-Prediction Indicator: This can indicate the inter-prediction direction (unidirectional prediction, bidirectional prediction, etc.) of the current block. Alternatively, it can indicate the number of reference images used to generate the prediction block for the current block. Alternatively, it can indicate the number of prediction blocks used when performing inter-prediction or motion compensation for the current block.

[0108] Prediction list utilization flag: Indicates whether a prediction block is generated using at least one reference picture within a specific reference picture list. The prediction list utilization flag can be used to derive an inter-screen prediction indicator, and conversely, the prediction list utilization flag can be derived using the inter-screen prediction indicator. For example, when the prediction list utilization flag indicates a first value of 0, it can indicate that a prediction block is not generated using a reference picture within the reference picture list, and when it indicates a second value of 1, it can indicate that a prediction block can be generated using the reference picture list.

[0109] Reference Picture Index: This may refer to an index that indicates a specific reference picture in the reference picture list.

[0110] Reference Picture: This may refer to an image referenced by a specific block for inter-frame prediction or motion compensation. Alternatively, the reference picture may be an image that includes a reference block referenced by the current block for inter-frame prediction or motion compensation. Hereinafter, the terms "reference picture" and "reference picture" may be used interchangeably and have the same meaning.

[0111] Motion Vector: This can be a two-dimensional vector used for inter-frame prediction or motion compensation. A motion vector can indicate the offset between a target block to be encoded / decoded and a reference block. For example, (mvX, mvY) can represent a motion vector. mvX can represent the horizontal component, and mvY can represent the vertical component.

[0112] Search Range: The search range can be a two-dimensional region where motion vectors are searched during inter-frame prediction. For example, the search range can have dimensions MxN, where M and N can each be positive integers.

[0113] Motion Vector Candidate: When predicting a motion vector, this can refer to a block that becomes a prediction candidate or the motion vector of that block. Additionally, the motion vector candidate can be included in a motion vector candidate list.

[0114] Motion Vector Candidate List: This may refer to a list constructed using one or more motion vector candidates.

[0115] Motion Vector Candidate Index: This may refer to an indicator pointing to a motion vector candidate within the motion vector candidate list. It may be the index of a motion vector predictor.

[0116] Motion Information: may mean information including at least one of a motion vector, a reference image index, an inter-screen prediction indicator, a prediction list utilization flag, reference image list information, a reference image, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index.

[0117] Merge Candidate List: This may refer to a list constructed using one or more merge candidates.

[0118] Merge Candidate: This can refer to a spatial merge candidate, a temporal merge candidate, a combined merge candidate, a combined bi-prediction merge candidate, a zero-merge candidate, etc. Merge candidates can include motion information such as inter-frame prediction indicators, reference image indices for each list, motion vectors, prediction list utilization flags, and inter-frame prediction indicators.

[0119] Merge Index: This may refer to an indicator that points to a merge candidate within the merge candidate list. Furthermore, the merge index may indicate the block that derived the merge candidate among the restored blocks spatially and temporally adjacent to the current block. Furthermore, the merge index may indicate at least one piece of motion information associated with the merge candidate.

[0120] Transform Unit: This can refer to a basic unit when performing residual signal encoding / decoding, such as transform, inverse transform, quantization, inverse quantization, and transform coefficient encoding / decoding. One transform unit can be divided into multiple lower transform units having smaller sizes. Here, the transform / inverse transform can include at least one of a primary transform / inverse transform and a secondary transform / inverse transform.

[0121] Scaling: This can refer to the process of multiplying a quantized level by a factor. The result of scaling the quantized level can be a transform coefficient. Scaling can also be called dequantization.

[0122] Quantization Parameter: This can refer to a value used when generating quantized levels using transform coefficients in quantization. Alternatively, it can refer to a value used when generating transform coefficients by scaling quantized levels in dequantization. The quantization parameter can be a value mapped to the quantization step size.

[0123] Delta Quantization Parameter: This can mean the difference value between the predicted quantization parameter and the quantization parameter of the target unit to be encoded / decoded.

[0124] Scan: This can refer to a method for arranging the order of coefficients within a unit, block, or matrix. For example, sorting a two-dimensional array into a one-dimensional array is called a scan. Alternatively, sorting a one-dimensional array into a two-dimensional array can also be called a scan or inverse scan.

[0125] Transform Coefficient: This may refer to a coefficient value generated after performing a transform in an encoder. Alternatively, it may refer to a coefficient value generated after performing at least one of entropy decoding and dequantization in a decoder. The meaning of the transform coefficient may also include a quantized level or a quantized transform coefficient level that applies quantization to a transform coefficient or residual signal.

[0126] Quantized Level: This can refer to the value generated by performing quantization on a transform coefficient or residual signal in an encoder. Alternatively, it can refer to the value that is the target of dequantization before dequantization is performed in a decoder. Similarly, the quantized transform coefficient level, which is the result of transformation and quantization, can also be included in the meaning of the quantized level.

[0127] Non-zero Transform Coefficient: This can mean a transform coefficient whose magnitude is not 0, a transform coefficient level whose magnitude is not 0, or a quantized level.

[0128] Quantization Matrix: This can refer to a matrix used in the quantization or dequantization process to improve the subjective or objective image quality. The quantization matrix can also be called a scaling list.

[0129] Quantization Matrix Coefficient: This can refer to each element within a quantization matrix. Quantization matrix coefficients can also be called matrix coefficients.

[0130] Default Matrix: This can refer to a predetermined quantization matrix that is predefined in the encoder and decoder.

[0131] Non-default Matrix: This can refer to a quantization matrix that is not predefined in the encoder and decoder and is signaled by the user.

[0132] Statistical value: The statistical value for at least one variable, encoding parameter, constant, etc. having specific operable values ​​may be at least one of the mean, weighted mean, weighted sum, minimum, maximum, mode, median, and interpolation values ​​of the specific values.

[0133] Figure 1 is a block diagram showing the configuration according to one embodiment of an encoding device to which the present invention is applied.

[0134] The encoding device (100) may be an encoder, a video encoding device, or an image encoding device. A video may include one or more images. The encoding device (100) may sequentially encode one or more images.

[0135] Referring to FIG. 1, the encoding device (100) may include a motion prediction unit (111), a motion compensation unit (112), an intra prediction unit (120), a switch (115), a subtractor (125), a transformation unit (130), a quantization unit (140), an entropy encoding unit (150), an inverse quantization unit (160), an inverse transformation unit (170), an adder (175), a filter unit (180), and a reference picture buffer (190).

[0136] The encoding device (100) can perform encoding on an input image in intra mode and / or inter mode. In addition, the encoding device (100) can generate a bitstream including encoded information through encoding the input image and output the generated bitstream. The generated bitstream can be stored in a computer-readable recording medium or can be streamed through a wired / wireless transmission medium. When the intra mode is used as the prediction mode, the switch (115) can be switched to intra, and when the inter mode is used as the prediction mode, the switch (115) can be switched to inter. Here, the intra mode can mean an intra-screen prediction mode, and the inter mode can mean an inter-screen prediction mode. The encoding device (100) can generate a prediction block for an input block of the input image. In addition, after the prediction block is generated, the encoding device (100) can encode a residual block using a residual of the input block and the prediction block. The input image may be referred to as the current image, which is the current encoding target. The input block may be referred to as the current block, which is the current encoding target, or the encoding target block.

[0137] When the prediction mode is intra mode, the intra prediction unit (120) can use samples of blocks already encoded / decoded around the current block as reference samples. The intra prediction unit (120) can perform spatial prediction on the current block using the reference samples, and can generate prediction samples for the input block through spatial prediction. Here, intra prediction can mean prediction within the screen.

[0138] When the prediction mode is inter mode, the motion prediction unit (111) can search for an area that best matches the input block from the reference image during the motion prediction process and derive a motion vector using the searched area. At this time, the area can be used as a search area. The reference image can be stored in the reference picture buffer (190). Here, when encoding / decoding for the reference image is processed, it can be stored in the reference picture buffer (190).

[0139] The motion compensation unit (112) can generate a prediction block for the current block by performing motion compensation using a motion vector. Here, inter prediction may mean inter-screen prediction or motion compensation.

[0140] The above motion prediction unit (111) and motion compensation unit (112) can generate a prediction block by applying an interpolation filter to a portion of the reference image when the value of the motion vector does not have an integer value. In order to perform inter-screen prediction or motion compensation, it is possible to determine whether the motion prediction and motion compensation method of the prediction unit included in the corresponding encoding unit is a skip mode, a merge mode, an advanced motion vector prediction (AMVP) mode, or a current picture reference mode based on the encoding unit, and perform inter-screen prediction or motion compensation according to each mode.

[0141] The subtractor (125) can generate a residual block using the difference between the input block and the predicted block. The residual block may also be referred to as a residual signal. The residual signal may refer to the difference between the original signal and the predicted signal. Alternatively, the residual signal may be a signal generated by transforming, quantizing, or transforming and quantizing the difference between the original signal and the predicted signal. The residual block may be a residual signal in block units.

[0142] The transform unit (130) can perform a transform on the residual block to generate a transform coefficient and output the generated transform coefficient. Here, the transform coefficient may be a coefficient value generated by performing a transform on the residual block. When the transform skip mode is applied, the transform unit (130) may also skip the transform on the residual block.

[0143] Quantized levels can be generated by applying quantization to transform coefficients or residual signals. In the following embodiments, quantized levels may also be referred to as transform coefficients.

[0144] The quantization unit (140) can generate a quantized level by quantizing a transform coefficient or residual signal according to a quantization parameter, and can output the generated quantized level. At this time, the quantization unit (140) can quantize the transform coefficient using a quantization matrix.

[0145] The entropy encoding unit (150) can generate a bitstream by performing entropy encoding according to a probability distribution on values ​​produced by the quantization unit (140) or coding parameter values ​​produced during the encoding process, and can output the bitstream. The entropy encoding unit (150) can perform entropy encoding on information about image samples and information for decoding the image. For example, the information for decoding the image can include syntax elements, etc.

[0146] When entropy encoding is applied, a small number of bits are allocated to symbols with a high occurrence probability, and a large number of bits are allocated to symbols with a low occurrence probability, thereby representing the symbols, whereby the size of the bit string for the symbols to be encoded can be reduced. The entropy encoding unit (150) can use an encoding method such as exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), or Context-Adaptive Binary Arithmetic Coding (CABAC) for entropy encoding. For example, the entropy encoding unit (150) can perform entropy encoding using a Variable Length Coding / Code (VLC) table. In addition, the entropy encoding unit (150) may perform arithmetic encoding using the binarization method, probability model, and context model derived from the binarization method of the target symbol and the probability model of the target symbol / bin.

[0147] The entropy encoding unit (150) can change a two-dimensional block form coefficient into a one-dimensional vector form through a transform coefficient scanning method to encode a transform coefficient level (quantized level).

[0148] Coding parameters may include not only information (flags, indices, etc.) encoded by the encoder and signaled to the decoder, such as syntax elements, but also information derived during the encoding or decoding process, and may mean information required when encoding or decoding an image. For example, unit / block size, unit / block depth, unit / block partition information, unit / block shape, unit / block partition structure, whether to partition in quadtree shape, whether to partition in binary tree shape, partition direction in binary tree shape (horizontal direction or vertical direction), partition type in binary tree shape (symmetric partition or asymmetric partition), whether to partition in 3-partition tree shape, partition direction in 3-partition tree shape (horizontal direction or vertical direction), partition type in 3-partition tree shape (symmetric partition or asymmetric partition), whether to partition in composite tree shape, partition direction in composite tree shape (horizontal direction or vertical direction), partition type in composite tree shape (symmetric partition or asymmetric partition), partition tree in composite tree shape (binary tree or 3-partition tree), prediction mode (intra-screen prediction or inter-screen prediction), intra-screen luminance prediction mode / direction, intra-screen chrominance prediction mode / direction, intra-screen partition information, inter-screen partition information, encoding block partition flag, prediction block partition flag, transform block partition flag, reference sample filtering method, reference sample filter tab, reference sample filter coefficients, prediction block filtering method, prediction block filter Tab, prediction block filter coefficient, prediction block boundary filtering method, prediction block boundary filter tab, prediction block boundary filter coefficient, intra-screen prediction mode, inter-screen prediction mode, motion information, motion vector, motion vector difference, reference picture index, inter-screen prediction direction, inter-screen prediction indicator, prediction list utilization flag, reference picture list, reference picture, motion vector prediction index, motion vector prediction candidate, motion vector candidate list, whether to use merge mode, merge index, merge candidate, merge candidate list, whether to use skip mode,Interpolation filter type, interpolation filter tap, interpolation filter coefficient, motion vector size, motion vector representation accuracy, transform type, transform size, information on whether to use the first transform, information on whether to use the second transform, first transform index, second transform index, information on whether there is a residual signal, coded block pattern, coded block flag, quantization parameter, residual quantization parameter, quantization matrix, whether to apply an intra-screen loop filter, intra-screen loop filter coefficients, intra-screen loop filter tap, intra-screen loop filter shape / shape, whether to apply a deblocking filter, deblocking filter coefficients, deblocking filter tap, deblocking filter strength, deblocking filter shape / shape, whether to apply an adaptive sample offset, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, whether to apply an adaptive loop filter, adaptive loop filter coefficients, adaptive loop filter tap, adaptive loop filter shape / shape, binarization / inverse binarization method, context model determination method, context model update method, whether to perform a regular mode, Whether to perform bypass mode, context bin, bypass bin, significant coefficient flag, last significant coefficient flag, coefficient group unit encoding flag, last significant coefficient position, flag whether coefficient value is greater than 1, flag whether coefficient value is greater than 2, flag whether coefficient value is greater than 3, remaining coefficient value information, sign information, restored luminance sample, restored chrominance sample, residual luminance sample, residual chrominance sample, luminance transform coefficient, chrominance transform coefficient, luminance quantized level, chrominance quantized level, transform coefficient level scanning method, size of decoder lateral motion vector search region, shape of decoder lateral motion vector search region, number of decoder lateral motion vector searches, CTU size information, minimum block size information, maximum block size information, maximum block depth information, minimum block depth information, image display / output order, slice identification information, slice type,At least one value or a combined form of slice division information, tile group identification information, tile group type, tile group division information, tile identification information, tile type, tile division information, picture type, input sample bit depth, restored sample bit depth, residual sample bit depth, transform coefficient bit depth, quantized level bit depth, information about a luminance signal, and information about a chrominance signal may be included in the encoding parameter.

[0149] Here, signaling a flag or index may mean that the encoder entropy encodes the flag or index and includes it in the bitstream, and that the decoder entropy decodes the flag or index from the bitstream.

[0150] When the encoding device (100) performs encoding through inter prediction, the encoded current image can be used as a reference image for other images to be processed later. Accordingly, the encoding device (100) can reconstruct or decode the encoded current image again and store the reconstructed or decoded image as a reference image in the reference picture buffer (190).

[0151] The quantized level can be dequantized in the dequantization unit (160) and inversely transformed in the inverse transformation unit (170). The dequantized and / or inversely transformed coefficients can be combined with a prediction block through an adder (175), and a reconstructed block can be generated by combining the dequantized and / or inversely transformed coefficients and the prediction block. Here, the dequantized and / or inversely transformed coefficients refer to coefficients on which at least one of dequantization and inverse transformation has been performed, and may refer to a reconstructed residual block.

[0152] The restoration block may pass through a filter unit (180). The filter unit (180) may apply at least one of a deblocking filter, a sample adaptive offset (SAO), an adaptive loop filter (ALF), etc. to the restoration sample, restoration block, or restoration image. The filter unit (180) may also be referred to as an in-loop filter.

[0153] A deblocking filter can remove block distortion that occurs at the boundaries between blocks. Whether to apply a deblocking filter to the current block can be determined based on the samples contained in several columns or rows within the block. When applying a deblocking filter to a block, different filters can be applied depending on the required deblocking filtering strength.

[0154] Sample adaptive offset can be used to compensate for encoding errors by adding an appropriate offset value to sample values. Sample adaptive offset can compensate for the offset from the original image on a sample-by-sample basis for deblocked images. This can be done by dividing the samples contained in the image into a fixed number of regions, determining the regions to be offset, and applying the offset to those regions. Alternatively, the offset can be applied by considering the edge information of each sample.

[0155] An adaptive loop filter can perform filtering based on a comparison between a reconstructed image and the original image. By dividing the samples contained in the image into predetermined groups and determining the filter to be applied to each group, filtering can be performed differentially for each group. Information regarding whether to apply an adaptive loop filter can be signaled for each coding unit (CU), and the shape and filter coefficients of the adaptive loop filter applied to each block can vary.

[0156] The restored block or restored image that has passed through the filter unit (180) may be stored in the reference picture buffer (190). The restored block that has passed through the filter unit (180) may be a part of the reference image. In other words, the reference image may be a restored image composed of restored blocks that have passed through the filter unit (180). The stored reference image may be used for inter-screen prediction or motion compensation thereafter.

[0157] Figure 2 is a block diagram showing the configuration according to one embodiment of a decryption device to which the present invention is applied.

[0158] The decoding device (200) may be a decoder, a video decoding device, or an image decoding device.

[0159] Referring to FIG. 2, the decoding device (200) may include an entropy decoding unit (210), an inverse quantization unit (220), an inverse transformation unit (230), an intra prediction unit (240), a motion compensation unit (250), an adder (255), a filter unit (260), and a reference picture buffer (270).

[0160] The decoding device (200) can receive a bitstream output from the encoding device (100). The decoding device (200) can receive a bitstream stored in a computer-readable recording medium, or a bitstream streamed through a wired / wireless transmission medium. The decoding device (200) can perform decoding on the bitstream in intra mode or inter mode. In addition, the decoding device (200) can generate a restored image or a decoded image through decoding, and can output the restored image or the decoded image.

[0161] If the prediction mode used for decryption is intra mode, the switch can be switched to intra. If the prediction mode used for decryption is inter mode, the switch can be switched to inter.

[0162] The decoding device (200) can decode the input bitstream to obtain a reconstructed residual block and generate a prediction block. Once the reconstructed residual block and the prediction block are obtained, the decoding device (200) can generate a reconstructed block to be decoded by adding the reconstructed residual block and the prediction block. The block to be decoded may be referred to as a current block.

[0163] The entropy decoding unit (210) can generate symbols by performing entropy decoding according to a probability distribution for the bitstream. The generated symbols may include symbols in the form of quantized levels. Here, the entropy decoding method may be the reverse process of the entropy encoding method described above.

[0164] The entropy decoding unit (210) can change a one-dimensional vector-shaped coefficient into a two-dimensional block-shaped coefficient through a transform coefficient scanning method to decode a transform coefficient level (quantized level).

[0165] The quantized level can be dequantized in the dequantization unit (220) and inversely transformed in the inverse transformation unit (230). The quantized level can be generated as a restored residual block as a result of performing the dequantization and / or inverse transformation. At this time, the inverse quantization unit (220) can apply a quantization matrix to the quantized level.

[0166] When the intra mode is used, the intra prediction unit (240) can generate a prediction block by performing spatial prediction on the current block using sample values ​​of already decoded blocks surrounding the block to be decoded.

[0167] When the inter mode is used, the motion compensation unit (250) can generate a prediction block by performing motion compensation using a motion vector and a reference image stored in the reference picture buffer (270) on the current block. The motion compensation unit (250) can generate a prediction block by applying an interpolation filter to a portion of the reference image when the value of the motion vector does not have an integer value. In order to perform motion compensation, it is possible to determine whether the motion compensation method of the prediction unit included in the corresponding encoding unit is skip mode, merge mode, AMVP mode, or current picture reference mode based on the encoding unit, and motion compensation can be performed according to each mode.

[0168] The adder (255) can add the restored residual block and the prediction block to generate a restored block. The filter unit (260) can apply at least one of a deblocking filter, a sample adaptive offset, and an adaptive loop filter to the restored block or restored image. The filter unit (260) can output the restored image. The restored block or restored image can be stored in the reference picture buffer (270) and used for inter prediction. The restored block that has passed through the filter unit (260) can be a part of the reference image. In other words, the reference image can be a restored image composed of restored blocks that have passed through the filter unit (260). The stored reference image can be used for inter-screen prediction or motion compensation thereafter.

[0169] Figure 3 is a diagram schematically illustrating an image segmentation structure when encoding and decoding an image. Figure 3 schematically illustrates an embodiment in which one unit is divided into multiple sub-units.

[0170] In order to efficiently segment an image, a coding unit (CU) may be used in encoding and decoding. The coding unit may be used as a basic unit for image encoding / decoding. In addition, the coding unit may be used as a unit for distinguishing an intra-screen prediction mode and an inter-screen prediction mode during image encoding / decoding. The coding unit may be a basic unit used for the process of prediction, transformation, quantization, inverse transformation, inverse quantization, or encoding / decoding of transform coefficients.

[0171] Referring to FIG. 3, an image (300) is sequentially divided into Largest Coding Unit (LCU) units, and a division structure is determined for each LCU unit. Here, LCU may be used in the same sense as Coding Tree Unit (CTU). Division of a unit may mean division of a block corresponding to the unit. Block division information may include information regarding the depth of the unit. The depth information may indicate the number of times and / or the degree to which the unit is divided. One unit may be hierarchically divided into multiple sub-units with depth information based on a tree structure. In other words, a unit and a sub-unit generated by division of the unit may correspond to a node and a child node of the node, respectively. Each divided sub-unit may have depth information. The depth information may be information indicating the size of a CU and may be stored for each CU. Since the unit depth indicates the number of times and / or the degree to which the unit is divided, the division information of a sub-unit may include information regarding the size of the sub-unit.

[0172] The partition structure may refer to the distribution of coding units (CUs) within the CTU (310). This distribution may be determined depending on whether to partition one CU into a plurality of CUs (a positive integer greater than or equal to 2, including 2, 4, 8, 16, etc.). The horizontal and vertical sizes of the CU generated by the partition may be half the horizontal size and half the vertical size of the CU before the partition, respectively, or may be smaller than the horizontal size and vertical size of the CU before the partition, depending on the number of partitions. The CU may be recursively partitioned into a plurality of CUs. By recursive partitioning, at least one of the horizontal size and the vertical size of the partitioned CU may be reduced compared to at least one of the horizontal size and the vertical size of the CU before the partitioning. The partitioning of the CU may be performed recursively up to a predefined depth or a predefined size. For example, the depth of a CTU may be 0, and the depth of a Smallest Coding Unit (SCU) may be a predefined maximum depth. Here, the CTU may be a coding unit having the largest coding unit size as described above, and the SCU may be a coding unit having the smallest coding unit size. Splitting starts from the CTU (310), and each time the horizontal and / or vertical size of the CU is reduced by the splitting, the depth of the CU increases by 1. For example, for each depth, a CU that is not split may have a size of 2Nx2N. Additionally, for a CU that is split, a CU of size 2Nx2N may be split into four CUs of size NxN. The size of N may be halved each time the depth increases by 1.

[0173] Additionally, information on whether a CU is split can be expressed through the CU's split information. The split information can be 1-bit information. All CUs except SCUs can include split information. For example, if the split information value is the first value, the CU may not be split, and if the split information value is the second value, the CU may be split.

[0174] Referring to Figure 3, a CTU with depth 0 can be a 64x64 block. 0 can be the minimum depth. An SCU with depth 3 can be an 8x8 block. 3 can be the maximum depth. CUs of 32x32 blocks and 16x16 blocks can be represented as depths 1 and 2, respectively.

[0175] For example, when one coding unit is split into four coding units, the horizontal and vertical sizes of the four split coding units may be half the sizes of the horizontal and vertical sizes of the coding unit before being split. For example, when a coding unit having a size of 32x32 is split into four coding units, each of the four split coding units may have a size of 16x16. When one coding unit is split into four coding units, it can be said that the coding unit is split in the form of a quad-tree (quad-tree partition).

[0176] For example, when one coding unit is split into two coding units, the horizontal or vertical size of the two split coding units may be half the size compared to the horizontal or vertical size of the coding unit before being split. For example, when a coding unit having a size of 32x32 is split vertically into two coding units, each of the two split coding units may have a size of 16x32. For example, when a coding unit having a size of 8x32 is split horizontally into two coding units, each of the two split coding units may have a size of 8x16. When one coding unit is split into two coding units, the coding unit can be said to be split in the form of a binary tree (binary-tree partition).

[0177] For example, when one coding unit is split into three coding units, the coding unit can be split into three coding units by splitting the horizontal or vertical size of the coding unit before splitting at a ratio of 1:2:1. For example, when a coding unit having a size of 16x32 is split horizontally into three coding units, the three split coding units can have sizes of 16x8, 16x16, and 16x8 from the top, respectively. For example, when a coding unit having a size of 32x32 is split vertically into three coding units, the three split coding units can have sizes of 8x32, 16x32, and 8x32 from the left, respectively. When one coding unit is split into three coding units, the coding unit can be said to have been split in the form of a ternary-tree (ternary-tree partition).

[0178] CTU (320) of Fig. 3 is an example of a CTU to which quadtree partitioning, binary tree partitioning, and 3-split tree partitioning are all applied.

[0179] As described above, at least one of quadtree partitioning, binary tree partitioning, and 3-partition tree partitioning may be applied to partition a CTU. Each partitioning may be applied based on a predetermined priority. For example, quadtree partitioning may be preferentially applied to a CTU. A coding unit that cannot be further quadtree partitioned may correspond to a leaf node of a quadtree. A coding unit corresponding to a leaf node of a quadtree may be a root node of a binary tree and / or a 3-partition tree. That is, a coding unit corresponding to a leaf node of a quadtree may be binary-tree partitioned, 3-partition tree partitioned, or may not be partitioned any further. At this time, by preventing quadtree partitioning from being performed again on a coding unit generated by binary-tree partitioning or 3-partition tree partitioning of a coding unit corresponding to a leaf node of a quadtree, partitioning of a block and / or signaling of partition information may be effectively performed.

[0180] The splitting of a coding unit corresponding to each node of a quadtree can be signaled using quad splitting information. Quad splitting information having a first value (e.g., '1') can indicate that the corresponding coding unit is quadtree split. Quad splitting information having a second value (e.g., '0') can indicate that the corresponding coding unit is not quadtree split. The quad splitting information can be a flag having a predetermined length (e.g., 1 bit).

[0181] There may be no priority between binary tree partitioning and 3-partition tree partitioning. That is, a coding unit corresponding to a leaf node of a quadtree may be partitioned either by a binary tree or by a 3-partition tree. Furthermore, a coding unit generated by a binary tree partitioning or a 3-partition tree partitioning may be partitioned again by a binary tree or a 3-partition tree, or may not be partitioned any further.

[0182] A partition in which there is no priority between a binary tree partition and a 3-partition tree partition can be called a multi-type tree partition. That is, a coding unit corresponding to a leaf node of a quadtree can become a root node of a multi-type tree. The partitioning of a coding unit corresponding to each node of a multi-type tree can be signaled using at least one of information on whether the multi-type tree is partitioned, information on the direction of partitioning, and information on the partition tree. For the partitioning of a coding unit corresponding to each node of the multi-type tree, information on whether the multi-type tree is partitioned, information on the direction of partitioning, and information on the partition tree may be sequentially signaled.

[0183] Information on whether a composite tree with a first value (e.g., '1') is split may indicate that the corresponding encoding unit is split into a composite tree. Information on whether a composite tree with a second value (e.g., '0') may indicate that the corresponding encoding unit is not split into a composite tree.

[0184] When an encoding unit corresponding to each node of a composite tree is split into a composite tree, the encoding unit may further include split direction information. The split direction information may indicate a split direction of the composite tree split. Split direction information having a first value (e.g., '1') may indicate that the corresponding encoding unit is split in a vertical direction. Split direction information having a second value (e.g., '0') may indicate that the corresponding encoding unit is split in a horizontal direction.

[0185] When an encoding unit corresponding to each node of a composite tree is split into a composite tree, the encoding unit may further include split tree information. The split tree information may indicate a tree used for splitting the composite tree. Split tree information having a first value (e.g., '1') may indicate that the encoding unit is split into a binary tree. Split tree information having a second value (e.g., '0') may indicate that the encoding unit is split into a 3-split tree.

[0186] The information on whether to split, the information on the split tree, and the information on the split direction may each be flags having a predetermined length (e.g., 1 bit).

[0187] At least one of quad partition information, information on whether a composite tree is partitioned, partition direction information, and partition tree information can be entropy encoded / decoded. For entropy encoding / decoding of the above information, information of a peripheral encoding unit adjacent to a current encoding unit can be used. For example, the partitioning shape (whether to be partitioned, partition tree, and / or partitioning direction) of a left encoding unit and / or an upper encoding unit is likely to be similar to the partitioning shape of the current encoding unit. Therefore, based on the information of the peripheral encoding unit, context information for entropy encoding / decoding of the information of the current encoding unit can be derived. At this time, the information of the peripheral encoding unit can include at least one of quad partition information of the corresponding encoding unit, information on whether a composite tree is partitioned, partition direction information, and partition tree information.

[0188] In another embodiment, among binary tree partitioning and 3-partition tree partitioning, binary tree partitioning may be performed preferentially. That is, binary tree partitioning may be applied first, and the encoding unit corresponding to the leaf node of the binary tree may be set as the root node of the 3-partition tree. In this case, quadtree partitioning and binary tree partitioning may not be performed for the encoding unit corresponding to the node of the 3-partition tree.

[0189] A coding unit that cannot be further split by quadtree splitting, binary tree splitting, and / or 3-tree splitting can become a unit of encoding, prediction, and / or transformation. That is, a coding unit may not be further split for prediction and / or transformation. Accordingly, a split structure, split information, etc. for splitting a coding unit into prediction units and / or transformation units may not exist in the bitstream.

[0190] However, if the size of the encoding unit that is the unit of division is larger than the size of the largest transform block, the encoding unit may be recursively divided until the size becomes equal to or smaller than the size of the largest transform block. For example, if the size of the encoding unit is 64x64 and the size of the largest transform block is 32x32, the encoding unit may be divided into four 32x32 blocks for transformation. For example, if the size of the encoding unit is 32x64 and the size of the largest transform block is 32x32, the encoding unit may be divided into two 32x32 blocks for transformation. In this case, whether or not to split the encoding unit for transformation is not separately signaled, but may be determined by comparing the width or height of the encoding unit with the width or height of the largest transform block. For example, if the width of the encoding unit is larger than the width of the largest transform block, the encoding unit may be divided into two vertically. Additionally, if the height of the encoding unit is greater than the height of the maximum transform block, the encoding unit may be divided into two halves horizontally.

[0191] Information about the maximum and / or minimum size of the coding unit and information about the maximum and / or minimum size of the transform block can be signaled or determined at a higher level of the coding unit. The higher level can be, for example, a sequence level, a picture level, a tile level, a tile group level, a slice level, etc. For example, the minimum size of the coding unit can be determined as 4x4. For example, the maximum size of the transform block can be determined as 64x64. For example, the minimum size of the transform block can be determined as 4x4.

[0192] Information about the minimum size of a coding unit corresponding to a leaf node of a quadtree (quadtree minimum size) and / or information about the maximum depth from a root node to a leaf node of a composite tree (composite tree maximum depth) may be signaled or determined at a higher level of the coding unit. The higher level may be, for example, a sequence level, a picture level, a slice level, a tile group level, a tile level, etc. Information about the quadtree minimum size and / or information about the composite tree maximum depth may be signaled or determined for each of an intra-screen slice and an inter-screen slice.

[0193] The differential information about the size of a CTU and the maximum size of a transform block can be signaled or determined at a higher level of the coding unit. The higher level can be, for example, a sequence level, a picture level, a slice level, a tile group level, a tile level, etc. Information about the maximum size of a coding unit corresponding to each node of a binary tree (binary tree maximum size) can be determined based on the size of the coding tree unit and the differential information. The maximum size of a coding unit corresponding to each node of a 3-partition tree (3-partition tree maximum size) can have different values ​​depending on the type of slice. For example, in the case of an intra-screen slice, the maximum size of the 3-partition tree can be 32x32. Also, for example, in the case of an inter-screen slice, the maximum size of the 3-partition tree can be 128x128. For example, the minimum size of the encoding unit corresponding to each node of the binary tree (binary tree minimum size) and / or the minimum size of the encoding unit corresponding to each node of the 3-partition tree (3-partition tree minimum size) can be set as the minimum size of the encoding block.

[0194] As another example, the maximum size of a binary tree and / or the maximum size of a 3-partition tree may be signaled or determined at the slice level. Additionally, the minimum size of a binary tree and / or the minimum size of a 3-partition tree may be signaled or determined at the slice level.

[0195] Based on the size and depth information of the various blocks described above, quad partition information, information on whether a composite tree is partitioned, partition tree information, and / or partition direction information may or may not be present in the bitstream.

[0196] For example, if the size of the encoding unit is not greater than the quadtree minimum size, the encoding unit does not include quad partition information, and the quad partition information can be inferred as the second value.

[0197] For example, if the size (width and height) of an encoding unit corresponding to a node of a composite tree is larger than the maximum size (width and height) of a binary tree and / or the maximum size (width and height) of a 3-partition tree, the encoding unit may not be split into a binary tree and / or a 3-partition tree. Accordingly, information on whether the composite tree is split is not signaled, but can be inferred as a second value.

[0198] Alternatively, if the size (width and height) of the encoding unit corresponding to the node of the composite tree is equal to the minimum size (width and height) of the binary tree, or if the size (width and height) of the encoding unit is equal to twice the minimum size (width and height) of the 3-partition tree, the encoding unit may not be subjected to binary tree splitting and / or 3-partition tree splitting. Accordingly, information on whether the composite tree is split or not may be inferred as a second value without being signaled. This is because, if the encoding unit is subjected to binary tree splitting and / or 3-partition tree splitting, an encoding unit smaller than the minimum size of the binary tree and / or the minimum size of the 3-partition tree is generated.

[0199] Alternatively, the binary tree splitting or the 3-split tree splitting may be limited based on the size of the virtual pipeline data unit (hereinafter, the pipeline buffer size). For example, if the binary tree splitting or the 3-split tree splitting splits the encoding unit into sub-coding units that do not fit the pipeline buffer size, the binary tree splitting or the 3-split tree splitting may be limited. The pipeline buffer size may be the size of the largest transform block (e.g., 64X64). For example, when the pipeline buffer size is 64X64, the following splitting may be limited.

[0200] - 3-partition tree partitioning for NxM (N and / or M are 128) coding units

[0201] - Horizontal binary tree partitioning for 128xN (N <= 64) encoding units

[0202] - Vertical binary tree partitioning for Nx128 (N <= 64) coding units

[0203] Alternatively, if the depth of the composite tree of the encoding unit corresponding to the node of the composite tree is equal to the maximum depth of the composite tree, the encoding unit may not be split into a binary tree and / or a 3-partition tree. Accordingly, information on whether the composite tree is split is not signaled, but can be inferred as a second value.

[0204] Alternatively, information on whether the composite tree is split may be signaled only if at least one of vertical binary tree splitting, horizontal binary tree splitting, vertical 3-partition tree splitting, and horizontal 3-partition tree splitting is possible for the encoding unit corresponding to the node of the composite tree. Otherwise, the encoding unit may not be split into a binary tree and / or a 3-partition tree. Accordingly, information on whether the composite tree is split may not be signaled, but may be inferred as a second value.

[0205] Alternatively, the split direction information may be signaled only when both vertical binary tree splitting and horizontal binary tree splitting are possible for the encoding unit corresponding to the node of the composite tree, or when both vertical 3-partition tree splitting and horizontal 3-partition tree splitting are possible. Otherwise, the split direction information may not be signaled and may be inferred as a value indicating a possible splitting direction.

[0206] Alternatively, the split tree information may be signaled only if both vertical binary tree splitting and vertical 3-partition tree splitting are possible for the encoding unit corresponding to the node of the composite tree, or if both horizontal binary tree splitting and horizontal 3-partition tree splitting are possible. Otherwise, the split tree information may not be signaled and may be inferred as a value indicating a tree that can be split.

[0207] Figure 4 is a diagram for explaining an embodiment of an on-screen prediction process.

[0208] The arrows from the center to the periphery of Figure 4 may indicate the prediction directions of the prediction modes within the screen.

[0209] In-frame encoding and / or decoding may be performed using reference samples from neighboring blocks of the current block. The neighboring blocks may be reconstructed neighboring blocks. For example, in-frame encoding and / or decoding may be performed using values ​​or encoding parameters of reference samples contained in the reconstructed neighboring blocks.

[0210] A prediction block may refer to a block generated as a result of performing prediction within a screen. The prediction block may correspond to at least one of a CU, a PU, and a TU. The unit of the prediction block may be the size of at least one of a CU, a PU, and a TU. The prediction block may be a square block having a size such as 2x2, 4x4, 16x16, 32x32, or 64x64, or may be a rectangular block having a size such as 2x8, 4x8, 2x16, 4x16, or 8x16.

[0211] In-screen prediction can be performed based on the in-screen prediction mode for the current block. The number of in-screen prediction modes that the current block can have can be a predefined fixed value, or it can be determined differently based on the properties of the prediction block. For example, the properties of the prediction block can include the size and shape of the prediction block.

[0212] The number of prediction modes within a picture may be fixed to N regardless of the size of the block. Or, for example, the number of prediction modes within a picture may be 3, 5, 9, 17, 34, 35, 36, 65, or 67. Or, the number of prediction modes within a picture may vary depending on the size of the block and / or the type of the color component. For example, the number of prediction modes within a picture may vary depending on whether the color component is a luma signal or a chroma signal. For example, the number of prediction modes within a picture may increase as the size of the block increases. Or, the number of prediction modes within a luma component block may be greater than the number of prediction modes within a chroma component block.

[0213] The in-screen prediction mode can be a non-directional mode or a directional mode. The non-directional mode can be a DC mode or a planar mode, and the angular mode can be a prediction mode having a specific direction or angle. The in-screen prediction mode can be expressed by at least one of a mode number, a mode value, a mode number, a mode angle, and a mode direction. The number of in-screen prediction modes can be one or more M including the non-directional and directional modes. A step of checking whether samples included in reconstructed neighboring blocks for in-screen prediction of the current block can be used as reference samples of the current block can be performed. If there is a sample that cannot be used as a reference sample of the current block, the sample value of at least one of the samples included in the reconstructed neighboring blocks is copied and / or interpolated to replace the sample value of the sample that cannot be used as a reference sample, and then the sample value can be used as a reference sample of the current block.

[0214] Figure 7 is a diagram illustrating reference samples available for prediction within the screen.

[0215] As illustrated in FIG. 7, at least one of reference sample lines 0 to 3 may be used for intra-picture prediction of the current block. In FIG. 7, samples of segments A and F may be padded with the closest samples of segments B and E, respectively, instead of being taken from reconstructed neighboring blocks. Index information indicating a reference sample line to be used for intra-picture prediction of the current block may be signaled. If the upper boundary of the current block is a boundary of a CTU, only reference sample line 0 may be available. Therefore, in this case, the index information may not be signaled. If a reference sample line other than reference sample line 0 is used, filtering on the prediction block described below may not be performed.

[0216] When making in-screen predictions, a filter can be applied to at least one of the reference sample or the prediction sample based on at least one of the in-screen prediction mode and the size of the current block.

[0217] In planar mode, when generating a prediction block of the current block, the sample value of the prediction target sample can be generated using a weighted sum of the top and left reference samples of the current sample, the top-right and bottom-left reference samples of the current block, depending on the position of the prediction target sample within the prediction block. In addition, in DC mode, when generating a prediction block of the current block, the average value of the top and left reference samples of the current block can be used. In addition, in directional mode, the prediction block can be generated using the top, left, top-right and / or bottom-left reference samples of the current block. Real-valued interpolation can also be performed to generate the prediction sample value.

[0218] In the case of intra-picture prediction between color components, a prediction block for a current block of a second color component can be generated based on a corresponding reconstruction block of a first color component. For example, the first color component can be a luminance component, and the second color component can be a chrominance component. For intra-picture prediction between color components, parameters of a linear model between the first color component and the second color component can be derived based on a template. The template can include top and / or left peripheral samples of the current block and top and / or left peripheral samples of a reconstruction block of the first color component corresponding thereto. For example, the parameters of the linear model can be derived using a sample value of the first color component having a maximum value among the samples in the template and a sample value of the second color component corresponding thereto, and a sample value of the first color component having a minimum value among the samples in the template and a sample value of the second color component corresponding thereto. Once the parameters of the linear model are derived, a prediction block for the current block can be generated by applying a corresponding reconstruction block to the linear model. Depending on the video format, subsampling may be performed on the surrounding samples of the reconstructed block of the first color component and the corresponding reconstructed block. For example, if one sample of the second color component corresponds to four samples of the first color component, the four samples of the first color component may be subsampled to compute one corresponding sample. In this case, parameter derivation of the linear model and intra-picture prediction between color components may be performed based on the subsampled corresponding samples. Whether intra-picture prediction between color components is performed and / or the range of the template may be signaled as an intra-picture prediction mode.

[0219] A current block can be split into two or four sub-blocks in the horizontal or vertical direction. The split sub-blocks can be sequentially reconstructed. That is, intra-picture prediction can be performed on the sub-blocks to generate sub-prediction blocks. In addition, inverse quantization and / or inverse transformation can be performed on the sub-blocks to generate sub-residual blocks. A reconstructed sub-block can be generated by adding the sub-prediction block to the sub-residual block. The reconstructed sub-block can be used as a reference sample for intra-picture prediction of a subsequent sub-block. A sub-block can be a block including a predetermined number of samples (e.g., 16). Therefore, for example, if the current block is an 8x4 block or a 4x8 block, the current block can be split into two sub-blocks. In addition, if the current block is a 4x4 block, the current block cannot be split into sub-blocks. If the current block has a size other than that, the current block can be split into four sub-blocks. Information regarding whether or not to perform the sub-block-based intra-screen prediction and / or the splitting direction (horizontal or vertical) may be signaled. The sub-block-based intra-screen prediction may be restricted to be performed only when using reference sample line 0. When the sub-block-based intra-screen prediction is performed, filtering on the prediction block described below may not be performed.

[0220] A final prediction block can be generated by performing filtering on a predicted prediction block within a screen. The filtering can be performed by applying predetermined weights to a filtering target sample, a left reference sample, an upper reference sample, and / or an upper left reference sample. The weights and / or reference samples (range, position, etc.) used for the filtering can be determined based on at least one of a block size, an intra-screen prediction mode, and a position of the filtering target sample within the prediction block. The filtering can be performed only for a predetermined intra-screen prediction mode (e.g., DC, planar, vertical, horizontal, diagonal, and / or adjacent diagonal mode). The adjacent diagonal mode can be a mode obtained by adding or subtracting k from the diagonal mode. For example, k can be a positive integer less than or equal to 8.

[0221] The intra-screen prediction mode of the current block can be predicted from the intra-screen prediction modes of blocks existing around the current block and entropy encoded / decoded. If the intra-screen prediction modes of the current block and the surrounding blocks are the same, information indicating that the intra-screen prediction modes of the current block and the surrounding blocks are the same can be signaled using predetermined flag information. In addition, indicator information regarding an intra-screen prediction mode that is the same as the intra-screen prediction mode of the current block among the intra-screen prediction modes of a plurality of surrounding blocks can be signaled. If the intra-screen prediction modes of the current block and the surrounding blocks are different, entropy encoding / decoding can be performed based on the intra-screen prediction modes of the surrounding blocks to entropy encode / decode the intra-screen prediction mode information of the current block.

[0222] Figure 5 is a diagram for explaining an embodiment of a screen-to-screen prediction process.

[0223] The rectangles illustrated in Figure 5 can represent images. Additionally, the arrows in Figure 5 can indicate prediction directions. Each image can be classified into an I-picture (Intra Picture), a P-picture (Predictive Picture), a B-picture (Bi-predictive Picture), etc., depending on its encoding type.

[0224] An I picture can be encoded / decoded through intra-picture prediction without inter-picture prediction. A P picture can be encoded / decoded through inter-picture prediction using only reference pictures existing in a unidirectional direction (e.g., forward or backward). A B picture can be encoded / decoded through inter-picture prediction using reference pictures existing in both directions (e.g., forward and backward). In addition, in the case of a B picture, it can be encoded / decoded through inter-picture prediction using reference pictures existing in both directions or inter-picture prediction using reference pictures existing in one of the forward and backward directions. Here, the bidirectional direction can be forward and backward. Here, when inter-picture prediction is used, the encoder can perform inter-picture prediction or motion compensation, and the decoder can perform corresponding motion compensation.

[0225] Below, inter-screen prediction according to an embodiment is described in detail.

[0226] Inter-screen prediction or motion compensation can be performed using reference images and motion information.

[0227] Motion information for a current block can be derived through inter-frame prediction by each of the encoding device (100) and the decoding device (200). The motion information can be derived using motion information of a reconstructed surrounding block, motion information of a collocated block (col block), and / or a block adjacent to the collocated block. The collocated block may be a block corresponding to the spatial position of the current block within an already reconstructed collocated picture (col picture). Here, the collocated picture may be one picture from at least one reference picture included in a reference picture list.

[0228] The method for deriving motion information may vary depending on the prediction mode of the current block. For example, prediction modes applied for inter-frame prediction may include AMVP mode, merge mode, skip mode, merge mode with motion vector difference, sub-block merge mode, triangulation mode, inter-intra joint prediction mode, and affine inter mode. Here, the merge mode may be referred to as motion merge mode.

[0229] For example, when AMVP is applied as a prediction mode, a motion vector candidate list can be generated by determining at least one of the motion vector of the reconstructed neighboring block, the motion vector of the called block, the motion vector of the block adjacent to the called block, and the (0, 0) motion vector as a motion vector candidate. A motion vector candidate can be derived using the generated motion vector candidate list. Motion information of the current block can be determined based on the derived motion vector candidate. Here, the motion vector of the called block or the motion vector of the block adjacent to the called block can be referred to as a temporal motion vector candidate, and the motion vector of the reconstructed neighboring block can be referred to as a spatial motion vector candidate.

[0230] The encoding device (100) can calculate the motion vector difference (MVD) between the motion vector of the current block and the motion vector candidate, and can entropy encode the MVD. In addition, the encoding device (100) can generate a bitstream by entropy encoding the motion vector candidate index. The motion vector candidate index can indicate an optimal motion vector candidate selected from among the motion vector candidates included in the motion vector candidate list. The decoding device (200) can entropy decode the motion vector candidate index from the bitstream, and select a motion vector candidate of a block to be decoded from among the motion vector candidates included in the motion vector candidate list using the entropy-decoded motion vector candidate index. In addition, the decoding device (200) can derive a motion vector of a block to be decoded by summing the entropy-decoded MVD and the motion vector candidate.

[0231] Meanwhile, the encoding device (100) can entropy encode the resolution information of the calculated MVD. The decoding device (200) can adjust the resolution of the entropy-decoded MVD using the MVD resolution information.

[0232] Meanwhile, the encoding device (100) can calculate the motion vector difference (MVD) between the motion vector of the current block and the motion vector candidate based on the affine model, and can entropy encode the MVD. The decoding device (200) can derive the affine control motion vector of the block to be decoded through the sum of the entropy-decoded MVD and the affine control motion vector candidate, thereby deriving the motion vector in units of sub blocks.

[0233] The bitstream may include a reference picture index indicating a reference picture, etc. The reference picture index may be entropy encoded and signaled from the encoding device (100) to the decoding device (200) via the bitstream. The decoding device (200) may generate a prediction block for the block to be decoded based on the derived motion vector and the reference picture index information.

[0234] Another example of a method for deriving motion information is merge mode. Merge mode may refer to merging motions of multiple blocks. Merge mode may refer to a mode in which motion information of a current block is derived from motion information of surrounding blocks. When merge mode is applied, a merge candidate list may be generated using motion information of reconstructed surrounding blocks and / or motion information of a call block. The motion information may include at least one of 1) a motion vector, 2) a reference image index, and 3) an inter-frame prediction indicator. The prediction indicator may be unidirectional (L0 prediction, L1 prediction) or bidirectional.

[0235] The merge candidate list may represent a list in which motion information is stored. The motion information stored in the merge candidate list may be at least one of motion information of a neighboring block adjacent to the current block (spatial merge candidate), motion information of a block collocated with the current block in a reference image (temporal merge candidate), new motion information generated by a combination of motion information already existing in the merge candidate list, motion information of a block encoded / decoded before the current block (history-based merge candidate), and a zero merge candidate.

[0236] The encoding device (100) can generate a bitstream by entropy encoding at least one of a merge flag and a merge index, and then signal it to the decoding device (200). The merge flag can be information indicating whether to perform a merge mode for each block, and the merge index can be information on which block among the neighboring blocks adjacent to the current block will be merged. For example, the neighboring blocks of the current block can include at least one of the left neighboring block, the upper neighboring block, and the temporal neighboring block of the current block.

[0237] Meanwhile, the encoding device (100) can entropy encode correction information for correcting the motion vector among the motion information of the merge candidate and signal it to the decoding device (200). The decoding device (200) can correct the motion vector of the merge candidate selected by the merge index based on the correction information. Here, the correction information can include at least one of correction status information, correction direction information, and correction size information. As described above, a prediction mode that corrects the motion vector of the merge candidate based on the signaled correction information can be referred to as a merge mode with motion vector difference.

[0238] Skip mode may be a mode that applies motion information of surrounding blocks as is to the current block. When skip mode is used, the encoding device (100) may entropy encode information on which block's motion information is to be used as the motion information of the current block and signal it to the decoding device (200) through a bitstream. At this time, the encoding device (100) may not signal a syntax element regarding at least one of motion vector difference information, an encoding block flag, and a transform coefficient level (quantized level) to the decoding device (200).

[0239] Subblock merge mode may refer to a mode for deriving motion information in units of subblocks of a coding block (CU). When the subblock merge mode is applied, a subblock merge candidate list may be generated using motion information (subblock-based temporal merge candidate) of a subblock collocated with a current subblock in a reference image and / or an affine control point motion vector merge candidate.

[0240] The triangle partition mode may refer to a mode in which the current block is divided in the diagonal direction to derive motion information for each block, each prediction sample is derived using each derived motion information, and each derived prediction sample is weighted and combined to derive a prediction sample of the current block.

[0241] Inter-intra combined prediction mode may mean a mode in which a prediction sample of the current block is derived by weighting prediction samples generated through inter-screen prediction and prediction samples generated through intra-screen prediction.

[0242] The decoding device (200) can independently correct the derived motion information. The decoding device (200) can search a predefined area based on a reference block indicated by the derived motion information to derive the motion information with the minimum SAD as corrected motion information.

[0243] The decoding device (200) can compensate for the prediction sample derived through inter-screen prediction using optical flow.

[0244] Figure 6 is a diagram for explaining the process of transformation and quantization.

[0245] As illustrated in FIG. 6, a quantized level can be generated by performing a transformation and / or quantization process on the residual signal. The residual signal can be generated as a difference between an original block and a prediction block (an intra-screen prediction block or an inter-screen prediction block). Here, the prediction block can be a block generated by intra-screen prediction or inter-screen prediction. Here, the transformation can include at least one of a primary transformation and a secondary transformation. A transformation coefficient can be generated by performing a primary transformation on the residual signal, and a secondary transformation can be performed on the transformation coefficient to generate a secondary transformation coefficient.

[0246] The primary transform can be performed using at least one of a plurality of pre-defined transform methods. For example, the plurality of pre-defined transform methods can include a discrete cosine transform (DCT), a discrete sine transform (DST), or a Karhunen-Loeve transform (KLT)-based transform. A secondary transform can be performed on transform coefficients generated after the primary transform is performed. The transform method applied during the primary transform and / or the secondary transform can be determined according to at least one of the encoding parameters of the current block and / or the neighboring blocks. Alternatively, transform information indicating the transform method can be signaled. The DCT-based transform can include, for example, DCT2, DCT-8, etc. The DST-based transform can include, for example, DST-7.

[0247] Quantization can be performed on the result or residual signal of the first transform and / or the second transform to generate a quantized level. The quantized level can be scanned according to at least one of an up-right diagonal scan, a vertical scan, and a horizontal scan based on at least one of an within-picture prediction mode or a block size / shape. For example, the coefficients of a block can be converted into a one-dimensional vector form by scanning them using an up-right diagonal scan. Depending on the size of the transform block and / or the within-picture prediction mode, a vertical scan that scans the two-dimensional block shape coefficients in the column direction, or a horizontal scan that scans the two-dimensional block shape coefficients in the row direction may be used instead of the up-right diagonal scan. The scanned quantized level can be entropy encoded and included in a bitstream.

[0248] A decoder can entropy-decode a bitstream to generate quantized levels. These quantized levels can be aligned into a two-dimensional block shape through inverse scanning. At least one of the following methods can be used for inverse scanning: upper-right diagonal scanning, vertical scanning, or horizontal scanning.

[0249] Inverse quantization can be performed on a quantized level, a second inverse transform can be performed depending on whether a second inverse transform is performed, and a first inverse transform can be performed depending on whether a first inverse transform is performed on the result of the second inverse transform, thereby generating a restored residual signal.

[0250] Inverse mapping of the dynamic range may be performed on the luminance component restored through intra-picture prediction or inter-picture prediction before in-loop filtering. The dynamic range may be divided into 16 equal pieces, and a mapping function for each piece may be signaled. The mapping function may be signaled at the slice level or the tile group level. The inverse mapping function for performing the inverse mapping may be derived based on the mapping function. In-loop filtering, storage of reference pictures, and motion compensation are performed in the inverse mapped area, and the prediction block generated through inter-picture prediction may be converted to the mapped area by mapping using the mapping function, and then used to generate a reconstructed block. However, since intra-picture prediction is performed in the mapped area, the prediction block generated through intra-picture prediction may be used to generate a reconstructed block without mapping / inverse mapping.

[0251] If the current block is a residual block of chrominance components, the residual block can be converted into an inverse mapped region by performing scaling on the chrominance components of the mapped region. The availability of the scaling can be signaled at the slice level or the tile group level. The scaling can be applied only when the mapping for the luma component is available and the partitioning of the luminance component and the partitioning of the chrominance component follow the same tree structure. The scaling can be performed based on the average of the sample values ​​of the luminance prediction block corresponding to the chrominance block. In this case, if the current block uses inter-screen prediction, the luminance prediction block can mean the mapped luminance prediction block. The value required for the scaling can be derived by referring to a lookup table using the index of the piece to which the average of the sample values ​​of the luminance prediction block belongs. Finally, by scaling the residual block using the derived value, the residual block can be converted into an inverse mapped region. Restoration of the subsequent chrominance component blocks, intra-screen prediction, inter-screen prediction, in-loop filtering, and storage of reference pictures can be performed in the reverse-mapped area.

[0252] Information indicating whether mapping / demapping of the luminance component and chrominance component is available can be signaled via a sequence parameter set.

[0253] A prediction block of a current block can be generated based on a block vector indicating a displacement between the current block and a reference block within the current picture. In this way, a prediction mode that generates a prediction block by referencing the current picture can be called an Intra Block Copy (IBC) mode. The IBC mode can be applied to an MxN (M<=64, N<=64) coding unit. The IBC mode can include a skip mode, a merge mode, an AMVP mode, etc. In the case of the skip mode or the merge mode, a merge candidate list is configured, and a merge index is signaled so that one merge candidate can be specified. The block vector of the specified merge candidate can be used as a block vector of the current block. The merge candidate list can include at least one or more of a spatial candidate, a history-based candidate, an average-of-two-candidate candidate, or a zero-merge candidate. In the case of the AMVP mode, a differential block vector can be signaled. Additionally, the predicted block vector can be derived from the left neighboring block and the upper neighboring block of the current block. An index indicating which neighboring block to use can be signaled. The predicted block in IBC mode can be limited to blocks included in the current CTU or the left CTU and within the previously reconstructed region. For example, the block vector value of the predicted block of the current block can be limited so that it is located within the three 64x64 block regions preceding the 64x64 block to which the current block belongs in the encoding / decoding order. By limiting the block vector value in this way, the memory consumption and device complexity associated with the IBC mode implementation can be reduced.

[0254]

[0255] FIG. 8 is a diagram for explaining intra-screen prediction encoding / decoding according to one embodiment of the present invention.

[0256] In step S510, an on-screen prediction mode can be derived.

[0257] The intra-screen prediction mode for the current block can be derived using at least one of a method of deriving a predetermined mode (N) and / or intra-screen prediction modes of surrounding blocks, a method of entropy encoding / decoding the intra-screen prediction mode of the current block, and a method of adaptively deriving a prediction mode according to a slice type.

[0258] Intra-screen prediction modes can include various modes such as DC, Planar, PDPC (Position Dependent Intra Prediction Combination), LM (Linear Model), angular prediction, and CPR (Current Picture Referencing).

[0259] The size of the current block can be expressed as W×H, where W and H are positive integers a·2, respectively. n (a = 1, 2, 3, …, n = 0, 1, 2, 3, 4, …) can have values.

[0260] The intra-screen prediction mode of the current block can be derived using a given intra-screen prediction mode and / or the intra-screen prediction modes of the surrounding blocks.

[0261] The above-described intra-screen prediction mode may be N modes selected from among available intra-screen prediction modes. In this case, N may be a positive integer including 1.

[0262] The above-mentioned surrounding block may be a surrounding block that is spatially / temporally adjacent to the current block.

[0263] A Most Frequent Mode (MFM) can be configured using the above-described intra-screen prediction mode and / or the intra-screen prediction mode of the surrounding blocks. The MFM can include one or more N intra-screen prediction modes. When deriving the MFM, the number of MFMs and / or the derivation method of the MFM can vary based on at least one of the size, shape, color component, and slice type of the current block.

[0264] The above MFM can be derived from surrounding blocks.

[0265] When deriving N intra-screen prediction modes from surrounding blocks, N MFMs can be derived for each sub-block.

[0266] For example, N MFMs can be derived by exploring the patterns of surrounding blocks and used in prediction mode.

[0267] For example, a specific mode can be defined as MFM based on the gradient values ​​of surrounding blocks and used as a prediction mode.

[0268] For example, N MFMs can be derived by exploring the prediction modes of surrounding blocks and used as prediction modes.

[0269] Figure 9 is a diagram for explaining a method for deriving an intra-screen prediction mode using a sub-block.

[0270] Sub-blocks may exist on the left, top, and right of the current block, as shown in (a) of Fig. 9. Below, an embodiment in which sub-blocks exist on the left and top of the current block is described.

[0271] The size of a sub-block can be greater than or equal to the minimum CU size. The size of a sub-block is W sub x H sub can be expressed as W sub and H sub are positive integers a and 2, respectively. n(a = 1, 2, 3, …, n = 0, 1, 2, 3, 4, …) can have values.

[0272] The search range of a sub-block may be determined in various ways depending on the size and / or shape of the current block. The search may mean deriving an intra-screen prediction mode of one or more surrounding sub-blocks.

[0273] Figure 9 (b) is an example in which the current block size is 16x16 and the sub-block size is 4x4. Figure 9 (c) is an example in which the current block size is 16x8 and the sub-block size is 4x4. However, the sizes of the current block and sub-block are not limited to the above example.

[0274] In the examples shown in (b) and (c) of Fig. 9, when the size of the current block is WxH, the number of sub-blocks searched to derive the intra-screen prediction mode is (nWxnH + 1) or d×(nW×mH)+d 2 It can be a dog. (n = 0, 1, 2, 3, …, m = 0, 1, 2, 3, …, d = 0, 1, 2, 3, …)

[0275] In the example shown in (c) of Fig. 9, if the current block is rectangular, n > m, n < m, or n = m. In addition, d v > d h , d v < d h or d v = d h It could be.

[0276] The size and / or search range of the above sub-blocks may vary depending on the color component. For example, for the chrominance block, the sub-blocks used in the luminance block may be sub-sampled at a ratio of 1:x (x = 1, 2, 3, …).

[0277] A predetermined mode among the intra-screen prediction modes derived from one or more of the above-described surrounding blocks can be derived as an MFM. The predetermined mode may mean at least one of a mode with the highest occurrence frequency, a mode corresponding to a surrounding block at a predetermined location, and a combination of one or more intra-screen prediction modes. The method for deriving the MFM may vary based on at least one of the size / shape of the current block, the size / shape of the surrounding block, and the intra-screen prediction mode of the surrounding block.

[0278] Fig. 10 is a drawing for explaining an embodiment of determining MFM.

[0279] In (a) to (c) of Fig. 10, n, m, and d all have the value 1.

[0280] In (a) of Fig. 10, the mode with the highest occurrence frequency is mode 18. In this case, MFM can be induced into mode 18.

[0281] In the example illustrated in (b) of Fig. 10, the MFM derivation method can be derived differently based on the size of at least one of the CTU, CU, PU, ​​and TU that the surrounding block includes. For example, when the frequencies of the modes derived from the sub-blocks are the same, the MFM can be derived by applying different weights depending on the size of the surrounding block. For example, in the example illustrated in (b) of Fig. 10, mode 18 can be derived as MFM by applying a high weight to a block among the surrounding blocks with a large size. Alternatively, mode 17 can be derived as MFM by applying a high weight to a block among the surrounding blocks with a small size.

[0282] In the example illustrated in (c) of Fig. 10, the size of the surrounding blocks is the same as that of the example illustrated in (b) of Fig. 10, but the current block is rectangular. In this case, since the mode with the highest occurrence frequency among the prediction modes derived in sub-block units is mode 17, the MFM can be derived in mode 17.

[0283] A Most Probable Mode (MPM) can be configured to derive the on-screen prediction mode of the current block. The aforementioned MFM can be excluded from the MPM candidate list. For example, when the MFM is mode 18, the MPM candidate list can be configured excluding mode 18.

[0284] An indicator indicating whether the current block's on-screen prediction mode is MFM can be encoded / decoded. For example, if the MFM indicator is a first value (e.g., "1"), the derived MFM can be set as the current block's on-screen prediction mode.

[0285] When there are two or more MFMs, additional MFM indices may be encoded / decoded. An MFM index may be an index indicating one of N MFMs.

[0286] When the MFM indicator is a second value (e.g., “0”), the MPM indicator may be encoded / decoded. The MPM indicator may be an indicator indicating whether the intra-screen prediction mode of the current block is MPM.

[0287] When predicting a mode in sub-block units, the predicted mode within the screen can be derived from the partial positions of surrounding blocks that have already been encoded / decoded.

[0288] The partial location of the surrounding block may be determined based on at least one of the slice type, color component, and size / shape of the block.

[0289] Figure 14 is a drawing for explaining the partial positions of surrounding blocks.

[0290] As shown in (a) of Fig. 14, the partial positions can be L, A, and AL. Based on the partial positions, the MFM derivation method described above can be applied.

[0291] Or, as shown in (b) of Fig. 14, the partial positions may be L, A, AR, LB, AL.

[0292] If the slice containing the current block is an I slice, the MFM is derived at the position shown in (a) or (b) of Fig. 14 or at a predetermined designated position, and if it is a P or B slice, the positions of the surrounding blocks may be changed.

[0293] If the current block is a luminance block, MFM is derived at the location shown in (a) or (b) of Fig. 14 or at a predetermined designated location, and if it is a chrominance block, the location of the surrounding blocks may be changed.

[0294] If the current block is a square, the MFM is derived at the position shown in (a) or (b) of Fig. 14 or at a predetermined designated position, and if it is a rectangle, the positions of the surrounding blocks may be changed.

[0295] When predicting a mode in sub-block units, a prediction mode can be derived by performing a search of the entire surrounding block or a partial search of the surrounding block.

[0296] When predicting modes on a sub-block basis, the predicted mode within the screen can be derived from spatially neighboring blocks. The spatially neighboring blocks of the current block may already be blocks for which encoding / decoding has been completed.

[0297] Figure 11 is a drawing for explaining the spatial surrounding blocks of the current block.

[0298] In Fig. 11, blocks a to m are surrounding blocks of the current block, shaded blocks are inter-screen predicted blocks, and non-shaded blocks are intra-screen predicted blocks.

[0299] As shown in (a) of Fig. 11, if all surrounding blocks are predicted within the screen, the MFM of the current block can be derived by searching for all surrounding blocks in sub-block units.

[0300] As shown in (b) of Fig. 11, if some of the surrounding blocks are predicted within the screen, the MFM of the current block can be derived by searching only for the surrounding blocks predicted within the screen in sub-block units.

[0301] In the example illustrated in (b) of Fig. 11, if some of the surrounding blocks are inter-predicted, the intra-screen prediction mode can be found from the reference picture of the surrounding blocks and replaced with the intra-screen prediction mode to derive the prediction mode of the current block. The MFM of the current block can be derived from the prediction modes searched for on a sub-block basis, including the replaced intra-screen prediction mode.

[0302] When predicting modes on a sub-block basis, the predicted mode within the screen can be derived from temporally surrounding blocks.

[0303] The temporal surrounding blocks of the current block may be reference blocks existing within a reference picture that has already been encoded / decoded. The reference picture may be one or more pictures stored in a reference picture buffer (DPB, Decoded Picture Buffer).

[0304] Figure 12 is a diagram for explaining the temporal surrounding blocks of the current block.

[0305] In deriving the on-screen prediction mode of the current block, the MFM of the current block can be derived by searching in sub-block units from the spatial surrounding blocks of the reference block.

[0306] For example, if the spatial surrounding blocks of a reference block are all predicted within the screen as shown in (a) of Fig. 11, the MFM of the current block can be derived by searching for all surrounding blocks in sub-block units.

[0307] For example, if some of the spatial surrounding blocks of the reference block are predicted within the screen as shown in (b) of Fig. 11, the MFM of the current block can be derived by searching only for the predicted surrounding blocks within the screen in units of sub-blocks.

[0308] For example, if some of the spatial neighboring blocks of a reference block are inter-predicted as illustrated in (b) of Fig. 11, the intra-screen prediction mode can be found from the reference picture of the neighboring block and replaced with the intra-screen prediction mode to derive the prediction mode of the current block. The MFM of the current block can be derived from the prediction modes searched for in units of sub-blocks, including the replaced intra-screen prediction mode.

[0309] In deriving an intra-screen prediction mode in sub-block units, the intra-screen prediction mode can be derived through spatial and / or temporal template matching.

[0310] When deriving an on-screen prediction mode through the above template matching, an indicator for whether template matching is performed can be encoded / decoded.

[0311] If the template matching indicator is the first value (e.g., “1”), the MFM of the current block can be derived from the block found by performing template matching.

[0312] When the template matching indicator is a second value (e.g., “0”), the MFM of the current block can be derived from prediction modes searched in units of surrounding sub-blocks of the current block.

[0313] At least one matching method among spatial / temporal template matching can be used.

[0314] When both spatial and temporal template matching are possible, an index of which template matching is used can be encoded / decoded.

[0315] When the template matching index is the first value (e.g., “0”), spatial template matching (or temporal template matching) can be performed.

[0316] If the template matching index is a second value (e.g., “1”), temporal template matching (or spatial template matching) can be performed.

[0317] When spatial template matching is performed, the spatial template can be constructed from surrounding blocks of the current block. For example, spatial templates can be constructed with various sizes and depths, such as the configuration of the sub-blocks in FIG. 9.

[0318] Using the constructed template, the most similar template can be found within the search range from the already encoded / decoded blocks.

[0319] The search range can be specified by a picture, slice, CTU, or surrounding region. For example, the search range can be specified as the range of a given CTU surrounding the current picture, the current slice, or the current CTU. Within the specified search range, the template most similar to the configured spatial template can be searched for.

[0320] At this time, the CTU index (CTU_index) for the search range can be encoded / decoded. For example, if the CTU_index is 0, the search range can be CTU 0.

[0321] For example, a search may be performed within the region surrounding the current block. If there is more than one region, one or more indices (Region_index) for specifying the region may be encoded / decoded. For example, if Region_index is 0, the search range may be Region 0.

[0322] Searching for the most similar template may involve finding the template with the smallest difference from the template of the current block, and methods such as SAD (Sum of Absolute Difference) may be used.

[0323] The MFM of the current block can be derived from the block found through template matching, sub-block by sub-block. The derivation process can be identical to the above method for deriving the MFM from spatial / temporal surrounding blocks.

[0324] When performing temporal template matching, the temporal template of the current block may exist within a reference picture that has already been encoded / decoded. The reference picture may be one or more pictures stored in a reference picture buffer (DPB, Decoded Picture Buffer).

[0325] A temporal template can be constructed from temporally neighboring blocks of the current block. For example, temporal templates can be constructed with various sizes and depths, as in the sub-block configuration of FIG. 9. A temporal template can be a neighboring block of a reference block within the reference picture.

[0326] Using the constructed template, the most similar template can be found from the surroundings of a location within a reference picture corresponding to the location of the current block.

[0327] Searching for the most similar template may correspond to finding the template with the smallest difference from the template of the current block, and a method such as SAD (Sum of Absolute Difference) may be used.

[0328] The MFM of the current block can be derived from the block found through template matching, sub-block by sub-block. The derivation process can be identical to the above method for deriving the MFM from spatial / temporal surrounding blocks.

[0329]

[0330] To encode / decode the on-screen prediction mode of the current block, N predetermined modes among the on-screen prediction modes can be derived as MFMs. The MFMs can be various modes such as DC, Planar, PDPC, LM, and directional modes.

[0331] N predetermined modes can be selected according to the characteristics of the mode.

[0332] For example, N non-directional modes can be selected as MFMs. For example, when the intra-screen prediction mode consists of 35 modes (DC, Planar, and 33 directional modes), the DC mode and the Planar mode can be selected as MFMs. Alternatively, when the intra-screen prediction mode consists of 67 modes (DC, Planar, and 65 directional modes), the DC mode and the Planar mode can be selected as MFMs. In this case, an index indicating one of the N modes can be encoded / decoded.

[0333] For example, the commonly chosen on-screen prediction mode can be selected as MFM.

[0334] When the on-screen prediction mode is composed of 35 modes or 67 modes including two non-directional modes as described above, the commonly selected DC mode and Planar mode (N = 2) can be selected as MFM. Alternatively, the commonly selected DC mode or Planar mode (N = 1) can be selected as MFM. Alternatively, when one of the directional modes is commonly selected, the corresponding directional mode can be selected as MFM.

[0335] At this time, when N is 2 or more, an index indicating one of N modes can be encoded / decoded.

[0336] A commonly selected mode may be predefined in the encoder / decoder. The commonly selected mode may be updated at each predetermined unit. The predetermined unit may be at least one of a video, a sequence, a picture, a slice, a tile, and a CTU. For the update, the usage frequency of each mode may be stored. Each time the predetermined unit is changed, one or more commonly selected modes may be determined based on the stored frequency. Alternatively, information regarding one or more commonly selected modes may be signaled at each predetermined unit.

[0337] Modes derived from MFM may be excluded from the MPM candidate list construction. For example, if DC mode and / or Planar mode are selected as MFM, DC mode and / or Planar mode may be excluded when constructing the MPM candidate list.

[0338] It can be determined whether the derived MFM and the intra-picture prediction mode of the current block are the same. For example, if the MFM is a Planar mode and the intra-picture prediction mode of the current block is a Planar mode, the intra-picture prediction mode of the current block can be encoded / decoded using the MFM. If the intra-picture prediction mode of the current block and the MFM are not the same, an MPM list can be constructed. If the intra-picture prediction mode of the current block exists in the MPM list, the intra-picture prediction mode of the current block can be encoded / decoded using the MPM index.

[0339] An indicator indicating whether the current block's intra-picture prediction mode is identical to MFM may be encoded / decoded. If the current block's intra-picture prediction mode is identical to MFM, the MFM indicator may have a first value (e.g., "1"), and if not, the MFM indicator may have a second value (e.g., "0").

[0340] When MFM includes N modes, which are two or more, an MFM index indicating one of the N modes can be additionally encoded / decoded.

[0341] Figure 27 is a diagram for explaining an embodiment of determining an on-screen prediction mode using both MFM and MPM.

[0342] As shown in (a) of Fig. 27, the MFM indicator can be determined after determining the MPM indicator.

[0343] According to (a) of Fig. 27, it can be determined whether the MPM indicator is true or false (S2701). If the MPM indicator is true (e.g., “1”), it can be determined whether the MFM indicator is true or false (S2702).

[0344] If the MFM indicator is true (e.g., “1”), a predetermined mode can be derived as the on-screen prediction mode of the current block (S2703). The predetermined mode can be, for example, a Planar mode or a DC mode. Alternatively, the predetermined modes can be multiple (e.g., two non-directional modes), in which case the mode indicated by the MFM index can be derived as the on-screen prediction mode of the current block.

[0345] If the MFM indicator is false (e.g., “0”), among the MPM candidates excluding MFM, the mode indicated by the MPM index can be derived as the on-screen prediction mode of the current block (S2704).

[0346] If the MPM indicator is false (e.g., “0”), the mode indicated by the Non-MPM index among the remaining modes that are not MPM candidates can be derived as the on-screen prediction mode of the current block (S2705).

[0347] As shown in (b) of Fig. 27, the MPM indicator can be determined after determining the MFM indicator.

[0348] According to (b) of Fig. 27, it can be determined whether the MFM indicator is true or false (S2711). If the MFM indicator is true (e.g., “1”), a predetermined mode can be derived as the on-screen prediction mode of the current block (S2712). The predetermined mode can be, for example, a Planar mode or a DC mode. Alternatively, the predetermined modes can be multiple (e.g., two non-directional modes), in which case the mode indicated by the MFM index can be derived as the on-screen prediction mode of the current block.

[0349] If the MFM indicator is false (e.g., “0”), it can be determined whether the MPM indicator is true or false (S2713). If the MPM indicator is true (e.g., “1”), among the MPM candidates excluding MFM, the mode indicated by the MPM index can be derived as the on-screen prediction mode of the current block (S2714).

[0350] If the MPM indicator is false (e.g., “0”), the mode indicated by the Non-MPM index among the remaining modes that are not MPM candidates can be derived as the on-screen prediction mode of the current block (S2715).

[0351] At least one of the MFM indicators and the MPM indicators can be inferred or implied by the indicators regarding various on-screen prediction methods.

[0352] Here, the various on-screen prediction methods can be at least one of MRL (Multi Reference Line), ISP (Intra Sub Partition), and MIP (Matrix Intra Prediction).

[0353] For example, assuming that the above-described various on-screen prediction methods are performed only on one or more of the MPM candidates and MFM candidates, if the indicator indicating the various on-screen prediction methods is 1, at least one of the MPM indicator and the MFM indicator can be inferred / implied to be true (e.g., “1”). In this case, the MFM indicator can be determined before or after the MPM indicator, as described with reference to FIG. 27.

[0354] For example, among the various on-screen prediction methods, it is assumed that ISP is performed on MPM candidates and MFM candidates.

[0355] FIG. 28 is a diagram illustrating one embodiment of a method for determining an intra-screen prediction mode when an ISP is performed on MPM candidates and MFM candidates.

[0356] In the embodiment of Fig. 28, the judgment of the MFM indicator precedes the judgment of the MPM indicator.

[0357] First, it can be determined whether the MIP indicator is true (e.g., “1”) or false (e.g., “0”) (S2801). If the MIP indicator is true, the MIP mode is performed (S2807). If the MIP indicator is false, it can be determined whether the MRL indicator is true (e.g., “1”) or false (e.g., “0”) (S2802). If the MRL indicator is true, the determination of the MFM indicator and the MPM indicator can be omitted (S2808, S2809). In this case, the signaling of the MFM indicator and the MPM indicator can be omitted and inferred as “false” and “true”, respectively, and the intra-picture prediction mode of the current block can be derived based on the signaled MPM index (S2810).

[0358] If the MRL indicator is false, it can be determined whether the ISP indicator is true (e.g., “1”) or false (e.g., “0”) (S2803). If the ISP indicator is true, it can be determined whether the MFM indicator is true (e.g., “1”) or false (e.g., “0”) (S2811).

[0359] If the MFM indicator is false at step S2811, the judgment regarding the MPM indicator may be omitted (S2809). In this case, the signaling of the MPM branch may be omitted, inferred as "true," and the on-screen prediction mode of the current block may be derived based on the signaled MPM index (S2810).

[0360] If the MFM indicator is true at step S2811, a predetermined mode can be determined as the on-screen prediction mode of the current block (S2812). If there are two or more predetermined modes, one predetermined mode can be determined based on the MFM index.

[0361] If the ISP indicator is false, it can be determined whether the MFM indicator is true (e.g., “1”) or false (e.g., “0”) (S2804).

[0362] If the MFM indicator is true at step S2804, a given mode can be determined as the on-screen prediction mode of the current block (S2812).

[0363] If the MFM indicator is false at step S2804, it can be determined whether the MPM indicator is true (e.g., “1”) or false (e.g., “0”) (S2805). If the MPM indicator is true, the intra-picture prediction mode of the current block can be derived based on the signaled MPM index (S2810). If the MPM index is false, the intra-picture prediction mode of the current block can be determined based on the Non_MPM index, which is information indicating one of the MFM candidates and modes excluding the MPM candidates.

[0364] FIG. 29 is a diagram illustrating another embodiment of a method for determining an intra-screen prediction mode when an ISP is performed on MPM candidates and MFM candidates.

[0365] In the embodiment of Fig. 29, the judgment of the MPM indicator precedes the judgment of the MFM indicator.

[0366] Steps S2901, S2902, and S2906 may correspond to steps S2801, S2802, and S2807, respectively. Also, similar to the embodiment of FIG. 28, when the MRL indicator is true, the judgment of the MFM indicator and the judgment of the MPM indicator are omitted (S2907), and the on-screen prediction mode of the current block is determined according to the MPM index (S2908).

[0367] At step S2903, if the ISP instruction is true, the judgment of the MPM instruction may be omitted (S2909). For example, the MPM instruction is not signaled and is inferred as “true,” and it may be determined whether the MFM instruction is true (e.g., “1”) or false (e.g., “0”) (S2910).

[0368] If the MFM directive is true, step S2911 may be performed, and if it is false, step S2908 may be performed.

[0369] If the ISP indicator is false, it can be determined whether the MPM indicator is true (e.g., "1") or false (e.g., "0") (S2914). If the MPM indicator is true, the process moves to step S2910, and the subsequent steps are as described above. If the MPM indicator is false, the process moves to step S2905.

[0370] Each of steps S2905, S2908 and S2911 may correspond to each of steps S2806, S2810 and S2812.

[0371] For example, if at least one of the above various on-screen prediction methods is performed only for MPM candidates and not for MFM candidates, the MPM indicator can be inferred or implied as “true” and the MFM indicator can be inferred or implied as “false”.

[0372] For example, if MRL is performed on MPM candidates but not on MFM candidates, the MFM indicator may not be signaled and inferred as "false." Furthermore, the MPM indicator may not be signaled and inferred as "true." In this case, among the MPM candidates, excluding the specified mode (the MFM candidate), the mode indicated by the MPM index may be determined as the on-screen prediction mode of the current block.

[0373]

[0374] To derive the intra-picture prediction mode of the current block using MPM, an MPM list including M intra-picture prediction modes as MPM candidates can be constructed. The MPM candidates can be derived from the intra-picture prediction modes of neighboring blocks that have already been encoded / decoded. The maximum number of MPM candidates included in the MPM list can be determined based on at least one of the slice type, color component, size, and shape of the current block.

[0375] The neighboring blocks used to derive MPM candidates may vary. For example, at least one of the sub-block locations illustrated in (a) of Fig. 9 may be used as the neighboring block. If there are multiple neighboring blocks used to derive MPM candidates, the order of the neighboring blocks may vary depending on at least one of the slice type, color component, size, and shape of the current block.

[0376] Figure 25 is a diagram illustrating one embodiment of the locations of neighboring blocks for inducing MPM candidates.

[0377] Figure 26 is a diagram illustrating another embodiment of the locations of neighboring blocks for inducing MPM candidates.

[0378] As illustrated in Fig. 25, when the upper left coordinate of the current block is (xCB, yCB), the upper neighboring block (A) for deriving the MPM candidate can be the leftmost block containing the coordinate of (xCB, yCB-1). In addition, the left neighboring block (L) for deriving the MPM candidate can be the uppermost block containing the coordinate of (xCB-1, yCB).

[0379] Or, as illustrated in Fig. 26, when the upper left coordinate of the current block is (xCB, yCB), the upper neighboring block (A) for deriving the MPM candidate can be a block containing the coordinates of (xCB+W-1, yCB-1). In addition, the left neighboring block (L) for deriving the MPM candidate can be a block containing the coordinates of (xCB-1, yCB+H-1).

[0380] In FIGS. 25 and 26, the size of the current block is WxH, and W and H may be the same or different.

[0381] If the left neighboring block and / or the top neighboring block are unavailable, the intra-screen prediction mode for the unavailable neighboring blocks may be set to a non-directional mode. For example, the Planar mode may be set as the intra-screen prediction mode for the unavailable neighboring blocks.

[0382] For example, if the maximum number of MPM candidates is 3, neighboring blocks at positions L, A, and AL in (a) of Fig. 14 may be utilized. The induction order between neighboring blocks may be L, A, and AL, but is not limited thereto.

[0383] For example, if the shape of the current block is a long rectangle, the derivation order may be A, L, AL. Alternatively, the MPM list may be composed in the order of L, A, AL.

[0384] Alternatively, a list having three MPM modes can be constructed using the intra-screen prediction modes of neighboring blocks at positions A and L in (a) of Fig. 14. For example, if the intra-screen prediction modes of A and L are the same and are non-directional modes (DC or Planar), the MPM list can be constructed as {Planar, DC, Vertical}. If the intra-screen prediction modes of A and L are the same and are directional modes, the MPM list can be constructed as {L, 2 + (( L + 61 ) % 64 ), 2 + (( L - 1 ) % 64 )}.

[0385]

[0386] For example, when the maximum number of MPM candidates is 6, a list having 6 MPM modes can be constructed using the intra-screen prediction modes of the neighboring blocks at positions A and L in (a) of Fig. 14. For example, when the intra-screen prediction modes of A and L are the same and are non-directional modes (DC or Planar), the MPM list can be constructed as {Planar, DC, Vertical, Horizontal, Ver - 4, Ver + 4}. When the intra-screen prediction modes of A and L are the same and are directional modes, the MPM list can be constructed as {L, Planar, DC, L - 1, L + 1, L - 2}.

[0387] For example, if the intra-screen prediction mode of A and the intra-screen prediction mode of L are not the same and both modes are directional modes, an MPM list including L and A can be constructed.

[0388] In the aforementioned embodiments, another MPM candidate can be derived by adding or subtracting a predetermined integer from an MPM candidate already included in the MPM list. The predetermined integer can be 1, 2, 4, or any arbitrary integer.

[0389] For example, if the maximum number of MPM candidates is 6, neighboring blocks at positions L, A, LB, AR, and AL in Fig. 14 (b) can be used. The induction order between neighboring blocks can be, but is not limited to, the order of L, A, LB, AR, and AL. For example, if the shape of the current block is a long rectangle, the induction order can be A, L, LB, AR, and AL.

[0390] When using the Most Frequent Mode (MFM), N modes or N lists can be constructed regardless of the MPM list configuration. For example, even if a specific mode is derived as an MFM, the MPM list can be constructed to include the derived MFM. For example, if the MFM is a Planar, the MPM can include the Planar.

[0391] Alternatively, when using MFM, the MPM list can be configured to exclude MFM. For example, if MFM is DC and Planar, the MPM list can be configured to include modes excluding DC and Planar. For example, if MFM is mode 18, the MPM list can be configured to not include mode 18.

[0392] If there is only one MFM, the MPM list can be configured to contain only five MPM candidates. For example, the MPM list can be configured only if the MFM indicator is a second value (e.g., “0” or “false”).

[0393] Below, a method for constructing an MPM list including five MPM candidates is described when the intra-screen prediction mode of the upper adjacent block is A, the intra-screen prediction mode of the left adjacent block is L, and the MFM is Planar.

[0394] If both A and L are non-directional, i.e., DC or Planar, only DC can be included in the MPM list. The remaining four MPM candidates can be modes at a predetermined angle. The modes at a predetermined angle can include, for example, a vertical mode and a horizontal mode, and a mode obtained by adding or subtracting a predetermined offset to the vertical mode and the horizontal mode can be included in the MPM list. The predetermined offset can be, for example, -4 or +4. Accordingly, in addition to the vertical mode and the horizontal mode, modes such as “vertical mode-4” and “vertical mode+4” can be included in the MPM list. However, the offset is not limited to the above example and can be a predetermined integer.

[0395] If A and L are the same directional mode, the directional mode and a mode with a predetermined offset added or subtracted from the directional mode can be included in the MPM list. In addition, the DC mode can be included in the MPM list as the default mode. For example, the MPM list can be {L, L - 1, L + 1, DC, L - 2}.

[0396] If A and L are different directional modes, both A and L can be included in the MPM list. Additionally, the DC mode can be included in the MPM list as the default mode. The remaining MPM candidates can be determined based on the difference between A and L. That is, whether the result of subtracting the smaller value from the larger value of A and L falls within a given range is determined, and the remaining MPM candidates can be determined using different methods based on the result of the determination.

[0397] If one of A and L is a non-directional mode and the other is a directional mode, the corresponding directional mode and a mode with a predetermined offset added or subtracted from the corresponding directional mode may be included in the MPM list. Additionally, the DC mode may be included in the MPM list as the default mode.

[0398] The MPM list can be constructed similarly to the above-described method of deriving N MFMs from surrounding sub-blocks (hereinafter referred to as “Method [1]”).

[0399] For example, an MPM list can be constructed by deriving N MPM candidates based on the occurrence frequency of the prediction modes of already encoded / decoded surrounding sub-blocks.

[0400] In the example shown in (a) of Fig. 10, when N is 2, mode 18 and mode 15 can be included in the MPM list based on the occurrence frequency.

[0401] For example, if the occurrence frequency of the prediction modes of two or more sub-blocks is the same, the priority may be determined based on the block size that includes the sub-blocks. The block that includes the sub-blocks may be at least one of a CTU, a CU, a PU, and a TU.

[0402] The MPM list can be constructed similarly to the above-described method of deriving an MFM by selecting N modes among the prediction modes within the screen (hereinafter referred to as “Method [2]”).

[0403] For example, an MPM list can be constructed by selecting N frequently occurring modes among the on-screen prediction modes as MPM candidates.

[0404] The MPM list may include prediction modes of temporal and / or spatial surrounding blocks as MPM candidates (hereinafter referred to as “Method [3]”).

[0405] For example, when the maximum number of MPM candidates is 6, the intra-screen prediction mode of at least one of the adjacent sub-blocks surrounding the current block as shown in Fig. 9 may be determined as an MPM candidate. Alternatively, an MPM list may be constructed by combining the intra-screen prediction modes of one or more spatially surrounding blocks.

[0406] For example, when the maximum number of MPM candidates is 6, intra-picture prediction modes corresponding to M reference blocks can be used. The M reference blocks can be determined in the order of reference blocks existing in reference pictures close to the current picture in the POC. Alternatively, an MPM list can be constructed by combining intra-picture prediction modes of one or more temporally neighboring blocks.

[0407] For example, when the maximum number of MPM candidates is 6, the intra-screen prediction mode of the spatial surrounding blocks of the current block and the intra-screen prediction mode of the reference block can be used.

[0408] If there is no intra-screen prediction mode of a spatial neighboring block, the intra-screen prediction mode of a reference block at the same location as the spatial neighboring block may be used as a replacement mode. Alternatively, the intra-screen prediction mode of a reference block corresponding to the motion information of the spatial neighboring block may be used as a replacement mode.

[0409] Alternatively, the MPM list can be constructed by combining the within-screen prediction modes of one or more spatial / temporal surrounding blocks.

[0410] If the MPM list is not fully filled using at least one of the above methods [1], [2] and [3], the MPM list can be filled using a combination of the methods or a similar mode.

[0411] The order of using the above methods [1], [2], and [3] may be [1]-[2]-[3] or [2]-[1]-[3], but is not limited thereto. For example, if the MPM list is not fully filled using method [1], method [2] or method [3] may be used. Alternatively, when the directional MPM candidate mode already included in the MPM list is K, the MPM list may be constructed by adding modes such as K + a, K - a (where a is an integer greater than or equal to 1).

[0412] The order in which MPM candidates are derived may vary depending on the form of the current block.

[0413] For example, if the size of the current block is WxH and W > H, when applying the method [1], method [2] or method [3], the upper neighboring block may be preferentially considered to derive the prediction mode of the spatial neighboring block and / or the temporal neighboring block.

[0414] When the size of the current block is WxH and W > H, when applying the method [1], method [2] or method [3], the left neighboring block may be preferentially considered to derive the prediction mode of the spatial neighboring block and / or the temporal neighboring block.

[0415]

[0416] Figure 13 is a diagram illustrating peripheral blocks available for configuring the MPM list.

[0417] As illustrated in FIG. 13, at least one already encoded / decoded neighboring block may exist on the top, left, and right of the current block. The MPM list may be configured differently depending on the location of the already encoded / decoded neighboring block.

[0418] For example, if an already encoded / decoded block is located on the right and top, an MPM list can be constructed by deriving MPM candidates from at least one spatial and / or temporal surrounding block on the right and top.

[0419] For example, if the already encoded / decoded block is located on the right, top, and left, the MPM list can be constructed by deriving MPM candidates from at least one of the spatial and / or temporal surrounding blocks on the right, top, and left.

[0420] One or more MPM lists may be configured. For example, three MPM lists may be configured, such as MPM List 1, MPM List 2, and MPM List 3. In this case, the on-screen prediction modes included in each MPM list may not overlap with each other.

[0421] The maximum number of MPM candidates that an MPM list can contain may vary depending on the slice type. For example, for an I slice, the maximum number of MPM candidates may be 6, and for a P or B slice, the maximum number of MPM candidates may be 3.

[0422] The maximum number of MPM candidates may vary depending on the color component. For example, the maximum number of MPM candidates may be 6 for the luminance component, and 3 for the chrominance component.

[0423] The prediction mode within the screen can be expressed by a mode number. The directionality of the mode number may vary depending on the size and / or shape of the current block. Therefore, even if the modes of the surrounding blocks and the current block are the same, their directionality may differ. The MPM list for the current block may be composed of the modes of the surrounding blocks or the modes most similar to the modes of the surrounding blocks.

[0424] The available directionality of on-screen predictions may vary depending on the size and / or shape of the current block. For example, the range of prediction directions, the angle of the prediction direction, etc. may vary. That is, the prediction angle may be expanded in a given direction, and the mode for the prediction angle in the expanded direction may replace the mode for the unused prediction angle.

[0425] The angle of the extended directional prediction can be determined based on the shape and / or aspect ratio of the current block. For example, if the current block is a horizontally long rectangle, a directional prediction with an angle greater than 135 degrees can be made. Furthermore, the mode number of the extended directional mode can be replaced with the mode number of the existing mode, ranging from -45 degrees to 0 degrees.

[0426] For example, if the current block size is a vertically elongated rectangle, directional predictions can be made for angles less than -45 degrees. Furthermore, the mode number of the extended angle mode can be replaced with the mode number of the existing mode between 90 and 135 degrees.

[0427] Figure 21 is a drawing for explaining an example in which the directionality changes according to the mode number of the current block and surrounding blocks.

[0428] As previously mentioned, the directionality of a mode number may vary depending on the size and / or shape of a block. Therefore, if the current block and surrounding blocks differ in size and / or shape, the directionality mode of the surrounding blocks may not be included in the directionality modes available to the current block.

[0429] For example, as in (a) of Fig. 21, if the current block is a square and the surrounding blocks are horizontally long rectangles, the extended angle mode among the directional modes of the surrounding blocks cannot be used by the current block.

[0430] Similarly, as in (b) to (j) of FIG. 21, when the current block and the surrounding blocks are different in size and / or shape, the directional mode of the surrounding block may be a directional mode that is not available to the current block.

[0431] If the directional mode of the surrounding blocks is not available to the current block, the MPM list of the current block can be constructed using a prediction mode similar to the on-screen prediction mode of the surrounding blocks.

[0432] Hereinafter, a method for deriving six MPM candidates using the prediction modes at the L and A positions of Fig. 14 (a) is described. Here, the 67 within-screen prediction modes may include Planar (mode 0), DC (mode 1), and directional modes (modes 2 to 66) ranging from -45 degrees to 135 degrees. However, the positions of the surrounding blocks for deriving MPM candidates are not limited to L and A, and the maximum number of MPM candidates is not limited to 6.

[0433] If the current block is a horizontally long rectangle, it can have a directional mode greater than 135 degrees. If the current block is a vertically long rectangle, it can have a directional mode less than -45 degrees. The number of existing directional angles that are unavailable is equal to the number of extended directional angles. The prediction mode for the extended directional angle can be represented by the mode number of the prediction mode for the existing directional angle that is now unavailable.

[0434] Figure 22 is a diagram for explaining mode numbers indicating prediction modes for extended directional angles.

[0435] The existing directional mode and angle are as shown in (a) of Fig. 22.

[0436] As illustrated in (b) of Figure 22, if the current block is a horizontally elongated rectangle, the extended directional angle may be, for example, 137 degrees (bold arrow). In this case, a directional angle of -45 degrees is no longer available. Therefore, the prediction mode for 137 degrees may be represented as Mode 2.

[0437] Similarly, if the current block is a vertically elongated rectangle, the prediction mode for an extended -47 degree directional angle can be represented as mode 66.

[0438] Fig. 23 is a diagram for explaining an embodiment of configuring an MPM list by changing the prediction mode of a surrounding block to match the current block.

[0439] As mentioned above, the prediction modes of the surrounding blocks and the current block can be in opposite directions. Therefore, the MPM list of the current block can be adaptively redefined based on the size and / or shape of the current block and surrounding blocks.

[0440] For example, if the surrounding block is a long rectangle and the prediction mode is mode 2, the actual prediction angle may exceed 135 degrees. Therefore, the prediction mode of the surrounding block may be redefined as mode 66, which is the most similar mode among the available modes of the current block, which is a square.

[0441] For example, if the surrounding block is a vertically long rectangle and the prediction mode is mode 66, the actual prediction angle may not exceed -45 degrees. Therefore, the prediction mode of the surrounding block may be redefined as mode 2, which is the most similar mode among the available modes of the current block, which is a square.

[0442] The MPM list of the current block can be constructed using the prediction mode of the above-redefined surrounding blocks.

[0443] For example, as shown in (a) of Fig. 23, the MPM list of the current block derived using the prediction mode of the surrounding blocks may be {Mode 2, Planar, DC, Mode 66, Mode 3, Mode 65}. The MPM list of the current block that is erroneous may be redefined by considering the difference in size and / or shape between the current block and the surrounding blocks. As shown in (b) of Fig. 23, the redefined MPM list may be {Mode 66, Planar, DC, Mode 65, Mode 2, Mode 64}.

[0444] FIG. 24 is a diagram illustrating another embodiment of configuring an MPM list by changing the prediction mode of a surrounding block to match the current block.

[0445] In (a) of Fig. 24, the prediction modes of the surrounding blocks L and A before redefinition are identical as mode 2. The prediction modes of each surrounding block can be redefined considering the size and / or shape of the block. The redefined mode is identical as mode 66, and the MPM list of the current block can be composed of {L, Planar, DC, L-1, L+1, L-2} = {mode 66, Planar, DC, mode 65, mode 2, mode 64}.

[0446] In (b) of Fig. 24, the prediction modes before redefinition of the surrounding blocks L and A are different as mode 2 and mode 3. However, the redefined mode may be the same as mode 66. In this case, the MPM list of the current block may be composed of {L, L-1, Planar, DC, L-2, L+2} = {mode 66, mode 65, Planar, DC, mode 64, mode 3}. That is, when the prediction modes of the surrounding blocks before redefinition are different but the redefined prediction modes are the same, the MPM list may be composed using mode L+1 (or mode L-1) as the mode of the surrounding block A.

[0447] The on-screen prediction mode of the current block can be entropy encoded / decoded.

[0448] The on-screen prediction mode of the current block can be entropy encoded / decoded on a block-by-block basis.

[0449] Information about the intra-picture prediction to be entropy encoded / decoded includes a flag indicating whether MFM (Most Probable Mode) is matched, an index indicating one of N MFM modes, a flag indicating whether template is matched, an index indicating a template matching region, a flag indicating whether MPM (Most Probable Mode) is matched (e.g., prev_intra_luma_pred_flag), an index indicating one of MPM candidates in the MPM list (e.g., mpm_idx), a flag indicating whether a mode is included in a selected mode set among modes that are not MPM candidates (e.g., selected_mode_set_flag), an index indicating one of the modes included in the selected mode set (e.g., selected_mode_idx), an index indicating one of the non-MPM non-selected modes that are neither MPM candidates nor included in the selected mode set (e.g., non_selected_mode_idx), intra-picture prediction mode information of a luminance component (e.g., rem_intra_luma_pred_mode), chrominance component intra-prediction mode information (e.g., intra_chroma_pred_mode), and an index indicating a reference set of inter-chrominance component prediction.

[0450] At least one of the information regarding the prediction within the above screen may not be signaled based on at least one of the slice type, block size, and shape.

[0451] For example, if the current block has a predetermined size and / or is rectangular, at least one piece of information regarding the intra-picture prediction for the current block may not be signaled. In this case, information from a previously encoded / decoded previous block or a higher-order block may be used for the unsigned information.

[0452] When entropy encoding / decoding information about predictions within a screen, at least one of the binarization methods below may be used.

[0453] - Truncated Rice binarization method

[0454] - K-th order Exp_Golomb binarization method

[0455] - Limited K-th order Exp_Golomb binarization method

[0456] - Fixed-length binarization method

[0457] - Unary binarization method

[0458] - Truncated unary binarization method

[0459] - Truncated Binary Binarization Method

[0460] When performing entropy encoding / decoding on the above-mentioned predicted information within the screen or binary information generated through the above-mentioned binarization, at least one of the following may be used.

[0461] - Context-Adaptive Binary Arithmetic Coding (CABAC)

[0462] - Context-Adaptive Variable Length Coding (CAVLC)

[0463] - Bypass coding

[0464] Entropy encoding / decoding of the above-described intra-screen prediction information or binary information can be adaptively performed using at least one of the slice type, size, shape of the current block, and the prediction mode of the surrounding block.

[0465] For example, if the intra-screen prediction mode of the left peripheral block and the intra-screen prediction mode of the upper peripheral block are the same, CABAC can be performed, and if they are different, bypass coding can be performed.

[0466] For example, if the intra-screen prediction mode of the left peripheral block and the intra-screen prediction mode of the upper peripheral block are the same, CABAC can be performed using the first context model, and if they are different, CABAC can be performed using the second context model.

[0467] For example, if the slice type of the current block is an I slice, CABAC can be performed using the first context model, if it is a P slice, CABAC can be performed using the second context model, and if it is a B slice, CABAC can be performed using the third context model.

[0468] An embodiment of deriving an on-screen prediction mode of the current block using MFM and MPM is described with reference to (b) of FIG. 14.

[0469] As illustrated in (b) of FIG. 14, the intra-screen prediction modes of the neighboring blocks L, A, LB, AR, and AL of the current block may be used to derive the MFM and / or MPM. For example, the intra-screen prediction mode with the highest occurrence frequency among the intra-screen prediction modes of the neighboring blocks may be determined as the MFM. The derivation order of the intra-screen prediction modes of the neighboring blocks may be in the order of L, A, LB, AR, and AL. If there is more than one intra-screen prediction mode with the highest occurrence frequency, the first derived mode may be determined as the MFM. If the intra-screen prediction mode of the current block matches the derived MFM, the flag MFM_flag indicating whether or not it matches may be signaled by setting it to a first value (e.g., “1”).

[0470] Additionally, N MPM candidates can be derived. For example, three MPM candidates can be derived. The intra-picture prediction mode of the same surrounding block as the surrounding block used when deriving the MFM can be derived as the MPM candidate. The derivation order of the MPM candidates can be in the order of L, A, Planar, DC, LB, AR, AL, Vertica, Horizontal. Three modes that do not match the MFM can be determined as MPM candidates. When MFM_flag is a second value (e.g., “0”), a flag MPM_flag indicating whether the intra-picture prediction mode of the current block exists among the derived MPM candidates can be signaled.

[0471] When MPM_flag is the first value (e.g., “1”), index information MPM_idx indicating the same mode as the intra-picture prediction mode of the current block among the MPM candidates may be additionally signaled. To signal MPM_idx, context encoding / decoding may be performed for one or more bins. For example, encoding / decoding using one or more (e.g., two) context models may be performed for the first bin of MPM_idx. When encoding / decoding for the first bin of MPM_idx using the context models, the intra-picture prediction mode of the neighboring block may be used. For example, when the intra-picture prediction modes of neighboring blocks A and L are the same, the first context model may be used, and when they are not the same, the second context model may be used. Alternatively, encoding / decoding can be performed using a context model if the on-screen prediction modes of surrounding blocks A and L are the same, and bypassing them if they are not the same.

[0472] When MPM_flag is the second value (e.g., “0”), entropy encoding / decoding can be performed on the remaining modes. In this case, the number of the remaining modes is 2.n Otherwise, the on-screen prediction mode of the current block can be encoded / decoded using the Truncated Binary method.

[0473] An embodiment of deriving an on-screen prediction mode of the current block using MFM is described with reference to Fig. 14 (b).

[0474] As illustrated in (b) of Fig. 14, the intra-screen prediction modes of the surrounding blocks L, A, LB, AR, and AL of the current block can be utilized. For example, MFM 0, MFM 1, MFM 2, …, MFM N can be determined according to the occurrence frequency of the intra-screen prediction modes of the surrounding blocks. For example, there can be four MFMs. The order of the surrounding blocks for deriving MFMs can be L, A, Planar, DC, LB, AR, AL, Vertical, and Horizontal. If there are multiple modes with the same occurrence frequency, the MFMs can be derived according to the above order.

[0475] A flag MFM0_flag indicating whether MFM 0 matches the intra-picture prediction mode of the current block may be signaled. When MFM0_flag is a first value (e.g., “1”), MFM 0 is determined as the intra-picture prediction mode of the current block, and no other information regarding the intra-picture prediction mode may be signaled. When MFM0_flag is a second value (e.g., “0”), MFM_flag indicating whether there is a mode among MFM 1, MFM 2, …, MFM N that is identical to the intra-picture prediction mode of the current block may be signaled. When MFM_flag is a first value (e.g., “1”), MFM_idx indicating one of the N MFMs may be additionally signaled. When MFM_flag is a second value (e.g., “0”), information for determining the intra-picture prediction mode of the current block from the remaining intra-picture prediction modes excluding MFM 0 to MFM N may be signaled.

[0476] An embodiment of deriving an on-screen prediction mode of the current block using MPM is described with reference to Fig. 14 (b).

[0477] As illustrated in (b) of FIG. 14, the intra-screen prediction modes of the neighboring blocks L, A, LB, AR, and AL of the current block can be used. For example, three MPM candidates can be derived. The intra-screen prediction mode with the highest occurrence frequency among the intra-screen prediction modes of the neighboring blocks can be derived as MPM 0. The order of deriving the intra-screen prediction modes of the neighboring blocks can be, for example, L, A, LB, AR, and AL. If there are two or more intra-screen prediction modes with the highest occurrence frequency, the first derived mode can be determined as MPM 0. If the intra-screen prediction mode of the current block matches MPM 0, a flag MPM0_flag indicating whether or not it matches can be signaled by being set to a first value (e.g., “1”).

[0478] Additionally, two MPM candidates can be derived. For example, two modes that do not match MPM 0 can be selected in the order of L, A, Planar, DC, LB, AR, AL, Vertical, and determined as MPM 1 and MPM 2, respectively. In FIG. 14 and other drawings and descriptions of the present application, block identifiers such as L, A, etc. may also indicate intra-picture prediction modes of the corresponding blocks. When MPM0_flag is the second value (e.g., “0”), a flag MPM_flag indicating whether the intra-picture prediction mode of the current block matches one of the derived MPM 1 and MPM 2 can be signaled. When MPM_flag is the first value (e.g., “1”), index information MPM_idx indicating one of the remaining MPM candidates excluding MPM 0 can be additionally signaled. The MPM candidate indicated by MPM_idx can be set as the intra-picture prediction mode of the current block.

[0479] Information about MPM_idx and residual mode can be encoded / decoded by at least one of the various entropy encoding / decoding methods described above.

[0480] In the above-described embodiments, the within-screen prediction modes of the surrounding blocks L, A, LB, AR, and AL were used to count the occurrence frequency of the within-screen prediction modes of the surrounding blocks, but the surrounding blocks are not limited to the above-described examples.

[0481] A reference sample can be constructed at step S520.

[0482] In order to perform intra-screen prediction based on the intra-screen prediction mode derived above, a reference sample may be constructed. The reference sample may be constructed using one or more reconstructed samples or a combination of samples around the current block. In addition, filtering may be applied to the constructed reference sample. Each reconstructed sample on a plurality of reconstructed sample lines may be used as is to construct the reference sample. Alternatively, the reference sample may be constructed through filtering between samples on the same reconstructed sample line. Alternatively, the reference sample may be constructed through filtering between samples on different reconstructed sample lines. The constructed reference sample may be represented as ref[m, n], and the surrounding reconstructed sample or the filtered sample thereof may be represented as rec[m, n]. Here, m or n may be a predetermined integer. When the horizontal and vertical sizes of the current block are W and H, respectively, and the position of the upper left sample in the current block is (0, 0), the position of the reference sample at the upper left of the current block may be set to (-1, -1).

[0483] A reference sample may be constructed using one or more restoration sample lines adjacent to the current block.

[0484] A reference sample can be configured by selecting one of the plurality of restoration sample lines illustrated in FIG. 7. At this time, an indicator for the selected restoration sample line can be signaled.

[0485] Alternatively, a reference sample can be constructed using a combination of two or more restoration sample lines in FIG. 7. For example, a reference sample can be constructed using a weighted sum that assigns different weights according to the distance from the current block, as in Equation 1.

[0486]

[0487] A reference sample can be constructed by calculating at least one of an average, a maximum, a minimum, and a median of a plurality of restored samples based on at least one of a distance from a current block and an in-screen prediction mode of the current block.

[0488] Through the above process, one or more reference sample lines can be configured.

[0489] The reference sample at the top of the current block and the reference sample to the left of the current block can be constructed in different ways. Information indicating the method used to construct the reference sample can be encoded / decoded. For example, information indicating whether multiple restoration sample lines were used can be encoded / decoded.

[0490] Availability of the surrounding restoration samples used to construct the reference sample can be determined.

[0491] For example, if a surrounding reconstruction sample is located outside of at least one region of the picture, slice, tile, and CTU that contains the current block, the surrounding reconstruction sample may be determined to be unavailable. For example, if the surrounding reconstruction sample is included in an inter-screen predicted block, the surrounding reconstruction sample may be determined to be unavailable.

[0492] If it is determined that a peripheral restoration sample is unavailable, another available peripheral restoration sample may be used to replace the unavailable peripheral restoration sample. For example, the unavailable peripheral restoration sample may be replaced using at least one of the following methods.

[0493] FIG. 15 is a diagram illustrating an embodiment of replacing an unavailable sample using an available sample.

[0494] For example, starting from the lower left sample position 0, unavailable samples can be filled with available samples. For example, in the example illustrated in Figure 15, the first four unavailable samples can be filled with the sample value "a" of the first available sample. Additionally, the next 13 unavailable samples can be filled with the sample value "b" of the previous available sample.

[0495] For example, unavailable samples can be filled using a combination of available samples. For example, unavailable samples can be filled using available samples located at both ends of the unavailable sample. In this case, the first four unavailable samples can be filled using the sample value “a” of the first available sample. Then, the next 13 unavailable samples can be filled using the sample values ​​“b” and “c” of the two available samples. For example, the average or weighted average of “b” and “c” can be used. The weight applied to the weighted average can be inversely proportional to the distance to the available sample. That is, a large weight can be given to an available sample that is closer to the current unavailable sample.

[0496] Filtering may be applied to one or more configured reference samples. At this time, whether to apply filtering may be determined based on at least one of the current block's on-screen prediction mode, size, and shape. Furthermore, when applying filtering, the filter type may vary based on at least one of the current block's on-screen prediction mode, size, and shape.

[0497] When multiple reference sample lines are used, filtering can be applied differently for each reference sample line. For example, filtering can be applied differently or filter types can be set differently. For example, filtering can be applied to the first reference sample line adjacent to the current block, while filtering cannot be applied to the second reference sample line. For example, different types of filters can be applied to the first and second reference sample lines, respectively.

[0498] When performing in-screen prediction, both reference samples with and without filtering applied may be used.

[0499] When applying filtering, at least one of a 3-tap filter, a 5-tap filter, and a 7-tap filter can be selected and applied based on at least one of the on-screen prediction mode, size, and shape of the current block.

[0500] At step S530, intra-screen prediction for the current block can be performed based on the derived intra-screen prediction mode and reference samples.

[0501] For example, non-directional intra-picture prediction can be performed on the current block. The non-directional intra-picture prediction mode can be any mode except the directional mode.

[0502] Alternatively, directional in-screen prediction can be performed on the current block. The directional prediction mode can be performed using at least one of various angular modes, including a horizontal mode and a vertical mode.

[0503] Alternatively, position-based intra-picture prediction can be performed for the current block. The position information can be encoded / decoded, and the reconstructed block at the said position can be derived as the intra-picture prediction block of the current block. Alternatively, the decoder can search for a block similar to the current block. The retrieved block can be derived as the intra-picture prediction block of the current block. The reconstructed block or the retrieved block can be a reconstructed block included in the current picture.

[0504] Alternatively, intra-screen prediction between color components can be performed for the current block.

[0505] To perform intra-screen prediction between color components, at least one linear model can be constructed.

[0506] To construct a linear model, parameters can be determined that minimize the regression error between the luminance component and the color component.

[0507] Figure 16 is a diagram for explaining a method for determining linear parameters of prediction between color components.

[0508] The linear parameters α and β of the current block can be determined by mathematical expression 2 using the positions of the reference samples shown in Fig. 16.

[0509]

[0510] When there are more than two linear models, multiple linear parameters can be determined.

[0511] The locations of the samples referenced to determine the linear parameters can be configured in various ways.

[0512] Reference samples may be configured differently depending on the intra-screen prediction mode of the already encoded / decoded luminance block.

[0513] Figure 17 is a diagram illustrating an example of classifying the directionality of an on-screen prediction mode.

[0514] As illustrated in Figure 17, among the on-screen prediction modes, the directional mode can be classified into one of the directions of Left Positive, Above Positive, and Negative.

[0515] Figure 18 is a drawing for explaining a method of configuring a reference sample according to an on-screen prediction mode.

[0516] As illustrated in FIG. 18, the reference sample may be configured using at least one of the reference sample areas surrounding the current block. The reference sample area may be configured with one or more reference sample lines.

[0517] For example, if the on-screen prediction mode of the luminance block is non-directional, one or more linear models can be constructed using one or more reference sample lines.

[0518] For example, if the within-screen prediction mode of the luminance block is one of the Left Positive modes, one or more linear models can be constructed using one or more reference samples among the left samples (L1, L2, …).

[0519] For example, if the within-screen prediction mode of the luminance block is one of the Above Positive modes, one or more linear models can be constructed using one or more reference samples from among the upper samples (A1, A2, …).

[0520] For example, if the on-screen prediction mode of the luminance block is Vertical mode, one or more linear models can be constructed using one or more reference samples among the upper samples (A1, A3, …).

[0521] For example, if the on-screen prediction mode of the luminance block is Horizontal mode, one or more linear models can be constructed using one or more reference samples among the left samples (L1, L3, …).

[0522] For example, if the on-screen prediction mode of the luminance block is one of the Negative modes, one or more linear models can be constructed using one or more reference samples among the upper left sample (AL), the top sample (A), and the left sample (L).

[0523] At this time, the current chrominance block can be predicted within the screen by replacing the reference sample of the chrominance block according to the linear parameter using the reference sample of the configured luminance block. At this time, one or more of the prediction mode of the encoded / decoded luminance block or the existing chrominance prediction mode can be selected as the within-screen prediction mode of the current chrominance block.

[0524] To construct a linear model, parameters that minimize the regression error between two color components (Cb, Cr) can be determined.

[0525] The linear parameters of the current block can be determined using the locations of the reference samples shown in Fig. 16.

[0526] For example, the linear parameters for deriving the chrominance component Cr using the chrominance component Cb can be determined as in mathematical expression 3.

[0527]

[0528] For example, the linear parameters for deriving another chrominance component Cb using the chrominance component Cr can be determined as in mathematical expression 4.

[0529]

[0530] At this time, an indicator for prediction between the selected color components can be signaled.

[0531] The locations of the reference samples used to determine linear parameters can be configured in various ways. For example, a linear model can be constructed using the same reference sample area for both the luminance and chrominance components.

[0532] A linear model can be constructed by deriving linear parameters through simple operations while taking into account the complexity of the operations.

[0533] For example, a linear model using the location of the reference sample illustrated in Fig. 16 can be expressed as follows. The linear parameters for the linear model of the current block can be determined as in Equation 5.

[0534]

[0535] If there are m linear models used, there are m linear parameters (α1~ α m , β1~ β m ) can be determined.

[0536] The m models may differ from each other in some cases.

[0537] For example, Rec L You can determine which model to use by assigning a threshold according to the .

[0538] For example, if the number m of linear models is 1, α and β can be determined by combining various models.

[0539] For example, if α1 and α2 exist, α can be determined as the average of α1 and α2.

[0540] For example, if β1 and β2 exist, β can be determined as the average of β1 and β2.

[0541] To derive α and β, reference samples can be used as follows. Additionally, α and β can be derived using at least one method for each of the m models.

[0542] Here, L A Wow L B is a reference sample of the luminance component, C A , C B can be a reference sample of the color difference component.

[0543] For example, L Ais the nth maximum value among the reference samples of the luminance component, L B may be the nth minimum value among the reference samples of the luminance component. C A , C B are each L A Wow L B It may be a reference sample value of the corresponding color difference component.

[0544] For example, L A is the average of the nth maximum value and the n-1th maximum value among the reference samples of the luminance component, L B can be the average of the nth minimum value and the n-1th minimum value among the reference samples of the luminance component. At this time, C A can be the average of the reference sample values ​​of the chrominance component corresponding to the nth maximum value and the n-1th maximum value among the reference samples of the luminance component, respectively. In addition, C B can be the average of the reference sample values ​​of the chrominance component corresponding to the nth minimum value and the n-1th minimum value among the reference samples of the luminance component, respectively. In this case, n can be 2, and in this case, L A is the average of the first and second maximum values ​​of the reference samples of the luminance component, L B can be the average of the first minimum and the second minimum. Also, C A can be the average of the reference sample values ​​of the chrominance component corresponding to the first maximum value and the second maximum value among the reference samples of the luminance component, respectively. In addition, C B It can be the average of the reference sample values ​​of the chrominance component corresponding to the first minimum value and the second minimum value among the reference samples of the luminance component, respectively.

[0545] For example, L A is the nth maximum value among the reference samples of the luminance component, L B can be the nth minimum value among the reference samples of the luminance component. At this time, C A is the nth maximum value among the reference samples of the chrominance component, C Bmay be the nth minimum value among the reference samples of the chrominance components.

[0546] For example, L A is the average of the nth maximum value and the n-1th maximum value among the reference samples of the luminance component, L B can be the average of the nth minimum value and the n-1th minimum value among the reference samples of the luminance component. At this time, C A C is the average of the nth maximum value and the n-1th maximum value among the reference samples of the color difference component. B It can be the average of the nth minimum value and the n-1th minimum value among the reference samples of the chrominance component.

[0547] For example, the reference samples of the luminance component can be divided into two groups based on the average of the entire luminance component. In this case, L A is the average of the reference samples of the luminance component of the first group, L B can be the average of the reference samples of the luminance component of the second group. At this time, C A is the average of the reference samples of the color difference components of the first group, C B may be the average of reference samples of the chrominance components of the second group.

[0548] Also, L C is a reference sample of the luminance component, C C can be a reference sample of the color difference component.

[0549] For example, L C is the nth minimum or maximum value among the reference samples of the luminance component, C C is L C It may be a reference sample value of the corresponding color difference component.

[0550] For example, L C is the overall average of the reference samples of the luminance component, C C may be the overall average value of the reference samples of the color difference components.

[0551] For example, L Cis the average of the maximum and minimum values ​​of the reference samples of the luminance component (e.g., (maximum value + minimum value + 1) >> 1), C C It can be the average of the maximum and minimum values ​​among the reference samples of the color difference components.

[0552] The reference samples may be configured differently depending on at least one of the block size, shape, and whether or not the surrounding blocks are predicted within the screen.

[0553] For example, if the current block size is smaller than a predetermined size, one or more linear models can be constructed using one or more reference sample lines.

[0554] Figure 19 is a diagram for explaining a linear model configuration method according to the prediction mode of the surrounding blocks.

[0555] In Fig. 19, blocks a to m are surrounding blocks of the current block, shaded blocks are inter-screen predicted blocks, and non-shaded blocks are intra-screen predicted blocks.

[0556] As illustrated in (a) of Fig. 19, if all surrounding blocks of the current block are predicted within the screen, a linear model can be constructed using at least one of the samples belonging to the predicted surrounding blocks within the screen.

[0557] As in (b) of Fig. 19, if some of the upper blocks of the current block's surrounding blocks are predicted within the screen, a linear model can be constructed using at least one of the samples belonging to the predicted surrounding blocks within the screen.

[0558] As in (c) of Fig. 19, if some of the left side of the surrounding blocks of the current block are predicted within the screen, a linear model can be constructed using at least one of the samples belonging to the predicted surrounding blocks within the screen.

[0559] A set of reference samples can be configured, and an index indicating the set of reference samples used at this time can be encoded / decoded.

[0560] The set of reference samples can be configured differently depending on the size of the current block.

[0561] Referring to FIG. 18, various embodiments constituting a set of reference samples are described.

[0562] If the current block size is 4x4, various groups such as {A1, L1}, {A1, A2, L1, L2}, {A1, A3, L1, L3}, {A1, A3, A5, L1, L3, L5}, {A1, A2, A5, L1, L3, L5}, … can be formed, and a set of reference samples can be formed by selecting at least one group among these.

[0563] If the current block size is 8x8, various groups such as {A1, L1}, {A1, A2, L1, L2}, {A1, A3, L1, L3}, … can be formed, and a set of reference samples can be formed by selecting at least one group among these.

[0564] The above 4x4 or 8x8 sized blocks are used as unit blocks, and a set of reference samples can be configured based on at least one of the unit blocks for a current block of any size. Alternatively, a combination of two or more unit blocks can be used. In this case, various groups such as {A1, L1}, {A1, A2, L1}, {L1, L2, A1}, {L1, L2, L3, L4, A1}, {A1, A2, A3, A4, L1}, … can be configured, and a set of reference samples can be configured by selecting at least one group among them.

[0565] The set of reference samples can be configured differently depending on the on-screen prediction mode of the current block.

[0566] Figure 20 is a diagram for explaining a set of reference samples according to the on-screen prediction mode.

[0567] If the on-screen prediction mode of the current block is non-directional, various groups such as {L1, A1}, {L3, A3}, {L1, L3, A1, A3}, {L1, L3, L5, A1, A3, A5}, … can be formed, and a set of reference samples can be formed by selecting at least one group among these.

[0568] If the on-screen prediction mode of the current block is Left Positive prediction mode, various groups such as {L1, L2}, {L1, L2, AL1}, {L1, L4, AL1}, {L1, L2, L3, L4, AL1}, {L1, L2, L3, L4, L5, L6}, {L1, L2, L3, L4, AL1, AL2, AL3, AL4}, … can be formed, and a set of reference samples can be formed by selecting at least one group among these. For example, as illustrated in (a) of Fig. 20, a set of reference samples can be formed with a group consisting of {L1, L2}.

[0569] If the on-screen prediction mode of the current block is Above Positive prediction mode, various groups such as {A1, A2}, {A1, A2, AL1}, {A1, A4, AL1}, {A1, A2, A3, A4, AL1}, {A1, A2, A3, A4, A5, A6}, {A1, A2, A3, A4, AL1, AL2, AL3, AL4}, … can be formed, and a set of reference samples can be formed by selecting at least one group among these. For example, as illustrated in (b) of FIG. 20, a set of reference samples can be formed with a group consisting of {A1, A2}.

[0570] If the on-screen prediction mode of the current block is Vertical prediction mode, a set of reference samples can be formed by configuring various groups such as {A1}, {A1, A3}, {A1, A3, A5}, …, and selecting at least one group among these. For example, as illustrated in (c) of Fig. 20, a set can be formed with a group consisting of {A1, A3, A5, A7}.

[0571] If the on-screen prediction mode of the current block is Horizontal prediction mode, a set of reference samples can be configured by configuring various groups such as {L1}, {L1, L3}, {L1, L3, L5}, …, and selecting at least one group among these. For example, as illustrated in (d) of Fig. 20, a set can be configured with a group consisting of {L1, L3, L5, L7}.

[0572] If the on-screen prediction mode of the current block is Negative prediction mode, various groups such as {L1, A1, AL1}, {L1, L2, A1, A2, AL1}, {L1, L3, A1, A3, AL1, AL2, AL3, AL4}, {L1, L2, L3, L4, A1, A2, A3, A4, AL1, AL2, AL3, AL4}, … are formed, and a set of reference samples can be formed by selecting at least one group among these.

[0573] The set of reference samples can be configured differently depending on the type of downsampling filter applied to the current block of luminance components.

[0574] At least one of a 2-tap filter, a 4-tap filter, and a 6-tap filter may be optionally applied for downsampling.

[0575] For a downsampling filter using vertical luminance samples, a set of reference samples can be formed by configuring various groups such as {A1}, {A1, A3}, {A1, A3, A5}, …, and selecting at least one group among these.

[0576] For a downsampling filter using horizontal luminance samples, a set of reference samples can be formed by configuring various groups such as {L1}, {L1, L3}, {L1, L3, L5}, …, and selecting at least one group among these.

[0577] For a downsampling filter using luminance samples in a -45 degree diagonal direction, various groups such as {L1, A1, AL1}, {L1, L2, A1, A2, AL1}, {L1, L3, A1, A3, AL1, AL2, AL3, AL4}, {L1, L2, L3, L4, A1, A2, A3, A4, AL1, AL2, AL3, AL4}, … can be formed, and a set of reference samples can be formed by selecting at least one group among these.

[0578] For a downsampling filter using luminance samples in horizontal, vertical, and -45 degree diagonal directions, a set of reference samples can be formed by forming various groups such as {L1, A1}, {L3, A3}, {L1, L3, A1, A3}, {L1, L3, L5, A1, A3, A5}, …, and selecting at least one group among these.

[0579] An index indicating one of a plurality of reference sample sets may be entropy encoded / decoded. At this time, at least one of a truncated Rice binarization method, a K-th order Exp_Golomb binarization method, a restricted K-th order Exp_Golomb binarization method, a fixed-length binarization method, a unary binarization method, a truncated unary binarization method, and a truncated binary binarization method may be used.

[0580] The above embodiments can be performed in the same manner in the encoder and decoder.

[0581] An image can be encoded / decoded using at least one or a combination of at least one of the above embodiments.

[0582] The order of applying the above embodiments may be different in the encoder and the decoder, and the order of applying the above embodiments may be the same in the encoder and the decoder.

[0583] The above embodiments can be performed for each of the luminance and chrominance signals, and the above embodiments can be performed equally for the luminance and chrominance signals.

[0584] The shape of the block to which the above embodiments of the present invention are applied may have a square shape or a non-square shape.

[0585] The above embodiments of the present invention can be applied according to the size of at least one of an encoding block, a prediction block, a transform block, a block, a current block, an encoding unit, a prediction unit, a transform unit, a unit, and a current unit. Here, the size may be defined as a minimum size and / or a maximum size for applying the above embodiments, or may be defined as a fixed size for which the above embodiments are applied. In addition, the first embodiment of the above embodiments may be applied to a first size, and the second embodiment may be applied to a second size. That is, the above embodiments may be applied in a complex manner depending on the size. In addition, the above embodiments of the present invention may be applied only when the size is greater than or equal to the minimum size and less than or equal to the maximum size. That is, the above embodiments may be applied only when the block size is included within a certain range.

[0586] For example, the above embodiments can be applied only when the size of the current block is 8x8 or larger. For example, the above embodiments can be applied only when the size of the current block is 4x4. For example, the above embodiments can be applied only when the size of the current block is 16x16 or smaller. For example, the above embodiments can be applied only when the size of the current block is 16x16 or larger and 64x64 or smaller.

[0587] The above embodiments of the present invention can be applied according to temporal layers. A separate identifier is signaled to identify the temporal layer to which the above embodiments are applicable, and the above embodiments can be applied to the temporal layer specified by the identifier. The identifier here may be defined as the lowest layer and / or highest layer to which the above embodiments are applicable, or may be defined as indicating a specific layer to which the above embodiments are applicable. In addition, a fixed temporal layer to which the above embodiments are applicable may be defined.

[0588] For example, the above embodiments may be applied only when the temporal layer of the current image is the lowest layer. For example, the above embodiments may be applied only when the temporal layer identifier of the current image is 1 or greater. For example, the above embodiments may be applied only when the temporal layer of the current image is the highest layer.

[0589] The slice type or tile group type to which the above embodiments of the present invention are applied is defined, and the above embodiments of the present invention can be applied according to the slice type or tile group type.

[0590] In the embodiments described above, the methods are described based on a flowchart as a series of steps or units. However, the present invention is not limited to the order of the steps, and some steps may occur in a different order or simultaneously with other steps described above. Furthermore, those skilled in the art will understand that the steps depicted in the flowchart are not exclusive, and that other steps may be included, or one or more steps in the flowchart may be deleted without affecting the scope of the present invention.

[0591] The above-described embodiments include examples of various aspects. While not all possible combinations to illustrate the various aspects can be described, those skilled in the art will recognize that other combinations are possible. Accordingly, the present invention is intended to encompass all other alterations, modifications, and variations within the scope of the following claims.

[0592] The embodiments of the present invention described above may be implemented in the form of program commands that can be executed through various computer components and recorded on a computer-readable recording medium. The computer-readable recording medium may include program commands, data files, data structures, etc., either singly or in combination. The program commands recorded on the computer-readable recording medium may be those specially designed and configured for the present invention or may be those known and available to those skilled in the art of computer software. Examples of the computer-readable recording medium include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and hardware devices specially configured to store and execute program commands, such as ROMs, RAMs, and flash memories. Examples of program commands include not only machine language codes generated by a compiler, but also high-level language codes that can be executed by a computer using an interpreter, etc. The hardware devices may be configured to operate as one or more software modules to perform processing according to the present invention, and vice versa.

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

[0594] Therefore, the idea of ​​the present invention should not be limited to the embodiments described above, and all things that are modified equally or equivalently to the following claims as well as the claims are considered to fall within the scope of the idea of ​​the present invention.

[0595] The present invention can be used to encode / decode images.

Claims

1. A step of restoring an MFM indicator indicating whether the on-screen prediction mode of the current block is a predetermined on-screen prediction mode; A step of deriving an in-screen prediction mode of the current block based on the MFM indicator; and A video decoding method comprising a step of generating a prediction block of the current block by performing intra-screen prediction for the current block based on the intra-screen prediction mode.

2. In paragraph 1, A method for decoding an image in which the above-described on-screen prediction mode is a Planar mode.

3. In paragraph 1, A video decoding method in which, if the above MFM indicator has a first value, the intra-screen prediction mode of the current block is derived as the predetermined intra-screen prediction mode.

4. In paragraph 1, If the above MFM indicator has a second value, A Most Probable Mode (MPM) list is constructed based on the on-screen prediction mode of the surrounding blocks of the current block, A video decoding method for deriving an intra-screen prediction mode of the current block based on the above MPM list.

5. In paragraph 4, A video decoding method wherein the above MPM list is configured not to include the above-described intra-screen prediction mode.

6. In paragraph 4, A method for decoding an image, wherein the surrounding blocks of the current block include at least one of the upper right block of the current block and the lower left block of the current block.

7. In paragraph 4, An image decoding method in which, when the intra-screen prediction mode of the above-mentioned surrounding block is not available, the intra-screen prediction mode of the unavailable surrounding block is set to Planar mode.

8. In paragraph 4, The above MPM list is an image decoding method including five MPM candidates.

9. In paragraph 4, Further comprising a step of restoring an MPM indicator indicating whether the on-screen prediction mode of the current block is included in the MPM list, A video decoding method in which the MFM indicator is restored from a bitstream only when the MPM indicator has a first value.

10. In paragraph 1, To perform the above-described prediction, one of the plurality of reference sample lines is selected, An image decoding method that performs filtering on the reference sample line only when the selected reference sample line is the first reference sample line.

11. Step of determining the on-screen prediction mode of the current block; A step of generating a prediction block of the current block by performing intra-screen prediction for the current block based on the intra-screen prediction mode; A step of determining whether the on-screen prediction mode of the current block is a predetermined on-screen prediction mode; and An image encoding method comprising a step of encoding an MFM indicator based on the above judgment result.

12. In paragraph 11, A method for encoding an image in which the above-described on-screen prediction mode is a Planar mode.

13. In paragraph 11, A video encoding method in which the MFM indicator is encoded as a first value if the on-screen prediction mode of the current block is the predetermined mode.

14. In paragraph 11, If the on-screen prediction mode of the current block is not the predetermined mode, the MFM indicator is encoded as a second value, A Most Probable Mode (MPM) list is constructed based on the on-screen prediction mode of the surrounding blocks of the current block, A video encoding method for encoding an intra-screen prediction mode of the current block based on the above MPM list.

15. In paragraph 14, A video encoding method wherein the above MPM list is configured not to include the above-described intra-screen prediction mode.

16. In paragraph 14, A video encoding method wherein the surrounding blocks of the current block include at least one of the upper right block of the current block and the lower left block of the current block.

17. In paragraph 14, A video encoding method in which, when the intra-screen prediction mode of the above-mentioned surrounding block is not available, the intra-screen prediction mode of the unavailable surrounding block is set to Planar mode.

18. In paragraph 14, Further comprising a step of encoding an MPM indicator indicating whether the on-screen prediction mode of the current block is included in the MPM list, A video encoding method in which the MFM indicator is encoded only when the MPM indicator has a first value.

19. In paragraph 11, To perform the above-described prediction, one of the plurality of reference sample lines is selected, An image encoding method that performs filtering on the reference sample line only when the selected reference sample line is the first reference sample line.

20. A computer-readable recording medium storing a bitstream that is received and decoded by an image decoding device and used to restore an image, The above bitstream includes an MFM indicator indicating whether the intra-screen prediction mode of the current block is a given intra-screen prediction mode, The above MFM indicator is used to derive the on-screen prediction mode of the current block, The above-mentioned on-screen prediction mode is a computer-readable recording medium used to perform on-screen prediction for the current block to generate a prediction block of the current block.