Bidirectional intra prediction method and apparatus

By introducing a bidirectional intra prediction mode, using adjacent blocks and virtual pixel generation technology, the problem of insufficient intra prediction accuracy and efficiency in high-resolution and high-definition image encoding/decoding is solved, and the encoding efficiency and quality of UHD TV images are improved.

CN120547338APending Publication Date: 2025-08-26ELECTRONICS & TELECOMM RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510683580.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-07-12
Filing Date
2018-11-28
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

The existing image encoding/decoding technology has the intra prediction accuracy and efficiency to be improved when processing high-resolution and high-definition images, especially in high-resolution and high-definition image encoding/decoding technology, which lacks effective bidirectional intra prediction methods.

Method used

The bidirectional intra prediction mode is adopted to process the intra prediction of the target block by determining the pixel availability in the adjacent block in the specified direction of the target block, virtual neighboring pixels are generated, and the predicted value of the target pixel is derived using weights, and the appropriate prediction mode is selected in combination with the one-way/bidirectional classification indicator and the intra prediction mode indicator.

Benefits of technology

Improve the intra prediction accuracy and efficiency of high-resolution and high-definition images, enhance the performance of encoding/decoding devices, especially in UHD TV image processing, achieving higher encoding efficiency and image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120547338A_ABST
    Figure CN120547338A_ABST
Patent Text Reader

Abstract

Disclosed are a bidirectional intra prediction method and apparatus. Encoding and decoding of a target block are performed using intra prediction. The intra prediction is a bi-directional intra prediction and is an intra prediction using a remaining mode. In the bidirectional intra prediction, a prediction value of a target pixel in a target block is determined based on reference pixels in two directions according to the bidirectional intra prediction. In the intra prediction using the remaining mode, the remaining mode is the remaining intra prediction mode other than the MPM in the MPM list.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with the application date of November 28, 2018, application number 201880086865.0, and invention name “Bidirectional intra-frame prediction method and device”. Technical Field

[0002] The following embodiments generally relate to a video decoding method and apparatus and a video encoding method and apparatus, and more particularly, to a video decoding method and apparatus and a video encoding method and apparatus using bidirectional intra-frame prediction. Background Art

[0003] With the continuous development of the information and communication industry, broadcast services supporting high-definition (HD) resolution have become popular around the world. With this popularity, a large number of users have become accustomed to high-resolution and high-definition images and / or videos.

[0004] To meet user demand for higher definition, numerous organizations have accelerated the development of next-generation imaging devices. In addition to high-definition television (HDTV) and full-high-definition (FHD) television, interest in ultra-high-definition television (UHDTV), which offers over four times the resolution of full-high-definition (FHD) television, has also grown. This growing interest is driving a growing demand for image encoding and decoding technologies that deliver higher resolution and definition.

[0005] Image encoding / decoding devices and methods may use inter-frame prediction technology, intra-frame prediction technology, entropy coding technology, etc. to perform encoding / decoding on high-resolution and high-definition images. Inter-frame prediction technology may be a technology for predicting the values ​​of pixels included in a target picture using a temporally previous picture and / or a temporally subsequent picture. Intra-frame prediction technology may be a technology for predicting the values ​​of pixels included in a target picture using information about the pixels in the target picture. Entropy coding technology may be a technology for assigning short codewords to frequently occurring symbols and long codewords to rarely occurring symbols.

[0006] In intra prediction, various detailed techniques have been developed, and due to the application of these detailed techniques, the accuracy and efficiency of prediction can be improved. Summary of the Invention

[0007] Technical issues

[0008] The embodiments are directed to providing an encoding apparatus and method and a decoding apparatus and method using bidirectional intra prediction.

[0009] The embodiments are directed to providing an encoding apparatus and method and a decoding apparatus and method using a residual mode.

[0010] Technical Solution

[0011] According to one aspect, a decoding method is provided, comprising: determining an intra-frame prediction mode to be applied to decoding of a target block; and performing intra-frame prediction for the target block using the determined intra-frame prediction mode, wherein the intra-frame prediction mode is a bidirectional intra-frame prediction mode, and wherein the intra-frame prediction is a bidirectional intra-frame prediction.

[0012] The bi-directional intra prediction mode may be determined based on the availability of pixels in neighboring blocks located in a specified direction of the target block.

[0013] The bi-directional intra prediction mode may be determined based on prediction modes of neighboring blocks of the target block.

[0014] The two directions of the bidirectional intra prediction may be two opposite linear directions.

[0015] Virtual neighboring pixels may be generated in a designated direction of the target block, and bidirectional intra prediction may be performed on the target block using the virtual neighboring pixels.

[0016] The designated direction may be one or more of a right direction and a downward direction.

[0017] A prediction value for a target pixel in a target block may be derived using pixels in neighboring blocks located in both directions of bidirectional intra prediction.

[0018] A prediction value for a target pixel may be derived using weights according to distances between respective pixels in neighboring blocks located in both directions of bidirectional intra prediction and a target pixel in a target block.

[0019] The weights for the two directions of bidirectional intra prediction may be used to derive a prediction value for a target pixel in a target block.

[0020] The uni-directional / bi-directional classification indicator and the intra-prediction mode indicator may be used to determine whether the bi-directional intra-prediction mode for the target block is to be used.

[0021] Two directions of bidirectional intra prediction may be determined based on two directions indicated by two intra prediction mode indicators.

[0022] A single intra prediction mode indicator may indicate one of a direction of unidirectional intra prediction and a direction of bidirectional intra prediction.

[0023] One of unidirectional intra prediction and bidirectional intra prediction may be selected according to availability of reference pixels in a direction corresponding to a direction indicated by the intra prediction mode indicator.

[0024] It may be determined which of unidirectional intra prediction and bidirectional intra prediction is to be used for the entire target block.

[0025] It may be determined which of unidirectional intra prediction and bidirectional intra prediction is to be used for each of the pixels in the target block.

[0026] For the first and second directions of bidirectional intra prediction, when reference pixels in the first direction or the second direction are unavailable, padding may be used to generate values ​​of the unavailable reference pixels.

[0027] A prediction value for a target pixel in a target block may be determined using at least one of reference pixels located in two prediction directions of the bi-directional intra prediction mode.

[0028] A weight may be applied to each of the reference pixels.

[0029] The remaining mode indicator may indicate remaining modes to be used for intra prediction of the target block among a plurality of remaining modes.

[0030] The plurality of remaining modes may be remaining intra prediction modes except for a most probable mode (MPM) present in an MPM list.

[0031] The intra-prediction mode may be determined based on a number of different lists.

[0032] According to another aspect, an encoding method is provided, comprising: determining an intra-frame prediction mode to be applied to decoding of a target block; and performing intra-frame prediction for the target block using the determined intra-frame prediction mode, wherein the intra-frame prediction mode is a bidirectional intra-frame prediction mode, and wherein the intra-frame prediction is a bidirectional intra-frame prediction.

[0033] According to another aspect, a computer-readable storage medium storing a bitstream for image decoding is provided, the bitstream including information about an encoded target block, wherein an intra-frame prediction mode to be applied to decoding of the target block is determined, and wherein intra-frame prediction for the target block is performed using the information about the encoded target block and the determined intra-frame prediction mode.

[0034] Beneficial effects

[0035] Provided are an encoding apparatus and method and a decoding apparatus and method using bidirectional intra prediction.

[0036] Provided are an encoding apparatus and method and a decoding apparatus and method using a residual mode. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 is a block diagram showing a configuration of an embodiment of an encoding device to which the present disclosure is applied;

[0038] Figure 2is a block diagram showing a configuration of an embodiment of a decoding device to which the present disclosure is applied;

[0039] Figure 3 is a diagram schematically illustrating a partition structure of an image when the image is encoded and decoded;

[0040] Figure 4 is a diagram illustrating a form of prediction unit (PU) that a coding unit (CU) can include;

[0041] Figure 5 is a diagram illustrating a form of a transform unit (TU) that can be included in a CU;

[0042] Figure 6 shows the division of blocks according to an example;

[0043] Figure 7 is a diagram for explaining an embodiment of an intra prediction process;

[0044] Figure 8 is a diagram for explaining the positions of reference samples used in the intra prediction process;

[0045] Figure 9 is a diagram for explaining an embodiment of an inter-frame prediction process;

[0046] Figure 10 shows spatial candidates according to an embodiment;

[0047] Figure 11 shows the order in which motion information of spatial candidates is added to a merge list according to an embodiment;

[0048] Figure 12 shows a transform and quantization process according to an example;

[0049] Figure 13 shows a diagonal scan according to an example;

[0050] Figure 14 shows a horizontal scan according to an example;

[0051] Figure 15 shows vertical scanning according to an example;

[0052] Figure 16 is a configuration diagram of an encoding device according to an embodiment;

[0053] Figure 17 is a configuration diagram of a decoding device according to an embodiment;

[0054] Figure 18 is a flowchart of a bidirectional intra prediction method according to an embodiment;

[0055] Figure 19shows a unidirectional intra prediction mode according to an example;

[0056] Figure 20 shows a bidirectional intra prediction mode according to an example;

[0057] Figure 21 shows a bidirectional intra prediction mode using virtual neighboring pixels according to an example;

[0058] Figure 22 shows derivation and selection of bidirectional intra prediction from the direction of an intra prediction mode indicator according to an example;

[0059] Figure 23 shows generation of virtual neighboring pixels according to an example;

[0060] Figure 24 shows using virtual neighboring pixels to generate additional virtual neighboring pixels according to an example;

[0061] Figure 25 shows generation of a lower right virtual neighboring pixel and a middle virtual neighboring pixel according to an example;

[0062] Figure 26 shows bidirectional intra prediction according to an example;

[0063] Figure 27 shows bidirectional intra prediction using virtual neighboring pixels according to an example;

[0064] Figure 28 shows bidirectional intra prediction using distances between neighboring pixels and a target pixel according to an example;

[0065] Figure 29 shows bidirectional intra prediction using distances between virtual neighboring pixels and a target pixel according to an example;

[0066] Figure 30 shows using the remaining modes to determine the intra prediction mode according to an embodiment;

[0067] Figure 31 shows deriving the MPM after determining whether the MPM is used and using the remaining modes to determine the intra prediction mode according to an embodiment;

[0068] Figure 32 shows a block for deriving MPM candidates according to an example;

[0069] Figure 33 shows binarization of the remaining mode indicator according to an example;

[0070] Figure 34 is a flowchart of a target block prediction method and a bitstream generation method according to an embodiment; and

[0071] Figure 35 is a flowchart of a target block prediction method using a bitstream according to an embodiment. DETAILED DESCRIPTION

[0072] The present invention can be variously modified and can have various embodiments, and specific embodiments will be described in detail below with reference to the accompanying drawings. However, it should be understood that these embodiments are not intended to limit the present invention to the specific disclosed forms, and they include all changes, equivalent forms or modified forms included in the spirit and scope of the present invention.

[0073] The following exemplary embodiments will be described in detail with reference to the accompanying drawings showing specific embodiments. These embodiments are described so that those of ordinary skill in the art to which the present disclosure pertains can easily put these embodiments into practice. It should be noted that the various embodiments are different from one another, but do not need to be mutually exclusive. For example, the specific shapes, structures, and characteristics described herein can be implemented as other embodiments without departing from the spirit and scope of the multiple embodiments associated with an embodiment. In addition, it should be understood that the position or arrangement of the various components in each disclosed embodiment can be changed without departing from the spirit and scope of the embodiments. Therefore, the attached detailed description is not intended to limit the scope of the present disclosure, and the scope of the exemplary embodiments is limited only by the attached claims and their equivalents (as long as they are appropriately described).

[0074] In the accompanying drawings, like reference numerals are used to designate the same or similar functions in various aspects. The shapes, sizes, etc. of components in the accompanying drawings may be exaggerated to make the description clear.

[0075] Terms such as "first" and "second" may be used to describe various components, but the components are not limited by the terms. The terms are only used to distinguish one component from another. For example, a first component may be referred to as a second component without departing from the scope of this specification. Similarly, a second component may be referred to as a first component. The term "and / or" may include a combination of multiple related description items or any one of the multiple related description items.

[0076] It will be understood that when a component is referred to as being “connected” or “coupled” to another component, the two components may be directly connected or coupled to each other, or intervening components may be present between the two components. It will be understood that when a component is referred to as being “directly connected or coupled,” there are no intervening components between the two components.

[0077] In addition, the components described in the embodiments are shown independently to represent different feature functions, but this does not mean that each component is formed by a separate hardware or software. That is, for the convenience of description, multiple components are arranged and included separately. For example, at least two components of the multiple components can be integrated into a single component. Conversely, a component can be divided into multiple components. As long as it does not deviate from the essence of this specification, embodiments in which multiple components are integrated or embodiments in which some components are separated are included in the scope of this specification.

[0078] Furthermore, it should be noted that, in exemplary embodiments, the expression describing components “including” specific components means that additional components may be included within the scope of practice or technical spirit of the exemplary embodiments, but does not exclude the existence of components other than the specific components.

[0079] The terms used in this specification are only used to describe specific embodiments and are not intended to limit the present invention. Singular expressions include plural expressions unless the context specifically indicates the contrary. In this specification, it should be understood that terms such as "including" or "having" are only intended to indicate the presence of features, numbers, steps, operations, components, parts or combinations thereof, and are not intended to exclude the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts or combinations thereof.

[0080] The embodiments will be described in detail below with reference to the accompanying drawings so that those skilled in the art can easily practice the embodiments. In the following description of the embodiments, detailed descriptions of well-known functions or configurations that are deemed to obscure the main points of this specification will be omitted. In addition, the same reference numerals are used to designate the same components throughout the drawings, and repeated descriptions of the same components will be omitted.

[0081] Hereinafter, "image" may refer to a single frame constituting a video, or may refer to the video itself. For example, "encoding and / or decoding an image" may refer to "encoding and / or decoding a video" or "encoding and / or decoding any one of a plurality of images constituting a video."

[0082] Hereinafter, the terms "video" and "moving picture" may be used to have the same meaning and may be used interchangeably with each other.

[0083] Hereinafter, the target image may be an encoding target image as a target to be encoded and / or a decoding target image as a target to be decoded. In addition, the target image may be an input image input to an encoding device or an input image input to a decoding device.

[0084] Hereinafter, the terms "image," "picture," "frame," and "screen" may be used to have the same meaning and may be used interchangeably with each other.

[0085] Hereinafter, a target block may be an encoding target block (i.e., a target to be encoded) and / or a decoding target block (i.e., a target to be decoded). In addition, a target block may be a current block, i.e., a target to be currently encoded and / or decoded. Herein, the terms "target block" and "current block" may be used to have the same meaning and may be used interchangeably.

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

[0087] Hereinafter, the terms "region" and "segment" may be used interchangeably with each other.

[0088] Hereinafter, a specific signal may be a signal indicating a specific block. For example, an original signal may be a signal indicating a target block. A prediction signal may be a signal indicating a prediction block. A residual signal may be a signal indicating a residual block.

[0089] In the following embodiments, specific information, data, flags, elements, and attributes may have their own values. The value "0" corresponding to each of the information, data, flags, elements, and attributes may indicate a logical false value or a first predefined value. In other words, the values ​​"0," false, logical false, and the first predefined value may be used interchangeably. The value "1" corresponding to each of the information, data, flags, elements, and attributes may indicate a logical true value or a second predefined value. In other words, the values ​​"1," true, logical true, and the second predefined value may be used interchangeably.

[0090] When a variable such as i or j is used to indicate a row, column, or index, the value i may be an integer 0 or greater than 0, or may be an integer 1 or greater than 1. In other words, in an embodiment, each of the row, column, and index may be counted starting from 0, or may be counted starting from 1.

[0091] Hereinafter, terms to be used in the embodiments will be described.

[0092] Encoder: An encoder refers to a device used to perform encoding.

[0093] Decoder: A decoder refers to a device used to perform decoding.

[0094] Unit: A “unit” may refer to a unit of image encoding and decoding. The terms “unit” and “block” may be used to have the same meaning and may be used interchangeably with each other.

[0095] – A “cell” may be an M×N array of samples. M and N may be positive integers. The term “cell” may generally refer to a two-dimensional (2D) array of samples.

[0096] During image encoding and decoding, a "unit" may be a region generated by partitioning an image. In other words, a "unit" may be a specified region within an image. A single image may be partitioned into multiple units. Alternatively, an image may be partitioned into sub-parts, and a unit may represent each sub-part when encoding or decoding is performed on the partitioned sub-parts.

[0097] – During the encoding and decoding of an image, predefined processing can be performed on each unit according to the type of the unit.

[0098] – According to the function, the unit type can be classified into a macro unit, a coding unit (CU), a prediction unit (PU), a residual unit, a transform unit (TU), etc. Alternatively, according to the function, the unit can refer to a block, a macro block, 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.

[0099] The term "unit" may mean information including a luma component block, a chroma component block corresponding to the luma component block, and syntax elements for each block such that the unit is designated to be distinguished from the block.

[0100] - The size and shape of the unit can be implemented differently. In addition, the unit can have any of a variety of sizes and shapes. Specifically, the shape of the unit can include not only a square but also a geometric shape that can be represented in two dimensions (2D), such as a rectangle, a trapezoid, a triangle, and a pentagon.

[0101] In addition, the unit information may include one or more of a unit type, a unit size, a unit depth, a unit encoding order, a unit decoding order, etc. For example, the unit type may indicate one of a CU, a PU, a residual unit, and a TU.

[0102] - A cell can be partitioned into sub-cells, each sub-cell having a size smaller than that of the associated cell.

[0103] - Depth: Depth may indicate the degree to which a cell is partitioned. In addition, cell depth may indicate the level at which a corresponding cell exists when the cell is represented in a tree structure.

[0104] - The cell partition information may include a depth indicating the depth of the cell. The depth may indicate the number of times the cell is partitioned and / or the extent to which the cell is partitioned.

[0105] – In a tree structure, the root node can be considered to have the smallest depth and the leaf nodes the largest depth.

[0106] A single cell can be hierarchically partitioned into multiple sub-cells, with the sub-cell having depth information based on a tree structure. In other words, a cell and the sub-cells generated by partitioning the cell may correspond to a node and its child nodes, respectively. Each partitioned sub-cell may have a cell depth. Since the depth indicates the number of times a cell has been partitioned and / or the extent to which a cell has been partitioned, the sub-cell partition information may include information about the size of the sub-cell.

[0107] In a tree structure, the top node may correspond to the initial node before partitioning. The top node may be referred to as a "root node." Furthermore, the root node may have the smallest depth value. Here, the depth of the top node may be level "0."

[0108] - A node at a depth level of "1" may represent a cell generated when the original cell is partitioned once. A node at a depth level of "2" may represent a cell generated when the original cell is partitioned twice.

[0109] - A leaf node at depth level "n" may represent a cell generated when the initial cell is partitioned n times.

[0110] A leaf node may be a bottom node that cannot be partitioned further. The depth of a leaf node may be a maximum level. For example, a predefined value for the maximum level may be 3.

[0111] – QT depth may indicate the depth for a four-partition zone. BT depth may indicate the depth for a two-partition zone. TT depth may indicate the depth for a three-part zone.

[0112] - Sample: Sample can be the basic unit of building blocks. Available from 0 to 2 according to the bit depth (Bd) Bd- The value of 1 represents the sample point.

[0113] – A sample can be a pixel or a pixel value.

[0114] - Hereinafter, the terms "pixel" and "sample" may be used to have the same meaning and may be used interchangeably with each other.

[0115] Coding Tree Unit (CTU): A CTU may consist of a single luma component (Y) coding tree block and two chroma component (Cb, Cr) coding tree blocks associated with the luma component coding tree block. In addition, a CTU may represent information including the above blocks and syntax elements for each block.

[0116] Each coding tree unit (CTU) may be partitioned using one or more partitioning methods such as quadtree (QT), binary tree (BT), and ternary tree (TT) to configure sub-units such as coding units, prediction units, and transform units.

[0117] – “CTU” may be used as a term to designate a pixel block as a processing unit in image decoding and encoding processes (such as in the case of partitioning an input image).

[0118] Coding Tree Block (CTB): “CTB” may be used as a term designating any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.

[0119] Neighboring block: A neighboring block (or neighboring block) may refer to a block adjacent to the target block. A neighboring block may refer to a reconstructed neighboring block.

[0120] Hereinafter, the terms “neighboring block” and “neighboring block” may be used to have the same meaning and may be used interchangeably with each other.

[0121] Spatially neighboring blocks: Spatially neighboring blocks may be blocks that are spatially adjacent to the target block. Neighboring blocks may include spatially neighboring blocks.

[0122] – A target block and spatially neighboring blocks may be included in a target picture.

[0123] - The spatially neighboring block may refer to a block whose boundary contacts the target block or a block located within a predetermined distance from the target block.

[0124] - A spatially adjacent block may refer to a block adjacent to a vertex of the target block. Here, a block adjacent to a vertex of the target block may refer to a block vertically adjacent to a neighboring block horizontally adjacent to the target block or a block horizontally adjacent to a neighboring block vertically adjacent to the target block.

[0125] Temporally neighboring blocks: Temporally neighboring blocks may be blocks that are temporally adjacent to the target block. Neighboring blocks may include temporally neighboring blocks.

[0126] - Temporally neighboring blocks may include co-located blocks (col blocks).

[0127] The col block may be a block in a previously reconstructed co-located picture (col picture). The position of the col block in the col picture may correspond to the position of the target block in the target picture. Alternatively, the position of the col block in the col picture may be equal to the position of the target block in the target picture. The col picture may be a picture included in the reference picture list.

[0128] - The temporally neighboring block may be a block temporally adjacent to the spatially neighboring block of the target block.

[0129] Prediction unit: A prediction unit may be a basic unit for prediction such as inter prediction, intra prediction, inter compensation, intra compensation, and motion compensation.

[0130] A single prediction unit can be divided into multiple partitions or sub-prediction units of smaller size. The multiple partitions can also be the basic units when performing prediction or compensation. Partitions generated by dividing the prediction unit can also be prediction units.

[0131] Prediction unit partition: A prediction unit partition may be a shape into which a prediction unit is divided.

[0132] Reconstructed neighboring cells: Reconstructed neighboring cells may be cells around the target cell that have been decoded and reconstructed.

[0133] The reconstructed neighboring cell may be a cell that is spatially adjacent to the target cell or temporally adjacent to the target cell.

[0134] - The reconstructed spatially neighboring unit may be a unit included in the target picture that has been reconstructed through encoding and / or decoding.

[0135] The reconstructed temporally adjacent unit may be a unit included in a reference picture and already reconstructed through encoding and / or decoding. The position of the reconstructed temporally adjacent unit in the reference picture may be the same as the position of the target unit in the target picture, or may correspond to the position of the target unit in the target picture.

[0136] Parameter set: Parameter set can be header information in the structure of bitstream. For example, parameter set can include video parameter set, sequence parameter set, picture parameter set, adaptation parameter set, etc.

[0137] In addition, the parameter set may include slice header information and tile header information.

[0138] Rate-distortion optimization: The encoding device may use rate-distortion optimization to provide high encoding efficiency by utilizing a combination of the following: the size of the coding unit (CU), the prediction mode, the size of the prediction unit (PU), motion information, and the size of the transform unit (TU).

[0139] The rate-distortion optimization scheme can calculate the rate-distortion cost of each combination to select the optimal combination from these combinations. The rate-distortion cost can be calculated using the following equation 1. Generally, the combination that minimizes the rate-distortion cost can be selected as the optimal combination under the rate-distortion optimization scheme.

[0140] [Equation 1]

[0141] D+λ*R

[0142] −D may represent distortion. D may be the average of the squares of the differences between the original transform coefficients and the reconstructed transform coefficients in the transform unit (ie, a mean square error).

[0143] -R may represent the rate, which may use relevant context information to represent the bit rate.

[0144] –λ represents the Lagrange multiplier. R may include not only encoding parameter information such as prediction mode, motion information, and coding block flag, but also bits generated due to encoding of transform coefficients.

[0145] – The encoding device may perform processes such as inter-frame prediction and / or intra-frame prediction, transformation, quantization, entropy coding, inverse quantization (dequantization), and inverse transformation in order to calculate accurate D and R. These processes greatly increase the complexity of the encoding device.

[0146] – Bitstream: A bitstream may refer to a stream of bits including encoded image information.

[0147] – Parameter set: Parameter set can be header information in the structure of the bitstream.

[0148] The parameter set may include at least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set. In addition, the parameter set may include information about a slice header and information about a tile header.

[0149] Parsing: Parsing can be the decision on the value of a syntax element made by performing entropy decoding on the bitstream. Alternatively, the term "parsing" can refer to such entropy decoding itself.

[0150] Symbol: A symbol may be at least one of a syntax element, a coding parameter, and a transform coefficient of a coding target unit and / or a decoding target unit. In addition, a symbol may be a target of entropy coding or a result of entropy decoding.

[0151] Reference picture: A reference picture may be an image referenced by a unit in order to perform inter-frame prediction or motion compensation. Alternatively, a reference picture may be an image including a reference unit referenced by a target unit in order to perform inter-frame prediction or motion compensation.

[0152] Hereinafter, the terms “reference picture” and “reference image” may be used to have the same meaning and may be used interchangeably with each other.

[0153] Reference picture list: A reference picture list may be a list including one or more reference images used for inter prediction or motion compensation.

[0154] – The type of reference picture list may include merged list (LC), list 0 (L0), list 1 (L1), list 2 (L3), list 3 (L3), etc.

[0155] – For inter prediction, one or more reference picture lists may be used.

[0156] Inter-frame prediction indicator: The inter-frame prediction indicator may indicate the inter-frame prediction direction for the target unit. Inter-frame prediction can be either unidirectional or bidirectional. Optionally, the inter-frame prediction indicator may indicate the number of reference pictures used to generate the prediction unit for the target unit. Optionally, the inter-frame prediction indicator may indicate the number of prediction blocks used for inter-frame prediction or motion compensation for the target unit.

[0157] Reference picture index: The reference picture index may be an index indicating a specific reference picture in a reference picture list.

[0158] Motion Vector (MV): A motion vector is a 2D vector used for inter-frame prediction or motion compensation. A motion vector represents the offset between a target image and a reference image.

[0159] – For example, you can use a command such as (mv x , mv y ) to express MV. mv x Can indicate the horizontal component, mv y May indicate the vertical component.

[0160] -Search range: The search range may be a 2D area where a search for an MV is performed during inter prediction. For example, the size of the search range may be M×N. M and N may be positive integers, respectively.

[0161] Motion vector candidate: A motion vector candidate may be a block that is a prediction candidate when a motion vector is predicted or a motion vector of a block that is a prediction candidate.

[0162] – A motion vector candidate may be included in a motion vector candidate list.

[0163] Motion vector candidate list: A motion vector candidate list may be a list configured using one or more motion vector candidates.

[0164] Motion vector candidate index: The motion vector candidate index may be an indicator for indicating a motion vector candidate in the motion vector candidate list. Alternatively, the motion vector candidate index may be an index of a motion vector predictor.

[0165] Motion information: The motion information may be information including at least one of a reference picture list, a reference image, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index, as well as a motion vector, a reference picture index, and an inter prediction indicator.

[0166] Merge candidate list: The merge candidate list may be a list configured using merge candidates.

[0167] Merge candidate: A merge candidate may be a spatial merge candidate, a temporal merge candidate, a combined merge candidate, a combined bi-predictive merge candidate, a zero merge candidate, etc. The merge candidate may include motion information such as prediction type information, reference picture index for each list, and a motion vector.

[0168] Merge index: The merge index may be an indicator for indicating a merge candidate in the merge candidate list.

[0169] – The merge index may indicate a reconstructed unit for deriving a merge candidate between a reconstructed unit spatially adjacent to the target unit and a reconstructed unit temporally adjacent to the target unit.

[0170] – The merge index may indicate at least one of a plurality of pieces of motion information of a merge candidate.

[0171] Transformation unit: A transformation unit can be a basic unit for residual signal encoding and / or residual signal decoding (such as transformation, inverse transformation, quantization, inverse quantization, transformation coefficient encoding, and transformation coefficient decoding). A single transformation unit can be partitioned into multiple transformation units with smaller sizes.

[0172] Scaling: Scaling can be referred to as the process of multiplying the levels of the transform coefficients by a factor.

[0173] – As a result of scaling the transform coefficient levels, transform coefficients may be generated. Scaling may also be referred to as “inverse quantization”.

[0174] Quantization Parameter (QP): A quantization parameter may be a value used to generate transform coefficient levels for a transform coefficient during quantization. Alternatively, a quantization parameter may also be a value used to generate a transform coefficient by scaling the transform coefficient levels during inverse quantization. Alternatively, a quantization parameter may be a value mapped to a quantization step size.

[0175] Delta quantization parameter: The delta quantization parameter is the difference between the target unit's quantization parameter and the predicted quantization parameter.

[0176] Scanning: Scanning can refer to a method of arranging the order of coefficients in a cell, block, or matrix. For example, a method for arranging a 2D array in the form of a one-dimensional (1D) array can be referred to as "scanning." Alternatively, a method for arranging a 1D array in the form of a 2D array can also be referred to as "scanning" or "inverse scanning."

[0177] Transform coefficient: The transform coefficient may be a coefficient value generated when the encoding device performs transformation. Alternatively, the transform coefficient may be a coefficient value generated when the decoding device performs at least one of entropy decoding and inverse quantization.

[0178] - A quantized level or a quantized transform coefficient level generated by applying quantization to a transform coefficient or a residual signal may also be included in the meaning of the term "transform coefficient".

[0179] Quantization level: The quantization level may be a value generated when the encoding device performs quantization on the transform coefficient or residual signal. Alternatively, the quantization level may be a value that is a target of inverse quantization when the decoding device performs inverse quantization.

[0180] - A quantized transform coefficient level as a result of transformation and quantization may also be included in the meaning of the quantization level.

[0181] Non-zero transform coefficient: A non-zero transform coefficient may be a transform coefficient having a value other than 0, or may be a transform coefficient level having a value other than 0. Alternatively, a non-zero transform coefficient may be a transform coefficient having a value with a magnitude other than 0, or may be a transform coefficient level having a value with a magnitude other than 0.

[0182] Quantization Matrix: A quantization matrix may be a matrix used in a quantization process or an inverse quantization process to improve the subjective or objective image quality of an image. A quantization matrix may also be referred to as a "scaling list."

[0183] Quantization matrix coefficient: A quantization matrix coefficient can be each element in the quantization matrix. A quantization matrix coefficient can also be called a "matrix coefficient."

[0184] Default matrix: The default matrix may be a quantization matrix predefined by the encoding device and the decoding device.

[0185] Non-default matrix: A non-default matrix may be a quantization matrix that is not pre-defined by the encoding device and the decoding device. The non-default matrix may be signaled by the encoding device to the decoding device.

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

[0187] The encoding apparatus and the decoding apparatus may determine one or more MPMs based on encoding parameters related to the target block and properties of an object related to the target block.

[0188] The encoding device and the decoding device may determine one or more MPMs based on the intra-frame prediction mode of the reference block. The reference block may include multiple reference blocks. The multiple reference blocks may include a spatially neighboring block adjacent to the left of the target block and a spatially neighboring block adjacent to the top of the target block. In other words, depending on which intra-frame prediction mode has been used for the reference block, one or more different MPMs may be determined.

[0189] One or more MPMs may be determined in the same manner in both the encoding device and the decoding device. That is, the encoding device and the decoding device may share the same MPM list including one or more MPMs.

[0190] MPM list: The MPM list may be a list including one or more MPMs. The number of the one or more MPMs in the MPM list may be predefined.

[0191] MPM indicator: The MPM indicator may indicate an MPM to be used for intra prediction for a target block among one or more MPMs in an MPM list. For example, the MPM indicator may be an index for the MPM list.

[0192] Since the MPM list is determined in the same manner in both the encoding device and the decoding device, there may be no need to transmit the MPM list itself from the encoding device to the decoding device.

[0193] The MPM indicator may be signaled from the encoding apparatus to the decoding apparatus. Since the MPM indicator is signaled, the decoding apparatus may determine an MPM to be used for intra prediction for a target block among the MPMs in the MPM list.

[0194] MPM usage indicator: The MPM usage indicator may indicate whether an MPM usage mode is to be used for prediction for a target block. The MPM usage mode may be a mode of determining an MPM to be used for intra prediction for a target block using an MPM list.

[0195] The MPM usage indicator may be signaled from the encoding device to the decoding device.

[0196] Signaling: "Signaling" may mean that information is sent from an encoding device to a decoding device. Alternatively, signaling may mean that information is included in a bitstream or storage medium. Information signaled by an encoding device can be used by a decoding device.

[0197] Figure 1 is a block diagram showing a configuration of an embodiment of an encoding device to which the present disclosure is applied.

[0198] 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 (pictures). The encoding device 100 may sequentially encode one or more images of a video.

[0199] Reference Figure 1, the encoding device 100 includes an inter-frame prediction unit 110, an intra-frame prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization (dequantization) unit 160, an inverse transform unit 170, an adder 175, a filter unit 180 and a reference picture buffer 190.

[0200] The encoding apparatus 100 may perform encoding on a target image using an intra mode and / or an inter mode.

[0201] In addition, the encoding device 100 can generate a bitstream including information about encoding by encoding the target image, and can output the generated bitstream. The generated bitstream can be stored in a computer-readable storage medium and can be streamed through a wireless / wired transmission medium.

[0202] When the intra mode is used as the prediction mode, the switch 115 may switch to the intra mode. When the inter mode is used as the prediction mode, the switch 115 may switch to the inter mode.

[0203] The encoding apparatus 100 may generate a prediction block of the target block. In addition, after having generated the prediction block, the encoding apparatus 100 may encode a residual between the target block and the prediction block.

[0204] When the prediction mode is intra mode, the intra prediction unit 120 may use pixels of a previously encoded / decoded neighboring block around the target block as reference samples. The intra prediction unit 120 may perform spatial prediction on the target block using the reference samples and may generate prediction samples for the target block through spatial prediction.

[0205] The inter prediction unit 110 may include a motion prediction unit and a motion compensation unit.

[0206] When the prediction mode is the inter mode, the motion prediction unit may search the reference image for a region that best matches the target block during the motion prediction process, and may derive a motion vector for the target block and the found region based on the found region.

[0207] The reference image may be stored in the reference picture buffer 190. More specifically, when encoding and / or decoding of the reference image has been processed, the reference image may be stored in the reference picture buffer 190.

[0208] The motion compensation unit can generate a prediction block for the target block by performing motion compensation using a motion vector. Here, the motion vector can be a two-dimensional (2D) vector used for inter-frame prediction. In addition, the motion vector can represent the offset between the target image and the reference image.

[0209] When the motion vector has a value other than an integer, the motion prediction unit and the motion compensation unit may generate a prediction block by applying an interpolation filter to a partial area of ​​the reference image. In order to perform inter-frame prediction or motion compensation, it may be determined which mode among the skip mode, merge mode, advanced motion vector prediction (AMVP) mode, and current picture reference mode corresponds to a method for predicting and compensating the motion of the PU included in the CU based on the CU, and inter-frame prediction or motion compensation may be performed according to the mode.

[0210] The subtractor 125 may generate a residual block, which is the difference between the target block and the prediction block. The residual block may also be referred to as a "residual signal."

[0211] The residual signal may be the difference between the original signal and the predicted signal. Alternatively, the residual signal may be a signal generated by transforming or quantizing the difference between the original signal and the predicted signal, or a signal generated by transforming and quantizing the difference. The residual block may be a residual signal for a block unit.

[0212] The transform unit 130 may generate a transform coefficient by transforming the residual block, and may output the generated transform coefficient. Here, the transform coefficient may be a coefficient value generated by transforming the residual block.

[0213] The transform unit 130 may use one of a plurality of predefined transform methods when performing the transform.

[0214] The plurality of predefined transform methods may include discrete cosine transform (DCT), discrete sine transform (DST), Karhunen-Loeve transform (KLT), and the like.

[0215] The transform method used to transform the residual block may be determined based on at least one of the encoding parameters for the target block and / or the neighboring blocks. For example, the transform method may be determined based on at least one of the inter-prediction mode for the PU, the intra-prediction mode for the PU, the size of the TU, and the shape of the TU. Alternatively, transform information indicating the transform method may be signaled from the encoding device 100 to the decoding device 200.

[0216] When the transform skip mode is used, the transform unit 130 may omit the operation of transforming the residual block.

[0217] By performing quantization on the transform coefficients, quantized transform coefficient levels or quantized levels may be generated. Hereinafter, in an embodiment, each of the quantized transform coefficient levels and the quantized levels may also be referred to as a 'transform coefficient'.

[0218] The quantization unit 140 may generate a quantized transform coefficient level or a quantized level by quantizing the transform coefficient according to the quantization parameter. The quantization unit 140 may output the generated quantized transform coefficient level or the quantized level. In this case, the quantization unit 140 may quantize the transform coefficient using a quantization matrix.

[0219] The entropy encoding unit 150 may generate a bitstream by performing entropy encoding based on a probability distribution based on a value calculated by the quantization unit 140 and / or an encoding parameter value calculated during encoding. The entropy encoding unit 150 may output the generated bitstream.

[0220] The entropy encoding unit 150 may perform entropy encoding on information about pixels of an image and information required for decoding the image. For example, the information required for decoding the image may include syntax elements and the like.

[0221] When entropy coding is applied, fewer bits are allocated to symbols that appear more frequently, and more bits are allocated to symbols that appear less frequently. Since symbols are represented by this allocation, the size of the bit string used to encode the target symbol can be reduced. Therefore, entropy coding can improve the compression performance of video encoding.

[0222] In addition, to perform entropy coding, the entropy coding unit 150 may use a coding method such as Exponential Golomb, Context Adaptive Variable Length Coding (CAVLC), or Context Adaptive Binary Arithmetic Coding (CABAC). For example, the entropy coding unit 150 may use a variable length coding / code (VLC) table to perform entropy coding. For example, the entropy coding unit 150 may derive a binarization method for the target symbol. In addition, the entropy coding unit 150 may derive a probability model for the target symbol / bin. The entropy coding unit 150 may use the derived binarization method, probability model, and context model to perform arithmetic coding.

[0223] The entropy encoding unit 150 may transform coefficients in a 2D block form into a 1D vector form through a transform coefficient scanning method in order to encode quantized transform coefficient levels.

[0224] Coding parameters may be information required for encoding and / or decoding. Coding parameters may include information encoded by the encoding device 100 and transmitted from the encoding device 100 to the decoding device, and may also include information that can be derived during the encoding or decoding process. For example, the information transmitted to the decoding device may include syntax elements.

[0225] Coding parameters may include not only information (or flags or indices) encoded by an encoding device and signaled to a decoding device, such as syntax elements, but also information derived during the encoding or decoding process. Furthermore, coding parameters may include information required for encoding or decoding an image.For example, the coding parameters may include at least one value of the following items, a combination of the following items, or statistics: the size of the unit / block, the depth of the unit / block, the partition information of the unit / block, the partition structure of the unit / block, information indicating whether the unit / block is partitioned in a quadtree structure, information indicating whether the unit / block is partitioned in a binary tree structure, the partition direction of the binary tree structure (horizontal or vertical), the partition form of the binary tree structure (symmetric partitioning or asymmetric partitioning), information indicating whether the unit / block is partitioned in a ternary tree structure, the partition direction of the ternary tree structure (horizontal or vertical), the prediction scheme (intra-frame prediction or inter-frame prediction), the intra-frame prediction mode / direction, the reference sample filtering method, the prediction block filtering method method, prediction block boundary filtering method, filter taps for filtering, filter coefficients for filtering, inter prediction mode, motion information, motion vector, reference picture index, inter prediction direction, inter prediction indicator, reference picture list, reference image, motion vector predictor, motion vector prediction candidate, motion vector candidate list, information indicating whether merge mode is used, merge candidate, merge candidate list, information indicating whether skip mode is used, type of interpolation filter, taps of interpolation filter, filter coefficients of interpolation filter, size of motion vector, accuracy of motion vector representation, transform type, transform size, information indicating whether primary transform is used, information indicating whether additional (secondary) transform is used information indicating whether a deblocking filter is applied, coefficients of the deblocking filter, taps of the deblocking filter, strength of the deblocking filter, shape / form of the deblocking filter, information indicating whether an adaptive sample offset is applied, value of the adaptive sample offset, category of the adaptive sample offset, type of the adaptive sample offset, information indicating whether the adaptive loop filter is applied information of the application, coefficients of the adaptive loop filter, taps of the adaptive loop filter, shape / form of the adaptive loop filter, binarization / debinarization method, context model, context model decision method, context model update method, information indicating whether the normal mode is executed, information indicating whether the bypass mode is executed, context binary bit, bypass binary bit, transform coefficient, transform coefficient level, transform coefficient level scanning method, image display / output order, slice identification information, slice type, slice partition information, tile identification information, tile type, tile partition information, picture type, bit depth, information about the luminance signal, and information about the chrominance signal. The prediction scheme may indicate one of the intra prediction mode and the inter prediction mode.

[0226] The residual signal may represent the difference between the original signal and the predicted signal. Alternatively, the residual signal may be a signal generated by transforming the difference between the original signal and the predicted signal. Alternatively, the residual signal may be a signal generated by transforming and quantizing the difference between the original signal and the predicted signal. The residual block may be a residual signal for a block.

[0227] Here, signaling a flag or index may indicate that the encoding device 100 includes an entropy-coded flag or an entropy-coded index generated by performing entropy encoding on the flag or index in the bitstream, and may indicate that the decoding device 200 obtains the flag or index by performing entropy decoding on the entropy-coded flag or entropy-coded index extracted from the bitstream.

[0228] Since the encoding apparatus 100 performs encoding via inter-frame prediction, the encoded target image can be used as a reference image for another image to be subsequently processed. Therefore, the encoding apparatus 100 can reconstruct or decode the encoded target image and store the reconstructed or decoded image as a reference image in the reference picture buffer 190. For decoding, the encoded target image can be dequantized and inversely transformed.

[0229] The quantization level may be dequantized by the dequantization unit 160 and inversely transformed by the inverse transform unit 170. The dequantized and / or inversely transformed coefficients may be added to the prediction block by the adder 175. The dequantized and / or inversely transformed coefficients and the prediction block are added to generate a reconstructed block. Here, the dequantized and / or inversely transformed coefficients may represent coefficients on which one or more of dequantization and inverse transformation have been performed, and may also represent a reconstructed residual block.

[0230] The reconstructed block may be filtered by the filter unit 180. The filter unit 180 may apply one or more filters among a deblocking filter, a sample adaptive offset (SAO) filter, and an adaptive loop filter (ALF) to the reconstructed block or the reconstructed picture. The filter unit 180 may also be referred to as a "loop filter."

[0231] The deblocking filter may remove block distortion occurring at boundaries between blocks. To determine whether to apply the deblocking filter, the number of columns or rows of pixels included in the block and comprising pixels on which to determine whether to apply the deblocking filter to the target block may be determined.

[0232] When a deblocking filter is applied to a target block, the filter applied may differ depending on the desired strength of the deblocking filter. In other words, among different filters, a filter determined in consideration of the strength of the deblocking filter may be applied to the target block. When a deblocking filter is applied to a target block, a filter corresponding to either a strong filter or a weak filter may be applied to the target block depending on the desired strength of the deblocking filter.

[0233] Also, when vertical filtering and horizontal filtering are performed on a target block, the horizontal filtering and the vertical filtering may be performed in parallel.

[0234] SAO can add an appropriate offset to pixel values ​​to compensate for coding errors. SAO can perform pixel-by-pixel correction on an image to which deblocking has been applied, wherein the correction uses an offset that is the difference between the original image and the image to which deblocking has been applied. To perform offset correction on an image, a method can be used for dividing the pixels included in the image into a specific number of regions, determining the regions to which the offset is applied within the divided regions, and applying the offset to the determined regions. A method can also be used for applying the offset while taking into account edge information for each pixel.

[0235] The ALF can perform filtering based on values ​​obtained by comparing the reconstructed image with the original image. After the pixels included in the image have been divided into a predetermined number of groups, the filter to be applied to each group can be determined, and filtering can be performed differently for each group. For luma signals, information related to whether an adaptive loop filter is applied can be signaled for each CU. The shape and filter coefficients of the ALF to be applied to each block can be different for each block. Alternatively, a fixed ALF can be applied to the block regardless of its characteristics.

[0236] The reconstructed block or reconstructed image filtered by the filter unit 180 may be stored in the reference picture buffer 190. The reconstructed block filtered by the filter unit 180 may be part of a reference picture. In other words, the reference picture may be a reconstructed picture composed of the reconstructed blocks filtered by the filter unit 180. The stored reference picture may then be used for inter-frame prediction.

[0237] Figure 2 is a block diagram showing a configuration of an embodiment of a decoding device to which the present disclosure is applied.

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

[0239] Reference Figure 2, the decoding device 200 may include an entropy decoding unit 210, an inverse quantization (dequantization) unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, an inter-frame prediction unit 250, a switch 245, an adder 255, a filter unit 260 and a reference picture buffer 270.

[0240] The decoding apparatus 200 may receive a bitstream output from the encoding apparatus 100. The decoding apparatus 200 may receive a bitstream stored in a computer-readable storage medium, and may receive a bitstream streamed through a wired / wireless transmission medium.

[0241] The decoding apparatus 200 may perform decoding on a bitstream in an intra mode and / or an inter mode. In addition, the decoding apparatus 200 may generate a reconstructed image or a decoded image through decoding, and may output the reconstructed image or the decoded image.

[0242] For example, an operation of switching to intra mode or inter mode based on the prediction mode used for decoding may be performed by the switch 245. When the prediction mode used for decoding is intra mode, the switch 245 may be operated to switch to intra mode. When the prediction mode used for decoding is inter mode, the switch 245 may be operated to switch to inter mode.

[0243] The decoding device 200 can obtain a reconstructed residual block by decoding the input bit stream and can generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 can generate a reconstructed block as a decoding target by adding the reconstructed residual block to the prediction block.

[0244] The entropy decoding unit 210 may generate symbols by performing entropy decoding on the bitstream based on the probability distribution of the bitstream. The generated symbols may include quantized transform coefficient level format symbols. Here, the entropy decoding method may be similar to the entropy encoding method described above. That is, the entropy decoding method may be the inverse process of the entropy encoding method described above.

[0245] The entropy decoding unit 210 may change a coefficient having a one-dimensional (1D) vector form into a 2D block shape through a transform coefficient scanning method in order to decode quantized transform coefficient levels.

[0246] For example, the coefficients of the block can be changed to a 2D block shape by scanning the block coefficients using an upper right diagonal scan. Optionally, which of the upper right diagonal scan, vertical scan, and horizontal scan to use can be determined based on the size of the corresponding block and / or the intra prediction mode.

[0247] The quantized coefficients may be dequantized by the dequantization unit 220. The dequantization unit 220 may generate dequantized coefficients by performing dequantization on the quantized coefficients. Furthermore, the dequantized coefficients may be inversely transformed by the inverse transform unit 230. The inverse transform unit 230 may generate a reconstructed residual block by performing inverse transform on the dequantized coefficients. As a result of performing dequantization and inverse transform on the quantized coefficients, a reconstructed residual block may be generated. Here, when generating the reconstructed residual block, the dequantization unit 220 may apply a quantization matrix to the quantized coefficients.

[0248] When the intra mode is used, the intra prediction unit 240 may generate a prediction block by performing spatial prediction using pixel values ​​of previously decoded neighboring blocks around a target block.

[0249] The inter-frame prediction unit 250 may include a motion compensation unit. Alternatively, the inter-frame prediction unit 250 may be designated as a "motion compensation unit."

[0250] When the inter mode is used, the motion compensation unit 250 may generate a prediction block by performing motion compensation using a motion vector and a reference image stored in the reference picture buffer 270 .

[0251] The motion compensation unit may apply an interpolation filter to a partial area of ​​a reference image when a motion vector has a value other than an integer, and may generate a prediction block using the reference image to which the interpolation filter is applied. In order to perform motion compensation, the motion compensation unit may determine which mode of skip mode, merge mode, advanced motion vector prediction (AMVP) mode, and current picture reference mode corresponds to a motion compensation method for a PU included in the CU based on the CU, and may perform motion compensation according to the determined mode.

[0252] The reconstructed residual block and the prediction block may be added to each other by the adder 255. The adder 255 may generate a reconstructed block by adding the reconstructed residual block and the prediction block.

[0253] The reconstructed block may be filtered by the filter unit 260. The filter unit 260 may apply at least one of a deblocking filter, an SAO filter, and an ALF to the reconstructed block or the reconstructed image. The reconstructed image may be a picture including the reconstructed block.

[0254] The filtered reconstructed image may be output by the encoding apparatus 100 and may be used by the encoding apparatus.

[0255] The reconstructed image filtered by the filter unit 260 may be stored as a reference picture in the reference picture buffer 270. The reconstructed block filtered by the filter unit 260 may be part of the reference picture. In other words, the reference picture may be an image composed of the reconstructed blocks filtered by the filter unit 260. The stored reference picture may then be used for inter-frame prediction.

[0256] Figure 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded.

[0257] Figure 3 An example in which a single unit is partitioned into a plurality of subunits may be schematically shown.

[0258] To efficiently partition an image, coding units (CUs) may be used in encoding and decoding. The term "unit" may be used to collectively designate 1) a block containing image samples and 2) a syntax element. For example, "partition of a unit" may refer to "partition of blocks corresponding to the unit."

[0259] A CU may be used as a basic unit for image encoding / decoding. A CU may be used as a unit to which one mode selected from intra mode and inter mode is applied in image encoding / decoding. In other words, in image encoding / decoding, it may be determined which mode of intra mode and inter mode is to be applied to each CU.

[0260] Also, a CU may be a basic unit for predicting, transforming, quantizing, inversely transforming, dequantizing, and encoding / decoding a transform coefficient.

[0261] Reference Figure 3 , the image 300 may be sequentially partitioned into units corresponding to the largest coding unit (LCU), and a partition structure may be determined for each LCU. Here, LCU may be used to have the same meaning as a coding tree unit (CTU).

[0262] Partitioning a unit may mean partitioning the block corresponding to the unit. Block partition information may include depth information regarding the depth of the unit. The depth information may indicate the number of times the unit is partitioned and / or the degree to which the unit is partitioned. A single unit may be hierarchically partitioned into sub-units, with the single unit having depth information based on a tree structure. Each partitioned sub-unit may have depth information. The depth information may be information indicating the size of a CU. The depth information may be stored for each CU.

[0263] Each CU may have depth information. When a CU is partitioned, the depth of the CU generated from the partition may increase by 1 from the depth of the partitioned CU.

[0264] The partition structure may indicate the distribution of coding units (CUs) in the LCU 310 for efficiently encoding an image. This distribution may be determined based on whether a single CU is to be partitioned into multiple CUs. The number of CUs generated by partitioning may be a positive integer of 2 or greater, including 2, 3, 4, 8, 16, and the like. Depending on the number of CUs generated by partitioning, the horizontal and vertical sizes of each CU generated by partitioning may be smaller than those of the CU before partitioning.

[0265] Each partitioned CU may be recursively partitioned into four CUs in the same manner. Compared to at least one of the horizontal size and the vertical size of the CU before partitioning, at least one of the horizontal size and the vertical size of each partitioned CU may be reduced through recursive partitioning.

[0266] Partitioning of a CU may be recursively performed up to a predefined depth or a predefined size. For example, the depth of a CU may have a value ranging from 0 to 3. Depending on the depth of the CU, the size of the CU may range from 64×64 to 8×8.

[0267] For example, the depth of the LCU may be 0, and the depth of the minimum coding unit (SCU) may be a predefined maximum depth. Here, as described above, the LCU may be a CU with a maximum coding unit size, and the SCU may be a CU with a minimum coding unit size.

[0268] Partitioning may begin at the LCU 310, and each time the horizontal and / or vertical dimensions of the CU are reduced by partitioning, the depth of the CU may increase by one.

[0269] For example, for each depth, a non-partitioned CU may have a size of 2N×2N. In addition, when a CU is partitioned, a CU of size 2N×2N may be partitioned into four CUs of size N×N. Whenever the depth increases by 1, the value of N may be halved.

[0270] Reference Figure 3 , an LCU with a depth of 0 may have 64×64 pixels or a 64×64 block. 0 may be the minimum depth. An SCU with a depth of 3 may have 8×8 pixels or an 8×8 block. 3 may be the maximum depth. Here, a CU with a 64×64 block as an LCU may be represented by a depth of 0. A CU with a 32×32 block may be represented by a depth of 1. A CU with a 16×16 block may be represented by a depth of 2. A CU with an 8×8 block as an SCU may be represented by a depth of 3.

[0271] Information about whether a corresponding CU is partitioned can be represented by the CU's partition information. The partition information can be 1-bit information. All CUs except the SCU can include partition information. For example, the partition information value of a non-partitioned CU can be 0. The partition information value of a partitioned CU can be 1.

[0272] For example, when a single CU is partitioned into four CUs, the horizontal size and vertical size of each of the four CUs generated by partitioning may be half the horizontal size and vertical size of the CU before partitioning. When a CU with a size of 32×32 is partitioned into four CUs, the size of each of the four partitioned CUs may be 16×16. When a single CU is partitioned into four CUs, it can be considered that the CU has been partitioned in a quadtree structure.

[0273] For example, when a single CU is partitioned into two CUs, the horizontal size or vertical size of each of the two CUs generated by partitioning may be half the horizontal size or vertical size of the CU before partitioning. When a CU of size 32×32 is partitioned vertically into two CUs, the size of each of the two partitioned CUs may be 16×32. When a CU of size 32×32 is partitioned horizontally into two CUs, the size of each of the two partitioned CUs may be 32×16. When a single CU is partitioned into two CUs, it can be considered that the CU has been partitioned in a binary tree structure.

[0274] Both quadtree partitioning and binary tree partitioning are applied to Figure 3 LCU310.

[0275] In the encoding apparatus 100, a coding tree unit (CTU) of size 64×64 may be partitioned into multiple smaller CUs using a recursive quadtree structure. A single CU may be partitioned into four CUs of the same size. Each CU may be recursively partitioned and may have a quadtree structure.

[0276] By recursive partitioning of CUs, the optimal partitioning method that incurs the minimum rate-distortion cost can be selected.

[0277] Figure 4 is a diagram illustrating a form of prediction units (PUs) that a coding unit (CU) can include.

[0278] In a CU partitioned from an LCU, the CU that is no longer partitioned can be divided into one or more prediction units (PUs). This division is also called "partitioning."

[0279] PU can be a basic unit for prediction. PU can be encoded and decoded in any one of skip mode, inter mode and intra mode. PU can be partitioned into various shapes according to each mode. For example, Figure 1 The target block described above refers to Figure 2 The target blocks described may all be PUs.

[0280] A CU may not be split into PUs. When a CU is not split into PUs, the size of the CU and the size of the PU may be equal to each other.

[0281] In skip mode, partitioning may not exist in a CU.In skip mode, a 2Nx2N mode 410 may be supported without partitioning, wherein in the 2Nx2N mode 410, the size of the PU and the size of the CU are the same as each other.

[0282] In inter mode, eight types of partition shapes may exist in a CU. For example, in inter mode, 2N×2N mode 410, 2N×N mode 415, N×2N mode 420, N×N mode 425, 2N×nU mode 430, 2N×nD mode 435, nL×2N mode 440, and nR×2N mode 445 may be supported.

[0283] In intra mode, 2N×2N mode 410 and N×N mode 425 may be supported.

[0284] In 2N×2N mode 410, a PU of size 2N×2N may be encoded. A PU of size 2N×2N may represent a PU of the same size as a CU. For example, a PU of size 2N×2N may have a size of 64×64, 32×32, 16×16, or 8×8.

[0285] In NxN mode 425, PUs of size NxN may be encoded.

[0286] For example, in intra prediction, when the size of a PU is 8×8, four partitioned PUs may be encoded, and the size of each partitioned PU may be 4×4.

[0287] When encoding a PU in intra mode, any one of multiple intra prediction modes may be used to encode the PU. For example, HEVC technology provides 35 intra prediction modes, and a PU may be encoded in any of the 35 intra prediction modes.

[0288] Which mode of the 2Nx2N mode 410 and the NxN mode 425 is to be used to encode the PU may be determined based on the rate-distortion penalty.

[0289] The encoding device 100 may perform an encoding operation on a PU of size 2N×2N. Here, the encoding operation may be an operation of encoding the PU in each of a plurality of intra-prediction modes that can be used by the encoding device 100. Through the encoding operation, an optimal intra-prediction mode for the PU of size 2N×2N may be derived. The optimal intra-prediction mode may be an intra-prediction mode that, among the plurality of intra-prediction modes that can be used by the encoding device 100, results in a minimum rate-distortion cost when encoding the PU of size 2N×2N.

[0290] In addition, the encoding device 100 may sequentially perform encoding operations on each PU obtained by performing N×N partitioning. Here, the encoding operation may be an operation of encoding the PU in each of a plurality of intra-frame prediction modes that can be used by the encoding device 100. Through the encoding operation, the optimal intra-frame prediction mode for the PU of size N×N may be derived. The optimal intra-frame prediction mode may be the intra-frame prediction mode that produces the minimum rate-distortion cost when encoding the PU of size N×N among the plurality of intra-frame prediction modes that can be used by the encoding device 100.

[0291] The encoding apparatus 100 may determine which of the PU of size 2N×2N and the PU of size N×N to be encoded based on a comparison between the rate-distortion cost of the PU of size 2N×2N and the rate-distortion cost of the PU of size N×N.

[0292] A single CU may be partitioned into one or more PUs, and a PU may be partitioned into multiple PUs.

[0293] For example, when a single PU is partitioned into four PUs, the horizontal and vertical sizes of each of the four PUs generated by partitioning may be half the horizontal and vertical sizes of the PU before partitioning. When a PU of size 32×32 is partitioned into four PUs, the size of each of the four partitioned PUs may be 16×16. When a single PU is partitioned into four PUs, the PU may be considered to have been partitioned in a quadtree structure.

[0294] For example, when a single PU is partitioned into two PUs, the horizontal size or vertical size of each of the two PUs generated by partitioning may be half the horizontal size or vertical size of the PU before partitioning. When a PU of size 32×32 is partitioned vertically into two PUs, the size of each of the two partitioned PUs may be 16×32. When a PU of size 32×32 is partitioned horizontally into two PUs, the size of each of the two partitioned PUs may be 32×16. When a single PU is partitioned into two PUs, the PU may be considered to have been partitioned in a binary tree structure.

[0295] Figure 5 is a diagram illustrating a form of a transform unit (TU) that can be included in a CU.

[0296] A transform unit (TU) may be a basic unit used for processes such as transform, quantization, inverse transform, inverse quantization, entropy encoding, and entropy decoding in a CU.

[0297] A TU may have a square shape or a rectangular shape. The shape of a TU may be determined based on the size and / or shape of a CU.

[0298] Among the CUs partitioned from the LCU, the CUs that are no longer partitioned into CUs may be partitioned into one or more TUs. Here, the partition structure of the TU may be a quadtree structure. For example, Figure 5 As shown in , a single CU 510 can be partitioned one or more times according to a quadtree structure. Through this partitioning, a single CU 510 can be composed of TUs of various sizes.

[0299] It can be considered that a single CU is recursively split when it is split two or more times. Through splitting, a single CU can be composed of transform units (TUs) of various sizes.

[0300] Alternatively, a single CU may be split into one or more TUs based on the number of vertical lines and / or horizontal lines that partition the CU.

[0301] A CU may be divided into symmetric TUs or asymmetric TUs. To divide into asymmetric TUs, information about the size and / or shape of each TU may be signaled from the encoding apparatus 100 to the decoding apparatus 200. Alternatively, the size and / or shape of each TU may be derived from the information about the size and / or shape of the CU.

[0302] A CU may not be divided into TUs. When a CU is not divided into TUs, the size of the CU and the size of the TU may be equal to each other.

[0303] A single CU may be partitioned into one or more TUs, and a TU may be partitioned into multiple TUs.

[0304] For example, when a single TU is partitioned into four TUs, the horizontal size and vertical size of each of the four TUs generated by partitioning can be half the horizontal size and vertical size of the TU before partitioning. When a 32×32 TU is partitioned into four TUs, the size of each of the four partitioned TUs can be 16×16. When a single TU is partitioned into four TUs, the TU can be considered to have been partitioned in a quadtree structure.

[0305] For example, when a single TU is partitioned into two TUs, the horizontal size or vertical size of each of the two TUs generated by partitioning may be half the horizontal size or vertical size of the TU before partitioning. When a 32×32 TU is partitioned vertically into two TUs, the size of each of the two partitioned TUs may be 16×32. When a 32×32 TU is partitioned horizontally into two TUs, the size of each of the two partitioned TUs may be 32×16. When a single TU is partitioned into two TUs, the TU may be considered to have been partitioned in a binary tree structure.

[0306] Figure 6 The division of blocks according to an example is shown.

[0307] In the video encoding and / or decoding process, such as Figure 6 As shown in , the target block can be divided.

[0308] For splitting of the target block, an indicator indicating splitting information may be signaled from the encoding apparatus 100 to the decoding apparatus 200. The splitting information may be information indicating how the target block is split.

[0309] The split information may be one or more of a split flag (hereinafter referred to as "split_flag"), a quad-binary flag (hereinafter referred to as "QB_flag"), a quadtree flag (hereinafter referred to as "quadtree_flag"), a binary tree flag (hereinafter referred to as "binarytree_flag") and a binary type flag (hereinafter referred to as "Btype_flag").

[0310] "split_flag" may be a flag indicating whether a block is split. For example, a split_flag value of 1 may indicate that the corresponding block is split. A split_flag value of 0 may indicate that the corresponding block is not split.

[0311] "QB_flag" may be a flag indicating which of the quadtree and binary tree forms corresponds to the shape of the block partition. For example, a QB_flag value of 0 may indicate that the block is partitioned in a quadtree form. A QB_flag value of 1 may indicate that the block is partitioned in a binary tree form. Alternatively, a QB_flag value of 0 may indicate that the block is partitioned in a binary tree form. A QB_flag value of 1 may indicate that the block is partitioned in a quadtree form.

[0312] "quadtree_flag" may be a flag indicating whether the block is partitioned in a quadtree form. For example, a quadtree_flag value of 1 may indicate that the block is partitioned in a quadtree form. A quadtree_flag value of 0 may indicate that the block is not partitioned in a quadtree form.

[0313] "binarytree_flag" may be a flag indicating whether the block is partitioned in a binary tree form. For example, a binarytree_flag value of 1 may indicate that the block is partitioned in a binary tree form. A binarytree_flag value of 0 may indicate that the block is not partitioned in a binary tree form.

[0314] "Btype_flag" may be a flag indicating which of vertical and horizontal divisions corresponds to the division direction when the block is divided in a binary tree form. For example, a Btype_flag value of 0 may indicate that the block is divided in the horizontal direction. A Btype_flag value of 1 may indicate that the block is divided in the vertical direction. Alternatively, a Btype_flag value of 0 may indicate that the block is divided in the vertical direction. A Btype_flag value of 1 may indicate that the block is divided in the horizontal direction.

[0315] For example, it can be derived by signaling at least one of quadtree_flag, binarytree_flag, and Btype_flag. Figure 6 The partitioning information of the blocks in is shown in Table 1 below.

[0316] Table 1

[0317]

[0318] For example, it can be derived by signaling at least one of split_flag, QB_flag, and Btype_flag. Figure 6 The partitioning information of the blocks in is shown in Table 2 below.

[0319] Table 2

[0320]

[0321] The partitioning method may be limited to a quadtree or a binary tree depending on the size and / or shape of the block. When this limitation is applied, split_flag may be a flag indicating whether the block is partitioned in a quadtree or a flag indicating whether the block is partitioned in a binary tree. The size and shape of the block may be derived based on the depth information of the block, and the depth information may be signaled from the encoding device 100 to the decoding device 200.

[0322] When the size of the block falls within a specific range, partitioning only in the quadtree form is possible. For example, the specific range may be defined by at least one of a maximum block size and a minimum block size that can be partitioned only in the quadtree form.

[0323] Information indicating the maximum block size and the minimum block size that can be divided only in the quadtree form may be signaled from the encoding apparatus 100 to the decoding apparatus 200 through a bitstream. In addition, this information may be signaled for at least one of units such as a video, a sequence, a picture, and a slice (or segment).

[0324] Alternatively, the maximum block size and / or the minimum block size may be a fixed size predefined by the encoding device 100 and the decoding device 200. For example, when the size of the block is larger than 64×64 and smaller than 256×256, only quadtree division is possible. In this case, split_flag may be a flag indicating whether quadtree division is performed.

[0325] When the size of the block falls within a specific range, partitioning only in the binary tree form is possible. For example, the specific range may be defined by at least one of a maximum block size and a minimum block size that can be partitioned only in the binary tree form.

[0326] Information indicating a maximum block size and / or a minimum block size that can be divided only in a binary tree form may be signaled from the encoding apparatus 100 to the decoding apparatus 200 through a bitstream. In addition, this information may be signaled for at least one of units such as a sequence, a picture, and a slice (or segment).

[0327] Alternatively, the maximum block size and / or the minimum block size may be a fixed size predefined by the encoding device 100 and the decoding device 200. For example, when the size of the block is greater than 8×8 and less than 16×16, only binary tree division is possible. In this case, split_flag may be a flag indicating whether binary tree division is performed.

[0328] The partitioning of a block may be limited by the previous partitioning. For example, when a block is partitioned in a binary tree form and a plurality of partition blocks are generated, each partition block may be further partitioned only in a binary tree form.

[0329] When the horizontal size or the vertical size of the partition block is a size that cannot be further divided, the above-mentioned indicator may not be signaled.

[0330] Figure 7 is a diagram for explaining an embodiment of an intra prediction process.

[0331] from Figure 7 An arrow extending radially from the center of the diagram in represents a prediction direction of the intra prediction mode. Furthermore, a number appearing near the arrow may represent an example of a mode value assigned to the intra prediction mode or a prediction direction of the intra prediction mode.

[0332] Intra-frame encoding and / or decoding may be performed using reference samples of blocks adjacent to the target block. The adjacent blocks may be adjacent reconstructed blocks. For example, intra-frame encoding and / or decoding may be performed using values ​​of reference samples included in each adjacent reconstructed block or encoding parameters of the adjacent reconstructed blocks.

[0333] The encoding device 100 and / or the decoding device 200 may generate a prediction block by performing intra-frame prediction on the target block based on information about samples in the target image. When intra-frame prediction is performed, the encoding device 100 and / or the decoding device 200 may generate a prediction block for the target block by performing intra-frame prediction based on information about samples in the target image. When intra-frame prediction is performed, the encoding device 100 and / or the decoding device 200 may perform directional prediction and / or non-directional prediction based on at least one reconstructed reference sample.

[0334] The prediction block may be a block generated as a result of performing intra prediction. The prediction block may correspond to at least one of a CU, a PU, and a TU.

[0335] The prediction block may have a size corresponding to at least one of a CU, a PU, and a TU. The prediction block may have a square shape of 2N×2N or N×N. The N×N size may include sizes of 4×4, 8×8, 16×16, 32×32, 64×64, etc.

[0336] Alternatively, the prediction block may be a square block of size 2×2, 4×4, 8×8, 16×16, 32×32, 64×64, etc. or a rectangular block of size 2×8, 4×8, 2×16, 4×16, 8×16, etc.

[0337] Intra-frame prediction may be performed considering the intra-frame prediction mode used for the target block. The number of intra-frame prediction modes that the target block can have may be a predefined fixed value, or may be a value determined differently according to the properties of the prediction block. For example, the properties of the prediction block may include the size of the prediction block, the type of the prediction block, etc.

[0338] For example, regardless of the size of the prediction block, the number of intra prediction modes may be fixed to 35. Alternatively, the number of intra prediction modes may be 3, 5, 9, 17, 34, 35, or 36, for example.

[0339] The intra prediction mode can be a non-directional mode or a directional mode. Figure 7 As shown in , the intra prediction modes may include two non-directional modes and 33 directional modes.

[0340] The two non-directional modes may include a DC mode and a planar mode.

[0341] The direction pattern may be a pattern having a specific direction or a specific angle.

[0342] Each intra-frame prediction mode may be represented by at least one of a mode number, a mode value, and a mode angle. The number of intra-frame prediction modes may be M. The value of M may be 1 or greater. In other words, the number of intra-frame prediction modes may be M, where M includes the number of non-directional modes and the number of directional modes.

[0343] Regardless of the size of the block, the number of intra prediction modes may be fixed to M. For example, the number of intra prediction modes may be fixed to any one of 35 and 67 regardless of the size of the block.

[0344] Alternatively, the number of intra prediction modes may differ according to the size of the block and / or the type of color component.

[0345] For example, the larger the block size, the greater the number of intra-frame prediction modes. Alternatively, the larger the block size, the fewer the number of intra-frame prediction modes. When the block size is 4×4 or 8×8, the number of intra-frame prediction modes may be 67. When the block size is 16×16, the number of intra-frame prediction modes may be 35. When the block size is 32×32, the number of intra-frame prediction modes may be 19. When the block size is 64×64, the number of intra-frame prediction modes may be 7.

[0346] For example, the number of intra prediction modes may differ depending on whether the color component is a luma signal or a chroma signal. Alternatively, the number of intra prediction modes corresponding to a luma component block may be greater than the number of intra prediction modes corresponding to a chroma component block.

[0347] For example, in vertical mode with a mode value of 26, prediction may be performed in a vertical direction based on pixel values ​​of reference samples. For example, in horizontal mode with a mode value of 10, prediction may be performed in a horizontal direction based on pixel values ​​of reference samples.

[0348] Even in a directional mode other than the above-described modes, the encoding apparatus 100 and the decoding apparatus 200 may perform intra prediction on a target unit using reference samples according to an angle corresponding to the directional mode.

[0349] An intra-frame prediction mode located to the right relative to the vertical mode may be referred to as a "vertical-right mode". An intra-frame prediction mode located below the horizontal mode may be referred to as a "horizontal-below mode". For example, in Figure 7 , an intra prediction mode whose mode value is one of 27, 28, 29, 30, 31, 32, 33, and 34 may be a vertical-right mode 613. An intra prediction mode whose mode value is one of 2, 3, 4, 5, 6, 7, 8, and 9 may be a horizontal-bottom mode 616.

[0350] The non-directional mode may include a DC mode and a planar mode. For example, the value of the DC mode may be 1. The value of the planar mode may be 0.

[0351] The directional mode may include an angular mode. Among the plurality of intra prediction modes, the remaining modes except the DC mode and the planar mode may be directional modes.

[0352] When the intra prediction mode is the DC mode, the prediction block may be generated based on the average value of the pixel values ​​of the plurality of reference pixels. For example, the pixel values ​​of the prediction block may be determined based on the average value of the pixel values ​​of the plurality of reference pixels.

[0353] The number of intra prediction modes and the mode values ​​of the respective intra prediction modes described above are merely exemplary and may be defined differently depending on embodiments, implementations, and / or requirements.

[0354] In order to perform intra prediction on a target block, a step of checking whether samples included in a reconstructed neighboring block can be used as reference samples for the target block may be performed. When a sample that cannot be used as a reference sample for the target block exists among the samples in the neighboring block, a value generated by interpolation and / or replication using at least one sample value among the samples included in the reconstructed neighboring block may replace the sample value of the sample that cannot be used as a reference sample. When the value generated by replication and / or interpolation replaces the sample value of the existing sample, the sample may be used as a reference sample for the target block.

[0355] In intra prediction, a filter may be applied to at least one of a reference sample and a prediction sample based on at least one of an intra prediction mode and a size of a target block.

[0356] The type of filter to be applied to at least one of the reference sample and the prediction sample may differ according to at least one of an intra prediction mode of the target block, a size of the target block, and a shape of the target block. The type of filter may be classified according to one or more of the number of filter taps, the value of the filter coefficient, and the filter strength.

[0357] When the intra prediction mode is the planar mode, the sample value of the predicted target block may be generated by using a weighted sum of the upper reference sample of the target block, the left reference sample of the target block, the upper right reference sample of the target block, and the lower left reference sample of the target block according to the position of the predicted target sample in the prediction block when generating the prediction block of the target block.

[0358] When the intra prediction mode is the DC mode, the average of the reference samples above the target block and the reference samples to the left of the target block may be used when generating the prediction block of the target block. Furthermore, filtering using the values ​​of the reference samples may be performed on specific rows or columns in the target block. The specific rows may be one or more rows above the reference sample. The specific columns may be one or more columns to the left of the reference sample.

[0359] When the intra prediction mode is a directional mode, the prediction block may be generated using the upper reference sample, the left reference sample, the upper right reference sample, and / or the lower left reference sample of the target block.

[0360] In order to generate the above-mentioned prediction samples, real number-based interpolation may be performed.

[0361] The intra prediction mode of the target block may be predicted from intra prediction modes of neighboring blocks adjacent to the target block, and information used for the prediction may be entropy encoded / decoded.

[0362] For example, when the intra prediction modes of the target block and the neighboring block are identical to each other, a predefined flag may be used to signal that the intra prediction modes of the target block and the neighboring block are the same.

[0363] For example, an indicator indicating the same intra prediction mode as that of the target block among intra prediction modes of a plurality of neighboring blocks may be signaled.

[0364] When the intra prediction modes of the target block and the neighboring blocks are different from each other, information about the intra prediction mode of the target block may be encoded and / or decoded using entropy encoding and / or entropy decoding.

[0365] Figure 8 is a diagram for explaining positions of reference samples used in an intra prediction process.

[0366] Figure 8 The position of the reference sample used for intra prediction of the target block is shown. Figure 8 , the reconstructed reference samples used for intra-frame prediction of the target block may include a lower left reference sample 831 , a left reference sample 833 , an upper left corner reference sample 835 , an upper reference sample 837 and an upper right reference sample 839 .

[0367] For example, left reference sample 833 may represent a reconstructed reference pixel adjacent to the left side of the target block. Upper reference sample 837 may represent a reconstructed reference pixel adjacent to the top of the target block. Upper left corner reference sample 835 may represent a reconstructed reference pixel located at the upper left corner of the target block. Lower left reference sample 831 may represent a reference sample located below the left sample line among samples located on the same line as the left sample line formed by left reference sample 833. Upper right reference sample 839 may represent a reference sample located to the right of the upper sample line among samples located on the same line as the upper sample line formed by upper reference sample 837.

[0368] When the size of the target block is N×N, the numbers of the lower left reference sample 831 , the left reference sample 833 , the upper reference sample 837 , and the upper right reference sample 839 may all be N.

[0369] By performing intra prediction on the target block, a prediction block can be generated. The process of generating the prediction block may include determining the values ​​of the pixels in the prediction block. The target block and the prediction block may be the same size.

[0370] The reference samples used for intra-frame prediction of the target block may change according to the intra-frame prediction mode of the target block. The direction of the intra-frame prediction mode may indicate the dependency relationship between the reference samples and the pixels of the prediction block. For example, the value of a specified reference sample may be used as the value of one or more specified pixels in the prediction block. In this case, the specified reference sample and the one or more specified pixels in the prediction block may be samples and pixels located on a straight line along the direction of the intra-frame prediction mode. In other words, the value of the specified reference sample may be copied as the value of a pixel located in a direction opposite to the direction of the intra-frame prediction mode. Alternatively, the value of a pixel in the prediction block may be the value of a reference sample located in the direction of the intra-frame prediction mode relative to the position of the pixel.

[0371] In this example, when the intra prediction mode of the target block is a vertical mode with a mode value of 26, the upper reference sample 837 can be used for intra prediction. When the intra prediction mode is a vertical mode, the value of a pixel in the prediction block can be the value of a reference sample located vertically above the position of the pixel. Therefore, the upper reference sample 837 adjacent to the top of the target block can be used for intra prediction. In addition, the value of the pixels in a row of the prediction block can be the same as the value of the pixel of the upper reference sample 837.

[0372] In this example, when the intra prediction mode of the target block is horizontal mode with a mode value of 10, the left reference sample 833 can be used for intra prediction. When the intra prediction mode is horizontal mode, the value of a pixel in the prediction block can be the value of a reference sample located horizontally to the left of the pixel. Therefore, the left reference sample 833 adjacent to the left side of the target block can be used for intra prediction. In addition, the value of the pixel in a column of the prediction block can be the same as the value of the pixel of the left reference sample 833.

[0373] In an example, when the mode value of the intra prediction mode of the current block is 18, at least some of the left reference samples 833, the upper left reference sample 835, and at least some of the upper reference samples 837 may be used for intra prediction. When the mode value of the intra prediction mode is 18, the value of a pixel in the prediction block may be the value of a reference sample diagonally located at the upper left corner of the pixel.

[0374] In addition, in a case where an intra prediction mode with a mode value of 27, 28, 29, 30, 31, 32, 33, or 34 is used, at least a portion of the upper right reference sample 839 may be used for intra prediction.

[0375] In addition, in the case where an intra prediction mode with a mode value of 2, 3, 4, 5, 6, 7, 8, or 9 is used, at least a portion of the lower left reference sample 831 may be used for intra prediction.

[0376] Also, in the case of an intra prediction mode in which the mode value is a value ranging from 11 to 25, the upper left corner reference sample 835 may be used for intra prediction.

[0377] The number of reference samples used to determine the pixel value of one pixel in the prediction block may be 1 or 2 or more.

[0378] As described above, the pixel value of a pixel in the prediction block may be determined based on the position of the pixel and the position of the reference sample indicated by the direction of the intra prediction mode. When the position of the pixel and the position of the reference sample indicated by the direction of the intra prediction mode are integer positions, the value of one reference sample indicated by the integer position may be used to determine the pixel value of the pixel in the prediction block.

[0379] When the position of a pixel and the position of the reference sample indicated by the direction of the intra-frame prediction mode are not integer positions, an interpolated reference sample based on the two reference samples closest to the position of the reference sample may be generated. The value of the interpolated reference sample may be used to determine the pixel value of a pixel in the prediction block. In other words, when the position of a pixel in the prediction block and the position of the reference sample indicated by the direction of the intra-frame prediction mode indicate a position between two reference samples, an interpolated value based on the values ​​of these two samples may be generated.

[0380] The prediction block generated via prediction may be different from the original target block. In other words, there may be a prediction error, which is the difference between the target block and the prediction block, and there may also be a prediction error between the pixels of the target block and the pixels of the prediction block.

[0381] Hereinafter, the terms “difference”, “error” and “residual” may be used to have the same meaning and may be used interchangeably with each other.

[0382] For example, in the case of directional intra prediction, the longer the distance between the pixels of the prediction block and the reference samples, the greater the prediction error that may occur. This prediction error can lead to discontinuities between the generated prediction block and neighboring blocks.

[0383] To reduce prediction error, a filtering operation may be applied to the prediction block. The filtering operation may be configured to adaptively apply a filter to areas of the prediction block that are considered to have a large prediction error. For example, the areas considered to have a large prediction error may be boundaries of the prediction block. Furthermore, the areas of the prediction block considered to have a large prediction error may vary depending on the intra-frame prediction mode, and the characteristics of the filter may also vary depending on the intra-frame prediction mode.

[0384] Figure 9 is a diagram for explaining an embodiment of an inter-frame prediction process.

[0385] Figure 9 The rectangle shown in can represent an image (or picture). Figure 9 In FIG, an arrow may indicate a prediction direction. That is, each image may be encoded and / or decoded according to the prediction direction.

[0386] Images can be classified into intra-frame pictures (I pictures), unidirectional predictive pictures or predictive coded pictures (P pictures), and bidirectional predictive pictures or bidirectional predictive coded pictures (B pictures) according to the coding type. Each picture can be encoded and / or decoded according to the coding type of each picture.

[0387] When the target image to be encoded is an I picture, the target image can be encoded using data contained in the image itself without performing inter-frame prediction with reference to other images. For example, the I picture can be encoded only through intra-frame prediction.

[0388] When the target image is a P picture, the target image may be encoded through inter-frame prediction using a reference picture existing in one direction. Here, the one direction may be a forward direction or a backward direction.

[0389] When the target image is a B picture, the image may be encoded by inter-frame prediction using reference pictures existing in both directions, or may be encoded by inter-frame prediction using reference pictures existing in one of the forward direction and the backward direction. Here, the two directions may be the forward direction and the backward direction.

[0390] P-pictures and B-pictures encoded and / or decoded using reference pictures may be regarded as images using inter-frame prediction.

[0391] Hereinafter, inter prediction in inter mode according to an embodiment will be described in detail.

[0392] Inter-frame prediction may be performed using motion information.

[0393] In the inter mode, the encoding apparatus 100 may perform inter prediction and / or motion compensation on the target block, and the decoding apparatus 200 may perform inter prediction and / or motion compensation corresponding to the inter prediction and / or motion compensation performed by the encoding apparatus 100 on the target block.

[0394] The motion information of the target block may be separately derived during inter prediction by the encoding apparatus 100 and the decoding apparatus 200. The motion information may be derived using motion information of a reconstructed neighboring block, motion information of a col block, and / or motion information of a block adjacent to the col block.

[0395] For example, the encoding apparatus 100 or the decoding apparatus 200 may perform prediction and / or motion compensation by using the motion information of the spatial candidate and / or the temporal candidate as the motion information of the target block. The target block may represent a PU and / or a PU partition.

[0396] The spatial candidate may be a reconstructed block that is spatially adjacent to the target block.

[0397] The temporal candidate may be a reconstructed block corresponding to the target block in a previously reconstructed co-located picture (col picture).

[0398] In inter-frame prediction, the encoding device 100 and the decoding device 200 can improve encoding efficiency and decoding efficiency by utilizing motion information of spatial candidates and / or temporal candidates. The motion information of the spatial candidate may be referred to as "spatial motion information." The motion information of the temporal candidate may be referred to as "temporal motion information."

[0399] Hereinafter, the motion information of a spatial candidate may be the motion information of a PU including the spatial candidate. The motion information of a temporal candidate may be the motion information of a PU including the temporal candidate. The motion information of a candidate block may be the motion information of a PU including the candidate block.

[0400] Inter prediction may be performed using reference pictures.

[0401] The reference picture may be at least one of a picture before the target picture and a picture after the target picture.The reference picture may be an image used for prediction of the target block.

[0402] In inter prediction, a region in a reference picture may be specified using a reference picture index (or refIdx) indicating a reference picture, a motion vector to be described later, etc. Here, the region specified in the reference picture may indicate a reference block.

[0403] Inter prediction can select a reference picture, or select a reference block corresponding to the target block from the reference picture. In addition, inter prediction can use the selected reference block to generate a prediction block for the target block.

[0404] Motion information may be derived by each of the encoding apparatus 100 and the decoding apparatus 200 during inter prediction.

[0405] A spatial candidate may be a block that 1) exists in the target picture 2) has been previously reconstructed via encoding and / or decoding and 3) is adjacent to the target block or is located at a corner of the target block. Here, a "block located at a corner of the target block" may be a block vertically adjacent to a neighboring block horizontally adjacent to the target block, or a block horizontally adjacent to a neighboring block vertically adjacent to the target block. In addition, a "block located at a corner of the target block" may have the same meaning as a "block adjacent to a corner of the target block." The meaning of a "block located at a corner of the target block" may be included in the meaning of a "block adjacent to the target block."

[0406] For example, the spatial candidate can be a reconstructed block located to the left of the target block, a reconstructed block located above the target block, a reconstructed block located at the lower left corner of the target block, a reconstructed block located at the upper right corner of the target block, or a target block located at the upper left corner of the target block.

[0407] Each of the encoding apparatus 100 and the decoding apparatus 200 may identify a block existing in the col picture at a position spatially corresponding to the target block. The position of the target block in the target picture and the position of the identified block in the col picture may correspond to each other.

[0408] Each of the encoding apparatus 100 and the decoding apparatus 200 may determine a col block existing at a predefined relative position with respect to the identified block as a temporal candidate. The predefined relative position may be a position existing inside and / or outside the identified block.

[0409] For example, the col block may include a first col block and a second col block. When the coordinates of the identified block are (xP, yP) and the size of the identified block is represented by (nPSW, nPSH), the first col block may be a block located at the coordinates (xP+nPSW, yP+nPSH). The second col block may be a block located at the coordinates (xP+(nPSW>>1), yP+(nPSH>>1)). When the first col block is unavailable, the second col block may be selectively used.

[0410] The motion vector of the target block may be determined based on the motion vector of the col block. Each of the encoding apparatus 100 and the decoding apparatus 200 may scale the motion vector of the col block. The scaled motion vector of the col block may be used as the motion vector of the target block. In addition, the motion vector of the running information of the temporal candidate stored in the list may be the scaled motion vector.

[0411] The ratio of the motion vector of the target block to the motion vector of the col block may be the same as the ratio of the first distance to the second distance. The first distance may be the distance between the reference picture and the target picture of the target block. The second distance may be the distance between the reference picture and the col picture of the col block.

[0412] The scheme for deriving motion information may vary depending on the inter-frame prediction mode of the target block. For example, as inter-frame prediction modes applied to inter-frame prediction, there may be Advanced Motion Vector Predictor (AMVP) mode, merge mode, skip mode, current picture reference mode, etc. Merge mode may also be referred to as "motion merge mode." Each mode will be described in detail below.

[0413] 1) AMVP model

[0414] When using the AMVP mode, the encoding device 100 may search for similar blocks in the vicinity of the target block. The encoding device 100 may obtain a prediction block by performing prediction on the target block using the motion information of the found similar blocks. The encoding device 100 may encode a residual block that is the difference between the target block and the prediction block.

[0415] 1-1) Create a list of predicted motion vector candidates

[0416] When the AMVP mode is used as the prediction mode, each of the encoding device 100 and the decoding device 200 can create a list of prediction motion vector candidates using the motion vector of the spatial candidate, the motion vector of the temporal candidate, and the zero vector. The prediction motion vector candidate list may include one or more prediction motion vector candidates. At least one of the motion vector of the spatial candidate, the motion vector of the temporal candidate, and the zero vector may be determined and used as the prediction motion vector candidate.

[0417] Hereinafter, the terms "prediction motion vector (candidate)" and "motion vector (candidate)" may be used to have the same meaning and may be used interchangeably with each other.

[0418] Hereinafter, the terms “predicted motion vector candidate” and “AMVP candidate” may be used to have the same meaning and may be used interchangeably with each other.

[0419] Hereinafter, the terms “motion vector prediction candidate list” and “AMVP candidate list” may be used to have the same meaning and may be used interchangeably with each other.

[0420] The spatial candidate may include a reconstructed spatial neighboring block. In other words, the motion vector of the reconstructed neighboring block may be referred to as a "spatial prediction motion vector candidate."

[0421] The temporal candidate may include the col block and blocks adjacent to the col block. In other words, the motion vector of the col block or the motion vector of the block adjacent to the col block may be referred to as a "temporal prediction motion vector candidate".

[0422] The zero vector may be the (0,0) motion vector.

[0423] The predicted motion vector candidate may be a motion vector predictor for predicting a motion vector. In addition, in the encoding apparatus 100, each predicted motion vector candidate may be an initial search position for a motion vector.

[0424] 1-2) Searching for motion vector using a list of predicted motion vector candidates

[0425] The encoding device 100 may determine a motion vector to be used for encoding the target block within the search range using the list of predicted motion vector candidates. In addition, the encoding device 100 may determine a predicted motion vector candidate to be used as the predicted motion vector of the target block from among the predicted motion vector candidates in the predicted motion vector candidate list.

[0426] The motion vector to be used for encoding the target block may be a motion vector that can be encoded at a minimum cost.

[0427] Also, the encoding apparatus 100 may determine whether to encode the target block using the AMVP mode.

[0428] 1-3) Transmission of inter-frame prediction information

[0429] The encoding apparatus 100 may generate a bitstream including inter prediction information required for inter prediction, and the decoding apparatus 200 may perform inter prediction on a target block using the inter prediction information of the bitstream.

[0430] The inter prediction information may include 1) mode information indicating whether AMVP is used, 2) a prediction motion vector index, 3) a motion vector difference (MVD), 4) a reference direction, and 5) a reference picture index.

[0431] Hereinafter, the terms "prediction motion vector index" and "AMVP index" may be used to have the same meaning and may be used interchangeably with each other. In addition, the inter prediction information may include a residual signal.

[0432] When the mode information indicates that the AMVP mode is used, the decoding apparatus 200 may acquire a predicted motion vector index, an MVD, a reference direction, and a reference picture index from a bitstream through entropy decoding.

[0433] The predicted motion vector index may indicate a predicted motion vector candidate to be used for prediction of the target block among the predicted motion vector candidates included in the predicted motion vector candidate list.

[0434] 1-4) Inter-frame prediction in AMVP mode using inter-frame prediction information

[0435] The decoding apparatus 200 may derive a prediction motion vector candidate using the prediction motion vector candidate list, and may determine motion information of a target block based on the derived prediction motion vector candidate.

[0436] The decoding apparatus 200 may determine a motion vector candidate for the target block from among the predicted motion vector candidates included in the predicted motion vector candidate list using the predicted motion vector index. The decoding apparatus 200 may select the predicted motion vector candidate indicated by the predicted motion vector index from among the predicted motion vector candidates included in the predicted motion vector candidate list as the predicted motion vector of the target block.

[0437] The motion vector actually used for inter-frame prediction of the target block may not match the predicted motion vector. To indicate the difference between the motion vector actually used for inter-frame prediction of the target block and the predicted motion vector, MVD may be used. The encoding apparatus 100 may derive a predicted motion vector similar to the motion vector actually used for inter-frame prediction of the target block in order to use as small an MVD as possible.

[0438] The MVD may be a difference between a motion vector of a target block and a predicted motion vector. The encoding apparatus 100 may calculate the MVD and may entropy encode the MVD.

[0439] The MVD may be transmitted from the encoding device 100 to the decoding device 200 via a bitstream. The decoding device 200 may decode the received MVD. The decoding device 200 may derive a motion vector of the target block by summing the decoded MVD and the predicted motion vector. In other words, the motion vector of the target block derived by the decoding device 200 may be the sum of the entropy-decoded MVD and the motion vector candidate.

[0440] The reference direction may indicate a list of reference pictures to be used for prediction of the target block. For example, the reference direction may indicate one of reference picture list L0 and reference picture list L1.

[0441] The reference direction only indicates the reference picture list to be used for prediction of the target block and may not mean that the direction of the reference picture is limited to the forward direction or the backward direction. In other words, each of the reference picture lists L0 and L1 may include pictures in the forward direction and / or the backward direction.

[0442] A unidirectional reference direction may mean that a single reference picture list is used. A bidirectional reference direction may mean that two reference picture lists are used. In other words, the reference direction may indicate one of the following cases: a case where only reference picture list L0 is used, a case where only reference picture list L1 is used, or a case where two reference picture lists are used.

[0443] The reference picture index may indicate a reference picture to be used for prediction of the target block among the reference pictures in the reference picture list. The reference picture index may be entropy-encoded by the encoding apparatus 100. The entropy-encoded reference picture index may be signaled by the encoding apparatus 100 to the decoding apparatus 200 via a bitstream.

[0444] When two reference picture lists are used to predict a target block, a single reference picture index and a single motion vector can be used for each reference picture list. In addition, when two reference picture lists are used to predict a target block, two prediction blocks can be specified for the target block. For example, the (final) prediction block for the target block can be generated using an average or weighted sum of the two prediction blocks for the target block.

[0445] The motion vector of the target block may be derived by predicting the motion vector index, MVD, reference direction, and reference picture index.

[0446] The decoding apparatus 200 may generate a prediction block for the target block based on the derived motion vector and the reference picture index. For example, the prediction block may be a reference block indicated by the derived motion vector in the reference picture indicated by the reference picture index.

[0447] Since the predicted motion vector index and the MVD are encoded but the motion vector itself of the target block is not encoded, the number of bits transmitted from the encoding apparatus 100 to the decoding apparatus 200 may be reduced and encoding efficiency may be improved.

[0448] The reconstructed motion information of the neighboring blocks can be used for the target block. In certain inter-frame prediction modes, the encoding device 100 may not separately encode the actual motion information of the target block. Instead of encoding the motion information of the target block, additional information may be encoded, where the additional information enables the motion information of the target block to be derived using the reconstructed motion information of the neighboring blocks. Since this additional information is encoded, the number of bits transmitted to the decoding device 200 can be reduced, and encoding efficiency can be improved.

[0449] For example, as an inter-frame prediction mode in which the motion information of the target block is not directly encoded, a skip mode and / or a merge mode may exist. Here, each of the encoding device 100 and the decoding device 200 may use an indicator and / or an index indicating a unit whose motion information is to be used as the motion information of the target unit among the reconstructed neighboring units.

[0450] 2) Merge mode

[0451] As a scheme for deriving motion information of a target block, there is a merge mode. The term "merge" may mean merging the motions of multiple blocks. "Merge" may also mean that the motion information of one block is also applied to other blocks. In other words, the merge mode may be a mode in which the motion information of the target block is derived from the motion information of neighboring blocks.

[0452] When using merge mode, the encoding device 100 may use the motion information of the spatial candidate and / or the motion information of the temporal candidate to predict the motion information of the target block. The spatial candidate may include a reconstructed spatial neighboring block that is spatially adjacent to the target block. The spatial neighboring block may include a left neighboring block and an upper neighboring block. The temporal candidate may include a col block. The terms "spatial candidate" and "spatial merge candidate" may be used to have the same meaning and may be used interchangeably with each other. The terms "temporal candidate" and "temporal merge candidate" may be used to have the same meaning and may be used interchangeably with each other.

[0453] The encoding apparatus 100 may obtain a prediction block through prediction. The encoding apparatus 100 may encode a residual block that is a difference between the target block and the prediction block.

[0454] 2-1) Create a merge candidate list

[0455] When using merge mode, each of the encoding device 100 and the decoding device 200 can use the motion information of the spatial candidate and / or the motion information of the temporal candidate to create a merge candidate list. The motion information may include 1) a motion vector, 2) a reference picture index, and 3) a reference direction. The reference direction can be unidirectional or bidirectional.

[0456] The merge candidate list may include a merge candidate. The merge candidate may be motion information. In other words, the merge candidate list may be a list storing multiple pieces of motion information.

[0457] A merge candidate may be a plurality of pieces of motion information of temporal candidates and / or spatial candidates. In addition, a merge candidate list may include new merge candidates generated by combining merge candidates already in the merge candidate list. In other words, the merge candidate list may include new motion information generated by combining multiple pieces of motion information previously in the merge candidate list.

[0458] A merge candidate may be a specific mode for deriving inter-frame prediction information. A merge candidate may be information indicating a specific mode for deriving inter-frame prediction information. Inter-frame prediction information for a target block may be derived according to the specific mode indicated by the merge candidate. Furthermore, the specific mode may include a process for deriving a series of inter-frame prediction information. This specific mode may be an inter-frame prediction information derivation mode or a motion information derivation mode.

[0459] Inter prediction information of the target block may be derived according to a mode indicated by a merge candidate selected from among merge candidates in the merge candidate list by a merge index.

[0460] For example, the motion information derivation mode in the merge candidate list may be at least one of the following modes: 1) a motion information derivation mode for sub-block units; 2) an affine motion information derivation mode. Furthermore, the merge candidate list may include motion information of a zero vector. A zero vector may also be referred to as a "zero merge candidate."

[0461] In other words, the multiple motion information in the merge candidate list can be at least one of the following information: 1) motion information of spatial candidates, 2) motion information of temporal candidates, 3) motion information generated by combining multiple motion information previously existing in the merge candidate list, and 4) zero vector.

[0462] Motion information may include 1) a motion vector, 2) a reference picture index, and 3) a reference direction. The reference direction may also be referred to as an "inter prediction indicator." The reference direction may be unidirectional or bidirectional. A unidirectional reference direction may indicate L0 prediction or L1 prediction.

[0463] A merge candidate list may be created before performing prediction in merge mode.

[0464] The number of merge candidates in the merge candidate list may be predefined. Each of the encoding device 100 and the decoding device 200 may add merge candidates to the merge candidate list according to a predefined scheme and a predefined priority, so that the merge candidate list has a predefined number of merge candidates. The merge candidate list of the encoding device 100 and the merge candidate list of the decoding device 200 may be made identical to each other using the predefined scheme and the predefined priority.

[0465] Merging can be applied on a CU or PU basis. When performing merging on a CU or PU basis, the encoding device 100 may transmit a bitstream including predefined information to the decoding device 200. For example, the predefined information may include 1) information indicating whether merging is performed for each block partition, and 2) information about blocks on which merging is to be performed among blocks that are spatial candidates and / or temporal candidates for the target block.

[0466] 2-2) Searching for motion vectors using the merge candidate list

[0467] The encoding device 100 may determine a merge candidate to be used for encoding the target block. For example, the encoding device 100 may perform prediction on the target block using a merge candidate in the merge candidate list and may generate a residual block for the merge candidate. The encoding device 100 may encode the target block using the merge candidate that generates the minimum cost in encoding the prediction and residual block.

[0468] Also, the encoding apparatus 100 may determine whether to encode the target block using the merge mode.

[0469] 2-3) Transmission of inter-frame prediction information

[0470] The encoding apparatus 100 may generate a bitstream including inter-frame prediction information required for inter-frame prediction. The encoding apparatus 100 may generate entropy-coded inter-frame prediction information by performing entropy coding on the inter-frame prediction information, and may transmit the bitstream including the entropy-coded inter-frame prediction information to the decoding apparatus 200. The entropy-coded inter-frame prediction information may be signaled from the encoding apparatus 100 to the decoding apparatus 200 through the bitstream.

[0471] The decoding apparatus 200 may perform inter prediction on a target block using inter prediction information of a bitstream.

[0472] The inter prediction information may include 1) mode information indicating whether the merge mode is used and 2) a merge index.

[0473] In addition, the inter-frame prediction information may include a residual signal.

[0474] The decoding apparatus 200 may acquire a merge index from a bitstream only when the mode information indicates that the merge mode is used.

[0475] The mode information may be a merge flag. The unit of the mode information may be a block. The information about the block may include the mode information, and the mode information may indicate whether the merge mode is applied to the block.

[0476] The merge index may indicate a merge candidate to be used for predicting the target block among the merge candidates included in the merge candidate list. Alternatively, the merge index may indicate a block to be merged with the target block among neighboring blocks that are spatially or temporally adjacent to the target block.

[0477] The encoding apparatus 100 may select a merge candidate having the highest encoding performance among the merge candidates included in the merge candidate list, and set a value of the merge index to indicate the selected merge candidate.

[0478] 2-4) Inter-frame prediction using merge mode of inter-frame prediction information

[0479] The decoding apparatus 200 may perform prediction on the target block using a merge candidate indicated by a merge index among merge candidates included in the merge candidate list.

[0480] The motion vector of the target block may be specified by the motion vector of the merge candidate indicated by the merge index, the reference picture index, and the reference direction.

[0481] 3) Skip mode

[0482] Skip mode can be a mode in which the motion information of a spatial candidate or a temporal candidate is applied to the target block without change. In addition, skip mode can be a mode in which a residual signal is not used. In other words, when skip mode is used, the reconstructed block can be a predicted block.

[0483] The difference between the merge mode and the skip mode is whether the residual signal is transmitted or used. That is, the skip mode is similar to the merge mode except that the residual signal is not transmitted or used.

[0484] When the skip mode is used, the encoding apparatus 100 may transmit information about a block, among blocks serving as spatial candidates or temporal candidates, whose motion information is to be used as the motion information of the target block, to the decoding apparatus 200 through a bitstream. The encoding apparatus 100 may generate entropy-coded information by performing entropy coding on the information, and may signal the entropy-coded information to the decoding apparatus 200 through a bitstream.

[0485] In addition, when the skip mode is used, the encoding device 100 may not transmit other syntax information (such as MVD) to the decoding device 200. For example, when the skip mode is used, the encoding device 100 may not signal syntax elements related to at least one of MVC, coded block flags, and transform coefficient levels to the decoding device 200.

[0486] 3-1) Create a merge candidate list

[0487] The merge candidate list can also be used in skip mode. In other words, the merge candidate list can be used in both merge mode and skip mode. In this regard, the merge candidate list can also be referred to as a "skip candidate list" or a "merge / skip candidate list."

[0488] Alternatively, the skip mode may use an additional candidate list different from the candidate list of the merge mode. In this case, in the following description, the merge candidate list and the merge candidate may be replaced by the skip candidate list and the skip candidate, respectively.

[0489] A merge candidate list may be created before performing prediction in skip mode.

[0490] 3-2) Searching for motion vectors using the merge candidate list

[0491] The encoding device 100 may determine a merge candidate to be used for encoding the target block. For example, the encoding device 100 may perform prediction on the target block using the merge candidate in the merge candidate list. The encoding device 100 may encode the target block using the merge candidate that generates the minimum cost in prediction.

[0492] Also, the encoding apparatus 100 may determine whether to encode the target block using the skip mode.

[0493] 3-3) Transmission of inter-frame prediction information

[0494] The encoding apparatus 100 may generate a bitstream including inter prediction information required for inter prediction, and the decoding apparatus 200 may perform inter prediction on a target block using the inter prediction information of the bitstream.

[0495] The inter prediction information may include 1) mode information indicating whether the skip mode is used and 2) a skip index.

[0496] The skip index may be the same as the merge index described above.

[0497] When skip mode is used, the target block may be encoded without using a residual signal. The inter prediction information may not include a residual signal. Alternatively, the bitstream may not include a residual signal.

[0498] The decoding device 200 may obtain the skip index from the bitstream only when the mode information indicates that the skip mode is used. As described above, the merge index and the skip index may be the same as each other. The decoding device 200 may obtain the skip index from the bitstream only when the mode information indicates that the merge mode or the skip mode is used.

[0499] The skip index may indicate a merge candidate to be used for prediction of a target block among merge candidates included in the merge candidate list.

[0500] 3-4) Inter-frame prediction in skip mode using inter-frame prediction information

[0501] The decoding apparatus 200 may perform prediction on the target block using the merge candidate indicated by the skip index among the merge candidates included in the merge candidate list.

[0502] The motion vector of the target block may be specified by the motion vector of the merge candidate indicated by the skip index, the reference picture index, and the reference direction.

[0503] 4) Current picture reference mode

[0504] The current picture reference mode may denote a prediction mode that uses a previously reconstructed area in a target picture to which the target block belongs.

[0505] A motion vector for specifying a previously reconstructed area may be used.A reference picture index of a target block may be used to determine whether the target block has been encoded in a current picture reference mode.

[0506] A flag or index indicating whether the target block is a block encoded in the current picture reference mode may be signaled by the encoding apparatus 100 to the decoding apparatus 200. Alternatively, whether the target block is a block encoded in the current picture reference mode may be inferred through the reference picture index of the target block.

[0507] When the target block is encoded in the current picture reference mode, the current picture may exist at a fixed position or an arbitrary position in the reference picture list for the target block.

[0508] For example, the fixed position may be a position where the reference picture index is 0 or a last position.

[0509] When a target picture exists at an arbitrary position in the reference picture list, an additional reference picture index indicating such an arbitrary position may be signaled by the encoding apparatus 100 to the decoding apparatus 200 .

[0510] In the AMVP mode, merge mode, and skip mode described above, an index of a list may be used to specify motion information to be used for prediction of a target block among a plurality of pieces of motion information in the list.

[0511] To improve encoding efficiency, the encoding apparatus 100 may signal only the index of the element generating the minimum cost in inter-frame prediction of the target block among the elements in the list. The encoding apparatus 100 may encode the index and signal the encoded index.

[0512] Therefore, the encoding device 100 and the decoding device 200 must be able to derive the above-described lists (i.e., the prediction motion vector candidate list and the merge candidate list) based on the same data using the same scheme. Here, the same data may include reconstructed pictures and reconstructed blocks. In addition, in order to specify an element using an index, the order of the elements in the list must be fixed.

[0513] Figure 10 Illustrated are spatial candidates according to an embodiment.

[0514] exist Figure 10 , the positions of the spatial candidates are shown.

[0515] The large block in the center of the figure may represent the target block, and the five small blocks may represent spatial candidates.

[0516] The coordinates of the target block may be (xP, yP), and the size of the target block may be represented by (nPSW, nPSH).

[0517] The spatial candidate A0 may be a block adjacent to the lower left corner of the target block. A0 may be a block occupying a pixel located at coordinates (xP-1, yP+nPSH+1).

[0518] The spatial coordinate A1 may be a block adjacent to the left side of the target block. A1 may be the lowest block among the blocks adjacent to the left side of the target block. Alternatively, A1 may be a block adjacent to the top of A0. A1 may be a block occupying a pixel located at coordinates (xP-1, yP+nPSH).

[0519] The spatial candidate B0 may be a block adjacent to the upper right corner of the target block. B0 may be a block occupying a pixel located at coordinates (xP+nPSW+1, yP-1).

[0520] Spatial candidate B1 may be a block adjacent to the top of the target block. B1 may be the rightmost block among the blocks adjacent to the top of the target block. Alternatively, B1 may be a block adjacent to the left of B0. B1 may be a block occupying a pixel located at coordinates (xP+nPSW, yP-1).

[0521] The spatial candidate B2 may be a block adjacent to the upper left corner of the target block. B2 may be a block occupying a pixel located at coordinates (xP-1, yP-1).

[0522] Determination of availability of spatial and temporal candidates

[0523] In order to include the motion information of the spatial candidate or the motion information of the temporal candidate in the list, it is necessary to determine whether the motion information of the spatial candidate or the motion information of the temporal candidate is available.

[0524] Hereinafter, candidate blocks may include spatial candidates and temporal candidates.

[0525] For example, the determination may be performed by sequentially applying the following steps 1) to 4) below.

[0526] Step 1) When the PU including the candidate block is located outside the boundary of the picture, the availability of the candidate block may be set to “false.” The expression “availability is set to false” may have the same meaning as “set to unavailable.”

[0527] Step 2) When the PU including the candidate block is located outside the boundary of the slice, the availability of the candidate block may be set to “false.” When the target block and the candidate block are located in different slices, the availability of the candidate block may be set to “false.”

[0528] Step 3) When the PU including the candidate block is located outside the boundary of the tile, the availability of the candidate block may be set to “false.” When the target block and the candidate block are located in different tiles, the availability of the candidate block may be set to “false.”

[0529] Step 4) When the prediction mode of the PU including the candidate block is intra prediction mode, the availability of the candidate block may be set to “false.” When the PU including the candidate block does not use inter prediction, the availability of the candidate block may be set to “false.”

[0530] Figure 11 An order in which motion information of spatial candidates is added to a merge list according to an embodiment is shown.

[0531] like Figure 11 As shown in , when multiple pieces of motion information of spatial candidates are added to the merge list, the order of A1, B1, B0, A0, and B2 may be used. That is, multiple pieces of motion information of available spatial candidates may be added to the merge list in the order of A1, B1, B0, A0, and B2.

[0532] Methods for deriving merge lists in merge mode and skip mode

[0533] As described above, the maximum number of merge candidates in a merge list can be set. The set maximum number can be indicated by "N". The set number can be transmitted from the encoding device 100 to the decoding device 200. The slice header of the slice may include N. In other words, the maximum number of merge candidates in the merge list for the target block of the slice can be set by the slice header. For example, the value of N can basically be 5.

[0534] A plurality of pieces of motion information (ie, merge candidates) may be added to the merge list in the order of the following steps 1) to 4).

[0535] Step 1) Among the space candidates, available space candidates can be added to the merge list. Figure 10 The plurality of pieces of motion information of the available spatial candidates are added to the merge list in the order shown in FIG. Here, when the motion information of the available spatial candidate overlaps with other motion information already in the merge list, the motion information of the available spatial candidate may not be added to the merge list. The operation of checking whether the corresponding motion information overlaps with other motion information in the list may be simply referred to as "overlap check."

[0536] The maximum number of pieces of motion information added may be N.

[0537] Step 2) When the number of motion information in the merge list is less than N and the temporal candidate is available, the motion information of the temporal candidate may be added to the merge list. Here, when the motion information of the available temporal candidate overlaps with other motion information already in the merge list, the motion information of the temporal candidate may not be added to the merge list.

[0538] Step 3) When the number of pieces of motion information in the merge list is less than N and the type of the target slice is 'B', combined motion information generated by combined bidirectional prediction (bi-prediction) may be added to the merge list.

[0539] The target slice may be a slice including the target block.

[0540] The combined motion information may be a combination of L0 motion information and L1 motion information. The L0 motion information may be motion information referring only to the reference picture list L0. The L1 motion information may be motion information referring only to the reference picture list L1.

[0541] In the merge list, there may be one or more pieces of L0 motion information. In addition, in the merge list, there may be one or more pieces of L1 motion information.

[0542] The combined motion information may include one or more pieces of combined motion information. When generating the combined motion information, the L0 motion information and the L1 motion information to be used in the step of generating the combined motion information may be predefined among the one or more pieces of L0 motion information and the one or more pieces of L1 motion information. The one or more pieces of combined motion information may be generated in a predefined order through bidirectional prediction using a combination of a pair of different motion information in a merge list. One piece of the pair of different motion information may be L0 motion information, and the other piece of the pair of different motion information may be L1 motion information.

[0543] For example, the combined motion information added with the highest priority may be a combination of L0 motion information with a merge index of 0 and L1 motion information with a merge index of 1. When the motion information with a merge index of 0 is not L0 motion information or when the motion information with a merge index of 1 is not L1 motion information, the combined motion information may be neither generated nor added. Next, the combined motion information added with the next highest priority may be a combination of L0 motion information with a merge index of 1 and L1 motion information with a merge index of 0. The subsequent detailed combinations may conform to other combinations in the field of video encoding / decoding.

[0544] Here, when the combined motion information overlaps with other motion information already present in the merge list, the combined motion information may not be added to the merge list.

[0545] Step 4) When the number of pieces of motion information in the merge list is less than N, motion information of a zero vector may be added to the merge list.

[0546] The zero-vector motion information may be motion information in which a motion vector is a zero vector.

[0547] The number of pieces of zero-vector motion information may be one or more. The reference picture indexes of one or more pieces of zero-vector motion information may be different from each other. For example, the reference picture index value of the first zero-vector motion information may be 0. The reference picture index value of the second zero-vector motion information may be 1.

[0548] The number of pieces of zero-vector motion information may be the same as the number of reference pictures in the reference picture list.

[0549] The reference direction of the zero-vector motion information may be bidirectional. Both motion vectors may be zero vectors. The number of pieces of zero-vector motion information may be the smaller of the number of reference pictures in reference picture list L0 and the number of reference pictures in reference picture list L1. Alternatively, when the number of reference pictures in reference picture list L0 and the number of reference pictures in reference picture list L1 are different, a unidirectional reference direction may be used for a reference picture index applicable only to a single reference picture list.

[0550] The encoding apparatus 100 and / or the decoding apparatus 200 may then add zero-vector motion information to the merge list while changing the reference picture index.

[0551] When the zero-vector motion information overlaps with other motion information already in the merge list, the zero-vector motion information may not be added to the merge list.

[0552] The order of steps 1) to 4) is merely exemplary and may be changed. In addition, some of the steps above may be omitted according to predefined conditions.

[0553] Method for deriving a candidate list of motion vector prediction in AMVP mode

[0554] The maximum number of motion vector predictor candidates in the motion vector predictor candidate list may be predefined. The predefined maximum number may be indicated by N. For example, the predefined maximum number may be 2.

[0555] A plurality of pieces of motion information (ie, prediction motion vector candidates) may be added to the prediction motion vector candidate list in the order of steps 1) to 3) below.

[0556] Step 1) Available spatial candidates among the spatial candidates may be added to the motion vector prediction candidate list.The spatial candidates may include a first spatial candidate and a second spatial candidate.

[0557] The first spatial candidate may be one of A0, A1, scaled A0, and scaled A1. The second spatial candidate may be one of B0, B1, B2, scaled B0, scaled B1, and scaled B2.

[0558] Multiple pieces of motion information of available spatial candidates may be added to the motion vector prediction candidate list in the order of the first spatial candidate and the second spatial candidate. In this case, if the motion information of an available spatial candidate overlaps with other motion information already in the motion vector prediction candidate list, the motion information of the available spatial candidate may not be added to the motion vector prediction candidate list. In other words, when the value of N is 2, if the motion information of the second spatial candidate is the same as the motion information of the first spatial candidate, the motion information of the second spatial candidate may not be added to the motion vector prediction candidate list.

[0559] The maximum number of pieces of motion information added may be N.

[0560] Step 2) When the number of pieces of motion information in the motion vector predictor candidate list is less than N and a temporal candidate is available, the motion information of the temporal candidate may be added to the motion vector predictor candidate list. In this case, if the motion information of the available temporal candidate overlaps with other motion information already in the motion vector predictor candidate list, the motion information of the available temporal candidate may not be added to the motion vector predictor candidate list.

[0561] Step 3) When the number of pieces of motion information in the motion vector predictor candidate list is less than N, zero vector motion information may be added to the motion vector predictor candidate list.

[0562] The zero-vector motion information may include one or more pieces of zero-vector motion information. Reference picture indices of the one or more pieces of zero-vector motion information may be different from each other.

[0563] The encoding apparatus 100 and / or the decoding apparatus 200 may sequentially add a plurality of pieces of zero-vector motion information to the prediction motion vector candidate list while changing the reference picture index.

[0564] When the zero-vector motion information overlaps with other motion information already existing in the motion vector predictor candidate list, the zero-vector motion information may not be added to the motion vector predictor candidate list.

[0565] The above description of the zero vector motion information in conjunction with the merge list is also applicable to the zero vector motion information, and its repeated description will be omitted.

[0566] The order of steps 1) to 3) described above is merely exemplary and may be changed. In addition, some of the steps may be omitted according to predefined conditions.

[0567] Figure 12 Transformation and quantization processes according to examples are shown.

[0568] like Figure 12 As shown in , the quantized levels may be generated by performing a transform and / or quantization process on the residual signal.

[0569] The residual signal may be generated as a difference between the original block and the predicted block.Here, the predicted block may be a block generated via intra prediction or inter prediction.

[0570] The residual signal may be transformed into a signal in the frequency domain through a transform process as part of the quantization process.

[0571] The transform kernel used for the transform may include various DCT kernels such as discrete cosine transform (DCT) type 2 (DCT-II) and discrete sine transform (DST) kernel.

[0572] These transform kernels may perform separable transform or two-dimensional (2D) non-separable transform on the residual signal.The separable transform may be a transform indicating that a one-dimensional (1D) transform is performed on the residual signal in each of horizontal and vertical directions.

[0573] The DCT type and DST type adaptively used for 1D transform may include DCT-V, DCT-VIII, DST-I, and DST-VII in addition to DCT-II, as shown in Table 3 below.

[0574] Table 3

[0575] Transformation Set Transformation Candidates 0 DST-VII, DCT-VIII 1 DST-VII, DST-I 2 DST-VII, DCT-V

[0576] As shown in Table 3, when the DCT type or DST type to be used for transformation is derived, a transform set can be used. Each transform set may include multiple transform candidates. Each transform candidate may be a DCT type or a DST type.

[0577] Table 4 below shows an example of a transform set applied to a horizontal direction according to an intra prediction mode.

[0578] Table 4

[0579]

[0580]

[0581] In Table 4, the number of each transform set in the horizontal direction to be applied to the residual signal is indicated according to the intra prediction mode of the target block.

[0582] Table 5 below shows an example of a transform set applied to a vertical direction of a residual signal according to an intra prediction mode.

[0583] Table 5

[0584]

[0585]

[0586] As illustrated in Tables 4 and 5, the transform sets to be applied in the horizontal and vertical directions may be predefined according to the intra prediction mode of the target block. The encoding apparatus 100 may perform transform and inverse transform on the residual signal using the transform included in the transform set corresponding to the intra prediction mode of the target block. In addition, the decoding apparatus 200 may perform inverse transform on the residual signal using the transform included in the transform set corresponding to the intra prediction mode of the target block.

[0587] In the transformation and inverse transformation, the transform set to be applied to the residual signal may be determined and may not be signaled as illustrated in Tables 3, 4, and 5. Transform indication information may be signaled from the encoding apparatus 100 to the decoding apparatus 200. The transform indication information may be information indicating which one of a plurality of transform candidates to be applied to the residual signal included in the transform set is to be used.

[0588] As described above, methods using various transforms may be applied to a residual signal generated via intra prediction or inter prediction.

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

[0590] The first transform may be referred to as a “main transform.” Furthermore, the first transform may also be referred to as an “adaptive multi-transform (AMT) scheme.” As described above, AMT may indicate that different transforms are applied to each 1D direction (ie, vertical and horizontal directions).

[0591] The secondary transform may be a transform for improving the energy concentration of the transform coefficients generated by the primary transform. Similar to the primary transform, the secondary transform may be a separable transform or a non-separable transform. Such a non-separable transform may be a non-separable secondary transform (NSST).

[0592] The first transform may be performed using at least one of a plurality of predefined transform methods, such as discrete cosine transform (DCT), discrete sine transform (DST), Karhunen-Loeve transform (KLT), and the like.

[0593] A secondary transform may be performed on transform coefficients generated by performing the first transform.

[0594] The primary transform and the secondary transform may be applied to signal components corresponding to one or more of a luma component and a chroma component. Whether to apply the primary transform and / or the secondary transform may be determined based on at least one of the coding parameters for the target block and / or the neighboring blocks. For example, whether to apply the primary transform and / or the secondary transform may be determined based on the size and / or shape of the target block.

[0595] The transform method to be applied to the first transform and / or the second transform may be determined based on at least one of the encoding parameters for the target block and / or the neighboring blocks. The determined transform method may also indicate that the first transform and / or the second transform is not used.

[0596] Alternatively, transform information indicating a transform method may be signaled from the encoding apparatus 100 to the decoding apparatus 200. For example, the transform information may include an index of a transform to be used for a primary transform and / or a secondary transform.

[0597] The quantization level may be generated by performing quantization on a result generated by performing the first transform and / or the second transform or performing quantization on a residual signal.

[0598] Figure 13 A diagonal scan according to an example is shown.

[0599] Figure 14 A horizontal scan according to an example is shown.

[0600] Figure 15 A vertical scan according to an example is shown.

[0601] The quantized transform coefficients may be scanned via at least one of (upper right) diagonal scanning, vertical scanning, and horizontal scanning according to at least one of an intra prediction mode, a block size, and a block shape. The block may be a transform unit (TU)

[0602] Each scan may be initiated at a specific start point and may be terminated at a specific end point.

[0603] For example, by using Figure 13 The coefficients of the block are scanned by diagonal scanning to change the quantized transform coefficients into 1D vector form. Optionally, the quantized transform coefficients can be used according to the size of the block and / or the intra prediction mode. Figure 14 Horizontal scan or Figure 15 vertical scanning instead of diagonal scanning.

[0604] Vertical scanning may be an operation of scanning 2D block type coefficients in a column direction, and horizontal scanning may be an operation of scanning 2D block type coefficients in a row direction.

[0605] In other words, which of diagonal scanning, vertical scanning, and horizontal scanning is to be used may be determined according to the size of a block and / or an inter prediction mode.

[0606] like Figure 13 、 Figure 14 and Figure 15 As shown in , the quantized transform coefficients may be scanned along a diagonal direction, a horizontal direction, or a vertical direction.

[0607] The quantized transform coefficients can be represented by a block shape. Each block can include multiple sub-blocks. Each sub-block can be defined according to a minimum block size or a minimum block shape.

[0608] In the scanning, a scanning order according to a type or direction of scanning may be first applied to a subblock. In addition, a scanning order according to a direction of scanning may be applied to quantized transform coefficients in each subblock.

[0609] For example, Figure 13 、 Figure 14 and Figure 15 As shown in , when the size of the target block is 8×8, quantized transform coefficients can be generated by performing a primary transform, a secondary transform, and quantization on the residual signal of the target block. Therefore, one of three types of scanning orders can be applied to the four 4×4 sub-blocks, and the quantized transform coefficients can also be scanned for each 4×4 sub-block according to the scanning order.

[0610] The scanned quantized transform coefficients may be entropy encoded, and the bitstream may include the entropy encoded quantized transform coefficients.

[0611] The decoding apparatus 200 may generate quantized transform coefficients by entropy decoding a bitstream. The quantized transform coefficients may be arranged in the form of 2D blocks by inverse scanning. Here, as the inverse scanning method, at least one of upper right diagonal scanning, vertical scanning, and horizontal scanning may be performed.

[0612] Inverse quantization may be performed on the quantized transform coefficients. Depending on whether the secondary inverse transform is to be performed, a secondary inverse transform may be performed on the result generated by performing the inverse quantization. Furthermore, depending on whether the primary inverse transform is to be performed, a primary inverse transform may be performed on the result generated by performing the secondary inverse transform. A reconstructed residual signal may be generated by performing the primary inverse transform on the result generated by performing the secondary inverse transform.

[0613] Figure 16 is a configuration diagram of an encoding device according to an embodiment.

[0614] The encoding apparatus 1600 may correspond to the encoding apparatus 100 described above.

[0615] The encoding apparatus 1600 may include a processing unit 1610, a memory 1630, a user interface (UI) input device 1650, a UI output device 1660, and a storage 1640 communicating with each other through a bus 1690. The electronic device 1600 may further include a communication unit 1620 connected to a network 1699.

[0616] The processing unit 1610 may be a central processing unit (CPU) or a semiconductor device for executing processing instructions stored in the memory 1630 or the storage 1640. The processing unit 1610 may be at least one hardware processor.

[0617] The processing unit 1610 may generate and process signals, data, or information input to, output from, or used in the encoding device 1600, and may perform checks, comparisons, determinations, etc. related to the signals, data, or information. In other words, in embodiments, the generation and processing of data or information, as well as checks, comparisons, and determinations related to the data or information, may be performed by the processing unit 1610.

[0618] The processing unit 1610 may include an inter-frame prediction unit 110, an intra-frame prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180 and a reference picture buffer 190.

[0619] At least some of the inter-frame prediction unit 110, the intra-frame prediction unit 120, the switch 115, the subtractor 125, the transform unit 130, the quantization unit 140, the entropy encoding unit 150, the inverse quantization unit 160, the inverse transform unit 170, the adder 175, the filter unit 180, and the reference picture buffer 190 may be program modules and may communicate with an external device or system. The program modules may be included in the encoding apparatus 1600 in the form of an operating system, an application module, or other program modules.

[0620] The program modules may be physically stored in various types of well-known storage devices. In addition, at least some of the program modules may also be stored in a remote storage device that can communicate with the encoding device 1200.

[0621] Program modules may include, but are not limited to, routines, subroutines, programs, objects, components, and data structures for performing functions or operations according to embodiments or for implementing abstract data types according to embodiments.

[0622] The program modules may be implemented using instructions or codes executed by at least one processor of the encoding device 1600 .

[0623] The processing unit 1610 can execute instructions or codes in the inter-frame prediction unit 110, the intra-frame prediction unit 120, the switch 115, the subtractor 125, the transform unit 130, the quantization unit 140, the entropy coding unit 150, the inverse quantization unit 160, the inverse transform unit 170, the adder 175, the filter unit 180 and the reference picture buffer 190.

[0624] The storage unit may represent the memory 1630 and / or the storage 1640. Each of the memory 1630 and the storage 1640 may be any of various types of volatile or non-volatile storage media. For example, the memory 1630 may include at least one of a read-only memory (ROM) 1631 and a random access memory (RAM) 1632.

[0625] The storage unit may store data or information used for the operation of the encoding apparatus 1600. In an embodiment, data or information of the encoding apparatus 1600 may be stored in the storage unit.

[0626] For example, the storage unit may store pictures, blocks, lists, motion information, inter-frame prediction information, bitstreams, and the like.

[0627] The encoding device 1600 may be implemented in a computer system including a computer-readable storage medium.

[0628] The storage medium may store at least one module required for the operation of the encoding apparatus 1600. The memory 1630 may store at least one module and may be configured such that the at least one module is executed by the processing unit 1610.

[0629] Functions related to communication of data or information of the encoding apparatus 1600 may be performed through the communication unit 1620 .

[0630] For example, the communication unit 1620 may transmit the bitstream to the decoding apparatus 1600 which will be described later.

[0631] Figure 17 is a configuration diagram of a decoding device according to an embodiment.

[0632] The decoding apparatus 1700 may correspond to the decoding apparatus 200 described above.

[0633] The decoding apparatus 1700 may include a processing unit 1710, a memory 1730, a user interface (UI) input device 1750, a UI output device 1760, and a storage 1740 communicating with each other through a bus 1790. The decoding apparatus 1700 may also include a communication unit 1720 connected to a network 1799.

[0634] The processing unit 1710 may be a central processing unit (CPU) or a semiconductor device for executing processing instructions stored in the memory 1730 or the storage 1740. The processing unit 1710 may be at least one hardware processor.

[0635] The processing unit 1710 may generate and process signals, data, or information input to, output from, or used in the decoding device 1700, and may perform checks, comparisons, determinations, etc. related to the signals, data, or information. In other words, in embodiments, the generation and processing of data or information, as well as checks, comparisons, and determinations related to the data or information, may be performed by the processing unit 1710.

[0636] The processing unit 1710 may include an entropy decoding unit 210 , an inverse quantization unit 220 , an inverse transform unit 230 , an intra prediction unit 240 , an inter prediction unit 250 , a switch 245 , an adder 255 , a filter unit 260 , and a reference picture buffer 270 .

[0637] At least some of the entropy decoding unit 210, the inverse quantization unit 220, the inverse transform unit 230, the intra-frame prediction unit 240, the inter-frame prediction unit 250, the adder 255, the switch 245, the filter unit 260, and the reference picture buffer 270 of the decoding device 200 may be program modules and may communicate with an external device or system. The program modules may be included in the decoding device 1700 in the form of an operating system, an application module, or other program modules.

[0638] The program modules may be physically stored in various types of well-known storage devices. In addition, at least some of the program modules may also be stored in a remote storage device that can communicate with the decoding device 1700.

[0639] Program modules may include, but are not limited to, routines, subroutines, programs, objects, components, and data structures for performing functions or operations according to embodiments or for implementing abstract data types according to embodiments.

[0640] The program modules may be implemented using instructions or codes executed by at least one processor of the decoding device 1700 .

[0641] The processing unit 1710 can execute instructions or codes in the entropy decoding unit 210, the inverse quantization unit 220, the inverse transform unit 230, the intra-frame prediction unit 240, the inter-frame prediction unit 250, the switch 245, the adder 255, the filter unit 260 and the reference picture buffer 270.

[0642] The storage unit may represent the memory 1730 and / or the storage 1740. Each of the memory 1730 and the storage 1740 may be any of various types of volatile or non-volatile storage media. For example, the memory 1730 may include at least one of the ROM 1731 and the RAM 1732.

[0643] The storage unit may store data or information used for the operation of the decoding apparatus 1700. In an embodiment, data or information of the decoding apparatus 1700 may be stored in the storage unit.

[0644] For example, the storage unit may store pictures, blocks, lists, motion information, inter-frame prediction information, bitstreams, and the like.

[0645] The decoding device 1700 may be implemented in a computer system including a computer-readable storage medium.

[0646] The storage medium may store at least one module required for the operation of the decoding apparatus 1700. The memory 1730 may store at least one module and may be configured such that the at least one module is executed by the processing unit 1710.

[0647] Functions related to communication of data or information of the decoding apparatus 1700 may be performed through the communication unit 1720 .

[0648] For example, the communication unit 1720 may receive a bitstream from the encoding apparatus 1600 .

[0649] Method and apparatus for bidirectional intra prediction

[0650] Figure 18 is a flowchart of a bidirectional intra prediction method according to an embodiment.

[0651] The bidirectional intra prediction method may be performed by the encoding apparatus 1600 and / or the decoding apparatus 1700 .

[0652] For example, the encoding device 1600 may perform a prediction method according to an embodiment to compare the efficiencies of multiple prediction methods for a target block and / or multiple partitioned blocks, and may also perform a prediction method according to an embodiment to generate a reconstructed block for the target block.

[0653] In an embodiment, the target block may be a PU, or may be at least one of a CTB, a CU, a PU, a TU, a sub-block, a block with a specific size, and a block with a size within a predefined range. Alternatively, the target block may be a coding unit.

[0654] For example, the decoding apparatus 1700 may perform the prediction method according to the embodiment in order to generate a reconstructed block for the target block.

[0655] Hereinafter, the term “processing unit” may correspond to the processing unit 1610 of the encoding device 1600 and / or the processing unit 1710 of the decoding device 1700 .

[0656] At step 1810 , the processing unit may determine a bidirectional intra prediction mode to be applied to encoding and / or decoding of a target block.

[0657] The processing unit may determine and derive a bidirectional intra prediction mode based on at least one of: 1) an intra prediction mode indicator, 2) a unidirectional / bidirectional classification indicator, 3) a most probable mode (MPM), 4) the availability of pixels in neighboring blocks located in a specified direction of the target block, and 5) a prediction mode of the neighboring blocks.

[0658] In step 1820 , the processing unit may determine a prediction value of a prediction block for the target block by performing bidirectional intra prediction on the target block using the determined bidirectional intra prediction mode.

[0659] In an embodiment, the two directions of the bidirectional intra prediction may be two linear directions implemented in opposite directions, for example, the two directions may be a direction at an angle of 45° and a direction at an angle of 225°.

[0660] In an embodiment, the two directions of the bidirectional intra prediction may be two different directions that are not collinearly oriented, for example, the two directions may be a direction at an angle of 45° and a direction at an angle of 90°.

[0661] The processing unit may generate at least one virtual neighboring pixel in a specified direction of the target block and may perform bidirectional intra prediction for the target block using the at least one virtual neighboring pixel. The processing unit may derive a predicted value of the target pixel in the prediction block based on the at least one virtual neighboring pixel. The specified direction may include one or more of a right direction and a downward direction.

[0662] The target pixel may be a pixel that is a target of encoding and / or decoding.

[0663] The processing unit may derive a prediction value for a target pixel in a target block using at least one of: 1) pixels in neighboring blocks located in both directions of bidirectional intra prediction, 2) weights based on distances between the target pixel and each pixel in the neighboring blocks located in both directions, and 3) weights for both directions.

[0664] The predicted value of the target pixel in the target block may be the value of the pixel in the prediction block.

[0665] The processing unit may perform encoding and / or decoding in intra prediction using the derived prediction value.

[0666] In step 1810, the processing unit may derive a bidirectional intra-frame prediction mode based on at least one of the coding parameters related to the target block, information of the target picture, information of the target slice, a quantization parameter, a coding block flag (CBF), the size of the target block, the form of the target block, the entropy coding method applied to the target block, the intra-frame prediction mode of the neighboring blocks of the target block, and the temporal layer level of the target block.

[0667] Optionally, in step 1820, the processing unit may derive a predicted value of a target pixel in the target block based on at least one of coding parameters related to the target block, information of the target picture, information of the target slice, a quantization parameter, a coding block flag (CBF), the size of the target block, the form of the target block, an entropy coding method applied to the target block, an intra-frame prediction mode of a neighboring block of the target block, and a temporal layer level of the target block.

[0668] Determination of bidirectional intra prediction mode

[0669] Hereinafter, the bidirectional intra prediction mode may indicate a direction of bidirectional intra prediction.The terms “bidirectional intra prediction mode” and “direction of bidirectional intra prediction” may be used to have the same meaning and may be used interchangeably with each other.

[0670] Figure 19A unidirectional intra prediction mode according to an example is shown.

[0671] Figure 20 A bidirectional intra prediction mode according to an example is shown.

[0672] Figure 21 A bidirectional intra prediction mode using virtual neighboring pixels according to an example is shown.

[0673] The processing unit may determine and derive a bidirectional intra prediction mode based on at least one of: 1) an intra prediction mode indicator, 2) a unidirectional / bidirectional classification indicator, 3) an MPM, 4) the availability of pixels in neighboring blocks located in a specified direction of the target block, and 5) a prediction mode of the neighboring blocks.

[0674] like Figure 19 As shown in , the unidirectional intra prediction mode may be an intra prediction mode that refers to pixels located in a single specified direction.

[0675] like Figure 20 As shown in , the bidirectional intra prediction mode may be an intra prediction mode that refers to pixels located in two designated directions.

[0676] Here, the pixels to be referenced may be pixels adjacent to the target block.The pixels to be referenced for intra prediction may also be referred to as "samples."

[0677] Here, the term “pixels located in two designated directions” may mean “pixels located in a first designated direction and pixels located in a second designated direction”.

[0678] like Figure 21 As shown in , in the bidirectional intra prediction mode, pixels in the reconstructed neighboring blocks may be used to generate at least one virtual neighboring pixel located to the right of the target block or below the target block. In other words, the at least one virtual neighboring pixel may be located to the right of the target block or below the target block. The bidirectional intra prediction mode may be an intra prediction mode that uses pixels in the reconstructed neighboring blocks and virtual neighboring pixels as references to pixels located in two specified directions.

[0679] Here, the virtual neighboring pixel located on the right side of the target block may be adjacent to the target block and on the right side of the target block.Here, the virtual neighboring pixel located below the target block may be adjacent to the target block and below the target block.

[0680] The processing unit may determine whether a bidirectional intra prediction mode is to be used for the target block based on at least one of the unidirectional / bidirectional classification indicator and the intra prediction mode indicator, and may derive the bidirectional intra prediction mode.

[0681] The unidirectional / bidirectional classification indicator may indicate whether a bidirectional intra prediction mode is to be used for a target block. The unidirectional / bidirectional classification indicator may have any one of a first value and a second value. The first value may indicate that unidirectional intra prediction is to be used. For example, the first value may be "0." The second value may indicate that bidirectional intra prediction is to be used. For example, the second value may be "1."

[0682] The unidirectional / bidirectional classification indicator can be signaled at the level of a specific unit of coding and / or decoding (such as a video, sequence, picture, slice, tile, CTU, CU, target block, subblock of a target block, and block of a specific size). In other words, a specific unit of coding and / or decoding may include a unidirectional / bidirectional classification indicator indicating whether a bidirectional intra prediction mode will be used for a target in the unit.

[0683] The bidirectional intra prediction mode may indicate two directions for bidirectional intra prediction. The two directions may be indicated using the schemes given below in 1) to 4).

[0684] 1) The number of intra prediction mode indicators may be two, and two directions of bidirectional intra prediction may be indicated by two intra prediction mode indicators, respectively.

[0685] Each of the two intra prediction mode indicators may indicate a direction of a unidirectional intra prediction mode. The two directions of bidirectional intra prediction may be determined by the two directions indicated by the two intra prediction mode indicators.

[0686] In this case, one intra prediction mode indicator may indicate one direction for the intra prediction mode, rather than distinguishing between a unidirectional prediction mode and a bidirectional prediction mode. Here, the direction may correspond to an angle such as 45°, 80°, or 135°.

[0687] 2) One intra prediction mode indicator may indicate either the direction of unidirectional intra prediction or the direction of bidirectional intra prediction.

[0688] For example, a value of '3' of the intra prediction mode indicator may indicate unidirectional intra prediction of 45°, and a value of '70' of the intra prediction mode indicator may indicate bidirectional intra prediction of 45° and 225°.

[0689] 3) To indicate the direction of intra prediction, the unidirectional / bidirectional classification indicator and the intra prediction mode indicator may be used together.

[0690] The unidirectional / bidirectional classification indicator may indicate which of unidirectional intra prediction and bidirectional intra prediction is to be used, and the intra prediction mode indicator may indicate the direction of prediction.

[0691] For example, when the value of the unidirectional / bidirectional classification indicator is the second value and the value of the intra prediction mode indicator is 7, bidirectional intra prediction of 45° and 225° may be used, where 225° is a direction opposite to 45°.

[0692] For example, when the value of the unidirectional / bidirectional classification indicator is the first value and the value of the intra prediction mode indicator is 7, 45° unidirectional intra prediction may be used.

[0693] 4) When one intra prediction mode indicator indicates a specific direction of unidirectional intra prediction, bidirectional intra prediction can be performed.

[0694] For example, when the intra prediction mode indicator indicates unidirectional prediction of 45°, bidirectional intra prediction of 45° and 225° may be performed, where 225° is a direction opposite to 45°.

[0695] Figure 22 Derivation and selection of bi-directional intra prediction from the direction of an intra prediction mode indicator according to an example is shown.

[0696] The processing unit may adaptively determine and derive a bi-directional intra prediction mode based on 1) the intra prediction mode indicator and 2) the availability of pixels in neighboring blocks of the target block.

[0697] like Figure 22 As shown in , the intra prediction mode indicator may indicate one direction of the intra prediction mode, and an additional direction corresponding to the direction of the intra prediction mode may be determined. Here, the additional direction may be a direction for bidirectional intra prediction determined according to the direction of the intra prediction mode.

[0698] The additional direction may be a direction opposite to the direction of intra prediction.

[0699] Any one of unidirectional intra prediction and bidirectional intra prediction may be selected and derived according to availability of reference pixels in a direction corresponding to a direction indicated by the intra prediction mode indicator.

[0700] For example, any one of unidirectional intra prediction and bidirectional intra prediction may be selected and derived according to availability of reference pixels in a direction opposite to the direction indicated by the intra prediction mode indicator.

[0701] Here, when reference pixels in the corresponding direction are available, bidirectional intra prediction may be selected, and when reference pixels in the corresponding direction are not available, unidirectional intra prediction may be selected.

[0702] Hereinafter, the term “a (reference) pixel in a specified direction” may mean a “a (reference) pixel located in a specified direction”.

[0703] Here, the fact that the reference pixel is available may mean that the value of the reference pixel has been determined. Alternatively, the fact that the reference pixel is available may mean that reconstruction of the reference pixel has been performed before intra prediction of the target block is performed. The fact that the reference pixel is unavailable may mean that the value of the reference pixel has not yet been determined. Alternatively, the fact that the reference pixel is unavailable may mean that reconstruction of the reference pixel has not yet been performed before intra prediction of the target block is performed, and therefore the value of the reference pixel has not yet been determined.

[0704] For example, when the intra-frame prediction mode indicator indicates the upper right direction (e.g., a 45° angle) and pixels in the neighboring block in the lower left direction (e.g., a 225° angle) which is the direction opposite to the upper right direction are available, the processing unit may determine that the intra-frame prediction to be used for the target block is bidirectional intra-frame prediction in two directions (i.e., the upper right direction and the lower left direction).

[0705] For example, when the intra-frame prediction mode indicator indicates the upper right direction (e.g., a 45° angle) and pixels in the neighboring block in the lower left direction (e.g., a direction at an angle of 225 degrees), which is the direction opposite to the upper right direction, are not available, the processing unit may determine that the intra-frame prediction to be used for the target block is a unidirectional intra-frame prediction in the upper right direction.

[0706] The unit for determining and deriving the intra prediction mode may be a target block. The intra prediction mode selection may determine which of unidirectional intra prediction and bidirectional intra prediction is to be used. That is, it may be adaptively determined which of unidirectional intra prediction and bidirectional intra prediction is to be used for the entire target block.

[0707] Hereinafter, the intra prediction direction indicated by the intra prediction mode indicator may be designated as a 'first direction', and the second direction may designate a direction corresponding to the first direction or a direction opposite to the first direction.

[0708] For example, for all pixels in the target block, when all reference pixels in the first direction and all reference pixels in the second direction are available, bidirectional intra prediction in the first and second directions may be used. For all pixels in the target block, when at least one unavailable reference pixel exists among all reference pixels in the second direction, unidirectional intra prediction in the first direction may be used.

[0709] The unit for determining and deriving the intra prediction mode may be each pixel in the target block. That is, it may be adaptively determined which of unidirectional intra prediction and bidirectional intra prediction is to be used for each pixel in the target block.

[0710] For example, for a specific pixel in the target block, when reference pixels in the first direction and reference pixels in the second direction are available, bidirectional intra prediction in the first direction and the second direction may be used. For a specific pixel in the target block, when reference pixels in the second direction are not available, unidirectional intra prediction in the first direction may be used.

[0711] When a reference pixel in the first direction or a reference pixel in the second direction is unavailable, the processing unit may use padding to generate a value for the unavailable reference pixel. Here, the value used to pad the unavailable reference pixel may be the value of the available reference pixel closest to the unavailable reference pixel. When there are multiple reference pixels closest to the unavailable reference pixel, the value used to pad the unavailable reference pixel may be an average of the values ​​of the multiple closest available reference pixels.

[0712] With the help of padding, unavailable reference pixels may be made available, and unidirectional intra prediction or bidirectional intra prediction using the available reference pixels may be performed.

[0713] The second direction may be a collinear direction opposite to the first direction indicated by the intra-frame prediction mode indicator. In other words, the second direction may be a direction generated by adding 180° to the first direction. Alternatively, the second direction may be a direction obtained by adding a predefined angle (α) to the first direction indicated by the intra-frame prediction mode indicator. The predefined angle (α) may be set to the same value in the encoding device 1600 and the decoding device 1700 and may be signaled from the encoding device 1600 to the decoding device 1700.

[0714] As described above, the intra prediction mode indicator in an embodiment may not distinguish the unidirectional mode from the bidirectional mode, and may indicate the direction of the intra prediction.

[0715] The processing unit may select a bidirectional intra prediction mode for a target block based on at least one of: 1) MPM, 2) unidirectional / bidirectional classification indicator, 3) intra prediction mode of neighboring blocks, and 4) availability of reference pixels in a specified direction.

[0716] The processing unit may use the intra prediction modes of neighboring blocks and the MPM to determine a bi-directional intra prediction mode for the target block.

[0717] The processing unit may use the intra prediction modes of neighboring blocks of the target block and the MPM to determine a bi-directional intra prediction mode for the target block.

[0718] For example, when bidirectional intra prediction has been used for at least one of the neighboring blocks and at least one of the MPMs of the target block matches the bidirectional intra prediction mode of the neighboring block, the processing unit may determine the bidirectional intra prediction mode using the matching MPM as the bidirectional intra prediction mode of the target block.

[0719] For example, the processing unit may use the MPMs of two directions among the N MPMs of the target block to determine the bidirectional intra prediction mode for the target block. N may be an integer of 2 or greater. For example, N may be 6.

[0720] The processing unit may determine a bi-directional intra prediction mode for the target block using the intra prediction modes of neighboring blocks of the target block, the MPM, and the uni-directional / bi-directional classification indicator.

[0721] For example, when the unidirectional / bidirectional classification indicator indicates that bidirectional intra prediction is used, the processing unit may use one of the MPMs of the target block to determine the bidirectional intra prediction mode for the target block. For example, the MPM to be used may be the first MPM in the MPM list.

[0722] The processing unit may select a bi-directional intra prediction mode for the target block based on the intra prediction mode of the neighboring blocks, the MPM, and the availability of reference pixels in a direction opposite to the intra prediction direction of the neighboring blocks.

[0723] For example, the processing unit may be configured to derive a direction of intra-frame prediction for the target block from any one of the MPMs of the target block, and may be configured to use the derived direction and the bidirectional intra-frame prediction mode in the corresponding direction for intra-frame prediction of the target block when reference pixels in the direction corresponding to the derived direction are available.

[0724] Intra prediction using bidirectional intra prediction mode

[0725] When the intra prediction mode of the target block is derived and selected as the bidirectional intra prediction mode, the processing unit may determine a prediction value for the target pixel by referring to at least one of pixels in neighboring blocks located in two prediction directions of the bidirectional intra prediction mode.

[0726] Here, the target pixel may be a pixel that is a target of prediction and may be a pixel in a target block or a pixel in a prediction block for the target block. In other words, a prediction value for the target block may be determined via bidirectional intra prediction according to a bidirectional intra prediction mode.

[0727] In such bidirectional intra prediction, the processing unit may obtain reference pixels in each prediction direction by filtering pixels in neighboring blocks located in each prediction direction of the bidirectional intra prediction. The processing unit may use at least one of the obtained reference pixels to derive a prediction value for the target pixel.

[0728] In other words, the reference pixel may be a pixel in a neighboring block and may be a pixel at a position specified by a specified prediction direction of a pixel in a target block. Alternatively, the reference pixel may be a value obtained by applying filtering to a pixel adjacent to a position specified by a specified prediction direction of a pixel in a target block.

[0729] The processing unit may determine a prediction value for a target pixel using at least one of reference pixels in two prediction directions of the bi-directional intra prediction mode.

[0730] When at least one of the reference pixels in the two prediction directions of the bidirectional intra prediction mode is used, a weight may be applied to each reference pixel. The weight may be predefined. Alternatively, the weight may be set by calculation.

[0731] For example, the weights may be set based on the distances between the target pixel and each reference pixel. The weights may be inversely proportional to the distances between the target pixel and each reference pixel. Alternatively, the weights may be directly proportional to the distances between the target pixel and each reference pixel. The ratio of the weights of the reference pixels may be the inverse of the ratio of the distances between each reference pixel and the target pixel.

[0732] The weight of the reference pixels may be different depending on the prediction direction.

[0733] The weight of each reference pixel may differ depending on whether the corresponding reference pixel is a reference pixel in the direction indicated by the intra-frame prediction mode indicator. For example, the weight of the direction indicated by the intra-frame prediction mode indicator may be α, and the weight of the direction corresponding to the indicated direction may be 1-α. α may be a real number greater than 0 and less than 1. For example, α may be 2 / 3.

[0734] Alternatively, the weight of each reference pixel may be set based on the distance between the target pixel and the corresponding reference pixel and based on whether the reference pixel is a reference pixel in a direction indicated by the intra prediction mode indicator.

[0735] The weight may be set by the encoding apparatus 1600 , and the set weight may be signaled from the encoding apparatus 1600 to the decoding apparatus 1700 through a bitstream.

[0736] When the weight of one of the two prediction directions of the bidirectional intra prediction mode is signaled, the weight of the other prediction direction may be set based on the signaled weight.

[0737] Each weight may be signaled at the level of a specific unit of coding and / or decoding (such as a video, sequence, picture, slice, tile, CTU, CU, target block, subblock of a target block, and block of a specific size). In other words, a specific unit of coding and / or decoding may include the weight to be used for the target in the corresponding unit or information to be used to derive the weight.

[0738] Bidirectional intra prediction using virtual pixels

[0739] Figure 23 The generation of virtual neighboring pixels according to an example is shown.

[0740] Since some of the pixels in both prediction directions of the bidirectional intra prediction mode are not reconstructed before the bidirectional intra prediction, they may not be used for the bidirectional intra prediction. The processing unit may generate virtual neighboring pixels corresponding to the unreconstructed pixels and may use the virtual neighboring pixels to perform the bidirectional intra prediction.

[0741] The neighboring pixels may be reconstructed pixels in the reconstructed neighboring blocks. Each virtual neighboring pixel may be a pixel generated using one or more reconstructed pixels. In other words, the value of the virtual neighboring pixel may be generated based on the values ​​of one or more reconstructed pixels.

[0742] For example, the virtual neighboring pixel may be a pixel adjacent to the target block and above or to the left of the target block.The virtual neighboring pixel may be a pixel adjacent to the target block and below or to the right of the target block.

[0743] The virtual neighboring pixels for the target block may be pixels in a virtual neighboring block for the target block. The virtual neighboring block may be an unreconstructed block adjacent to the target block. For example, the virtual neighboring block may be a block adjacent to the target block and below or to the right of the target block.

[0744] When the intra prediction mode of the target block is derived and determined to be a bidirectional intra prediction mode, the processing unit may determine a prediction value for the target pixel by referring to at least one of neighboring pixels and virtual neighboring pixels located in two prediction directions of the bidirectional intra prediction mode.

[0745] When performing prediction in this manner, the processing unit may obtain reference pixels in each prediction direction by filtering neighboring pixels in each prediction direction. Furthermore, the processing unit may obtain reference pixels in each prediction direction by filtering virtual neighboring pixels in each prediction direction. The processing unit may use at least one of the obtained reference pixels to derive a prediction value for the target pixel.

[0746] In other words, the reference pixel may be a neighboring pixel or a virtual neighboring pixel, and may be a pixel at a position specified by a specified prediction direction of the pixel in the target block. Alternatively, the reference pixel may be a value obtained by applying filtering to neighboring pixels and / or virtual neighboring pixels adjacent to the position specified by the specified prediction direction of the pixel in the target block.

[0747] The processing unit may determine a prediction value for a target pixel using at least one of reference pixels in two prediction directions of the bidirectional intra prediction mode. The reference pixels may include neighboring pixels and virtual neighboring pixels.

[0748] The aforementioned description of weights can also be applied to virtual neighboring pixels. When at least one of reference pixels in two prediction directions of a bidirectional intra prediction mode is used, weights can be applied to neighboring pixels and virtual neighboring pixels as reference pixels, respectively.

[0749] Next, an exemplary method for generating virtual neighboring pixels will be described.

[0750] The upper left coordinate of the target block may be (Cx, Cy). W may be the horizontal size of the target block. H may be the height or vertical size of the target block.

[0751] Hereinafter, “pixel (α, β)” may refer to a pixel having coordinates (α, β).

[0752] 1) The processing unit may generate virtual neighboring pixels based on pixels in the reconstructed neighboring block.

[0753] The virtual neighboring pixels may include a right virtual neighboring pixel adjacent to the target block and on the right side of the target block and a lower virtual neighboring pixel adjacent to the target block and below the target block.

[0754] The position of the right virtual neighboring pixel can be given by the following equation 2:

[0755] [Equation 2]

[0756] N(Cx+W,y), where (y∈{Cy,Cy+1,Cy+2,…,Cy+H})

[0757] The position of the next virtual neighboring pixel can be given by the following equation 3:

[0758] [Equation 3]

[0759] N(x,Cy+H), where (x∈{Cx,Cx+1,Cx+2,…,Cx+W})

[0760] 2) The processing unit may generate a virtual neighboring pixel (Cx+W, Cy) based on one or more reconstructed neighboring pixels among the reconstructed neighboring pixels adjacent to and above the target block.

[0761] For example, in Figure 23 In the embodiment of the present invention, one or more reconstructed neighboring pixels among the reconstructed neighboring pixels adjacent to and above the target block may be used to generate a virtual neighboring pixel R. The virtual neighboring pixel R may be the uppermost virtual neighboring pixel among the right virtual neighboring pixels.

[0762] 3) The processing unit may generate a virtual neighboring pixel (Cx+W, Cy) based on the neighboring pixel (Cx+W, Cy-1).

[0763] For example, in Figure 23 In FIG, a virtual neighboring pixel R may be generated based on the neighboring pixel b. The virtual neighboring pixel R may be the uppermost virtual neighboring pixel among the right virtual neighboring pixels. The neighboring pixel b may be a pixel adjacent to the virtual neighboring pixel R and above the virtual neighboring pixel R.

[0764] For example, the relationship between the virtual neighboring pixel R and the neighboring pixel b can be expressed by the following equation 4:

[0765] [Equation 4]

[0766] R=b

[0767] 4) The processing unit may generate a virtual neighboring pixel (Cx+W, Cy) based on one or more of the neighboring pixel (Cx+W-1, Cy-1), the neighboring pixel (Cx+W, Cy-1), and the neighboring pixel (Cx+W+1, Cy-1).

[0768] For example, in Figure 23 , the neighboring pixel a, the neighboring pixel b, and the neighboring pixel c may be used to generate the virtual neighboring pixel R. The virtual neighboring pixel R may be the uppermost virtual neighboring pixel among the right virtual neighboring pixels.

[0769] The coordinates of the neighboring pixel a, the neighboring pixel b, and the neighboring pixel c may be given by the following Equations 5, 6, and 7:

[0770] [Equation 5]

[0771] (Cx+W-1,Cy-1)

[0772] [Equation 6]

[0773] (Cx+W,Cy-1)

[0774] [Equation 7]

[0775] (Cx+W+1,Cy-1)

[0776] In other words, the neighboring pixel b may be a pixel adjacent to and above the virtual neighboring pixel R. The neighboring pixel a may be a pixel adjacent to and to the left of the neighboring pixel b. The neighboring pixel c may be a pixel adjacent to and to the right of the neighboring pixel b.

[0777] For example, in Figure 23 In FIG, the virtual neighboring pixel R may be a weighted sum of neighboring pixel a, neighboring pixel b, and neighboring pixel c. When generating the virtual neighboring pixel R, weights may be assigned to neighboring pixel a, neighboring pixel b, and neighboring pixel c, respectively.

[0778] For example, the relationship between the virtual neighboring pixel R, the neighboring pixel a, the neighboring pixel b, and the neighboring pixel c may be expressed by the following Equation 8:

[0779] [Equation 8]

[0780] R=1 / 4*a+2 / 4*b+1 / 4*c=1 / 4*a+1 / 2*b+1 / 4*c=(a+b<<1+c)>>2

[0781] Here, "<<" can be a left shift operator. ">>" can be a right shift operator.

[0782] 5) Similar to requirements 2) to 4) above, the processing unit may generate a virtual neighboring pixel (Cx, Cy+H) based on one or more reconstructed neighboring pixels adjacent to and on the left side of the target block.

[0783] For example, in Figure 23 In the embodiment of the present invention, one or more reconstructed neighboring pixels adjacent to the target block and on the left side of the target block may be used to generate a virtual neighboring pixel L. The virtual neighboring pixel L may be a leftmost virtual neighboring pixel among the lower virtual neighboring pixels.

[0784] 6) The processing unit may generate a virtual neighboring pixel (Cx, Cy+H) based on the neighboring pixel (Cx-1, Cy+H).

[0785] For example, in Figure 23 In the example, the neighboring pixel q may be used to generate a virtual neighboring pixel L. The virtual neighboring pixel L may be the leftmost virtual neighboring pixel among the virtual neighboring pixels. The neighboring pixel q may be a pixel adjacent to the virtual neighboring pixel L and on the left side of the virtual neighboring pixel L.

[0786] For example, the relationship between the virtual neighboring pixel L and the neighboring pixel q can be expressed by the following equation 9:

[0787] [Equation 9]

[0788] L = q

[0789] 7) The processing unit may generate a virtual neighboring pixel (Cx, Cy+H) based on one or more of the neighboring pixel (Cx-1, Cy+H-1), the neighboring pixel (Cx-1, Cy+H), and the neighboring pixel (Cx-1, Cy+H+1).

[0790] For example, in Figure 23 , the neighboring pixel p, the neighboring pixel q, and the neighboring pixel r may be used to generate a virtual neighboring pixel L. The virtual neighboring pixel L may be the leftmost virtual neighboring pixel among the lower virtual neighboring pixels.

[0791] The coordinates of the neighboring pixel p, the neighboring pixel q, and the neighboring pixel r may be given by the following Equations 10, 11, and 12.

[0792] [Equation 10]

[0793] (Cx-1,Cy+H-1)

[0794] [Equation 11]

[0795] (Cx-1,Cy+H)

[0796] [Equation 12]

[0797] (Cx-1,Cy+H+1)

[0798] In other words, the neighboring pixel q may be a pixel adjacent to and to the left of the virtual neighboring pixel L. The neighboring pixel p may be a pixel adjacent to and above the neighboring pixel q. The neighboring pixel r may be a pixel adjacent to and below the neighboring pixel q.

[0799] For example, in Figure 23 In FIG, the virtual neighboring pixel L may be a weighted sum of the neighboring pixel p, the neighboring pixel q, and the neighboring pixel r. When generating the virtual neighboring pixel L, respective weights may be assigned to the neighboring pixel p, the neighboring pixel q, and the neighboring pixel r.

[0800] For example, the relationship between the virtual neighboring pixel L, the neighboring pixel p, the neighboring pixel q, and the neighboring pixel r may be expressed by the following Equation 13:

[0801] [Equation 13]

[0802] L=1 / 4*p+2 / 4*q+1 / 4*r=1 / 4*p+1 / 2*q+1 / 4*r=(p+q<<1+r)>>2

[0803] 8) The processing unit may generate additional virtual neighboring pixels based on a plurality of virtual neighboring pixels generated using the neighboring pixels.

[0804] For example, in Figure 23 In the example, a virtual neighboring pixel N can be generated based on the virtual neighboring pixel R and the virtual neighboring pixel L. i . Virtual neighboring pixel N i It can be a virtual neighboring pixel between the virtual neighboring pixel R and the virtual neighboring pixel L.

[0805] Figure 24 It is shown that additional virtual neighboring pixels are generated using virtual neighboring pixels according to an example.

[0806] like Figure 24 As shown in , virtual neighboring pixels for a target block may be arranged in a row according to a distance from a virtual neighboring pixel L and a distance from a virtual neighboring pixel R.

[0807] Specific virtual neighboring pixel N i The distance from the virtual neighboring pixel L can be expressed by the following equation 14:

[0808] [Equation 14]

[0809] (N i The absolute value of the difference between the x-coordinate of and the x-coordinate of L) + (N i The absolute value of the difference between the y-coordinate of and the y-coordinate of L)

[0810] Specific virtual neighboring pixel N i The distance from the virtual neighboring pixel R can be expressed by the following equation 15:

[0811] [Equation 15]

[0812] (N i The absolute value of the difference between the x-coordinate of and the x-coordinate of R) + (N i The absolute value of the difference between the y-coordinate of and the y-coordinate of R)

[0813] In other words, the distance between pixels may be the sum of the absolute value of the difference between the x-coordinates of the pixels and the absolute value of the difference between the y-coordinates of the pixels.

[0814] 9) The processing unit may generate a virtual neighboring pixel L and a virtual neighboring pixel R based on neighboring pixels in the reconstructed neighboring block, and may generate a virtual neighboring pixel N between the virtual neighboring pixel L and the virtual neighboring pixel R based on the virtual neighboring pixel L and the virtual neighboring pixel R. i .

[0815] When generating virtual neighboring pixels N i When , a weight for distance can be used. The weight for distance can include a weight based on the virtual neighboring pixels N iThe weight of the distance between the virtual neighboring pixel L and the virtual neighboring pixel N i The weight of the distance to the virtual neighboring pixel R.

[0816] For example, the virtual neighboring pixel N i The relationship between the virtual neighboring pixel L and the virtual neighboring pixel R can be expressed by the following equation 16:

[0817] [Equation 16]

[0818]

[0819] d R Can be a virtual neighboring pixel N i The distance between the virtual neighboring pixel R.

[0820] d L Can be a virtual neighboring pixel N i The distance between the virtual neighboring pixel L.

[0821] Figure 25 Illustrated is the generation of a lower right virtual neighboring pixel and a middle virtual neighboring pixel according to an example.

[0822] The upper left coordinate of the target block may be (Cx, Cy). W may be the horizontal size of the target block. H may be the height or vertical size of the target block.

[0823] 10) The processing unit may generate virtual neighboring pixels (Cx+W, Cy+H) based on one or more of the reconstructed neighboring pixels adjacent to and above the target block and the reconstructed neighboring pixels adjacent to and to the left of the target block.

[0824] For example, in Figure 25 In the embodiment of the present invention, one or more of the reconstructed neighboring pixels adjacent to and above the target block and the reconstructed neighboring pixels adjacent to and to the left of the target block may be used to generate the virtual neighboring pixel G. The virtual neighboring pixel G may be a lower right virtual neighboring pixel. In other words, the virtual neighboring pixel G may be a pixel adjacent to and to the right of the lower virtual neighboring pixel, and may be a pixel adjacent to and below the right virtual neighboring pixel.

[0825] 11) The processing unit may generate a virtual neighboring pixel (Cx+W, Cy+H) based on the neighboring pixel (Cx+W, Cy-1) and the neighboring pixel (Cx-1, Cy+H).

[0826] For example, in Figure 25In the example, a virtual neighboring pixel G may be generated based on neighboring pixel b and neighboring pixel q. The virtual neighboring pixel G may be a lower right virtual neighboring pixel. The neighboring pixel b may be a pixel adjacent to the upper right portion of the target block. The neighboring pixel q may be a pixel adjacent to the lower left portion of the target block.

[0827] For example, the relationship between the virtual neighboring pixel G, the neighboring pixel b, and the neighboring pixel q can be expressed by the following equation 17:

[0828] [Equation 17]

[0829] G=1 / 2*(b+q)=(b+q)>>1

[0830] 12) The processing unit may generate a virtual neighboring pixel (Cx+W, Cy+H) based on the virtual neighboring pixel (Cx+W, Cy) and the virtual neighboring pixel (Cx, Cy+H).

[0831] For example, in Figure 25 In the embodiment of the present invention, a virtual neighboring pixel G can be generated using a virtual neighboring pixel R and a virtual neighboring pixel L. The virtual neighboring pixel G can be a lower right virtual neighboring pixel. The virtual neighboring pixel R can be the uppermost virtual neighboring pixel among the right virtual neighboring pixels. The virtual neighboring pixel L can be the leftmost virtual neighboring pixel among the lower virtual neighboring pixels.

[0832] For example, the relationship between the virtual neighboring pixel G, the virtual neighboring pixel R, and the virtual neighboring pixel L may be expressed by the following Equation 18:

[0833] [Equation 18]

[0834] G=1 / 2*(R+L)=(R+L)>>1

[0835] 12) The processing unit may generate a third virtual neighboring pixel based on the first virtual neighboring pixel and the second virtual neighboring pixel, and may generate a fourth virtual neighboring pixel based on the first virtual neighboring pixel and the third virtual neighboring pixel.

[0836] The processing unit may generate a virtual neighboring pixel between the virtual neighboring pixel (Cx+W, Cy) and the virtual neighboring pixel (Cx+W, Cy+H) based on the virtual neighboring pixel (Cx+W, Cy), the virtual neighboring pixel (Cx, Cy+H), and the virtual neighboring pixel (Cx+W, Cy+H). In addition, the processing unit may generate a virtual neighboring pixel between the virtual neighboring pixel (Cx+W, Cy) and the virtual neighboring pixel (Cx+W, Cy+H) based on the virtual neighboring pixel (Cx+W, Cy), the virtual neighboring pixel (Cx, Cy+H), and the virtual neighboring pixel (Cx+W, Cy+H).

[0837] For example, in Figure 25In the example, the virtual neighboring pixel M can be generated based on the virtual neighboring pixel R, the virtual neighboring pixel L, and the virtual neighboring pixel G. i . Virtual neighboring pixel M i It can be a pixel between the virtual adjacent pixel R and the virtual adjacent pixel G.

[0838] For example, in Figure 25 In the example, virtual neighboring pixels R, L, and G may be used to generate virtual neighboring pixels N. i . Virtual neighboring pixel N i It can be a pixel between the virtual adjacent pixel L and the virtual adjacent pixel G.

[0839] 13) The processing unit may generate a third virtual neighboring pixel based on the first and second virtual neighboring pixels, and may generate a fourth virtual neighboring pixel based on the first and third virtual neighboring pixels. Here, when generating the fourth virtual neighboring pixel, the processing unit may use weights for the additional virtual neighboring pixels. The additional virtual neighboring pixels may include the first and third virtual neighboring pixels. The weights for the additional virtual neighboring pixels may be set based on the distance between the fourth virtual neighboring pixel and the additional virtual neighboring pixel.

[0840] For example, in Figure 25 In the example, the virtual neighboring pixel M can be generated based on the virtual neighboring pixel R, the virtual neighboring pixel L, and the virtual neighboring pixel G. i . Virtual neighboring pixel M i It can be a pixel between the virtual adjacent pixel R and the virtual adjacent pixel G.

[0841] When generating virtual neighboring pixels M i When , one or more of the weight for the virtual neighboring pixel R, the weight for the virtual neighboring pixel L, and the weight for the virtual neighboring pixel G may be used.

[0842] Based on the virtual neighboring pixel R and the virtual neighboring pixel M i The weight for the virtual neighboring pixel R is set based on the distance between them.

[0843] Based on the virtual neighboring pixel L and the virtual neighboring pixel M i The weight for the virtual neighboring pixel L is set based on the distance between them.

[0844] Based on the virtual neighboring pixel G and the virtual neighboring pixel M i The weight for the virtual neighboring pixel G is set based on the distance between them.

[0845] For example, in Figure 25 In the example, virtual neighboring pixels R, L, and G may be used to generate virtual neighboring pixels N.i . Virtual neighboring pixel N i It can be a pixel between the virtual adjacent pixel L and the virtual adjacent pixel G.

[0846] When generating virtual neighboring pixels N i When , one or more of the weight for the virtual neighboring pixel R, the weight for the virtual neighboring pixel L, and the weight for the virtual neighboring pixel G may be used.

[0847] Based on the virtual neighboring pixel R and the virtual neighboring pixel N i The weight for the virtual neighboring pixel R is set based on the distance between them.

[0848] Based on the virtual neighboring pixel L and the virtual neighboring pixel N i The weight for the virtual neighboring pixel L is set based on the distance between them.

[0849] Based on the virtual neighboring pixel G and the virtual neighboring pixel N i The weight for the virtual neighboring pixel G is set based on the distance between them.

[0850] Based on the virtual neighboring pixel G and the virtual neighboring pixel N i The weight for the virtual neighboring pixel L can be set based on the distance between the virtual neighboring pixel G and the virtual neighboring pixel N. i The weight for the virtual neighboring pixel L can be proportional to the distance between the virtual neighboring pixels N. i The distance to the virtual neighboring pixel L and the distance from the virtual neighboring pixel N i The sum of the distances to the virtual neighboring pixels G is inversely proportional.

[0851] Based on the virtual neighboring pixel L and the virtual neighboring pixel N i The weight for the virtual neighboring pixel G can be set based on the distance between the virtual neighboring pixel L and the virtual neighboring pixel N. i The weight for the virtual neighboring pixel G can be proportional to the distance between the virtual neighboring pixels N. i The distance to the virtual neighboring pixel L and the distance from the virtual neighboring pixel N i The sum of the distances to the virtual neighboring pixels G is inversely proportional.

[0852] For example, the virtual neighboring pixel N i The relationship between the virtual neighboring pixel L and the virtual neighboring pixel G can be expressed by the following equation 19:

[0853] [Equation 19]

[0854]

[0855] dG Can be a virtual neighboring pixel N i The distance between the virtual neighboring pixel G.

[0856] d L Can be a virtual neighboring pixel N i The distance between the virtual neighboring pixel L.

[0857] For example, the virtual neighboring pixel M i , the virtual neighboring pixel R and the virtual neighboring pixel G can be expressed by the following equation 20.

[0858] [Equation 20]

[0859]

[0860] d G It can be a virtual neighboring pixel M i The distance between the virtual neighboring pixel G.

[0861] d R It can be a virtual neighboring pixel M i The distance between the virtual neighboring pixel R.

[0862] Figure 26 Bidirectional intra prediction according to an example is shown.

[0863] The processing unit may derive a prediction value for a target pixel using at least one of reconstructed neighboring pixels and virtual neighboring pixels located in two prediction directions of the bidirectional intra prediction mode.

[0864] The processing unit may derive a prediction value for the target pixel X using one or more of two reference pixels located in two prediction directions of the bidirectional intra prediction mode.

[0865] The two reference pixels may include a reference pixel Ref_A and a reference pixel Ref_B.

[0866] Ref_A and Ref_B may be pixels located in two prediction directions respectively derived and selected via bidirectional intra prediction of the target pixel.

[0867] The two reference pixels can be reconstructed adjacent pixels. Figure 26 As shown in , both Ref_A and Ref_B can be neighboring pixels.

[0868] Figure 27 Bidirectional intra prediction using virtual neighboring pixels according to an example is shown.

[0869] The processing unit may derive a prediction value for the target pixel X using one or more of two reference pixels located in two prediction directions of the bidirectional intra prediction mode.

[0870] The two reference pixels may include a reference pixel Ref_A and a reference pixel Ref_B.

[0871] Ref_A and Ref_B may be pixels located in two prediction directions respectively derived and selected via bidirectional intra prediction of the target pixel.

[0872] At least one of the two reference pixels may be a virtual neighboring pixel. Figure 27 As shown in , Ref_A may be a neighboring pixel and Ref_B may be a virtual neighboring pixel.

[0873] Such a reference pixel may be a pixel at a specific position in each of two prediction directions of bidirectional intra prediction. The processing unit may obtain the reference pixel by performing filtering on one or more neighboring pixels and / or virtual neighboring pixels near the specific position.

[0874] For example, when the specific position is not indicated by integer coordinates, the processing unit may acquire a reference pixel by performing filtering on one or more of neighboring pixels and / or virtual neighboring pixels near the specific position.

[0875] For example, when a pixel at a specific location is unavailable, the processing unit may acquire a reference pixel by performing filtering on one or more of neighboring pixels and / or virtual neighboring pixels near the specific location.

[0876] The neighboring pixels near the specific position may be neighboring pixels adjacent to the specific position. The virtual neighboring pixels near the specific position may be virtual neighboring pixels adjacent to the specific position.

[0877] The predicted value Pred_X derived for the target pixel may be a statistical value associated with one or more of Ref_A and Ref_B, and the predicted value Pred_X may be derived based on the statistical value. Hereinafter, the statistical value in the embodiment may be at least one of an average value, a weighted average value, a maximum value, a minimum value, a mode, a median value, and an interpolated value.

[0878] As illustrated in Equation 21 below, Ref_A and Ref_b may be used to derive a predicted value Pred_X for a target pixel.

[0879] [Equation 21]

[0880] Pred_X=F(Ref_A,Ref_B)

[0881] F() can be a specific function.

[0882] As described above, the processing unit may use one or more of the two reference pixels located in the two prediction directions of the bidirectional intra prediction mode to derive a prediction value for the target pixel X. Here, when deriving the prediction value for the target pixel X, the processing unit may apply weights to the two reference pixels located in the two prediction directions, respectively.

[0883] For example, the sum of the weights may be 1.

[0884] The two reference pixels may include a reference pixel Ref_A and a reference pixel Ref_B.

[0885] Ref_A and Ref_B may be pixels located in two prediction directions respectively derived and selected via bidirectional intra prediction of the target pixel.

[0886] For example, Figure 26 As shown in , both Ref_A and Ref_B can be reconstructed neighboring pixels.

[0887] Alternatively, in the example, Figure 27 As shown in , Ref_A may be a reconstructed neighboring pixel, and Ref_B may be a virtual neighboring pixel.

[0888] As illustrated in the following Equation 22, a prediction value Pred_X for a target pixel may be derived using a weight for Ref_A and a weight for Ref_B.

[0889] [Equation 22]

[0890] Pred_X=Dir_A*Ref_A+Dir_B*Ref_B

[0891] Dir_A may be a weight for Ref_A. Dir_B may be a weight for Ref_B.

[0892] The sum of Dir_A and Dir_B may be 1.

[0893] When generating the derived prediction value Pred_X for the target block, the processing unit may use the above-mentioned filtering to obtain reference pixels and weights for the reference pixels together.

[0894] Such a reference pixel may be a pixel at a specific position in each of the two prediction directions of the bidirectional intra prediction. The processing unit may obtain the reference pixel by performing filtering on one or more of the neighboring pixels and / or virtual neighboring pixels near the specific position. In addition, the processing unit may apply corresponding weights to the generated reference pixel.

[0895] Figure 28Bidirectional intra prediction using distances between neighboring pixels and a target pixel according to an example is shown.

[0896] Figure 29 Bidirectional intra prediction using distances between virtual neighboring pixels and a target pixel according to an example is shown.

[0897] As described above, the processing unit may use one or more of the two reference pixels located in the two prediction directions of the bidirectional intra prediction mode to derive a prediction value for the target pixel X. Here, the processing unit may use a weight according to the distance between the corresponding reference pixel and the target pixel for each of the two reference pixels located in the two prediction directions.

[0898] The two reference pixels may include a reference pixel Ref_A and a reference pixel Ref_B.

[0899] Ref_A and Ref_B may be pixels located in two prediction directions respectively derived and selected via bidirectional intra prediction of the target pixel.

[0900] For example, Figure 28 As shown in , both Ref_A and Ref_B can be reconstructed neighboring pixels.

[0901] Alternatively, in the example, Figure 29 As shown in , Ref_A may be a reconstructed neighboring pixel, and Ref_B may be a virtual neighboring pixel.

[0902] When generating the derived prediction value Pred_X for the target block, the processing unit may use the above-mentioned filtering to obtain reference pixels together with weights according to the distance between the reference pixels and the target pixels.

[0903] Such a reference pixel may be a pixel at a specific position in each of the two prediction directions of the bidirectional intra prediction. The processing unit may obtain the reference pixel by performing filtering on one or more of the neighboring pixels and / or virtual neighboring pixels near the specific position. In addition, the processing unit may apply corresponding weights to the generated reference pixel.

[0904] As illustrated in Equation 23 below, a prediction value Pred_X for a target pixel may be derived using one or more of Ref_A, Dis_A, Ref_B, and Dis_B.

[0905] [Equation 23]

[0906] Pred_X=F(Ref_A,Dis_A,Ref_B,Dis_B)

[0907] F() can be a specific function.

[0908] Dis_A may be the distance between the target pixel and Ref_A, and Dis_B may be the distance between the target pixel and Ref_B.

[0909] The derived prediction value Pred_X for the target pixel may be a statistical value related to one or more of Ref_A, Dis_A, Ref_B, and Dis_B, and the prediction value Pred_X may be derived based on the statistical value.

[0910] As illustrated in the following Equation 24, a prediction value Pred_X for a target pixel may be derived based on a weight according to a distance between the target pixel and a corresponding reference pixel.

[0911] [Equation 24]

[0912]

[0913] The weight for one of the two reference pixels may be proportional to the distance between the other of the two reference pixels and the target pixel.

[0914] The weight for one of the two reference pixels may be inversely proportional to the sum of distances from the target pixel to the two reference pixels.

[0915] For example, the weight for Ref_B may be given by the following equation 25:

[0916] [Equation 25]

[0917]

[0918] For example, the weight for Ref_A may be given by Equation 26 below.

[0919] [Equation 26]

[0920]

[0921] As described above, the processing unit may use one or more of the two reference pixels located in the two prediction directions of the bidirectional intra prediction mode to derive a prediction value for the target pixel X. Here, the processing unit may use one or more of a distance weight and a direction weight for each of the two reference pixels in the two prediction directions.

[0922] The distance weight may be a weight according to the distance between the corresponding reference pixel and the target pixel, and the direction weight may be a weight according to the direction from the target pixel to the corresponding reference pixel.

[0923] When generating the derived prediction value Pred_X for the target block, the processing unit may use the above filtering to obtain the reference pixels, the distance weight, and the direction weight together.

[0924] Such a reference pixel may be a pixel at a specific position in each of the two prediction directions of the bidirectional intra prediction. The processing unit may obtain the reference pixel by performing filtering on one or more of the neighboring pixels and / or virtual neighboring pixels near the specific position. In addition, the processing unit may apply one or more of the distance weight and the direction weight to the generated reference pixel.

[0925] As illustrated in Equation 27 below, a prediction value Pred_X for a target pixel may be derived using one or more of Ref_A, Dis_A, Dir_A, Ref_B, Dis_B, and Dir_B.

[0926] [Equation 27]

[0927] Pred_X=F(Ref_A,Dis_A,Dir_A,Ref_B,Dis_B,Dir_B)

[0928] F() can be a specific function.

[0929] Dis_A may be the distance between the target pixel and Ref_A. Dir_A may be the direction of Ref_A. Dir_A may be the direction from the target pixel to Ref_A. Dis_B may be the distance between the target pixel and Ref_B. Dir_B may be the direction of Ref_B. Dir_B may be the direction from the target pixel to Ref_B.

[0930] The derived prediction value Pred_X for the target pixel may be a statistical value related to one or more of Ref_A, Dis_A, Dir_A, Ref_B, Dis_B, and Dir_B, and the prediction value Pred_X may be derived based on the statistical value.

[0931] As illustrated in the following Equation 28, a prediction value Pred_X for a target pixel may be derived based on a distance from the target pixel to a reference pixel and a direction weight for the reference pixel.

[0932] [Equation 28]

[0933]

[0934] The weight for one of the two reference pixels may be proportional to the distance between the other of the two reference pixels and the target pixel.

[0935] Furthermore, the weight for one of the two reference pixels may be proportional to the directional weight for the one reference pixel.

[0936] The weight for one of the two reference pixels may be inversely proportional to the sum of distances from the target pixel to the two reference pixels.

[0937] For example, the weight for Ref_B may be given by the following equation 29:

[0938] [Equation 29]

[0939]

[0940] For example, the weight for Ref_A may be given by the following equation 30:

[0941] [Equation 30]

[0942]

[0943] Use MPM to derive intra prediction mode

[0944] When the intra prediction mode of a target block is determined, the likelihood that a particular intra prediction mode will be used for intra prediction of the target block may be high or low depending on encoding parameters associated with the target block. Taking this likelihood into account, an MPM list may be used.

[0945] The remaining modes may be the remaining intra prediction modes other than the MPMs in the MPM list. In other words, the remaining modes may be the remaining intra prediction modes after excluding one or more MPMs in the MPM list from all intra prediction modes.

[0946] The remaining modes may be classified into a first remaining mode set and a second remaining mode set according to a probability that the remaining modes will be used for intra prediction of a target block.

[0947] The remaining modes that are likely to be used for intra prediction of the target block may be defined as a first remaining mode set. The first remaining mode set may be referred to as "possible remaining modes." In other words, the possible remaining modes may indicate intra prediction modes that are likely to be used as intra prediction modes of the target block among the remaining intra prediction modes (i.e., among all intra prediction modes except the MPM).

[0948] Remaining patterns not included in the first remaining pattern set among all remaining patterns may be defined as a second remaining pattern set. The second remaining pattern set may be referred to as "pure (true) remaining patterns."

[0949] The remaining mode indicator may indicate the remaining modes to be used for intra prediction of the target block among the remaining modes. Alternatively, the remaining mode indicator may indicate the remaining modes to be used for intra prediction of the target block among the remaining modes as possible remaining modes.

[0950] Figure 30 Determination of intra prediction mode using the remaining modes according to an embodiment is illustrated.

[0951] In step 3010 , the processing unit may derive one or more MPMs for the target block.

[0952] The processing unit may derive one or more MPMs in the MPM list for the target block.

[0953] In step 3020 , the processing unit may determine whether the intra prediction mode of the target block is one of the MPMs.

[0954] The processing unit may use the MPM usage indicator to determine whether the intra prediction mode of the target block is one of the MPMs. The processing unit may obtain the MPM usage indicator from the bitstream.

[0955] For example, the MPM usage indicator may have a name such as "prev_intra_pred_mode flag."

[0956] When the value of the MPM use indicator is a first value (eg, '1'), the processing unit may determine that the intra prediction mode of the target block is one of the MPMs.

[0957] When the value of the MPM use indicator is the second value (eg, '0'), the processing unit may determine that the intra prediction mode of the target block is not one of the MPMs.

[0958] If it is determined that the intra prediction mode of the target block is one of the MPMs, step 3030 may be performed.

[0959] If it is determined that the intra prediction mode of the target block is not one of the MPMs, step 3040 may be performed.

[0960] At step 3030 , the processing unit may use the MPM indicator to determine the intra prediction mode of the target block.

[0961] The processing unit may obtain the MPM indicator from the bitstream.

[0962] The processing unit may determine the MPM indicated by the MPM indicator among one or more MPMs in the MPM list as the intra prediction mode of the target block.

[0963] For example, the MPM indicator may be an index to an MPM list.

[0964] At step 3040, the processing unit may derive one or more possible remaining modes for the target block.

[0965] The processing unit may derive one or more possible remaining modes from the possible remaining mode list for the target block.

[0966] At step 3050 , the processing unit may use the remaining mode indicators to determine an intra prediction mode for the target block.

[0967] The processing unit may obtain the remaining mode indicator from the bitstream.

[0968] The processing unit may determine the possible remaining mode indicated by the remaining mode indicator among the one or more possible remaining modes in the possible remaining mode list as the intra prediction mode of the target block.

[0969] For example, the remaining mode indicator may be an index into a list of possible remaining modes.

[0970] As described above, the intra prediction mode of the target block may be determined based on a plurality of different lists corresponding to the MPM list and the possible remaining mode list.

[0971] Figure 31 Derivation of the MPM after determining whether to use the MPM and determination of the intra prediction mode using the remaining modes according to an embodiment are illustrated.

[0972] Refer to above Figure 30 The order of steps 3010 and 3020 described may be changed.

[0973] At step 3110 , the processing unit may determine whether an MPM is used to perform intra prediction for the target block.

[0974] Here, the fact that MPM is used to perform intra prediction for the target block may mean: 1) the case where the intra prediction mode of the target block is one of the MPMs, and 2) the case where the intra prediction mode of the target block is one of the remaining modes and the MPM list is used for the remaining modes.

[0975] The processing unit may use the MPM usage indicator to determine whether the MPM is used to perform intra prediction for the target block.The processing unit may obtain the MPM usage indicator from the bitstream.

[0976] For example, the MPM usage indicator may have a name such as "prev_intra_pred_mode flag."

[0977] When the value of the MPM usage indicator is a first value (eg, '1'), the processing unit may determine that the MPM is used to perform intra prediction for the target block.

[0978] When the value of the MPM usage indicator is a second value (eg, “0”), the processing unit may determine that the MPM is not used to perform intra prediction for the target block.

[0979] The processing unit may use the MPM indicator to determine whether the MPM is used to perform intra prediction for the target block. If it is determined that the MPM indicator indicates one of the MPM and the possible remaining modes, the processing unit may determine that the MPM is used to perform intra prediction for the target block. If it is determined that the MPM indicator does not indicate one of the MPM and the possible remaining modes, the processing unit may determine that the MPM is not used to perform intra prediction for the target block.

[0980] If it is determined that the MPM is used to perform intra prediction for the target block, step 3120 may be performed.

[0981] If it is determined that the MPM is not used to perform intra prediction of the target block, the process may be terminated and intra prediction based on the additional scheme may be performed.

[0982] At step 3120 , the processing unit may derive one or more MPMs for the target block.

[0983] The processing unit may derive one or more MPMs in the MPM list for the target block.

[0984] At step 3130 , the processing unit may determine whether the possible remaining modes are used to perform intra prediction for the target block.

[0985] Alternatively, the processing unit may determine which of the MPM and possible remaining modes to use to perform intra prediction for the target block.

[0986] In an example, if it is determined that the MPM indicator indicates one of the possible remaining modes, the processing unit may determine that the possible remaining mode is used to perform intra prediction for the target block.

[0987] In an example, if it is determined that the MPM indicator does not indicate one of the possible remaining modes, the processing unit may determine that the possible remaining mode is not used to perform intra prediction for the target block.

[0988] In an example, if it is determined that the MPM indicator indicates one of the MPMs, the processing unit may determine that the MPM is used to perform intra prediction for the target block.

[0989] In an example, if it is determined that the possible remaining mode is used to perform intra prediction for the target block, step 3150 may be performed.

[0990] In an example, if it is determined that the MPM is used to perform intra prediction for the target block, step 3140 may be performed.

[0991] In an example, if it is determined that the intra prediction mode of the target block is one of the MPMs, step 3140 may be performed.

[0992] In an example, if it is determined that the intra prediction mode of the target block is one of the possible remaining modes, step 3150 may be performed.

[0993] Step 3140 may correspond to step 3030. Repeated description will be omitted here.

[0994] Step 3150 may correspond to step 3040. Repeated description will be omitted here.

[0995] Possible remaining modes may be derived based on the MPM derived in step 3120. The relationship between the MPM and the possible remaining modes and the derivation of the possible remaining modes under the relationship will be described in detail below.

[0996] Step 3160 may correspond to step 3050. Repeated description will be omitted here.

[0997] Step 3040 and step 3150 may be performed selectively. In an example, the processing unit may use the remaining mode usage indicator to determine whether the intra-frame prediction mode of the target block is one of the possible remaining modes. The processing unit may obtain the remaining mode usage indicator from the bitstream. When the value of the remaining mode usage indicator is a first value (e.g., "1"), the processing unit may determine that the intra-frame prediction mode of the target block is one of the possible remaining modes. When the value of the remaining mode usage indicator is a second value (e.g., "0"), the processing unit may determine that the intra-frame prediction mode of the target block is not one of the possible remaining modes. If it is determined that the intra-frame prediction mode of the target block is one of the possible remaining modes, step 3040 or 3150 may be performed. If it is determined that the intra-frame prediction mode of the target block is not one of the possible remaining modes, the processing may be terminated, and additional intra-frame prediction that neither uses the MPM nor the possible remaining modes may be processed.

[0998] Derivation of possible residual patterns

[0999] Figure 32 Blocks for deriving MPM candidates according to an example are shown.

[1000] The processing unit may derive one or more of the remaining intra prediction modes excluding the MPM among all the intra prediction modes as possible remaining modes.

[1001] The number of possible remaining modes may be predefined. For example, the number of possible remaining modes may be 2 or 3.

[1002] For example, assuming that the total number of intra prediction modes is 67 and the number of MPMs is 6, the number of possible remaining modes may be 2.

[1003] For example, assuming that the total number of intra prediction modes is 67 and the number of MPMs is 6, the number of possible remaining modes may be 3.

[1004] Six MPM candidates (ie, candModeList[0] to candModeList[5]) may be derived as follows.

[1005] 1) When the intra prediction mode candIntraPredModeA of the neighboring block A of the target block and the intra prediction mode candIntraPredModeB of the neighboring block B of the target block are the same as each other, and the intra prediction mode candIntraPredModeA of the neighboring block A is greater than INTRA_DC, six MPM candidates can be derived as shown in the following code 1.

[1006] [Code 1]

[1007] candModeList[0] = intra prediction mode of neighboring block A (candIntraPredModeA)

[1008] candModeList[1]=INTRA_PLANAR

[1009] candModeList[2]=INTRA_DC

[1010] candModeList[3]=2+((candIntraPredModeA+61)%64)

[1011] candModeList[4]=2+((candIntraPredModeA-1)%64)

[1012] candModeList[5]=2+((candIntraPredModeA+60)%64)

[1013] 2) When the above condition in 1) is not satisfied (that is, when the intra prediction mode candIntraPredModeA of the neighboring block A and the intra prediction mode candIntraPredModeB of the neighboring block B are different from each other and the intra prediction mode candIntraPredModeA of the neighboring block A or the intra prediction mode candIntraPredModeB of the neighboring block B is greater than INTRA_DC), the MPM candidate may be derived as shown in the following Code 2 to Code 7:

[1014] [Code 2]

[1015] minAB=candModeList[(candModeList[0]>candModeList[1])? 1:0]

[1016] maxAB=candModeList[(candModeList[0]>candModeList[1])? 0:1]

[1017] 2-1) When the intra prediction mode candIntraPredModeA of the neighboring block A and the intra prediction mode candIntraPredModeB of the neighboring block B are both greater than INTRA_DC, the MPM candidate may be derived as shown in the following code 3:

[1018] [Code 3]

[1019] candModeList[0]=candIntraPredModeA

[1020] candModeList[1]=candIntraPredModeB

[1021] candModeList[2]=INTRA_PLANAR

[1022] candModeList[3]=INTRA_DC

[1023] When the difference between the derived MaxAB and MinAB falls within the range from 2 to 62, the fifth and sixth MPM candidates may be derived as shown in the following Code 4:

[1024] [Code 4]

[1025] candModeList[4]=2+((maxAB+61)%64)

[1026] candModeList[5]=2+((maxAB-1)%64)

[1027] When the difference between the derived MaxAB and MinAB does not fall within the range from 2 to 62, the fifth and sixth MPM candidates may be derived as shown in the following Code 5:

[1028] [Code 5]

[1029] candModeList[4]=2+((maxAB+60)%64)

[1030] candModeList[5]=2+((maxAB)%64)

[1031] 2-2) When the condition in 2-1) is not satisfied (i.e., when at least one of the intra prediction mode candIntraPredModeA of the neighboring block A and the intra prediction mode candIntraPredModeB of the neighboring block B is greater than INTRA_DC), six MPM candidates may be derived as shown in the following Code 6:

[1032] [Code 6]

[1033] candModeList[0]=candIntraPredModeA

[1034] candModeList[1]=candIntraPredModeB

[1035] candModeList[2]=1-minAB

[1036] candModeList[3]=2+((maxAB+61)%64)

[1037] candModeList[4]=2+((maxAB-1)%64)

[1038] candModeList[5]=2+((maxAB+60)%64)

[1039] 3) When the above conditions in 1) and 2) are not met, six MPM candidates can be derived as shown in the following code 7:

[1040] [Code 7]

[1041] candModeList[0]=candIntraPredModeA

[1042] candModeList[1]=(candModeList[0]==INTRA_PLANAR)? INTRA_DC:INTRA_PLANAR

[1043] candModeList[2]=INTRA_ANGULAR50

[1044] candModeList[3]=INTRA_ANGULAR18

[1045] candModeList[4]=INTRA_ANGULAR46

[1046] candModeList[5]=INTRA_ANGULAR54

[1047] The processing unit may derive possible residual modes based on spatially neighboring blocks and temporally neighboring blocks of the target block.

[1048] The processing unit may derive at least one intra prediction mode that does not belong to the MPM from among the intra prediction modes of the spatially neighboring blocks of the target block and the intra prediction modes of the temporally neighboring blocks of the target block as the possible remaining modes.

[1049] For example, when the intra-frame prediction mode of one of the neighboring blocks of the target block is numbered 30 and the other intra-frame prediction mode is numbered 40, and when the intra-frame prediction mode No. 30 belongs to the MPM and the intra-frame prediction mode No. 40 does not belong to the MPM, the intra-frame prediction mode No. 40 can be derived as a possible remaining mode.

[1050] The processing unit may derive possible remaining modes based on the MPM selected from all MPMs.

[1051] The selected MPM may be a predefined number of MPMs that are sequentially preceding. Here, the MPM that is sequentially preceding may represent an intra prediction mode defined by a smaller number of binary bits. Alternatively, the MPM that is sequentially preceding may be the MPM with the lowest index in the MPM list.

[1052] In an embodiment, the predefined number of selected MPMs may be "1".

[1053] The number of the derived possible remaining mode may be the sum of the number and offset of the first MPM. For example, when the number of the first MPM is 30, the sum of the number "30" and the offset "1" is 31, and thus the 31st intra-frame prediction mode may be derived as the possible remaining mode.

[1054] The number of the derived possible remaining mode can be the difference between the number of the first MPM and the offset. For example, when the number of the first MPM is 30, the difference between the number "30" and the offset "1" is 29, and therefore the 29th intra-frame prediction mode can be derived as the possible remaining mode.

[1055] The derived possible remaining mode number may be: 1) the sum of the number and the offset of the first MPM, and 2) the difference between the number and the offset of the first MPM. In this example, when the number of the first MPM is 30, the 29th intra-frame prediction mode and the 31st intra-frame prediction mode may be derived as possible remaining modes.

[1056] The derived number of possible remaining modes may be: 1) the sum of the number of the first MPM and the first offset, and 2) the difference between the number of the first MPM and the first offset. For example, the first offset may be 1.

[1057] When 1) an intra-frame prediction mode having a number corresponding to the sum of the number of the first MPM and the first offset or 2) an intra-frame prediction mode having a number corresponding to the difference between the number of the first MPM and the first offset is one of the existing MPMs, 1) an intra-frame prediction mode having a number corresponding to the sum of the number of the first MPM and the second offset or 2) an intra-frame prediction mode having a number corresponding to the difference between the number of the first MPM and the second offset may be derived as a possible remaining mode. For example, the second offset may be 2. Alternatively, the second offset may be different from the first offset. Alternatively, the second offset may be a value obtained by adding "1" to the first offset or by adding a predefined number to the first offset.

[1058] For example, when an intra prediction mode having a number corresponding to the sum of the number of the first MPM and the first offset is one of the existing MPMs, an intra prediction mode having a number corresponding to the sum of the number of the first MPM and the second offset may be derived as a possible remaining mode.

[1059] For example, when an intra-frame prediction mode having a number corresponding to the difference between the number of the first MPM and the first offset is one of the existing MPMs, an intra-frame prediction mode having a number corresponding to the difference between the number of the first MPM and the second offset can be derived as a possible remaining mode.

[1060] In an embodiment, the predefined number of selected MPMs may be '3'.

[1061] For example, the processing unit may determine the number of possible remaining modes by adding an offset to the numbers of the first, second, and third MPMs among one or more MPMs in the MPM list or by subtracting the offset from the numbers of the first, second, and third MPMs.

[1062] For example, when the numbers of the first MPM, the second MPM, and the third MPM are 30, 40, and 50, respectively, the numbers of the derived possible remaining modes may be 31, 41, and 51, respectively.

[1063] When a specific mode is not included in the MPM, the processing unit may derive the specific mode as a possible remaining mode. For example, the specific mode may be a non-directional mode. The non-directional mode may be a DC mode and / or a planar mode.

[1064] For example, when the DC mode is not included in the MPM, the DC mode may become the first possible remaining mode or the second possible remaining mode.

[1065] For example, when the planar mode is not included in the MPM, the planar mode may become the first possible remaining mode or the second possible remaining mode.

[1066] The processing unit may deduce possible remaining modes based on the direction of the MPM.

[1067] For example, the processing unit may derive the intra prediction mode for a specified direction as a possible remaining mode based on the direction of the MPM.

[1068] For example, the processing unit may derive an intra prediction mode having a direction that does not belong to the direction of the MPM in the designated direction as a possible remaining mode based on the direction of the MPM.

[1069] For example, when all MPMs are intra prediction modes with horizontal directivity, an intra prediction mode with vertical directivity may be derived as a possible remaining mode. An intra prediction mode with horizontal directivity may be an intra prediction mode with a slope in which the change in the horizontal component is greater than the change in the vertical component. An intra prediction mode with vertical directivity may be an intra prediction mode with a slope in which the change in the vertical component is greater than the change in the horizontal component.

[1070] For example, when all MPMs are intra prediction modes having vertical directivity, an intra prediction mode having horizontal directivity or a horizontal intra prediction mode may be derived as a possible remaining mode.

[1071] For example, when all MPMs are intra prediction modes having horizontal directivity, an intra prediction mode having vertical directivity or a vertical intra prediction mode may be derived as a possible remaining mode.

[1072] The processing unit may deduce the possible remaining patterns based on the statistical values ​​of the selected MPMs.The selected MPMs may be a predefined number of MPMs preceding in order.

[1073] In other words, the intra prediction mode having the number corresponding to the statistical value may be derived as the possible remaining mode.

[1074] For example, an intra prediction mode numbered as the average of the first and second MPM numbers may be derived as a possible remaining mode. When the first MPM number is 30 and the second MPM number is 40, the 35th intra prediction mode may be derived as a possible remaining mode.

[1075] When deriving possible remaining modes based on the statistical values ​​of the selected MPM, the processing unit may exclude the DC mode and the planar mode as non-directional modes. Alternatively, when selecting a predefined number of sequentially preceding MPMs from all MPMs, if an MPM as a non-directional mode is present among the predefined number of sequentially preceding MPMs, the processing unit may not select the corresponding MPM as a non-directional mode, but may select a subsequent MPM as a directional mode.

[1076] For example, the processing unit may calculate the average of the two preceding MPMs among a total of six MPMs and derive the intra-frame prediction mode numbered corresponding to the average as a possible remaining mode. When the six MPMs indicate a DC mode, a 30th mode, a planar mode, a 10th mode, a 50th mode, and a 52nd mode, respectively, the MPM that is the DC mode and the MPM that is the planar mode may be excluded from selection. Due to this exclusion, the 30th and 10th MPMs that are the two preceding MPMs may be selected, and since the average of 30 and 10 is 20, the 20th intra-frame prediction mode may be derived as a possible remaining mode.

[1077] The processing unit may derive the possible remaining modes based on the statistical values ​​of all MPMs. The number of the intra prediction mode derived as the possible remaining mode may be the statistical value. For example, the total number of MPMs may be 6, and the statistical value may be the average thereof.

[1078] When deriving possible remaining modes based on the statistical values ​​of the selected MPM, the processing unit may exclude the DC mode and the planar mode as non-directional modes.

[1079] For example, the processing unit may exclude the DC mode and the planar mode from all MPMs and derive possible remaining modes based on statistics of the remaining MPMs. The intra prediction mode with a number corresponding to the statistics may be derived as the possible remaining mode.

[1080] The processing unit may use the possible remaining mode candidate list to derive the possible remaining mode.

[1081] The possible remaining mode candidate list may include one or more possible remaining mode candidates. The possible remaining mode candidate list may be identically defined by the encoding apparatus 1600 and the decoding apparatus 1700.

[1082] The processing unit may sequentially search for possible remaining mode candidates present in the possible remaining mode candidate list, and may derive possible remaining mode candidates that do not belong to the MPM as possible remaining modes.

[1083] Searching the possible remaining pattern candidates sequentially may mean that possible remaining pattern candidates with smaller indices in the possible remaining pattern candidate list are searched earlier than possible remaining pattern candidates with larger indices.

[1084] The number of possible remaining mode candidates derived as possible remaining modes among the possible remaining mode candidates in the possible remaining mode candidate list may be predefined.

[1085] For example, when the possible remaining mode candidates are defined in the order of intra-frame prediction mode No. 30, intra-frame prediction mode No. 40, intra-frame prediction mode No. 50, intra-frame prediction mode No. 20 and intra-frame prediction mode No. 10, and intra-frame prediction mode No. 30 and intra-frame prediction mode No. 40 belong to MPM, if the number of possible remaining mode candidates derived as possible remaining modes is 1, intra-frame prediction mode No. 50 can be derived as the possible remaining mode.

[1086] Optionally, as described above, when possible remaining mode candidates are defined and intra-frame prediction mode No. 30 and intra-frame prediction mode No. 40 belong to MPM, if the number of possible remaining mode candidates derived as possible remaining modes is 3, then intra-frame prediction mode No. 50, intra-frame prediction mode No. 20 and intra-frame prediction mode No. 10 can be derived as the first possible remaining mode, the second possible remaining mode and the third possible remaining mode, respectively.

[1087] The processing unit may derive at least one intra prediction mode as a possible remaining mode based on the number of intra prediction modes in the remaining mode candidates.

[1088] In an example, among the 61 remaining mode candidates obtained by excluding six MPM candidate modes from a total of 67 intra-frame prediction modes, the first possible remaining mode, the second possible remaining mode, and the third possible remaining mode can be separately derived from the mode with the smallest intra-frame prediction mode number in ascending order. In an example, when the number of intra-frame prediction modes is 67 and the number of MPMs is 6 (i.e., 20, 30, 0, 1, 31, 32), the first possible remaining mode can be defined as the three remaining modes with the smallest intra-frame prediction mode number among the remaining modes (2, 3, 4, ..., 19, 21, 22, ..., 29, 33, 34, ..., 66), that is, the remaining modes (2, 3, 4).

[1089] In an example, among the 61 remaining mode candidates obtained by excluding six MPM candidate modes from a total of 67 intra prediction modes, the first possible remaining mode, the second possible remaining mode, and the third possible remaining mode can be separately derived from the mode with the largest intra prediction mode number in descending order.

[1090] Using the remaining mode indicators to determine the intra prediction mode

[1091] Figure 33 Binarization of the remaining mode indicator according to an example is shown.

[1092] exist Figure 33 , the symbol and the truncated binary code of the remaining mode indicator are depicted, and the remaining mode indicated by the symbol and the truncated binary code are depicted.

[1093] The processing unit may use the remaining mode indicators to determine the intra-prediction mode for the target block.

[1094] The intra prediction mode indicated by the residual mode indicator may include both the possible residual mode and the pure residual mode. In other words, the residual mode indicator may indicate one of the possible residual mode and the pure residual mode as the intra prediction mode of the target block.

[1095] The remaining mode indicator may be a value binarized using a truncated binary encoding method.

[1096] like Figure 33 As shown in , the number of bins in the possible remainder pattern and the number of bins in the pure remainder pattern may be different from each other.

[1097] For example, the number of possible remaining modes may be 2.

[1098] For example, assuming that the total number of intra prediction modes is 67 and the number of MPMs is 6, the number of possible residual modes may be 2, and the number of pure residual modes may be 59. In other words, intra prediction modes that do not belong to MPMs among all intra prediction modes may be classified into two possible residual modes and 59 pure residual modes.

[1099] The possible remainder pattern may have five binary bits, and the pure remainder pattern may have six binary bits.

[1100] In an embodiment, the binary bits for two possible remaining patterns may be defined as "00000" and "00001." "00000" may indicate a first possible remaining pattern. "00001" may indicate a second possible remaining pattern.

[1101] The binary bits for the 59 pure remainder patterns may be defined as six binary bits other than "000000", "000001", "000010", and "000011". For example, the binary bits for the pure remainder patterns may include "000100", "000101", and the like.

[1102] As described above, the processing unit may encode and / or decode the remaining mode indicator using the binarized value.

[1103] In another embodiment, the binary digits for the two possible remaining patterns may be defined as "11110" and "11111." "11110" may indicate the first possible remaining pattern, and "11111" may indicate the second possible remaining pattern.

[1104] The binary bits for the 59 pure remainder patterns may be defined as six binary bits other than "111100," "111101," "111110," and "111111." For example, the binary bits for the pure remainder patterns may include "111000," "111001," and the like.

[1105] As described above, the processing unit may encode and / or decode the remaining mode indicator using the binarized value.

[1106] When the total number of intra prediction modes is 67 and the number of MPMs is 6, the number of possible residual modes may be 3 and the number of pure residual modes may be 58. In other words, intra prediction modes that do not belong to MPMs among all intra prediction modes may be classified into three possible residual modes and 58 pure residual modes.

[1107] The possible remainder pattern may have five binary bits, and the pure remainder pattern may have six binary bits.

[1108] In an embodiment, the binary bits for the three possible remaining patterns may be defined as "00000", "00001", and "00010". "00000" may indicate the first possible remaining pattern. "00001" may indicate the second possible remaining pattern. "00010" may indicate the third possible remaining pattern.

[1109] The binary bits for the 58 pure residue patterns may be defined as the sum of the binarized value and an offset of 3. For example, the binary bits for the pure residue pattern may include “000110” (= “000011” + “000011”), “000111” (= “000100” + “000011”), “001000”, “001001”, and the like.

[1110] As described above, the processing unit may encode and / or decode the remaining mode indicator using the binarized value.

[1111] Figure 34 is a flowchart of a target block prediction method and a bitstream generation method according to an embodiment.

[1112] The target block prediction method and the bitstream generation method according to this embodiment may be performed by the encoding apparatus 1600. This embodiment may be a part of a target block encoding method or a video encoding method.

[1113] At step 3410 , the processing unit 1610 may determine an intra prediction mode to be applied to encoding of a target block.

[1114] Step 3410 can be referred to above Figure 18 In addition, step 3410 can be the same as the step 1810 described above. Figure 30 Step 3010, step 3020, step 3030, step 3040 and step 3050 described above correspond to each other. In addition, step 3410 can be compared with the above reference step 3010. Figure 31 The described steps 3110, 3120, 3130, 3140 and 3150 correspond to each other.

[1115] The determined intra prediction mode may be 1) a bidirectional intra prediction mode and / or 2) an intra prediction mode using a residual mode.

[1116] Intra prediction can be 1) bidirectional intra prediction and / or 2) intra prediction using residual mode.

[1117] Among the intra prediction modes available for the target block, the processing unit 1610 may determine the intra prediction mode for the target block considering the rate-distortion cost of the intra prediction mode.

[1118] At step 3420 , the processing unit 1610 may perform intra prediction for the target block using the determined intra prediction mode.

[1119] Step 3420 can be referred to above Figure 18 The described step 1820 corresponds.

[1120] The information about the encoded target block may be generated by performing intra prediction for the target block using an intra prediction mode.

[1121] A prediction block may be generated by intra prediction of a target block using an intra prediction mode, and a residual block may be generated as a difference between the target block and the prediction block. Information about the encoded target block may be generated by applying transformation and quantization to the residual block.

[1122] The information about the encoded target block may include transform and quantization coefficients of the target block. The information about the encoded target block may include encoding parameters of the target block.

[1123] At step 3430 , the processing unit 1610 may generate a bitstream.

[1124] The bitstream may include information about the encoded target block.

[1125] The bitstream may include prediction information. The prediction information may be information for bidirectional intra prediction and / or intra prediction using residual mode. In other words, the prediction information may include coding parameters related to the target block required for intra prediction as described in the embodiments.

[1126] For example, the prediction information may include 1) unidirectional / bidirectional classification indicator, 2) intra prediction mode indicator, 3) weight for reference pixels, 4) MPM usage indicator, 5) MPM indicator, 6) predefined angle α, etc. for bidirectional intra prediction.

[1127] For example, the prediction information may include 1) an MPM use indicator, 2) an MPM indicator, 3) a residual mode indicator, 4) a residual mode use indicator, etc. for intra prediction using the residual mode.

[1128] The prediction information may be generated in step 3430 , or may be generated at least in part in steps 3410 and 3420 .

[1129] The processing unit 1610 may store the generated bitstream in the memory 1640. Alternatively, the communication unit 1620 may transmit the bitstream to the decoding apparatus 1700.

[1130] The processing unit 1610 may perform entropy encoding on the prediction information and may generate a bitstream including the entropy-encoded prediction information.

[1131] The embodiment can be compared with the above Figure 1 The operations of the encoding apparatus 100 described above may be combined. For example, the operations in steps 3410 and 3420 may be performed by the intra prediction unit 120. The operation in step 3430 may be performed by the entropy encoding unit 150. In addition, operations performed by other components of the encoding apparatus 100 may be performed before, after, and simultaneously with the execution of steps 3410, 3420, and 3430.

[1132] Figure 35 is a flowchart of a target block prediction method using a bitstream according to an embodiment.

[1133] The target block prediction method using a bitstream according to this embodiment may be performed by the decoding apparatus 1700. The embodiment may be a part of a target block decoding method or a video decoding method.

[1134] In step 3510 , the communication unit 1720 may obtain a bitstream. The communication unit 1720 may receive the bitstream from the encoding apparatus 1600 .

[1135] The bitstream may include information about the encoded target block.

[1136] The information about the encoded target block may include transform and quantization coefficients of the target block. The information about the encoded target block may include encoding parameters of the target block.

[1137] The bitstream may include prediction information. The prediction information may be information for bidirectional intra prediction and / or intra prediction using residual mode. In other words, the prediction information may include coding parameters related to the target block required for intra prediction as described in the embodiments.

[1138] For example, the prediction information may include 1) unidirectional / bidirectional classification indicator, 2) intra prediction mode indicator, 3) weight for reference pixels, 4) MPM usage indicator, 5) MPM indicator, 6) predefined angle α, etc. for bidirectional intra prediction.

[1139] For example, the prediction information may include 1) an MPM use indicator, 2) an MPM indicator, 3) a residual mode indicator, 4) a residual mode use indicator, etc. for intra prediction using the residual mode.

[1140] The processing unit 1710 may store the acquired bitstream in the memory 1740 .

[1141] The processing unit 1710 may obtain prediction information from the bitstream. The processing unit 1710 may obtain the prediction information by performing entropy decoding on the entropy-encoded prediction information of the bitstream.

[1142] At step 3520 , the processing unit 1710 may determine an intra prediction mode to be applied to decoding of the target block.

[1143] Step 3520 can be referred to above Figure 18 In addition, step 3520 can be the same as the step 1810 described above. Figure 30 Step 3010, step 3020, step 3030, step 3040 and step 3050 described above correspond to each other. In addition, step 3520 can be compared with the above reference step 3010. Figure 31 The described steps 3110, 3120, 3130, 3140 and 3150 correspond to each other.

[1144] The determined intra prediction mode may be 1) a bidirectional intra prediction mode and / or 2) an intra prediction mode using a residual mode.

[1145] Intra prediction can be 1) bidirectional intra prediction and / or 2) intra prediction using residual mode.

[1146] The processing unit 1710 may determine an intra prediction mode for a target block based on the prediction information.

[1147] In step 3530 , the processing unit 1710 may perform intra prediction for the target block using the information about the encoded target block and the determined intra prediction mode.

[1148] Step 3530 can be referred to above Figure 18 The described step 1820 corresponds to the described step 1820. In addition, in step 3530, a prediction block may be generated by performing intra prediction on the target block using the intra prediction mode, and a reconstructed block may be generated as a sum of the prediction block and the reconstructed residual block.

[1149] The embodiment can be compared with the above Figure 2 The operations of the decoding device 200 described above may be combined. For example, the operation in step 3510 may be performed by the entropy decoding unit 210. The operations in steps 3520 and 3530 may be performed by the intra-frame prediction unit 240. In addition, before, after, and simultaneously with the execution of steps 3510, 3520, and 3530, operations performed by other components of the decoding device 200 may be performed.

[1150] In the embodiments described above, although the methods have been described based on flowcharts as a series of steps or units, the present disclosure is not limited to the order of the steps, and some steps may be performed in an order different from the order of the steps described or performed simultaneously with other steps. In addition, those skilled in the art will understand that the steps shown in the flowcharts are not exclusive and may include other steps, or one or more steps in the flowcharts may be deleted without departing from the scope of the present disclosure.

[1151] The embodiments described above according to the present disclosure may be implemented as programs that can be run by various computer devices and may be recorded on a computer-readable storage medium. The computer-readable storage medium may include program instructions, data files, and data structures, either individually or in combination. The program instructions recorded on the storage medium may be specifically designed or configured for the present disclosure, or may be known or available to those skilled in the art of computer software.

[1152] The computer-readable storage medium may include information used in the embodiments of the present disclosure. For example, the computer-readable storage medium may include a bit stream, and the bit stream may contain the information described above in the embodiments of the present invention.

[1153] Computer-readable storage media may include non-transitory computer-readable media.

[1154] Examples of computer-readable storage media may include all types of hardware devices specifically configured to record and execute program instructions, such as magnetic media (such as hard disks, floppy disks, and magnetic tapes), optical media (such as compact disk (CD)-ROMs and digital versatile disks (DVDs)), and magneto-optical media (such as floppy disks, ROMs, RAMs, and flash memories). Examples of program instructions include machine codes (such as codes created by a compiler) and high-level language codes that can be executed by a computer using an interpreter. A hardware device may be configured to operate as one or more software modules to perform the operations of the present disclosure, and vice versa.

[1155] As described above, although the present disclosure has been described based on specific details (such as detailed components and a limited number of embodiments and drawings), the specific details are only provided for easy understanding of the present disclosure, and the present disclosure is not limited to these embodiments. Those skilled in the art will practice various changes and modifications based on the above description.

[1156] Therefore, it should be understood that the spirit of the present embodiment is not limited to the above-described embodiment, and that the appended claims and their equivalents and modifications fall within the scope of the present disclosure.

Claims

1. A decoding method, comprising: Determine the target block; determining a prediction mode for a target block; and performing prediction for the target block based on the prediction mode, Wherein, a prediction block is generated based on the prediction.

2. The method according to claim 1, wherein The prediction is performed using reference pixels determined by the prediction mode.

3. The decoding method according to claim 2, wherein: The reference pixels include a first reference pixel and a second reference pixel, and The first reference pixel and the second reference pixel are determined by the direction of the prediction mode.

4. The decoding method according to claim 3, wherein: The prediction is performed using a first weight value for a first reference value determined through the first reference pixel and a second weight value for a second reference value determined through the second reference pixel.

5. The decoding method according to claim 4, wherein: The first weight value is determined based on a distance between a target pixel of the target block and a first reference pixel, and The second weight value is determined based on a distance between the target pixel and a second reference pixel.

6. The decoding method according to claim 3, wherein: The prediction is performed by a number of different prediction methods.

7. The decoding method according to claim 2, wherein: The reference pixels include a first reference pixel and a second reference pixel, The first reference pixel and the second reference pixel are not adjacent to the target block, The X coordinate of the first reference pixel and the X coordinate of the second reference pixel are different from each other, and The Y coordinate of the first reference pixel and the Y coordinate of the second reference pixel are different from each other.

8. The decoding method according to claim 1, wherein: In a case where the first indicator indicates that at least one first intra prediction mode is used for the prediction for the target block, performing the prediction for the target block using the at least one first intra prediction mode, in a case where a first indicator indicates that the at least one first intra prediction mode is not used for the prediction for the target block and a second indicator indicates that a list including one or more second intra prediction modes is used for the prediction for the target block, using an intra prediction mode in the list for the prediction for the target block, The at least one first intra prediction mode is not included in the list.

9. The decoding method according to claim 1, wherein: determining whether to perform said prediction using a list comprising one or more most probable modes (MPMs), performing the prediction using a selected remaining pattern from among a plurality of remaining patterns without using the list, The plurality of remaining modes do not include the one or more MPMs, The remaining mode indicator indicates the remaining modes of the selection, and The value of the remaining mode indicator is binarized using a truncated binary encoding method.

10. The decoding method according to claim 9, wherein: The number of the plurality of remaining patterns is 61, The remaining mode indicator is decoded from one of a plurality of truncated bins, The plurality of truncated binary bits are used to indicate 61 remaining modes, respectively, and The plurality of truncated binary bits for the 61 remaining patterns are "00000", "00001", "00010", "000110", "000111", "001000", "001001", "001010", "001011", "001100", "001101", "001110", "001111", "0100 00", "010001", "010010", "010011", "010100", "010101", "010110", "010111", "011000", "011001", "011010", "011011", "011100", "011101", "011110", "011111", "010 0000", "100001", "100010", "100011", "100100", "100101", "100110", "100111", "101000", "101001", "101010", "101011", "101100", "101101", "101110", "101111", " "110000", "110001", "110010", "110011", "110100", "110101", "110110", "110111", "111000", "111001", "111010", "111011", "111100", "111101", "111110", and "111111".

11. A coding method comprising: Determine the target block; determining a prediction mode for a target block; and performing prediction for the target block based on the prediction mode, Wherein, a prediction block is generated based on the prediction.

12. The encoding method according to claim 11, wherein: The prediction is performed using reference pixels determined by the prediction mode.

13. The encoding method according to claim 12, wherein: The reference pixels include a first reference pixel and a second reference pixel, and The first reference pixel and the second reference pixel are determined by the direction of the prediction mode.

14. The encoding method according to claim 11, wherein: In a case where the first indicator indicates that at least one first intra prediction mode is used for the prediction for the target block, performing the prediction for the target block using the at least one first intra prediction mode, in a case where a first indicator indicates that the at least one first intra prediction mode is not used for the prediction for the target block and a second indicator indicates that a list including one or more second intra prediction modes is used for the prediction for the target block, using an intra prediction mode in the list for the prediction for the target block, The at least one first intra prediction mode is not included in the list.

15. The encoding method according to claim 11, wherein: determining whether to perform said prediction using a list comprising one or more most probable modes (MPMs), performing the prediction using a selected remaining pattern from among a plurality of remaining patterns without using the list, The plurality of remaining modes do not include the one or more MPMs, The remaining mode indicator indicates the remaining modes of the selection, and The value of the remaining mode indicator is binarized using a truncated binary encoding method.

16. A computer-readable medium storing a bit stream generated by an encoding device through the encoding method of claim 11.

17. A computer-readable recording medium storing a bit stream, the bit stream comprising: Prediction model information; The prediction mode information is information used to determine the prediction mode for the target block after the target block is determined. wherein the prediction mode is used to perform prediction for the target block, Wherein, a prediction block is generated based on the prediction.

18. The computer-readable recording medium according to claim 17, wherein The prediction is performed using reference pixels determined by the prediction mode.

19. The computer-readable recording medium according to claim 18, wherein The reference pixels include a first reference pixel and a second reference pixel, and The first reference pixel and the second reference pixel are determined by the direction of the prediction mode.

20. The computer-readable recording medium according to claim 17, wherein In a case where the first indicator indicates that at least one first intra prediction mode is used for the prediction for the target block, performing the prediction for the target block using the at least one first intra prediction mode, in a case where a first indicator indicates that the at least one first intra prediction mode is not used for the prediction for the target block and a second indicator indicates that a list including one or more second intra prediction modes is used for the prediction for the target block, using an intra prediction mode in the list for the prediction for the target block, The at least one first intra prediction mode is not included in the list.

21. The computer-readable recording medium according to claim 17, wherein determining whether to perform said prediction using a list comprising one or more most probable modes (MPMs), performing the prediction using a selected remaining pattern from among a plurality of remaining patterns without using the list, The plurality of remaining modes do not include the one or more MPMs, The remaining mode indicator indicates the remaining modes of the selection, and The value of the remaining mode indicator is binarized using a truncated binary encoding method.

22. A computer-readable medium storing a bitstream generated by a video encoding device performing an encoding method, the encoding method comprising: Determine the target block; determining a prediction mode for a target block; performing prediction for the target block based on the prediction mode; and storing a bitstream including prediction mode information indicating the prediction mode, Wherein, a prediction block is generated based on the prediction.

23. A method for transmitting a bitstream, the method comprising: sending a bitstream including prediction mode information; The prediction mode information is information used to determine the prediction mode for the target block after the target block is determined. wherein the prediction mode is used to perform prediction for the target block, Wherein, a prediction block is generated based on the prediction.

24. The method of claim 23, wherein: The prediction is performed using reference pixels determined by the prediction mode.

25. The method of claim 24, wherein: The reference pixels include a first reference pixel and a second reference pixel, and The first reference pixel and the second reference pixel are determined by the direction of the prediction mode.

26. The method of claim 23, wherein: In a case where the first indicator indicates that at least one first intra prediction mode is used for the prediction for the target block, performing the prediction for the target block using the at least one first intra prediction mode, in a case where a first indicator indicates that the at least one first intra prediction mode is not used for the prediction for the target block and a second indicator indicates that a list including one or more second intra prediction modes is used for the prediction for the target block, using an intra prediction mode in the list for the prediction for the target block, The at least one first intra prediction mode is not included in the list.

27. The method of claim 23, wherein: determining whether to perform said prediction using a list comprising one or more most probable modes (MPMs), performing the prediction using a selected remaining pattern from among a plurality of remaining patterns without using the list, The plurality of remaining modes do not include the one or more MPMs, The remaining mode indicator indicates the remaining modes of the selection, and The value of the remaining mode indicator is binarized using a truncated binary encoding method.

28. A decoding method comprising: Determine the target block; determining a prediction mode for a target block; and performing decoding for the target block based on the prediction mode, Wherein, a prediction block is generated based on the prediction mode.

29. A coding method comprising: Determine the target block; determining a prediction mode for a target block; and performing encoding for the target block based on the prediction mode, Wherein, a prediction block is generated based on the prediction mode.

30. A computer-readable medium storing a bit stream generated by an encoding device through the encoding method of claim 29.

31. A computer-readable recording medium storing a bitstream, the bitstream comprising: Prediction model information; The prediction mode information is information used to determine the prediction mode for the target block after the target block is determined. wherein the prediction mode is used to perform decoding for the target block, Wherein, a prediction block is generated based on the prediction mode.

32. A computer-readable medium storing a bitstream generated by a video encoding device performing an encoding method, the encoding method comprising: Determine the target block; determining a prediction mode for a target block; performing encoding for the target block based on the prediction mode; and storing a bitstream including prediction mode information indicating the prediction mode, Wherein, a prediction block is generated based on the prediction mode.

33. A method for transmitting a bitstream, the method comprising: sending a bitstream including prediction mode information; The prediction mode information is information used to determine the prediction mode for the target block after the target block is determined. wherein the prediction mode is used to perform decoding for the target block, Wherein, a prediction block is generated based on the prediction mode.