Bi - directional Intra Prediction Method and Device

By adopting a bidirectional intra prediction mode in high-resolution and high-definition images, using virtual neighboring pixels and neighboring block pixels in the bidirectional direction, the problem of low intra prediction efficiency in the prior art is solved, and more efficient encoding and decoding is achieved.

CN111684801BActive Publication Date: 2025-06-13ELECTRONICS & TELECOMM RES INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201880086865.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-07-12
Filing Date
2018-11-28
Publication Date
2025-06-13
Estimated Expiration
2038-11-28

AI Technical Summary

Technical Problem

The prior art is difficult to effectively utilize intra prediction technology to achieve efficient encoding and decoding in high-resolution and high-definition images.

Method used

Using a bidirectional intra prediction mode, virtual neighboring pixels are generated in a designated direction of the target block, and prediction values ​​are derived based on pixels in neighboring blocks in both directions of the bidirectional intra prediction.

Benefits of technology

Improves the accuracy and efficiency of intra prediction, enables more efficient processing of high-resolution and high-definition images, reducing the complexity of encoding and decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111684801B_ABST
    Figure CN111684801B_ABST
Patent Text Reader

Abstract

A video decoding method and apparatus, and a video encoding method and apparatus are disclosed. Intra prediction is used to perform encoding and decoding of a target block. The intra prediction is bidirectional intra prediction and is intra prediction using a residual mode. In the bidirectional intra prediction, a predicted value of a target pixel in the target block is determined based on reference pixels in two directions according to the bidirectional intra prediction. In the intra prediction using the residual mode, the residual mode is a remaining intra prediction mode other than the MPMs in the MPM list.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] 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 prediction. Background Art

[0002] With the continuous development of the information and communication industry, broadcast services supporting high definition (HD) resolution have become widespread worldwide. Through this spread, a large number of users have become accustomed to high-resolution and high-definition images and / or videos.

[0003] To meet the user's demand for high definition, a large number of institutions have accelerated the development of next-generation imaging devices. In addition to high-definition TVs (HDTVs) and full high-definition (FHD) TVs, users' interest in UHD TVs has also increased, where the resolution of UHD TVs is more than four times that of full high-definition (FHD) TVs. With the increase in their interest, there is a continuous need for image encoding / decoding technologies for images with higher resolution and higher definition.

[0004] Image encoding / decoding devices and methods can use inter prediction techniques, intra prediction techniques, entropy encoding techniques, etc., in order to perform encoding / decoding on high-resolution and high-definition images. The inter prediction technique can be a technique for predicting the values of pixels included in a target picture using a picture that is temporally previous and / or a picture that is temporally subsequent. The intra prediction technique can be a technique for predicting the values of pixels included in a target picture using information about the pixels in the target picture. The entropy encoding technique can be a technique for assigning short codewords to frequently occurring symbols and long codewords to rarely occurring symbols.

[0005] 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

[0006] Technical Problem

[0007] Embodiments are directed to providing an encoding device and method and a decoding device and method using bidirectional intra prediction.

[0008] Embodiments are directed to providing an encoding device and method and a decoding device and method using a residual mode.

[0009] Technical Solution

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

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

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

[0013] The two directions of the bi-directional intra prediction may be two opposite straight-line directions.

[0014] Virtual neighboring pixels may be generated in a specified direction of the target block, and the bi-directional intra prediction may be performed for the target block using the virtual neighboring pixels.

[0015] The specified direction may be one or more of the right direction and the down direction.

[0016] Pixels in neighboring blocks located in the two directions of the bi-directional intra prediction may be used to derive a predicted value for a target pixel in the target block.

[0017] A predicted value for the target pixel may be derived using weights according to the distances between respective pixels in neighboring blocks located in the two directions of the bi-directional intra prediction and the target pixel in the target block.

[0018] Weights for the two directions of the bi-directional intra prediction may be used to derive a predicted value for a target pixel in the target block.

[0019] A uni-directional / bi-directional classification indicator and an intra prediction mode indicator may be used to determine whether the bi-directional intra prediction mode for the target block will be used.

[0020] The two directions of the bi-directional intra prediction may be determined based on two directions indicated by two intra prediction mode indicators.

[0021] A single intra prediction mode indicator may indicate one of the direction of the uni-directional intra prediction and the direction of the bi-directional intra prediction.

[0022] One of the uni-directional intra prediction and the bi-directional intra prediction may be selected according to the availability of reference pixels in a direction corresponding to the direction indicated by the intra prediction mode indicator.

[0023] It may be determined which one of the uni-directional intra prediction and the bi-directional intra prediction will be used for the entire target block.

[0024] It is possible to determine which one of unidirectional intra prediction and bidirectional intra prediction will be used for each of the pixels in the target block.

[0025] For the first direction and the second direction of bidirectional intra prediction, when the reference pixels in the first direction or the reference pixels in the second direction are not available, padding can be used to generate the values of the unavailable reference pixels.

[0026] At least one of the reference pixels located in two prediction directions of the bidirectional intra prediction mode can be used to determine the prediction value for the target pixel in the target block.

[0027] Weights can be applied to each of the reference pixels.

[0028] The residual mode indicator can indicate the residual mode among multiple residual modes that will be used for the intra prediction of the target block.

[0029] The multiple residual modes can be residual intra prediction modes other than the MPMs present in the most probable mode (MPM) list.

[0030] The intra prediction mode can be determined based on multiple different lists.

[0031] According to another aspect, there is provided an encoding method including: determining the intra prediction mode to be applied to the decoding of a target block; and performing intra prediction for the target block using the determined intra prediction mode, where the intra prediction mode is a bidirectional intra prediction mode, and where the intra prediction is bidirectional intra prediction.

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

[0033] Advantageous Effects

[0034] There are provided an encoding device and method and a decoding device and method using bidirectional intra prediction.

[0035] There are provided an encoding device and method and a decoding device and method using residual modes. Brief Description of the Drawings

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

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

[0038] Figure 3 is a diagram schematically showing the partitioning structure of an image when the image is encoded and decoded;

[0039] Figure 4 is a diagram showing the forms of prediction units (PUs) that a coding unit (CU) can include;

[0040] Figure 5 is a diagram showing the forms of transform units (TUs) that can be included in a CU;

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

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

[0043] Figure 8 is a diagram for explaining the positions of reference sample points used in the intra prediction process;

[0044] Figure 9 is a diagram for explaining an embodiment of the inter prediction process;

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

[0046] Figure 11 shows the order of adding the motion information of spatial candidates to the merge list according to an embodiment;

[0047] Figure 12 shows transform and quantization processing according to an example;

[0048] Figure 13 shows diagonal scanning according to an example;

[0049] Figure 14 shows horizontal scanning according to an example;

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

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

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

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

[0054] Figure 19Shows a unidirectional intra prediction mode according to an example;

[0055] Figure 20 Shows a bidirectional intra prediction mode according to an example;

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

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

[0058] Figure 23 Shows the generation of virtual neighboring pixels according to an example;

[0059] Figure 24 Shows the generation of additional virtual neighboring pixels using virtual neighboring pixels according to an example;

[0060] Figure 25 Shows the generation of lower - right virtual neighboring pixels and middle virtual neighboring pixels according to an example;

[0061] Figure 26 Shows bidirectional intra prediction according to an example;

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

[0063] Figure 28 Shows bidirectional intra prediction using the distance between neighboring pixels and a target pixel according to an example;

[0064] Figure 29 Shows bidirectional intra prediction using the distance between a virtual neighboring pixel and a target pixel according to an example;

[0065] Figure 30 Shows determining an intra prediction mode using a residual mode according to an embodiment;

[0066] Figure 31 Shows deriving the MPM after determining whether the MPM is used and determining the intra prediction mode using the residual mode according to an embodiment;

[0067] Figure 32 Shows a block for deriving MPM candidates according to an example;

[0068] Figure 33 Shows the binarization of a residual mode indicator according to an example;

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

[0070] Figure 35 It is a flowchart of a target block prediction method using a bitstream according to an embodiment. Detailed implementation manners

[0071] The present invention can be variously changed and can have various embodiments. 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 a specific disclosed form, and they include all changes, equivalent forms or modified forms included within the spirit and scope of the present invention.

[0072] The following exemplary embodiments will be described in detail with reference to the accompanying drawings showing specific embodiments. These embodiments are described such that those of ordinary skill in the art to which the present disclosure pertains can easily practice these embodiments. It should be noted that the various embodiments are different from each other but do not necessarily exclude each other. 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 related to one embodiment. In addition, it should be understood that the positions or arrangements of the respective components in each disclosed embodiment can be changed without departing from the spirit and scope of the embodiments. Therefore, the following detailed description is not intended to limit the scope of the present disclosure, and the scope of the exemplary embodiments is only defined by the appended claims and their equivalents (as long as they are properly described).

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

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

[0075] 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 there may be an intermediate component between the two components. It will be understood that when a component is referred to as being "directly connected or coupled", there is no intermediate component between the two components.

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

[0077] In addition, it should be noted that, in the exemplary embodiments, the expression describing that a component "includes" a specific component means that additional components may be included within the scope of the practice or technical spirit of the exemplary embodiments, but does not exclude the existence of components other than the said specific component.

[0078] The terms used in this specification are only for describing specific embodiments and are not intended to limit the present invention. Singular expressions include plural expressions unless specifically stated to the contrary in the context. In this specification, it should be understood that terms such as "include" or "have" are only intended to indicate the existence of features, numbers, steps, operations, components, parts, or combinations thereof, and are not intended to exclude the possibility that one or more other features, numbers, steps, operations, components, parts, or combinations thereof will exist or be added.

[0079] Embodiments will be described in detail below with reference to the accompanying drawings so that those of ordinary skill in the art to which the embodiments pertain can easily practice the embodiments. In the following description of the embodiments, a detailed description of well-known functions or configurations that are considered to obscure the gist of this specification will be omitted. In addition, the same reference numerals are used throughout the drawings to designate the same components, and repeated descriptions of the same components will be omitted.

[0080] Hereinafter, an "image" may represent a single frame constituting a video, or may represent the video itself. For example, "encoding and / or decoding of an image" may represent "encoding and / or decoding of a video", and may also represent "encoding and / or decoding of any one of the multiple images constituting a video".

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

[0082] Hereinafter, a target image may be an encoding target image that is a target to be encoded and / or a decoding target image that is 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.

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

[0084] 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, that is, a target currently to be encoded and / or decoded. Here, the terms "target block" and "current block" may be used with the same meaning and may be used interchangeably with each other.

[0085] Hereinafter, the terms "block" and "unit" may be used with the same meaning and may be used interchangeably with each other. Optionally, "block" may represent a specific unit.

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

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

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

[0089] When variables such as i or j are used to indicate a row, column, or index, the value of i may be an integer 0 or an integer greater than 0, or may be an integer 1 or an integer 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.

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

[0091] Encoder: An encoder represents a device for performing encoding.

[0092] Decoder: A decoder represents a device for performing decoding.

[0093] Unit: "Unit" may represent a unit of image encoding and decoding. The terms "unit" and "block" may be used with the same meaning and may be used interchangeably with each other.

[0094] – A "unit" can be an M×N sample array. M and N can be positive integers respectively. The term "unit" generally can represent a two-dimensional (2D) sample array.

[0095] – During the encoding and decoding processes of an image, a "unit" can be a region generated by partitioning an image. In other words, a "unit" can be a region specified in an image. A single image can be partitioned into multiple units. Optionally, an image can be partitioned into sub-parts, and a unit can represent each partitioned sub-part when encoding or decoding the partitioned sub-parts is performed.

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

[0097] – According to functions, unit types can be classified as macro units, coding units (CUs), prediction units (PUs), residual units, transform units (TUs), etc. Optionally, according to functions, a unit can represent 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.

[0098] – The term "unit" can represent including a luma component block, a chroma component block corresponding to the luma component block, and information of syntax elements for each block such that the unit is specified to be distinct from the block.

[0099] – The size and shape of a unit can be implemented differently. In addition, a unit can have any one of various sizes and shapes. Specifically, the shape of a unit can include not only a square but also geometric shapes (such as rectangles, trapezoids, triangles, and pentagons) that can be represented in two dimensions (2D).

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

[0101] – A unit can be partitioned into sub-units, each sub-unit having a size smaller than that of the relevant unit.

[0102] – Depth: The depth can represent the degree to which a unit is partitioned. In addition, the unit depth can indicate the level at which the corresponding unit exists when the unit is represented in a tree structure.

[0103] – Unit partition information can include a depth indicating the depth of the unit. The depth can indicate the number of times a unit is partitioned and / or the degree to which a unit is partitioned.

[0104] – In a tree structure, it can be considered that the root node has the minimum depth and the leaf node has the maximum depth.

[0105] – A single unit can be hierarchically partitioned into multiple sub-units, while the single unit has depth information based on a tree structure. In other words, the unit and the sub-units generated by partitioning the unit can respectively correspond to a node and the children nodes of the node. Each partitioned sub-unit can have a unit depth. Since the depth indicates the number of times the unit is partitioned and / or the degree of partitioning of the unit, the partitioning information of the sub-unit can include information about the size of the sub-unit.

[0106] – In a tree structure, the top node can correspond to the initial node before partitioning. The top node can be referred to as the "root node". In addition, the root node can have the minimum depth value. Here, the depth of the top node can be level "0".

[0107] – A node with a depth of level "1" can represent the unit generated when the initial unit is partitioned once. A node with a depth of level "2" can represent the unit generated when the initial unit is partitioned twice.

[0108] – A leaf node with a depth of level "n" can represent the unit generated when the initial unit is partitioned n times.

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

[0110] – QT depth can represent the depth for four-way partitioning. BT depth can represent the depth for two-way partitioning. TT depth can represent the depth for three-way partitioning.

[0111] – Sample: A sample can be the basic unit that constitutes a block. The sample can be represented by values from 0 to 2 Bd- ^1 according to the bit depth (Bd).

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

[0113] – Hereinafter, the terms "pixel" and "sample" can be used with the same meaning and can be used interchangeably with each other.

[0114] Coding Tree Unit (CTU): A CTU can be composed of a single luma component (Y) coding tree block and two chroma component (Cb, Cr) coding tree blocks related to the luma component coding tree block. In addition, a CTU can represent the information including the above-mentioned blocks and the syntax elements for each block.

[0115] – One or more partitioning methods, such as quadtree (QT), binary tree (BT), and ternary tree (TT), can be used to partition each coding tree unit (CTU) to configure sub-units, such as coding units, prediction units, and transform units.

[0116] – "CTU" can be used as a term to specify a pixel block that serves as a processing unit in image decoding and encoding processes (such as in the case of partitioning an input image).

[0117] Coding tree block (CTB): "CTB" can be used as a term to specify any one of the Y coding tree block, Cb coding tree block, and Cr coding tree block.

[0118] Neighboring block: A neighboring block (or adjacent block) can represent a block adjacent to a target block. A neighboring block can represent a reconstructed neighboring block.

[0119] Hereinafter, the terms "neighboring block" and "adjacent block" can be used with the same meaning and can be used interchangeably with each other.

[0120] Spatial neighboring block: A spatial neighboring block can be a block that is spatially adjacent to a target block. A neighboring block can include a spatial neighboring block.

[0121] – The target block and the spatial neighboring block can be included in the target picture.

[0122] – A spatial neighboring block can represent a block whose boundary touches the target block or a block whose position is within a predetermined distance from the target block.

[0123] – A spatial neighboring block can represent a block adjacent to the vertex of the target block. Here, a block adjacent to the vertex of the target block can represent a block that is vertically adjacent to a horizontally adjacent neighboring block of the target block or a block that is horizontally adjacent to a vertically adjacent neighboring block of the target block.

[0124] Temporal neighboring block: A temporal neighboring block can be a block that is temporally adjacent to a target block. A neighboring block can include a temporal neighboring block.

[0125] – A temporal neighboring block can include a collocated block (col block).

[0126] – A col block can be a block in a previously reconstructed collocated picture (col picture). The position of the col block in the col picture can correspond to the position of the target block in the target picture. Optionally, the position of the col block in the col picture can be equal to the position of the target block in the target picture. The col picture can be a picture included in the reference picture list.

[0127] – A temporal neighboring block can be a block that is temporally adjacent to a spatial neighboring block of the target block.

[0128] Prediction Unit: The prediction unit can be a basic unit for prediction (such as inter-frame prediction, intra-frame prediction, inter-frame compensation, intra-frame compensation, and motion compensation).

[0129] – A single prediction unit can be divided into multiple partitions or sub-prediction units with smaller sizes. The multiple partitions can also be basic units during the execution of prediction or compensation. The partitions generated by dividing the prediction unit can also be prediction units.

[0130] Prediction Unit Partition: The prediction unit partition can be the shape into which the prediction unit is divided.

[0131] Reconstructed Neighboring Unit: The reconstructed neighboring unit can be a unit that has been decoded and reconstructed around the target unit.

[0132] – The reconstructed neighboring unit can be a unit that is spatially adjacent or temporally adjacent to the target unit.

[0133] – The reconstructed spatial neighboring unit can be a unit that has been reconstructed through encoding and / or decoding and is included in the target picture.

[0134] – The reconstructed temporal neighboring unit can be a unit that has been reconstructed through encoding and / or decoding and is included in the reference image. The position of the reconstructed temporal neighboring unit in the reference image can be the same as the position of the target unit in the target picture, or can correspond to the position of the target unit in the target picture.

[0135] Parameter Set: The parameter set can be the header information in the structure of the bitstream. For example, the parameter set can include a video parameter set, a sequence parameter set, a picture parameter set, an adaptive parameter set, etc.

[0136] In addition, the parameter set can include slice header information and parallel block header information.

[0137] Rate-Distortion Optimization: The encoding device can 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), the motion information, and the size of the transform unit (TU).

[0138] – The rate-distortion optimization scheme can calculate the rate-distortion cost for each combination to select the optimal combination from these combinations. The following Equation 1 can be used to calculate the rate-distortion cost. Generally, the combination that minimizes the rate-distortion cost can be selected as the optimal combination under the rate-distortion optimization scheme.

[0139] [Equation 1]

[0140] D + λ * R

[0141] –D may represent distortion. D can be the average of the squares of the differences between the original transform coefficients and the reconstructed transform coefficients in a transform unit (i.e., the mean squared error).

[0142] –R may represent the rate, which can represent the bit rate using relevant context information.

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

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

[0145] –Bitstream: The bitstream can represent a stream of bits including encoded image information.

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

[0147] The parameter set can include at least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptive parameter set. In addition, the parameter set can include information about slice headers and information about parallel block headers.

[0148] Parsing: Parsing can be the determination of the value of a syntax element made by performing entropy decoding on the bitstream. Optionally, the term "parsing" can represent this entropy decoding itself.

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

[0150] Reference picture: A reference picture can be an image that is referenced by a unit to perform inter prediction or motion compensation. Optionally, a reference picture can be an image including reference units that are referenced by a target unit to perform inter prediction or motion compensation.

[0151] Hereinafter, the terms "reference picture" and "reference image" can be used with the same meaning and can be used interchangeably with each other.

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

[0153] –The types of reference picture lists can include a merged list (LC), list 0 (L0), list 1 (L1), list 2 (L3), list 3 (L3), etc.

[0154] – For inter - frame prediction, one or more reference picture lists can be used.

[0155] Inter - frame prediction indicator: The inter - frame prediction indicator can indicate the inter - frame prediction direction for the target unit. The inter - frame prediction can be one of unidirectional prediction and bidirectional prediction. Optionally, the inter - frame prediction indicator can represent the number of reference images used to generate the prediction unit for the target unit. Optionally, the inter - frame prediction indicator can represent the number of prediction blocks used for inter - frame prediction or motion compensation for the target unit.

[0156] Reference picture index: The reference picture index can be an index indicating a specific reference image in the reference picture list.

[0157] Motion vector (MV): The motion vector can be a 2D vector used for inter - frame prediction or motion compensation. The motion vector can represent the offset between the target image and the reference image.

[0158] – For example, the MV can be represented in a form such as (mv x , mv y ). mv x can indicate the horizontal component, and mv y can indicate the vertical component.

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

[0160] Motion vector candidate: The motion vector candidate can be a block that is a prediction candidate when the motion vector is predicted or the motion vector of a block that is a prediction candidate.

[0161] – The motion vector candidate can be included in the motion vector candidate list.

[0162] Motion vector candidate list: The motion vector candidate list can be a list configured using one or more motion vector candidates.

[0163] Motion vector candidate index: The motion vector candidate index can be an indicator used to indicate the motion vector candidate in the motion vector candidate list. Optionally, the motion vector candidate index can be the index of a motion vector predictor.

[0164] Motion information: The motion information can 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 - frame prediction indicator.

[0165] Merge candidate list: The merge candidate list can be a list configured using merge candidates.

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

[0167] Merge index: A merge index can be an indicator for indicating a merge candidate in a merge candidate list.

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

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

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

[0171] Scaling: Scaling may represent a process of multiplying a factor by a transform coefficient level.

[0172] – As a result of scaling the transform coefficient level, transform coefficients may be generated. Scaling may also be referred to as "dequantization".

[0173] Quantization parameter (QP): A quantization parameter can be a value for generating a transform coefficient level for a transform coefficient in quantization. Optionally, the quantization parameter can also be a value for generating a transform coefficient by scaling a transform coefficient level in dequantization. Optionally, the quantization parameter can be a value mapped to a quantization step size.

[0174] Variable Delta quantization parameter: A variable Delta quantization parameter is the difference between the quantization parameter of a target unit and a predicted quantization parameter.

[0175] Scanning: Scanning may represent a method of arranging the order of coefficients in a unit, block, or matrix. For example, a method for arranging a 2D array in the form of a one-dimensional (1D) array may be referred to as "scanning". Optionally, a method for arranging a 1D array in the form of a 2D array may also be referred to as "scanning" or "inverse scanning".

[0176] Transform coefficient: A transform coefficient can be a coefficient value generated when an encoding device performs a transform. Optionally, a transform coefficient can be a coefficient value generated when a decoding device performs at least one of entropy decoding and dequantization.

[0177] – The quantization levels or quantized transform coefficient levels generated by applying quantization to transform coefficients or residual signals may also be included in the meaning of the term "transform coefficient".

[0178] Quantization level: The quantization level may be a value generated when an encoding device performs quantization on transform coefficients or a residual signal. Optionally, the quantization level may be a value targeted for inverse quantization when a decoding device performs inverse quantization.

[0179] – The quantized transform coefficient levels resulting from transformation and quantization may also be included in the meaning of quantization levels.

[0180] 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. Optionally, a non-zero transform coefficient may be a transform coefficient whose value magnitude is not 0, or may be a transform coefficient level whose value magnitude is not 0.

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

[0182] Quantization matrix coefficient: The quantization matrix coefficient may be each element in the quantization matrix. The quantization matrix coefficient may also be referred to as a "matrix coefficient".

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

[0184] Non-default matrix: The non-default matrix may be a quantization matrix not predefined by the encoding device and the decoding device. The non-default matrix may be signaled by the encoding device to the decoding device.

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

[0186] The encoding device and the decoding device may determine one or more MPMs based on the coding parameters related to the target block and the attributes of the object related to the target block.

[0187] The encoding device and the decoding device may determine one or more MPMs based on the intra prediction modes of reference blocks. The reference blocks may include multiple reference blocks. The multiple reference blocks may include spatially adjacent blocks adjacent to the left side of the target block and spatially adjacent blocks adjacent to the upper side of the target block. In other words, one or more different MPMs may be determined according to which intra prediction modes have been used for the reference blocks.

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

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

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

[0191] Since the MPM list is determined in the same manner in both the encoding device and the decoding device, it may not be necessary to send the MPM list itself from the encoding device to the decoding device.

[0192] The MPM indicator can be signaled from the encoding device to the decoding device. Since the MPM indicator is signaled, the decoding device can determine the MPM among the MPMs in the MPM list that will be used for intra prediction for a target block.

[0193] MPM usage indicator: The MPM usage indicator can indicate whether the MPM usage mode will be used for prediction for a target block. The MPM usage mode can be a mode of using the MPM list to determine the MPM that will be used for intra prediction for a target block.

[0194] The MPM usage indicator can be signaled from the encoding device to the decoding device.

[0195] Signaling: "Signaling" can mean that information is sent from the encoding device to the decoding device. Optionally, signaling can mean that the information is included in a bitstream or a storage medium. The information signaled by the encoding device can be used by the decoding device.

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

[0197] The encoding device 100 can be an encoder, a video encoding device, or an image encoding device. The video can include one or more images (frames). The encoding device 100 can sequentially encode one or more images of the video.

[0198] Refer to 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 unit 160, an inverse transform unit 170, an adder 175, a filter unit 180, and a reference picture buffer 190.

[0199] The encoding device 100 can perform encoding on a target image using the intra-frame mode and / or the inter-frame mode.

[0200] In addition, the encoding device 100 can generate a bitstream including information about the 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 via a wireless / wired transmission medium.

[0201] When the intra-frame mode is used as the prediction mode, the switch 115 can switch to the intra-frame mode. When the inter-frame mode is used as the prediction mode, the switch 115 can switch to the inter-frame mode.

[0202] The encoding device 100 can generate a prediction block for a target block. In addition, after the prediction block has been generated, the encoding device 100 can encode the residual between the target block and the prediction block.

[0203] When the prediction mode is the intra-frame mode, the intra-frame prediction unit 120 can use the pixels of previously encoded / decoded neighboring blocks around the target block as reference sample points. The intra-frame prediction unit 120 can perform spatial prediction on the target block using the reference sample points and can generate prediction sample points for the target block via spatial prediction.

[0204] The inter-frame prediction unit 110 can include a motion prediction unit and a motion compensation unit.

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

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

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

[0208] 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 region of a reference image. To perform inter prediction or motion compensation, it may be determined which one of a skip mode, a merge mode, an advanced motion vector prediction (AMVP) mode, and a current picture reference mode corresponds to a method for predicting the motion of a PU included in a CU based on the CU and compensating for the motion, and inter prediction or motion compensation may be performed according to the mode.

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

[0210] The residual signal may be the difference between the original signal and the prediction signal. Optionally, the residual signal may be a signal generated by transforming or quantizing the difference between the original signal and the prediction signal or a signal generated by transforming and quantizing the difference. The residual block may be the residual signal for a block unit.

[0211] The transform unit 130 may generate transform coefficients by transforming the residual block and may output the generated transform coefficients. Here, the transform coefficients may be coefficient values generated by transforming the residual block.

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

[0213] The plurality of predefined transform methods may include a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loeve transform (KLT), etc.

[0214] The transform method for transforming the residual block may be determined according to at least one of the coding parameters for the target block and / or 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. Optionally, transform information indicating the transform method may be signaled from the coding device 100 to the decoding device 200.

[0215] When using the transform skip mode, the transform unit 130 may omit the operation of transforming the residual block.

[0216] By quantizing the transform coefficients, quantized transform coefficient levels or quantized levels may be generated. Hereinafter, in the embodiments, each of the quantized transform coefficient levels and the quantized levels may also be referred to as "transform coefficients".

[0217] Quantization unit 140 may generate quantized transform coefficient levels or quantized levels by quantizing transform coefficients according to quantization parameters. Quantization unit 140 may output the generated quantized transform coefficient levels or quantized levels. In this case, quantization unit 140 may use a quantization matrix to quantize transform coefficients.

[0218] Entropy encoding unit 150 may generate a bitstream by performing probability distribution-based entropy encoding based on values calculated by quantization unit 140 and / or encoding parameter values calculated during the encoding process. Entropy encoding unit 150 may output the generated bitstream.

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

[0220] When entropy encoding is applied, fewer bits may be assigned to more frequently occurring symbols, and more bits may be assigned to less frequently occurring symbols. Since symbols are represented by this assignment, the size of the bit string for the target symbols to be encoded can be reduced. Therefore, the compression performance of video encoding can be improved through entropy encoding.

[0221] In addition, for entropy encoding, entropy encoding unit 150 may use encoding methods such as exponential Golomb, context-adaptive variable-length coding (CAVLC), or context-adaptive binary arithmetic coding (CABAC). For example, entropy encoding unit 150 may use a variable-length coding / code (VLC) table to perform entropy encoding. For example, entropy encoding unit 150 may derive a binarization method for target symbols. In addition, entropy encoding unit 150 may derive a probability model for target symbols / bits. Entropy encoding unit 150 may use the derived binarization method, probability model, and context model to perform arithmetic coding.

[0222] Entropy encoding unit 150 may transform coefficients in 2D block form into 1D vector form by a transform coefficient scanning method in order to encode quantized transform coefficient levels.

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

[0224] Coding parameters may include not only information (or flags or indices) such as syntax elements that are coded by a coding device and signaled by the coding device to a decoding device, but also information derived during the coding or decoding process. Additionally, coding parameters may include information required to code or decode an image.For example, the coding parameters may include at least one value, a combination or statistics of the following items: the size of a unit / block, the depth of a unit / block, the partitioning information of a unit / block, the partitioning structure of a unit / block, information indicating whether a unit / block is partitioned in a quadtree structure, information indicating whether a unit / block is partitioned in a binary tree structure, the partitioning direction (horizontal direction or vertical direction) of a binary tree structure, the partitioning form (symmetric partitioning or asymmetric partitioning) of a binary tree structure, information indicating whether a unit / block is partitioned in a ternary tree structure, the partitioning direction (horizontal direction or vertical direction) of a ternary tree structure, a prediction scheme (intra prediction or inter prediction), an intra prediction mode / direction, a reference sample filtering method, a prediction block filtering method, a prediction block boundary filtering method, filter taps for filtering, filter coefficients for filtering, an inter prediction mode, motion information, a motion vector, a reference picture index, an inter prediction direction, an inter prediction indicator, a reference picture list, a reference image, a motion vector prediction factor, a motion vector prediction candidate, a motion vector candidate list, information indicating whether a merge mode is used, a merge candidate, a merge candidate list, information indicating whether a skip mode is used, the type of an interpolation filter, the taps of an interpolation filter, the filter coefficients of an interpolation filter, the magnitude of a motion vector, the precision of a motion vector representation, a transform type, a transform size, information indicating whether a first transform is used, information indicating whether an additional (second) transform is used, a first transform index, a second transform index, information indicating the presence or absence of a residual signal, a coded block style, a coded block flag, a quantization parameter, a quantization matrix, information about an in-loop filter, information indicating whether an in-loop filter is applied, the coefficients of an in-loop filter, the taps of an in-loop filter, the shape / form of an in-loop filter, information indicating whether a deblocking filter is applied, the coefficients of a deblocking filter, the taps of a deblocking filter, a deblocking filter strength, the shape / form of a deblocking filter, information indicating whether an adaptive sample offset is applied, the value of an adaptive sample offset, the category of an adaptive sample offset, the type of an adaptive sample offset, information indicating whether an adaptive in-loop filter is applied, the coefficients of an adaptive in-loop filter, the taps of an adaptive in-loop filter, the shape / form of an adaptive in-loop filter, a binarization / de-binarization method, a context model, a context model determination method, a context model update method, information indicating whether a normal mode is executed, information indicating whether a bypass mode is executed, context bits, bypass bits, transform coefficients, transform coefficient levels, a transform coefficient level scanning method, an image display / output order, slice identification information, slice type, slice partitioning information, parallel block identification information, parallel block type, parallel block partitioning information, picture type, bit depth, information about a luminance signal, and information about a chrominance signal. The prediction scheme may represent one of an intra prediction mode and an inter prediction mode.

[0225] The residual signal can represent the difference between the original signal and the predicted signal. Optionally, the residual signal can be a signal generated by transforming the difference between the original signal and the predicted signal. Optionally, the residual signal can be a signal generated by transforming and quantizing the difference between the original signal and the predicted signal. The residual block can be a residual signal for a block.

[0226] Here, it can be indicated by a signaling flag or index that the encoding device 100 includes an entropy-encoded flag or entropy-encoded index generated by performing entropy encoding on the flag or index in the bitstream, and it can be indicated that the decoding device 200 obtains the flag or index by performing entropy decoding on the entropy-encoded flag or entropy-encoded index extracted from the bitstream.

[0227] Since the encoding device 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. Thus, the encoding device 100 can reconstruct or decode the encoded target image and store the reconstructed or decoded image in the reference picture buffer 190 as a reference image. For decoding, inverse quantization and inverse transformation of the encoded target image can be performed.

[0228] The quantization levels can be inverse-quantized by the inverse quantization unit 160 and can be inverse-transformed by the inverse transformation unit 170. The coefficients that have been inverse-quantized and / or inverse-transformed can be added to the prediction block by the adder 175. Adding the inverse-quantized and / or inverse-transformed coefficients and the prediction block can then generate a reconstructed block. Here, the inverse-quantized and / or inverse-transformed coefficients can represent the coefficients that have undergone one or more of inverse quantization and inverse transformation, and can also represent the reconstructed residual block.

[0229] The reconstructed block can be filtered by the filter unit 180. The filter unit 180 can apply one or more of 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 can also be referred to as a "loop filter".

[0230] The deblocking filter can eliminate block distortion that appears at the boundaries between blocks. To determine whether to apply the deblocking filter, it can be decided the number of columns or rows of pixels included in the block and that includes the pixels based on which it is determined whether to apply the deblocking filter to the target block.

[0231] When the deblocking filter is applied to a target block, the filter applied may vary according to the strength of the required deblocking filtering. In other words, among different filters, a filter determined in consideration of the strength of deblocking filtering may be applied to the target block. When the 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 according to the required strength of deblocking filtering.

[0232] In addition, when performing vertical filtering and horizontal filtering on a target block, horizontal filtering and vertical filtering may be performed in parallel.

[0233] SAO may add an appropriate offset to the pixel value to compensate for the coding error. SAO may perform correction on an image to which deblocking is applied based on pixel pairs, where the correction uses an offset of the difference between the original image and the image to which deblocking is applied. To perform offset correction for an image, a method for dividing pixels included in the image into a specific number of regions, determining regions to which an offset will be applied among the divided regions, and applying the offset to the determined regions may be used, and a method for applying an offset in consideration of the edge information of each pixel may also be used.

[0234] ALF may perform filtering based on a value obtained by comparing a reconstructed image with an original image. After pixels included in an image have been divided into a predetermined number of groups, a filter to be applied to each group may be determined, and filtering may be performed differently for each group. For a luminance signal, information related to whether to apply an adaptive loop filter may be signaled for each CU. The shape and filter coefficients of the ALF to be applied to each block may vary for each block. Optionally, an ALF having a fixed form may be applied to the block regardless of the characteristics of the block.

[0235] 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 reconstructed blocks filtered by the filter unit 180. The stored reference picture may then be used for inter prediction.

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

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

[0238] Refer to Figure 2, the decoding device 200 may include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transformation unit 230, an intra prediction unit 240, an inter prediction unit 250, a switch 245, an adder 255, a filter unit 260, and a reference picture buffer 270.

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

[0240] The decoding device 200 may perform decoding on the bitstream in the intra mode and / or the inter mode. In addition, the decoding device 200 may generate a reconstructed image or a decoded image via decoding and may output the reconstructed image or the decoded image.

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

[0242] The decoding device 200 may obtain a reconstructed residual block by decoding the input bitstream and may generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 may generate a reconstructed block, which is the target of decoding, by adding the reconstructed residual block and the prediction block.

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

[0244] The entropy decoding unit 210 may change the coefficients in the form of a one-dimensional (1D) vector to a 2D block shape by a transform coefficient scanning method in order to decode the quantized transform coefficient levels.

[0245] For example, the coefficients of a block may be changed to a 2D block shape by scanning the block coefficients using a right upper diagonal scan. Optionally, which one of the right upper diagonal scan, the vertical scan, and the horizontal scan will be used may be determined according to the size of the corresponding block and / or the intra prediction mode.

[0246] The quantized coefficients can be dequantized by the dequantization unit 220. The dequantization unit 220 can generate dequantized coefficients by performing dequantization on the quantized coefficients. In addition, the dequantized coefficients can be inverse-transformed by the inverse transformation unit 230. The inverse transformation unit 230 can generate a reconstructed residual block by performing an inverse transformation on the dequantized coefficients. As a result of performing dequantization and inverse transformation on the quantized coefficients, a reconstructed residual block can be generated. Here, when generating the reconstructed residual block, the dequantization unit 220 can apply a quantization matrix to the quantized coefficients.

[0247] When using the intra mode, the intra prediction unit 240 can generate a prediction block by performing spatial prediction, where the spatial prediction uses pixel values of previously decoded neighboring blocks around the target block.

[0248] The inter prediction unit 250 can include a motion compensation unit. Optionally, the inter prediction unit 250 can be designated as the "motion compensation unit".

[0249] When using the inter mode, the motion compensation unit 250 can generate a prediction block by performing motion compensation, where the motion compensation uses a motion vector and a reference image stored in the reference picture buffer 270.

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

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

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

[0253] The filtered reconstructed image can be output by the encoding device 100 and can be used by the encoding device.

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

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

[0256] Figure 3 An example in which a single unit is partitioned into multiple sub-units can be schematically shown.

[0257] To effectively partition an image, coding units (CUs) can be used in encoding and decoding. The term "unit" can be used to commonly specify 1) a block including image samples and 2) syntax elements. For example, "partitioning of a unit" can mean "partitioning of a block corresponding to the unit".

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

[0259] In addition, a CU can be a basic unit for predicting, transforming, quantizing, inverse-transforming, dequantizing, and encoding / decoding transform coefficients.

[0260] Referring to Figure 3 , the image 300 can be sequentially partitioned into units corresponding to the largest coding units (LCUs), and the partitioning structure can be determined for each LCU. Here, the LCU can be used to have the same meaning as the coding tree unit (CTU).

[0261] Partitioning a unit can mean partitioning a block corresponding to the unit. The block partitioning information can include depth information about the depth of the unit. The depth information can indicate the number of times the unit is partitioned and / or the degree to which the unit is partitioned. A single unit can be hierarchically partitioned into sub-units while the single unit has depth information based on a tree structure. Each partitioned sub-unit can have depth information. The depth information can be information indicating the size of the CU. The depth information can be stored for each CU.

[0262] Each CU can have depth information. When a CU is partitioned, the depth of the CU generated from the partition can be increased by 1 from the depth of the partitioned CU.

[0263] The partition structure can represent the distribution of coding units (CUs) in the LCU 310 for efficiently encoding an image. Such a distribution can be determined based on whether a single CU will be partitioned into multiple CUs. The number of CUs generated by partitioning can be a positive integer 2 or greater, including 2, 3, 4, 8, 16, etc. According to the number of CUs generated by partitioning, the horizontal size and vertical size of each CU generated by partitioning can be smaller than the horizontal size and vertical size of the CU before partitioning.

[0264] Each partitioned CU can be recursively partitioned into four CUs in the same way. Compared with at least one of the horizontal size and vertical size of the CU before partitioning, at least one of the horizontal size and vertical size of each partitioned CU can be reduced via recursive partitioning.

[0265] The partitioning of the CU can be recursively performed until a predefined depth or a predefined size. For example, the depth of the CU can have a value in the range from 0 to 3. According to the depth of the CU, the range of the size of the CU can be from size 64×64 to size 8×8.

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

[0267] The partitioning can start at the LCU 310, and whenever the horizontal size and / or vertical size of the CU is reduced by partitioning, the depth of the CU can be incremented by 1.

[0268] For example, for each depth, the unpartitioned CU can have a size of 2N×2N. In addition, in the case where the CU is partitioned, the CU with a size of 2N×2N can be partitioned into four CUs each with a size of N×N. Whenever the depth is incremented by 1, the value of N can be halved.

[0269] Refer to Figure 3 , the LCU with a depth of 0 can have 64×64 pixels or a 64×64 block. 0 can be the minimum depth. The SCU with a depth of 3 can have 8×8 pixels or an 8×8 block. 3 can be the maximum depth. Here, the CU with a 64×64 block as the LCU can be represented by a depth of 0. The CU with a 32×32 block can be represented by a depth of 1. The CU with a 16×16 block can be represented by a depth of 2. The CU with an 8×8 block as the SCU can be represented by a depth of 3.

[0270] Information on whether a corresponding CU is partitioned can be represented by the partitioning information of the CU. The partitioning information can be 1-bit information. All CUs other than the SCU may include the partitioning information. For example, the value of the partitioning information of an unpartitioned CU may be 0. The value of the partitioning information of a partitioned CU may be 1.

[0271] 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 the partitioning can be half of 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 can 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.

[0272] 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 the partitioning can be half of the horizontal size or vertical size of the CU before partitioning. When a CU with a size of 32×32 is vertically partitioned into two CUs, the size of each of the two partitioned CUs can be 16×32. When a CU with a size of 32×32 is horizontally partitioned into two CUs, the size of each of the two partitioned CUs can 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.

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

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

[0275] Through the recursive partitioning of the CU, an optimal partitioning method that incurs the minimum rate-distortion cost can be selected.

[0276] Figure 4 is a diagram showing the forms of prediction units (PUs) that a coding unit (CU) can include.

[0277] Among the CUs partitioned from the LCU, a CU that is no longer partitioned can be divided into one or more prediction units (PUs). This division is also referred to as "partitioning".

[0278] A PU can be a basic unit for prediction. The PU can be encoded and decoded in any one of the skip mode, inter-frame mode, and intra-frame mode. The PU can be partitioned into various shapes according to each mode. For example, the target block referred to above Figure 1 described and the target block referred to above Figure 2 described can both be PUs.

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

[0280] In the skip mode, there may be no partitioning in the CU. In the skip mode, the 2N×2N mode 410 can be supported without partitioning, where in the 2N×2N mode 410, the size of the PU and the size of the CU are the same as each other.

[0281] In the inter-frame mode, there may be 8 types of partition shapes in the CU. For example, in the inter-frame mode, the 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 can be supported.

[0282] In the intra-frame mode, the 2N×2N mode 410 and the N×N mode 425 can be supported.

[0283] In the 2N×2N mode 410, a PU with a size of 2N×2N can be encoded. A PU with a size of 2N×2N can represent a PU whose size is the same as that of the CU. For example, a PU with a size of 2N×2N can have a size of 64×64, 32×32, 16×16, or 8×8.

[0284] In the N×N mode 425, a PU with a size of N×N can be encoded.

[0285] For example, in intra-frame prediction, when the size of the PU is 8×8, four partitioned PUs can be encoded. The size of each partitioned PU can be 4×4.

[0286] When encoding a PU in the intra-frame mode, any one of multiple intra-frame prediction modes can be used to encode the PU. For example, the HEVC technology can provide 35 intra-frame prediction modes, and the PU can be encoded in any one of the 35 intra-frame prediction modes.

[0287] Which one of the 2N×2N mode 410 and the N×N mode 425 will be used to encode the PU can be determined based on the rate-distortion cost.

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

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

[0290] The encoding device 100 can determine which one of the PU with a size of 2N×2N and the PU with a size of N×N will be encoded based on a comparison between the rate-distortion cost of the PU with a size of 2N×2N and the rate-distortion cost of the PU with a size of N×N.

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

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

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

[0294] Figure 5 It is a diagram showing the form of transform units (TUs) that can be included in a CU.

[0295] The transform unit (TU) can be the basic unit in a CU that is used for processes such as transformation, quantization, inverse transformation, dequantization, entropy coding, and entropy decoding.

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

[0297] In a CU partitioned from an LCU, a CU that is no longer partitioned into CUs can be partitioned into one or more TUs. Here, the partitioning structure of the TUs can be a quadtree structure. For example, as Figure 5 shown, a single CU 510 can be partitioned one or more times according to the quadtree structure. Through this partitioning, a single CU 510 can be composed of TUs with various sizes.

[0298] It can be considered that when a single CU is divided two or more times, the CU is recursively divided. Through the division, a single CU can be composed of transform units (TUs) with various sizes.

[0299] Optionally, a single CU can be divided into one or more TUs based on the number of vertical lines and / or horizontal lines for partitioning the CU.

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

[0301] 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 can be equal to each other.

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

[0303] 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 the partitioning can be half of the horizontal size and vertical size of the TU before partitioning. When a TU with a size of 32×32 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, it can be considered that the TU has been partitioned in a quadtree structure.

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

[0305] Figure 6 Shows the partitioning of a block according to an example.

[0306] In video encoding and / or decoding processing, as Figure 6 shown, the target block can be partitioned.

[0307] For the partitioning of the target block, an indicator indicating the partitioning information can be signaled from the encoding device 100 to the decoding device 200. The partitioning information can be information indicating how the target block is partitioned.

[0308] The partitioning information can be one or more of a split flag (hereinafter referred to as "split_flag"), a quaternary-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").

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

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

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

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

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

[0314] For example, the division information of the block in Figure 6 can be deduced by signaling at least one of quadtree_flag, binarytree_flag, and Btype_flag, as shown in Table 1 below.

[0315] Table 1

[0316]

[0317] For example, the division information of the block in Figure 6 can be deduced by signaling at least one of split_flag, QB_flag, and Btype_flag, as shown in Table 2 below.

[0318] Table 2

[0319]

[0320] The division method can be limited to quadtree or binary tree according to the size and / or shape of the block. When this limitation is applied, split_flag can be a flag indicating whether the block is divided in a quadtree form or a flag indicating whether the block is divided in a binary tree form. The size and shape of the block can be deduced from the depth information of the block, and the depth information can be signaled from the encoding device 100 to the decoding device 200.

[0321] When the size of the block falls within a specific range, it is only possible to divide it in a quadtree form. For example, the specific range can be defined by at least one of the maximum block size and the minimum block size that can only be divided in a quadtree form.

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

[0323] Optionally, the maximum block size and / or the minimum block size can be fixed sizes predefined by the encoding device 100 and the decoding device 200. For example, when the size of a block is greater than 64×64 and less than 256×256, partitioning only in a quadtree form is possible. In this case, split_flag can be a flag indicating whether to perform partitioning in a quadtree form.

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

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

[0326] Optionally, the maximum block size and / or the minimum block size can be fixed sizes predefined by the encoding device 100 and the decoding device 200. For example, when the size of a block is greater than 8×8 and less than 16×16, partitioning only in a binary tree form is possible. In this case, split_flag can be a flag indicating whether to perform partitioning in a binary tree form.

[0327] Partitioning of a block can be restricted by a previous partitioning. For example, when a block is partitioned in a binary tree form and multiple sub-blocks are generated, each sub-block can be additionally partitioned only in a binary tree form.

[0328] When the horizontal size or the vertical size of a sub-block is a size that cannot be further partitioned, the above indicator may not be signaled.

[0329] Figure 7 is a diagram for explaining an embodiment of intra prediction processing.

[0330] From Figure 7 Arrows radially extending from the center of the diagram in indicate the prediction directions of intra prediction modes. In addition, numbers appearing near the arrows can represent examples of mode values assigned to the intra prediction modes or the prediction directions of the intra prediction modes.

[0331] Reference sample points of blocks adjacent to a target block can be used to perform intra - coding and / or decoding. The adjacent blocks can be adjacent reconstructed blocks. For example, intra - coding and / or decoding can be performed using the values of the reference sample points included in each adjacent reconstructed block or the coding parameters of the adjacent reconstructed blocks.

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

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

[0334] The unit of the prediction block can have a size corresponding to at least one of a CU, a PU, and a TU. The prediction block can have a square shape with a size of 2N×2N or N×N. The size N×N can include sizes such as 4×4, 8×8, 16×16, 32×32, 64×64, etc.

[0335] Optionally, the prediction block can be a square block with a size of 2×2, 4×4, 8×8, 16×16, 32×32, 64×64, etc. or a rectangular block with a size of 2×8, 4×8, 2×16, 4×16, 8×16, etc.

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

[0337] For example, regardless of the size of the prediction block, the number of intra - prediction modes can be fixed at 35. Optionally, the number of intra - prediction modes can be, for example, 3, 5, 9, 17, 34, 35, or 36.

[0338] The intra - prediction mode can be a non - directional mode or a directional mode. For example, as Figure 7 shown, the intra - prediction mode can include two non - directional modes and 33 directional modes.

[0339] The two non - directional modes can include a DC mode and a planar mode.

[0340] The directional mode can be a mode with a specific direction or a specific angle.

[0341] Each available mode number, mode value, and mode angle in the intra prediction mode represents at least one of them. The number of intra prediction modes can be M. The value of M can be 1 or greater. In other words, the number of intra prediction modes can be M, where M includes the number of non-directional modes and the number of directional modes.

[0342] The number of intra prediction modes can be fixed to M regardless of the size of the block. For example, the number of intra prediction modes can be fixed to either 35 or 67 regardless of the size of the block.

[0343] Optionally, the number of intra prediction modes can vary according to the size of the block and / or the type of color component.

[0344] For example, the larger the size of the block, the more intra prediction modes there are. Optionally, the larger the size of the block, the fewer intra prediction modes there are. When the size of the block is 4×4 or 8×8, the number of intra prediction modes can be 67. When the size of the block is 16×16, the number of intra prediction modes can be 35. When the size of the block is 32×32, the number of intra prediction modes can be 19. When the size of the block is 64×64, the number of intra prediction modes can be 7.

[0345] For example, the number of intra prediction modes can vary according to whether the color component is a luminance signal or a chrominance signal. Optionally, the number of intra prediction modes corresponding to the luminance component block can be greater than the number of intra prediction modes corresponding to the chrominance component block.

[0346] For example, in the vertical mode with a mode value of 26, prediction can be performed along the vertical direction based on the pixel values of the reference samples. For example, in the horizontal mode with a mode value of 10, prediction can be performed along the horizontal direction based on the pixel values of the reference samples.

[0347] Even in the directional modes other than the above-mentioned modes, the encoding device 100 and the decoding device 200 can still perform intra prediction on the target unit using the reference samples according to the angle corresponding to the directional mode.

[0348] The intra prediction mode located to the right of the vertical mode can be referred to as the "vertical - right mode". The intra prediction mode located below the horizontal mode can be referred to as the "horizontal - below mode". For example, in Figure 7 Among them, the intra prediction mode with a mode value of one of 27, 28, 29, 30, 31, 32, 33, and 34 can be the vertical - right mode 613. The intra prediction mode with a mode value of one of 2, 3, 4, 5, 6, 7, 8, and 9 can be the horizontal - below mode 616.

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

[0350] The directional mode may include an angular mode. Among the multiple intra-frame prediction modes, the remaining modes other than the DC mode and the planar mode may be directional modes.

[0351] When the intra-frame prediction mode is the DC mode, a prediction block may be generated based on the average value of the pixel values of multiple reference pixels. For example, the pixel value of the prediction block may be determined based on the average value of the pixel values of multiple reference pixels.

[0352] The number of the above-described intra-frame prediction modes and the mode values of each intra-frame prediction mode are merely exemplary. The number of the above-described intra-frame prediction modes and the mode values of each intra-frame prediction mode may be defined differently according to embodiments, implementations, and / or requirements.

[0353] To perform intra-frame prediction on a target block, a step of checking whether the samples included in the reconstructed neighboring blocks can be used as reference samples for the target block may be performed. When there are samples among the samples in the neighboring blocks that cannot be used as reference samples for the target block, the value generated by interpolation and / or copying of at least one of the sample values among the samples included in the reconstructed neighboring blocks may replace the sample value of the sample that cannot be used as a reference sample. When the value generated by copying and / or interpolation replaces the sample value of the existing sample, the sample may be used as a reference sample for the target block.

[0354] In intra-frame prediction, a filter may be applied to at least one of the reference samples and the prediction samples based on at least one of the intra-frame prediction mode and the size of the target block.

[0355] The type of the filter to be applied to at least one of the reference samples and the prediction samples may vary according to at least one of the intra-frame prediction mode of the target block, the size of the target block, and the shape of the target block. The type of the 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.

[0356] When the intra-frame prediction mode is the planar mode, when generating the prediction block of the target block, the sample value of the prediction target block may be generated using the 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 prediction target sample in the prediction block.

[0357] When the intra prediction mode is the DC mode, the average value of the reference samples above the target block and the reference samples to the left of the target block can be used when generating the prediction block of the target block. In addition, filtering using the values of the reference samples can be performed on specific rows or specific columns in the target block. The specific rows can be one or more upper rows adjacent to the reference samples. The specific columns can be one or more left columns adjacent to the reference samples.

[0358] When the intra prediction mode is the direction mode, the upper reference sample, the left reference sample, the upper right reference sample, and / or the lower left reference sample of the target block can be used to generate the prediction block.

[0359] To generate the above prediction samples, real-number based interpolation can be performed.

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

[0361] For example, when the intra prediction modes of the target block and the neighboring block are the same, a predefined flag can be used to signal that the intra prediction modes of the target block and the neighboring block are the same.

[0362] For example, an indicator for indicating the intra prediction mode that is the same as the intra prediction mode of the target block among the intra prediction modes of multiple neighboring blocks can be signaled.

[0363] When the intra prediction modes of the target block and the neighboring block are different, the information about the intra prediction mode of the target block can be encoded and / or decoded using entropy encoding and / or entropy decoding.

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

[0365] Figure 8 Shows the positions of the reference samples for intra prediction of the target block. Referring to Figure 8 , the reconstructed reference samples for intra prediction of the target block can include the lower left reference sample 831, the left reference sample 833, the upper left reference sample 835, the upper reference sample 837, and the upper right reference sample 839.

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

[0367] 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 top reference sample 837, and the upper right reference sample 839 may all be N.

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

[0369] The reference samples for intra prediction of the target block may change according to the intra prediction mode of the target block. The direction of the intra prediction mode may represent the dependency relationship between the reference samples and the pixels in 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 prediction mode. In other words, the value of the specified reference sample may be copied as the value of the pixels located in the direction opposite to the direction of the intra prediction mode. Optionally, the value of a pixel in the prediction block may be the value of a reference sample located in the direction of the intra prediction mode relative to the position of the pixel.

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

[0371] In the example, when the intra prediction mode of the target block is the 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 the horizontal mode, the value of a pixel in the prediction block can be the value of the reference sample horizontally located to the left of the position 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 values of the pixels in a column of the prediction block can be the same as the values of the pixels of the left reference sample 833.

[0372] In the 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, at least some of the upper left reference samples 835, and the upper reference samples 837 can 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 can be the value of the reference sample diagonally located at the upper left corner of the pixel.

[0373] In addition, when an intra prediction mode with a mode value of 27, 28, 29, 30, 31, 32, 33, or 34 is used, at least a part of the upper right reference samples 839 can be used for intra prediction.

[0374] In addition, when an intra prediction mode with a mode value of 2, 3, 4, 5, 6, 7, 8, or 9 is used, at least a part of the lower left reference samples 831 can be used for intra prediction.

[0375] In addition, in the case of an intra prediction mode with a mode value in the range from 11 to 25, the upper left reference sample 835 can be used for intra prediction.

[0376] The number of reference samples used to determine the pixel value of a pixel in the prediction block can be 1 or 2 or more.

[0377] As described above, the pixel value of a pixel in the prediction block can 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 can be used to determine the pixel value of the pixel in the prediction block.

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

[0379] The predicted block generated through 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 predicted block, and there may also be a prediction error between the pixels of the target block and the pixels of the predicted block.

[0380] Hereinafter, the terms "difference", "error", and "residual" may be used with the same meaning and may be used interchangeably with each other.

[0381] For example, in the case of intra-frame prediction, the longer the distance between the pixels of the predicted block and the reference sample points, the greater the possible prediction error. Such a prediction error may cause discontinuity between the generated predicted block and the neighboring blocks.

[0382] To reduce the prediction error, a filtering operation for the predicted block may be used. The filtering operation may be configured to adaptively apply a filter to the regions in the predicted block that are considered to have a relatively large prediction error. For example, the regions considered to have a relatively large prediction error may be the boundaries of the predicted block. In addition, the regions in the predicted block that are considered to have a relatively large prediction error may vary according to the intra-frame prediction mode, and the characteristics of the filter may also vary according to the intra-frame prediction mode.

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

[0384] Figure 9 The rectangle shown in may represent an image (or picture). In addition, in Figure 9 the arrows may represent the prediction direction. That is, each image may be encoded and / or decoded according to the prediction direction.

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

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

[0387] 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 the forward direction or the backward direction.

[0388] When the target image is a B picture, the image can be encoded via inter prediction using reference pictures existing in two directions, or the image can be encoded via inter prediction using reference pictures existing in one of the forward direction and the backward direction. Here, the two directions can be the forward direction and the backward direction.

[0389] P pictures and B pictures encoded and / or decoded using reference pictures can be regarded as images using inter prediction.

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

[0391] Inter prediction can be performed using motion information.

[0392] In the inter mode, the encoding device 100 can perform inter prediction and / or motion compensation on a target block. The decoding device 200 can perform inter prediction and / or motion compensation corresponding to the inter prediction and / or motion compensation performed by the encoding device 100 on the target block.

[0393] The motion information of the target block can be separately derived by the encoding device 100 and the decoding device 200 during inter prediction. The motion information of a reconstructed neighboring block, the motion information of a col block, and / or the motion information of a block adjacent to the col block can be used to derive the motion information.

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

[0395] The spatial candidate can be a reconstructed block spatially adjacent to the target block.

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

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

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

[0399] Inter prediction can be performed using a reference picture.

[0400] The reference picture can be at least one of the picture before the target picture and the picture after the target picture. The reference picture can be an image for predicting the target block.

[0401] In inter-frame prediction, a reference picture index (or refIdx) for indicating a reference picture, a motion vector to be described later, etc. can be used to specify a region in the reference picture. Here, the region specified in the reference picture can indicate a reference block.

[0402] Inter-frame prediction can select a reference picture, and can also select a reference block corresponding to the target block from the reference picture. In addition, inter-frame prediction can use the selected reference block to generate a predicted block for the target block.

[0403] Motion information can be derived by each of the encoding device 100 and the decoding device 200 during inter-frame prediction.

[0404] A spatial candidate can 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 located at a corner of the target block. Here, a "block located at a corner of the target block" can be a block that is vertically adjacent to a neighboring block horizontally adjacent to the target block, or a block that is horizontally adjacent to a neighboring block vertically adjacent to the target block. In addition, a "block located at a corner of the target block" can 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" can be included in the meaning of a "block adjacent to the target block".

[0405] For example, a 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 the target block located at the upper left corner of the target block.

[0406] Each of the encoding device 100 and the decoding device 200 can identify a block at a position in the col picture that spatially corresponds 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 can correspond to each other.

[0407] Each of the encoding device 100 and the decoding device 200 can determine a col block at a predefined relevant position for the identified block as a temporal candidate. The predefined relevant position can be a position inside and / or outside the identified block.

[0408] 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 the block located at the coordinates (xP + nPSW, yP + nPSH). The second col block may be the 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.

[0409] The motion vector of the target block may be determined based on the motion vector of the col block. Each of the encoding device 100 and the decoding device 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 motion information of the temporal candidate stored in the list may be the scaled motion vector.

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

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

[0412] 1) AMVP mode

[0413] When using the AMVP mode, the encoding device 100 may search for a similar block in the neighboring region of the target block. The encoding device 100 may perform prediction on the target block by using the motion information of the found similar block to obtain a predicted block. The encoding device 100 may encode the residual block that is the difference between the target block and the predicted block.

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

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

[0416] Hereinafter, the terms "predicted motion vector (candidate)" and "motion vector (candidate)" may be used with the same meaning and may be used interchangeably with each other.

[0417] Hereinafter, the terms "predicted motion vector candidate" and "AMVP candidate" may be used with the same meaning and may be used interchangeably with each other.

[0418] Hereinafter, the terms "predicted motion vector candidate list" and "AMVP candidate list" may be used with the same meaning and may be used interchangeably with each other.

[0419] Spatial candidates may include reconstructed spatially neighboring blocks. In other words, the motion vectors of the reconstructed neighboring blocks may be referred to as "spatial predicted motion vector candidates".

[0420] Temporal candidates may include col blocks and blocks adjacent to the col blocks. In other words, the motion vector of the col block or the motion vectors of the blocks adjacent to the col block may be referred to as "temporal predicted motion vector candidates".

[0421] The zero vector may be a (0, 0) motion vector.

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

[0423] 1-2) Search for a motion vector using the list of predicted motion vector candidates

[0424] The encoding device 100 may use a list of predicted motion vector candidates to determine, within a search range, the motion vector that will be used to encode a target block. In addition, the encoding device 100 may determine, among the predicted motion vector candidates present in the predicted motion vector candidate list, the predicted motion vector candidate that will be used as the predicted motion vector of the target block.

[0425] The motion vector that will be used to encode a target block may be the motion vector that can be encoded at the minimum cost.

[0426] In addition, the encoding device 100 may determine whether to use the AMVP mode to encode the target block.

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

[0428] The encoding device 100 may generate a bitstream including the inter prediction information required for inter prediction. The decoding device 200 may use the inter prediction information of the bitstream to perform inter prediction on the target block.

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

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

[0431] When the mode information indicates that the AMVP mode is used, the decoding device 200 may obtain the predicted motion vector index, the MVD, the reference direction, and the reference picture index from the bitstream through entropy decoding.

[0432] The predicted motion vector index may indicate the predicted motion vector candidate among the predicted motion vector candidates included in the predicted motion vector candidate list that will be used to predict the target block.

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

[0434] The decoding device 200 may use the predicted motion vector candidate list to derive the predicted motion vector candidate, and may determine the motion information of the target block based on the derived predicted motion vector candidate.

[0435] The decoding device 200 may use the predicted motion vector index to determine the motion vector candidate for the target block among the predicted motion vector candidates included in the predicted motion vector candidate list. The decoding device 200 may select the predicted motion vector candidate indicated by the predicted motion vector index as the predicted motion vector of the target block from among the predicted motion vector candidates included in the predicted motion vector candidate list.

[0436] The motion vector that will actually be used for inter-frame prediction of the target block may not match the predicted motion vector. In order to indicate the difference between the motion vector that will actually be used for inter-frame prediction of the target block and the predicted motion vector, the MVD may be used. The encoding device 100 may derive a predicted motion vector similar to the motion vector that will actually be used for inter-frame prediction of the target block so as to use the smallest possible MVD.

[0437] The MVD may be the difference between the motion vector of the target block and the predicted motion vector. The encoding device 100 may calculate the MVD and may perform entropy encoding on the MVD.

[0438] The MVD can be sent from the encoding device 100 to the decoding device 200 via a bitstream. The decoding device 200 can decode the received MVD. The decoding device 200 can derive the 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 can be the sum of the entropy-decoded MVD and the motion vector candidate.

[0439] The reference direction can indicate a list of reference pictures that will be used for predicting the target block. For example, the reference direction can indicate one of the reference picture lists L0 and L1.

[0440] The reference direction only indicates the list of reference pictures that will be used for predicting the target block, and does not necessarily 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 can include pictures in the forward direction and / or the backward direction.

[0441] The reference direction being unidirectional can mean using a single reference picture list. The reference direction being bidirectional can mean using two reference picture lists. In other words, the reference direction can indicate one of the following cases: the case of using only the reference picture list L0, the case of using only the reference picture list L1, and the case of using two reference picture lists.

[0442] The reference picture index can indicate the reference picture among the reference pictures in the reference picture list that will be used for predicting the target block. The encoding device 100 can perform entropy coding on the reference picture index. The entropy-coded reference picture index can be signaled by the encoding device 100 to the decoding device 200 via a bitstream.

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

[0444] The motion vector of the target block can be derived by the prediction motion vector index, MVD, reference direction, and reference picture index.

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

[0446] Since the predicted motion vector index and the MVD are encoded while the motion vector of the target block itself is not encoded, the number of bits sent from the encoding device 100 to the decoding device 200 can be reduced, and the encoding efficiency can be improved.

[0447] The motion information of the reconstructed neighboring blocks can be used for the target block. In a specific inter prediction mode, the encoding device 100 may not encode the actual motion information of the target block separately. 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 motion information of the reconstructed neighboring blocks. Since the additional information is encoded, the number of bits sent to the decoding device 200 can be reduced, and the encoding efficiency can be improved.

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

[0449] 2) Merge mode

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

[0451] When using the merge mode, the encoding device 100 may use the motion information of spatial candidates and / or the motion information of temporal candidates to predict the motion information of the target block. Spatial candidates may include reconstructed spatial neighboring blocks that are spatially adjacent to the target block. Spatial neighboring blocks may include a left neighboring block and an upper neighboring block. Temporal candidates may include col blocks. 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.

[0452] The encoding device 100 may obtain a predicted block via prediction. The encoding device 100 may encode a residual block that is the difference between the target block and the predicted block.

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

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

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

[0456] A merge candidate may be motion information of multiple temporal candidates and / or spatial candidates. In addition, the merge candidate list may include new merge candidates generated by combining merge candidates already existing 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 existing in the merge candidate list.

[0457] 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. The inter-frame prediction information of a target block may be derived according to the specific mode indicated by the merge candidate. In addition, the specific mode may include a process for deriving a series of inter-frame prediction information. Such a specific mode may be an inter-frame prediction information derivation mode or a motion information derivation mode.

[0458] The inter-frame prediction information of a target block may be derived according to the mode indicated by the merge candidate selected from the merge candidates in the merge candidate list through a merge index.

[0459] 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 a sub-block unit; 2) an affine motion information derivation mode. In addition, the merge candidate list may include motion information of a zero vector. The zero vector may also be referred to as a "zero merge candidate".

[0460] In other words, multiple pieces of motion information in the merge candidate list may 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 pieces of motion information previously existing in the merge candidate list, and 4) a zero vector.

[0461] The 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-frame prediction indicator". The reference direction may be unidirectional or bidirectional. The unidirectional reference direction may indicate L0 prediction or L1 prediction.

[0462] The merge candidate list may be created before performing prediction in the merge mode.

[0463] The number of merge candidates in the merge candidate list can be predefined. Each of the encoding device 100 and the decoding device 200 can add merge candidates to the merge candidate list according to a predefined scheme and a predefined priority, such 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 can be made the same as each other using a predefined scheme and a predefined priority.

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

[0465] 2-2) Search for a motion vector using the merge candidate list

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

[0467] In addition, the encoding device 100 can determine whether to encode the target block using the merge mode.

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

[0469] The encoding device 100 can generate a bitstream including the inter-frame prediction information required for inter-frame prediction. The encoding device 100 can generate entropy-encoded inter-frame prediction information by performing entropy encoding on the inter-frame prediction information, and can send the bitstream including the entropy-encoded inter-frame prediction information to the decoding device 200. The entropy-encoded inter-frame prediction information can be signaled by the encoding device 100 to the decoding device 200 through the bitstream.

[0470] The decoding device 200 can perform inter-frame prediction on the target block using the inter-frame prediction information of the bitstream.

[0471] The inter-frame prediction information can include 1) mode information indicating whether the merge mode is used and 2) a merge index.

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

[0473] The decoding device 200 can obtain the merge index from the bitstream only when the mode information indicates that the merge mode is used.

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

[0475] The merge index may indicate the merge candidate among the merge candidates included in the merge candidate list that will be used to perform prediction on the target block. Optionally, the merge index may indicate the block among the neighboring blocks that are spatially or temporally adjacent to the target block that will be merged with the target block.

[0476] The encoding device 100 may select the merge candidate with the highest encoding performance among the merge candidates included in the merge candidate list, and set the value of the merge index to indicate the selected merge candidate.

[0477] 2-4) Inter-frame prediction in merge mode using inter-frame prediction information

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

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

[0480] 3) Skip mode

[0481] The skip mode may be a mode that applies the motion information of the spatial candidate or the motion information of the temporal candidate to the target block without change. In addition, the skip mode may be a mode that does not use the residual signal. In other words, when the skip mode is used, the reconstructed block may be a predicted block.

[0482] The difference between the merge mode and the skip mode lies in whether the residual signal is sent or used. That is, the skip mode may be similar to the merge mode except that the residual signal is not sent or used.

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

[0484] In addition, when the skip mode is used, the encoding device 100 may not send 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 the syntax elements related to at least one of MVC, coding block flag, and transform coefficient level to the decoding device 200.

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

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

[0487] Optionally, the skip mode may use an additional candidate list that is 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 with a skip candidate list and a skip candidate, respectively.

[0488] The merge candidate list may be created before performing prediction in the skip mode.

[0489] 3-2) Search for a motion vector using the merge candidate list

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

[0491] In addition, the encoding device 100 may determine whether to use the skip mode to encode the target block.

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

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

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

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

[0496] When the 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. Optionally, the bitstream may not include a residual signal.

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

[0498] The skip index may indicate a merge candidate among the merge candidates included in the merge candidate list that will be used to predict the target block.

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

[0500] The decoding device 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.

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

[0502] 4) Current picture reference mode

[0503] The current picture reference mode may represent a prediction mode that uses a previously reconstructed region in the target picture to which the target block belongs.

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

[0505] 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 device 100 to the decoding device 200. Optionally, it may be inferred whether the target block is a block encoded in the current picture reference mode through the reference picture index of the target block.

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

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

[0508] When the target picture is present 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 device 100 to the decoding device 200.

[0509] In the AMVP mode, merge mode, and skip mode described above, the index of the list may be used to specify the motion information among multiple pieces of motion information in the list that will be used to predict the target block.

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

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

[0512] Figure 10 Shows spatial candidates according to an embodiment.

[0513] In Figure 10 the positions of the spatial candidates are shown.

[0514] The large block at the center of the figure may represent the target block. The five small blocks may represent spatial candidates.

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

[0516] Spatial candidate A 0 may be a block adjacent to the lower left corner of the target block. A 0 may be a block occupying the pixel at the coordinate (xP - 1, yP + nPSH + 1).

[0517] Spatial coordinate A 1 may be a block adjacent to the left side of the target block. A 1 may be the lowermost block among the blocks adjacent to the left side of the target block. Optionally, A 1 may be a block adjacent to the top of A 0 A 1 may be a block occupying the pixel at the coordinate (xP - 1, yP + nPSH).

[0518] Spatial candidate B 0 may be a block adjacent to the upper right corner of the target block. B 0 may be a block occupying the pixel at the coordinate (xP + nPSW + 1, yP - 1).

[0519] Spatial candidate B 1 may be a block adjacent to the top of the target block. B 1 may be the rightmost block among the blocks adjacent to the top of the target block. Optionally, B 1 may be a block adjacent to the left side of B 0 B 1 may be a block occupying the pixel at the coordinate (xP + nPSW, yP - 1).

[0520] Spatial candidate B2 can be a block adjacent to the upper left corner of the target block. B2 can be a block that occupies the pixel at coordinates (xP-1, yP-1).

[0521] Determination of the availability of spatial and temporal candidates

[0522] In order to include the motion information of a spatial candidate or the motion information of a 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.

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

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

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

[0526] Step 2) When the PU including the candidate block is 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 in different slices, the availability of the candidate block may be set to "false".

[0527] Step 3) When the PU including the candidate block is outside the boundary of the parallel block, the availability of the candidate block may be set to "false". When the target block and the candidate block are in different parallel blocks, the availability of the candidate block may be set to "false".

[0528] Step 4) When the prediction mode of the PU including the candidate block is the 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".

[0529] Figure 11 Shows the order of adding the motion information of the spatial candidate to the merge list according to an embodiment.

[0530] As Figure 11 shown, when multiple motion information of the spatial candidate is added to the merge list, A 1 , B 1 , B 0 , A 0 and B 2 can be used. That is, the multiple motion information of the available spatial candidate can be added to the merge list in the order of A 1 , B 1 , B 0 , A 0 and B 2 .

[0531] Method for deriving a merge list in merge mode and skip mode

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

[0533] Multiple pieces of motion information (i.e., merge candidates) can be added to the merge list in the order of the following steps 1) to 4).

[0534] Step 1) Among the spatial candidates, available spatial candidates can be added to the merge list. Multiple pieces of motion information of the available spatial candidates can be added to the merge list in the order shown in Figure 10 . Here, when the motion information of the available spatial candidate overlaps with other motion information already existing 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 existing in the list can be simply referred to as "overlap check".

[0535] The maximum number of added motion information can be N.

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

[0537] Step 3) When the number of motion information in the merge list is less than N and the type of the target strip is "B", the combined motion information generated by combined bidirectional prediction (bi-prediction) can be added to the merge list.

[0538] The target strip can be the strip including the target block.

[0539] The combined motion information can be a combination of L0 motion information and L1 motion information. The L0 motion information can be the motion information that only refers to the reference picture list L0. The L1 motion information can be the motion information that only refers to the reference picture list L1.

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

[0541] 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 among the one or more pieces of L0 motion information and the one or more pieces of L1 motion information that will be used for the steps of generating the combined motion information may be predefined. One or more pieces of combined motion information may be generated in a predefined order via bidirectional prediction using combinations of a pair of different motion information in a merge list. One piece of motion information in the pair of different motion information may be L0 motion information, and the other piece of motion information in the pair of different motion information may be L1 motion information.

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

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

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

[0545] The motion information of a zero vector may be motion information whose motion vector is a zero vector.

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

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

[0548] The reference direction of the zero vector motion information can be bidirectional. Two motion vectors can be zero vectors. The number of zero vector motion information can be the smaller one of the number of reference pictures in reference picture list L0 and the number of reference pictures in reference picture list L1. Optionally, when the number of reference pictures in reference picture list L0 and the number of reference pictures in reference picture list L1 are different from each other, a unidirectional reference direction can be used for the reference picture index that can be applied only to a single reference picture list.

[0549] Encoding device 100 and / or decoding device 200 can then add the zero vector motion information to the merge list while changing the reference picture index.

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

[0551] The order of the above steps 1) to step 4) is only exemplary and can be changed. In addition, some of the above steps can be omitted according to predefined conditions.

[0552] Method for deriving a list of predicted motion vector candidates in AMVP mode

[0553] The maximum number of predicted motion vector candidates in the predicted motion vector candidate list can be predefined. The predefined maximum number can be indicated by N. For example, the predefined maximum number can be 2.

[0554] Multiple motion information (i.e., predicted motion vector candidates) can be added to the predicted motion vector candidate list in the order of the following steps 1) to step 3).

[0555] Step 1) The available spatial candidates among the spatial candidates can be added to the predicted motion vector candidate list. The spatial candidates can include a first spatial candidate and a second spatial candidate.

[0556] The first spatial candidate can be one of A 0 , A 1 , scaled A 0 and scaled A. 1 The second spatial candidate can be one of B 0 , B 1 , B 2 , scaled B 0 , scaled B 1 and scaled B. 2

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

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

[0559] Step 2) When the number of pieces of motion information in the predicted motion vector candidate list is less than N and time candidates are available, the motion information of the time candidates may be added to the predicted motion vector candidate list. In this case, when the motion information of an available time candidate overlaps with other motion information already existing in the predicted motion vector candidate list, the motion information of the available time candidate may not be added to the predicted motion vector candidate list.

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

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

[0562] The encoding device 100 and / or the decoding device 200 may sequentially add multiple pieces of zero vector motion information to the predicted motion vector candidate list while changing the reference picture index.

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

[0564] The description of the zero vector motion information made above in combination with the merge list may also be applied to the zero vector motion information. The repeated description thereof will be omitted.

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

[0566] Figure 12 Shows the transform and quantization processing according to the example.

[0567] As Figure 12As shown, a quantized level can be generated by performing a transform and / or quantization process on a residual signal.

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

[0569] The residual signal can be transformed into a signal in the frequency domain by a transform process that is part of the quantization process.

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

[0571] These transform kernels can perform a separable transform or a two-dimensional (2D) non-separable transform on the residual signal. A separable transform can be a transform that indicates performing a one-dimensional (1D) transform on the residual signal in each of the horizontal and vertical directions.

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

[0573] Table 3

[0574] Transform set Transform candidate 0 DST-VII, DCT-VIII 1 DST-VII, DST-I 2 DST-VII, DCT-V

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

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

[0577] Table 4

[0578]

[0579]

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

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

[0582] Table 5

[0583]

[0584]

[0585] As illustrated in Tables 4 and 5, a transform set to be applied to the horizontal direction and the vertical direction can be predefined according to the intra prediction mode of the target block. The encoding device 100 can perform a transform and an 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 device 200 can perform an inverse transform on the residual signal using the transform included in the transform set corresponding to the intra prediction mode of the target block.

[0586] In the transform and the inverse transform, as illustrated in Tables 3, 4, and 5, the transform set to be applied to the residual signal can be determined and not signaled. The transform indication information can be signaled from the encoding device 100 to the decoding device 200. The transform indication information can be information indicating which one of the multiple transform candidates included in the transform set to be applied to the residual signal is used.

[0587] As described above, a method using various transforms can be applied to the residual signal generated via intra prediction or inter prediction.

[0588] The transform can include at least one of a first transform and a second transform. The transform coefficients can be generated by performing the first transform on the residual signal, and the second transform coefficients can be generated by performing the second transform on the transform coefficients.

[0589] The first transform can be referred to as the "main transform". In addition, the first transform can also be referred to as the "adaptive multi-transform (AMT) scheme". As described above, AMT can mean applying different transforms to each 1D direction (i.e., the vertical direction and the horizontal direction).

[0590] The second transform can be a transform for enhancing the energy concentration of the transform coefficients generated by the first transform. Similar to the first transform, the second transform can be a separable transform or a non-separable transform. Such a non-separable transform can be a non-separable second transform (NSST).

[0591] At least one of a plurality of predefined transform methods can be used to perform the first transform. For example, the plurality of predefined transform methods can include a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loeve transform (KLT), etc.

[0592] The second transform can be performed on the transform coefficients generated by performing the first transform.

[0593] The first transformation and the second transformation can be applied to signal components corresponding to one or more of a luma component and a chroma component. Whether to apply the first transformation and / or the second transformation can be determined according to at least one of encoding parameters for a target block and / or neighboring blocks. For example, whether to apply the first transformation and / or the second transformation can be determined according to the size and / or shape of the target block.

[0594] The transformation method to be applied to the first transformation and / or the second transformation can be determined according to at least one of encoding parameters for a target block and / or neighboring blocks. The determined transformation method can also indicate that the first transformation and / or the second transformation is not used.

[0595] Optionally, transformation information indicating the transformation method can be signaled from the encoding device 100 to the decoding device 200. For example, the transformation information can include an index of the transformation to be used for the first transformation and / or the second transformation.

[0596] A quantized level can be generated by performing quantization on the result generated by performing the first transformation and / or the second transformation or by performing quantization on the residual signal.

[0597] Figure 13 Diagonal scanning according to an example is shown.

[0598] Figure 14 Horizontal scanning according to an example is shown.

[0599] Figure 15 Vertical scanning according to an example is shown.

[0600] The quantized transform coefficients can be scanned via at least one of (top - 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 can be a transform unit (TU).

[0601] Each scan can be initiated at a specific start point and terminated at a specific end point.

[0602] For example, by using Figure 13 diagonal scanning, the coefficients of a block can be scanned to transform the quantized transform coefficients into a 1D vector form. Optionally, according to the size of the block and / or the intra - prediction mode, Figure 14 horizontal scanning or Figure 15 vertical scanning can be used without using diagonal scanning.

[0603] Vertical scanning can be an operation of scanning 2D block - type coefficients in the column direction. Horizontal scanning can be an operation of scanning 2D block - type coefficients in the row direction.

[0604] In other words, it is possible to determine which of diagonal scanning, vertical scanning, and horizontal scanning will be used according to the size of the block and / or the inter-frame prediction mode.

[0605] As Figure 13 , Figure 14 and Figure 15 shown, the quantized transform coefficients can be scanned in a diagonal direction, a horizontal direction, or a vertical direction.

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

[0607] In the scanning, the scanning order according to the type or direction of the scanning can be first applied to the sub-blocks. In addition, the scanning order according to the direction of the scanning can be applied to the quantized transform coefficients in each sub-block.

[0608] For example, as Figure 13 , Figure 14 and Figure 15 shown, when the size of the target block is 8×8, the quantized transform coefficients can be generated by a first transformation, a second transformation, and quantization of the residual signal of the target block. Therefore, one of three types of scanning orders can be applied to 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.

[0609] The scanned quantized transform coefficients can be entropy-coded, and the bitstream can include the entropy-coded quantized transform coefficients.

[0610] The decoding device 200 can generate the quantized transform coefficients by performing entropy decoding on the bitstream. The quantized transform coefficients can be arranged in the form of a 2D block via inverse scanning. Here, as a method of inverse scanning, at least one of a top-right diagonal scan, a vertical scan, and a horizontal scan can be performed.

[0611] Inverse quantization can be performed on the quantized transform coefficients. According to whether a second inverse transformation is performed, a second inverse transformation can be performed on the result generated by performing inverse quantization. In addition, according to whether a first inverse transformation will be performed, a first inverse transformation can be performed on the result generated by performing the second inverse transformation. The reconstructed residual signal can be generated by performing a first inverse transformation on the result generated by performing the second inverse transformation.

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

[0613] The encoding device 1600 can correspond to the encoding device 100 described above.

[0614] The encoding device 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 that communicate with each other via a bus 1690. The electronic device 1600 may further include a communication unit 1620 connected to a network 1699.

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

[0616] 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 an embodiment, the generation and processing of data or information and the checks, comparisons, and determinations related to the data or information may be performed by the processing unit 1610.

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

[0618] 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 device 1600 in the form of an operating system, an application module, or other program modules.

[0619] 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 capable of communicating with the encoding device 1200.

[0620] The program modules may include, but are not limited to, routines, subroutines, programs, objects, components, and data structures for performing functions or operations according to an embodiment or for implementing abstract data types according to an embodiment.

[0621] The program modules may be implemented using instructions or code run by at least one processor of the encoding device 1600.

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

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

[0624] The storage unit can store data or information for the operation of the encoding device 1600. In an embodiment, the data or information of the encoding device 1600 can be stored in the storage unit.

[0625] For example, the storage unit can store pictures, blocks, lists, motion information, inter-frame prediction information, bitstreams, etc.

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

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

[0628] Functions related to the communication of data or information of the encoding device 1600 can be executed through the communication unit 1620.

[0629] For example, the communication unit 1620 can send a bitstream to the decoding device 1600 to be described later.

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

[0631] The decoding device 1700 can correspond to the decoding device 200 described above.

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

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

[0634] 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 an embodiment, the generation and processing of data or information and the checks, comparisons, and determinations related to the data or information may be performed by the processing unit 1710.

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

[0636] At least some of the entropy decoding unit 210, the inverse quantization unit 220, the inverse transform unit 230, the intra prediction unit 240, the inter 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 program module, or other program modules.

[0637] 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 capable of communicating with the decoding device 1700.

[0638] The program modules may include, but are not limited to, routines, subroutines, programs, objects, components, and data structures for performing functions or operations according to an embodiment or for implementing abstract data types according to an embodiment.

[0639] The program modules may be implemented using instructions or code run by at least one processor of the decoding device 1700.

[0640] The processing unit 1710 may run instructions or code in the entropy decoding unit 210, the inverse quantization unit 220, the inverse transform unit 230, the intra prediction unit 240, the inter prediction unit 250, the switch 245, the adder 255, the filter unit 260, and the reference picture buffer 270.

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

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

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

[0644] Decoding device 1700 may be implemented in a computer system including a computer-readable storage medium.

[0645] The storage medium may store at least one module required for the operation of decoding device 1700. Memory 1730 may store at least one module and may be configured such that the at least one module is run by processing unit 1710.

[0646] Functions related to the communication of data or information with decoding device 1700 may be performed by communication unit 1720.

[0647] For example, communication unit 1720 may receive a bitstream from encoding device 1600.

[0648] Method and device for bidirectional intra-frame prediction

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

[0650] The bidirectional intra prediction method may be performed by encoding device 1600 and / or decoding device 1700.

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

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

[0653] For example, decoding device 1700 may perform the prediction method according to the embodiment to generate a reconstructed block for the target block.

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

[0655] In step 1810, the processing unit may determine a bi-directional intra prediction mode to be applied to the encoding and / or decoding of the target block.

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

[0657] In step 1820, the processing unit may determine a predicted value of a predicted block for the target block by performing bi-directional intra prediction for the target block using the determined bi-directional intra prediction mode.

[0658] In an embodiment, the two directions of the bi-directional intra prediction may be two linear directions implemented in opposite directions. For example, the two directions may be the direction of a 45° angle and the direction of a 225° angle.

[0659] In an embodiment, the two directions of the bi-directional intra prediction may be two different non-collinear directions. For example, the two directions may be the direction of a 45° angle and the direction of a 90° angle.

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

[0661] The target pixel may be a pixel targeted for encoding and / or decoding.

[0662] The processing unit may use at least one of the following to derive a predicted value of a target pixel in the target block: 1) pixels in neighboring blocks located in two directions of the bi-directional intra prediction, 2) weights according to the distances between respective pixels in neighboring blocks located in the two directions and the target pixel, and 3) weights for the two directions.

[0663] The predicted value of the target pixel in the target block may be the value of a pixel in the predicted block.

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

[0665] At step 1810, the processing unit may derive a bi-directional intra prediction mode based on at least one of the coding parameters related to the target block, the information of the target picture, the information of the target strip, the quantization parameter, the 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 prediction mode of the neighboring blocks of the target block, and the temporal layer level of the target block.

[0666] Optionally, at step 1820, the processing unit may derive a predicted value of a target pixel in the target block based on at least one of the coding parameters related to the target block, the information of the target picture, the information of the target strip, the quantization parameter, the 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 prediction mode of the neighboring blocks of the target block, and the temporal layer level of the target block.

[0667] Determination of bidirectional intra-frame prediction mode

[0668] Hereinafter, the bi-directional intra prediction mode may indicate the direction of bi-directional intra prediction. The terms "bi-directional intra prediction mode" and "direction of bi-directional intra prediction" may be used with the same meaning and may be used interchangeably with each other.

[0669] Figure 19 Shows a unidirectional intra prediction mode according to an example.

[0670] Figure 20 Shows a bi-directional intra prediction mode according to an example.

[0671] Figure 21 Shows a bi-directional intra prediction mode using virtual neighboring pixels according to an example.

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

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

[0674] As Figure 20 shown, the bi-directional intra prediction mode may be an intra prediction mode that references pixels located in two specified directions.

[0675] 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".

[0676] Here, the term "pixels located in two specified directions" may represent "pixels located in a first specified direction and pixels located in a second specified direction".

[0677] As Figure 21 shown, in the bi - directional intra - prediction mode, pixels in the reconstructed neighboring blocks can be used to generate at least one virtual neighboring pixel to the right or below the target block. In other words, at least one virtual neighboring pixel can be located to the right or below the target block. The bi - directional intra - prediction mode can be an intra - prediction mode that uses pixels in the reconstructed neighboring blocks and the reference of virtual neighboring pixels located in two specified directions.

[0678] Here, the virtual neighboring pixel to the right of the target block can be adjacent to the target block and to the right of the target block. Here, the virtual neighboring pixel below the target block can be adjacent to the target block and below the target block.

[0679] The processing unit can determine whether the bi - directional intra - prediction mode will be used for the target block based on at least one of the uni - directional / bi - directional classification indicator and the intra - prediction mode indicator, and can derive the bi - directional intra - prediction mode.

[0680] The uni - directional / bi - directional classification indicator can indicate whether the bi - directional intra - prediction mode will be used for the target block. The uni - directional / bi - directional classification indicator can have either a first value or a second value. The first value can indicate that uni - directional intra - prediction is used. For example, the first value can be "0". The second value can indicate that bi - directional intra - prediction is used. For example, the second value can be "1".

[0681] The uni - directional / bi - directional classification indicator can be signaled at the level of a specific unit of encoding and / or decoding (such as video, sequence, picture, slice, parallel block, CTU, CU, target block, sub - block of the target block, and a block with a specific size). In other words, the specific unit of encoding and / or decoding can include the uni - directional / bi - directional classification indicator that indicates whether the bi - directional intra - prediction mode will be used for the target in the unit.

[0682] The bi - directional intra - prediction mode can indicate two directions for bi - directional intra - prediction. The following scheme given in 1) to 4) can be used to indicate the two directions.

[0683] 1) The number of intra - prediction mode indicators can be two, and the two directions of bi - directional intra - prediction can be indicated by two intra - prediction mode indicators respectively.

[0684] Each of the two intra - prediction mode indicators can indicate the direction of the uni - directional intra - prediction mode. The two directions of bi - directional intra - prediction can be determined by the two directions indicated by the two intra - prediction mode indicators.

[0685] In this case, an intra prediction mode indicator may indicate a direction for an intra prediction mode, rather than distinguishing between a uni - directional prediction mode and a bi - directional prediction mode. Here, the direction may correspond to an angle such as 45°, 80°, or 135°.

[0686] 2) An intra prediction mode indicator may indicate either the direction of uni - directional intra prediction or the direction of bi - directional intra prediction.

[0687] For example, the value "3" of the intra prediction mode indicator may indicate uni - directional intra prediction at 45°, and the value "70" of the intra prediction mode indicator may indicate bi - directional intra prediction at 45° and 225°.

[0688] 3) To indicate the direction of intra prediction, a uni - directional / bi - directional classification indicator and an intra prediction mode indicator may be used together.

[0689] The uni - directional / bi - directional classification indicator may indicate which of uni - directional intra prediction and bi - directional intra prediction will be used, and the intra prediction mode indicator may indicate the direction of the prediction.

[0690] For example, when the value of the uni - directional / bi - directional classification indicator is a second value and the value of the intra prediction mode indicator is 7, bi - directional intra prediction at 45° and 225° may be used, where 225° is the direction opposite to 45°.

[0691] For example, when the value of the uni - directional / bi - directional classification indicator is a first value and the value of the intra prediction mode indicator is 7, uni - directional intra prediction at 45° may be used.

[0692] 4) When an intra prediction mode indicator indicates a specified direction of uni - directional intra prediction, bi - directional intra prediction may be performed.

[0693] For example, when the intra prediction mode indicator indicates uni - directional prediction at 45°, bi - directional intra prediction at 45° and 225° may be performed, where 225° is the direction opposite to 45°.

[0694] Figure 22 Illustrates the derivation and selection of bi - directional intra prediction from the direction of an intra prediction mode indicator according to an example.

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

[0696] As Figure 22As shown, the intra prediction mode indicator may indicate a direction of an 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 bi-directional intra prediction determined according to the direction of the intra prediction mode.

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

[0698] Either one of unidirectional intra prediction and bi-directional intra prediction may be selected and derived according to the availability of reference pixels in a direction corresponding to the direction indicated by the intra prediction mode indicator.

[0699] For example, either one of unidirectional intra prediction and bi-directional intra prediction may be selected and derived according to the availability of reference pixels in a direction opposite to the direction indicated by the intra prediction mode indicator.

[0700] Here, when the reference pixels in the corresponding direction are available, bi-directional intra prediction may be selected, and when the reference pixels in the corresponding direction are unavailable, unidirectional intra prediction may be selected.

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

[0702] Here, the fact that the reference pixels are available may mean that the values of the reference pixels have been determined. Optionally, the fact that the reference pixels are available may mean that the reconstruction of the reference pixels has been performed before performing the intra prediction of the target block. The fact that the reference pixels are unavailable may mean that the values of the reference pixels have not been determined. Optionally, the fact that the reference pixels are unavailable may mean that the reconstruction of the reference pixels has not been performed before performing the intra prediction of the target block, and thus the values of the reference pixels have not been determined.

[0703] For example, when the intra prediction mode indicator indicates the upper right direction (e.g., a 45° angle) and the 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 prediction to be used for the target block is bi-directional intra prediction in two directions (i.e., the upper right direction and the lower left direction).

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

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

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

[0707] 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 direction and the second direction may be used. For all pixels in the target block, when there is at least one unavailable reference pixel among all reference pixels in the second direction, unidirectional intra prediction in the first direction may be used.

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

[0709] For example, for a specific pixel in the target block, when the reference pixel in the first direction and the reference pixel 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 the reference pixel in the second direction is unavailable, unidirectional intra prediction in the first direction may be used.

[0710] When the reference pixel in the first direction or the reference pixel in the second direction is unavailable, the processing unit may use filling to generate the value of the unavailable reference pixel. Here, the value to be used for filling 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 for filling the unavailable reference pixel may be the average of the values of the multiple closest available reference pixels.

[0711] By means of filling, the unavailable reference pixel can be made available, and unidirectional intra prediction or bidirectional intra prediction using the available reference pixel can be performed.

[0712] The second direction may be a collinear direction opposite to the first direction indicated by the intra prediction mode indicator. In other words, the second direction may be a direction generated by adding 180° to the first direction. Optionally, the second direction may be a direction obtained by adding a predefined angle (α) to the first direction indicated by the intra 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.

[0713] As described above, the intra prediction mode indicator in the embodiments may not distinguish between the uni-directional mode and the bi-directional mode, and may indicate the direction of intra prediction.

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

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

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

[0717] For example, when bi-directional 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 bi-directional intra prediction mode of the neighboring blocks, the processing unit may determine the bi-directional intra prediction mode using the matching MPM as the bi-directional intra prediction mode of the target block.

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

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

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

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

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

[0723] Intra-frame prediction using bidirectional intra-frame prediction mode

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

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

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

[0727] 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 the target block. Optionally, the reference pixel may be a value obtained by applying filtering to pixels adjacent to the position specified by the specified prediction direction of a pixel in the target block.

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

[0729] When at least one of the reference pixels in two prediction directions of the bi-directional intra prediction mode is used, weights may be applied to each reference pixel. The weights may be predefined. Optionally, the weights may be set by calculation.

[0730] For example, weights may be set based on the distances between a target pixel and respective reference pixels. The weights may be inversely proportional to the distances between the target pixel and the respective reference pixels. Optionally, the weights may be directly proportional to the distances between the target pixel and the respective reference pixels. The ratio of the weights of the reference pixels may be the reciprocal of the ratio of the distances between the respective reference pixels and the target pixel.

[0731] The weights of the reference pixels may vary according to the prediction direction.

[0732] The weight of each reference pixel may vary according to whether the corresponding reference pixel is a reference pixel in the direction indicated by the intra prediction mode indicator. For example, the weight of the direction indicated by the intra 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.

[0733] Optionally, 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 the direction indicated by the intra prediction mode indicator.

[0734] The weights may be set by the encoding device 1600, and the set weights may be signaled from the encoding device 1600 to the decoding device 1700 via a bitstream.

[0735] When the weight of one of the two prediction directions of the bi - directional intra prediction mode is signaled, the weight of the other prediction direction may be set based on the signaled weight.

[0736] Each weight may be signaled at the level of a specific unit of encoding and / or decoding (such as a video, sequence, picture, slice, parallel block, CTU, CU, target block, sub - block of the target block, and a block with a specific size). In other words, a specific unit of encoding and / or decoding may include the weights to be used for the target in the corresponding unit or the information for deriving the weights.

[0737] Bidirectional intra-frame prediction using virtual pixels

[0738] Figure 23 Illustrates the generation of virtual neighboring pixels according to an example.

[0739] Since some of the pixels in the two prediction directions of the bi - directional intra prediction mode are not reconstructed before the bi - directional intra prediction, they may not be used for the bi - directional 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 bi - directional intra prediction.

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

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

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

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

[0744] When performing prediction in this way, the processing unit may obtain reference pixels in each prediction direction by filtering neighboring pixels in each prediction direction. In addition, the processing unit obtains 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 predicted value for the target pixel.

[0745] In other words, a 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 pixels in the target block. Optionally, a 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 pixels in the target block.

[0746] The processing unit may use at least one of the reference pixels in two prediction directions of the bi-directional intra prediction mode to determine a predicted value for the target pixel. The reference pixels may include neighboring pixels and virtual neighboring pixels.

[0747] The foregoing description of weights may also be applied to virtual neighboring pixels. When at least one of the reference pixels in two prediction directions of the bi-directional intra prediction mode is used, weights may be applied to the neighboring pixels and virtual neighboring pixels that are reference pixels, respectively.

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

[0749] The upper left coordinates of the target block can be (Cx, Cy). W can be the horizontal size of the target block. H can be the height or vertical size of the target block.

[0750] Hereinafter, "pixel (α, β)" may represent a pixel having coordinates (α, β).

[0751] 1) The processing unit can generate virtual neighboring pixels based on the pixels in the reconstructed neighboring blocks.

[0752] The virtual neighboring pixels can include right virtual neighboring pixels adjacent to the target block and on the right side of the target block, and lower virtual neighboring pixels adjacent to the target block and below the target block.

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

[0754] [Equation 2]

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

[0756] The position of the lower virtual neighboring pixel can be given by the following Equation 3:

[0757] [Equation 3]

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

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

[0760] For example, in Figure 23 , one or more reconstructed neighboring pixels among the reconstructed neighboring pixels adjacent to the target block and above the target block can be used to generate a virtual neighboring pixel R. The virtual neighboring pixel R can be the uppermost virtual neighboring pixel among the right virtual neighboring pixels.

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

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

[0763] For example, the relationship between the virtual neighboring pixel R and the neighboring pixel b can be represented by the following Equation 4:

[0764] [Equation 4]

[0765] R = b

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

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

[0768] The coordinates of the neighboring pixels a, neighboring pixel b, and neighboring pixel c can be given by the following Equation 5, Equation 6, and Equation 7:

[0769] [Equation 5]

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

[0771] [Equation 6]

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

[0773] [Equation 7]

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

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

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

[0777] For example, the relationship between the virtual neighboring pixel R, neighboring pixel a, neighboring pixel b, and neighboring pixel c can be represented by the following Equation 8:

[0778] [Equation 8]

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

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

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

[0782] For example, in Figure 23 , one or more of the reconstructed neighboring pixels that are adjacent to 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 the leftmost virtual neighboring pixel among the lower virtual neighboring pixels.

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

[0784] For example, in Figure 23 , 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 lower virtual neighboring pixels. The neighboring pixel q may be a pixel that is adjacent to and on the left side of the virtual neighboring pixel L.

[0785] For example, the relationship between the virtual neighboring pixel L and the neighboring pixel q may be represented by the following Equation 9:

[0786] [Equation 9]

[0787] L = q

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

[0789] For example, in Figure 23 , the neighboring pixels p, q, and 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.

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

[0791] [Equation 10]

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

[0793] [Equation 11]

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

[0795] [Equation 12]

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

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

[0798] For example, in Figure 23 , the virtual neighboring pixel L can 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 can be assigned to the neighboring pixel p, the neighboring pixel q, and the neighboring pixel r.

[0799] For example, the relationship between the virtual neighboring pixel L, the neighboring pixel p, the neighboring pixel q, and the neighboring pixel r can be represented by the following Equation 13:

[0800] [Equation 13]

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

[0802] 8) The processing unit can generate additional virtual neighboring pixels based on multiple virtual neighboring pixels generated using neighboring pixels.

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

[0804] Figure 24 Illustrates generating additional virtual neighboring pixels using virtual neighboring pixels according to an example.

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

[0806] The distance between a specific virtual neighboring pixel N i and the virtual neighboring pixel L can be represented by the following Equation 14:

[0807] [Equation 14]

[0808] (N iThe 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)

[0809] Specific virtual neighboring pixel N i The distance between the virtual neighboring pixel N and the virtual neighboring pixel R can be represented by the following Equation 15:

[0810] [Equation 15]

[0811] (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)

[0812] In other words, the distance between pixels can 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.

[0813] 9) The processing unit can generate the virtual neighboring pixel L and the virtual neighboring pixel R based on the neighboring pixels in the reconstructed neighboring block, and can generate the 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 .

[0814] When generating the virtual neighboring pixel N i , a weight for distance can be used. The weight for distance can include the weight according to the distance between the virtual neighboring pixel N i and the virtual neighboring pixel L and the weight according to the distance between the virtual neighboring pixel N i and the virtual neighboring pixel R.

[0815] For example, the relationship between the virtual neighboring pixel N i , the virtual neighboring pixel L and the virtual neighboring pixel R can be represented by the following Equation 16:

[0816] [Equation 16]

[0817]

[0818] d R can be the distance between the virtual neighboring pixel N i and the virtual neighboring pixel R.

[0819] d L can be the distance between the virtual neighboring pixel N i and the virtual neighboring pixel L.

[0820] Figure 25 Shows the generation of the lower - right virtual neighboring pixel and the middle virtual neighboring pixel according to the example.

[0821] The upper left coordinates of the target block can be (Cx, Cy). W can be the horizontal dimension of the target block. H can be the height or vertical dimension of the target block.

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

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

[0824] 11) The processing unit can 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).

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

[0826] For example, the relationship between the virtual neighboring pixel G, the neighboring pixel b, and the neighboring pixel q can be represented by the following Equation 17:

[0827] [Equation 17]

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

[0829] 12) The processing unit can 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).

[0830] For example, in Figure 25 a virtual neighboring pixel G can be generated using the virtual neighboring pixel R and the 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.

[0831] For example, the relationship between the virtual adjacent pixel G, the virtual adjacent pixel R, and the virtual adjacent pixel L can be represented by the following Equation 18:

[0832] [Equation 18]

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

[0834] 12) The processing unit can generate a third virtual adjacent pixel based on the first virtual adjacent pixel and the second virtual adjacent pixel, and can generate a fourth virtual adjacent pixel based on the first virtual adjacent pixel and the third virtual adjacent pixel.

[0835] The processing unit can generate a virtual adjacent pixel between the virtual adjacent pixel (Cx + W, Cy) and the virtual adjacent pixel (Cx + W, Cy + H) based on the virtual adjacent pixel (Cx + W, Cy), the virtual adjacent pixel (Cx, Cy + H), and the virtual adjacent pixel (Cx + W, Cy + H). In addition, the processing unit can generate a virtual adjacent pixel between the virtual adjacent pixel (Cx, Cy + H) and the virtual adjacent pixel (Cx + W, Cy + H) according to the virtual adjacent pixel (Cx + W, Cy), the virtual adjacent pixel (Cx, Cy + H), and the virtual adjacent pixel (Cx + W, Cy + H).

[0836] For example, in Figure 25 , the virtual adjacent pixel M can be generated based on the virtual adjacent pixel R, the virtual adjacent pixel L, and the virtual adjacent pixel G i . The virtual adjacent pixel M i can be a pixel between the virtual adjacent pixel R and the virtual adjacent pixel G.

[0837] For example, in Figure 25 , the virtual adjacent pixel N can be generated using the virtual adjacent pixel R, the virtual adjacent pixel L, and the virtual adjacent pixel G i . The virtual adjacent pixel N i can be a pixel between the virtual adjacent pixel L and the virtual adjacent pixel G.

[0838] 13) The processing unit can generate a third virtual adjacent pixel based on the first virtual adjacent pixel and the second virtual adjacent pixel, and can generate a fourth virtual adjacent pixel based on the first virtual adjacent pixel and the third virtual adjacent pixel. Here, when generating the fourth virtual adjacent pixel, the processing unit can use the weight for the additional virtual adjacent pixel. The additional virtual adjacent pixel can include the first virtual adjacent pixel and the third virtual adjacent pixel. The weight for the additional virtual adjacent pixel can be set based on the distance between the fourth virtual adjacent pixel and the additional virtual adjacent pixel.

[0839] For example, in Figure 25In it, a virtual neighboring pixel M can be generated based on a virtual neighboring pixel R, a virtual neighboring pixel L, and a virtual neighboring pixel G. i The virtual neighboring pixel M i can be a pixel between the virtual neighboring pixel R and the virtual neighboring pixel G.

[0840] When generating the virtual neighboring pixel M i one or more of the weights for the virtual neighboring pixel R, the weights for the virtual neighboring pixel L, and the weights for the virtual neighboring pixel G can be used.

[0841] The weight for the virtual neighboring pixel R can be set based on the distance between the virtual neighboring pixel R and the virtual neighboring pixel M i

[0842] The weight for the virtual neighboring pixel L can be set based on the distance between the virtual neighboring pixel L and the virtual neighboring pixel M i

[0843] The weight for the virtual neighboring pixel G can be set based on the distance between the virtual neighboring pixel G and the virtual neighboring pixel M i

[0844] For example, in Figure 25 a virtual neighboring pixel N can be generated using the virtual neighboring pixel R, the virtual neighboring pixel L, and the virtual neighboring pixel G i The virtual neighboring pixel N i can be a pixel between the virtual neighboring pixel L and the virtual neighboring pixel G.

[0845] When generating the virtual neighboring pixel N i one or more of the weights for the virtual neighboring pixel R, the weights for the virtual neighboring pixel L, and the weights for the virtual neighboring pixel G can be used.

[0846] The weight for the virtual neighboring pixel R can be set based on the distance between the virtual neighboring pixel R and the virtual neighboring pixel N i

[0847] The weight for the virtual neighboring pixel L can be set based on the distance between the virtual neighboring pixel L and the virtual neighboring pixel N i

[0848] The weight for the virtual neighboring pixel G can be set based on the distance between the virtual neighboring pixel G and the virtual neighboring pixel N i

[0849] The weight for the virtual neighboring pixel G 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 is set based on the distance between them. The weight for the virtual neighboring pixel L can be proportional to 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 inversely proportional to the sum of the distance from the virtual neighboring pixel N i to the virtual neighboring pixel L and the distance from the virtual neighboring pixel N i to the virtual neighboring pixel G.

[0850] 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 pixel L and the virtual neighboring pixel N i The weight for the virtual neighboring pixel G can be inversely proportional to the sum of the distance from the virtual neighboring pixel N i to the virtual neighboring pixel L and the distance from the virtual neighboring pixel N i to the virtual neighboring pixel G.

[0851] For example, the relationship between the virtual neighboring pixel N i , the virtual neighboring pixel L, and the virtual neighboring pixel G can be represented by the following Equation 19:

[0852] [Equation 19]

[0853]

[0854] d G can be the distance between the virtual neighboring pixel N i and the virtual neighboring pixel G.

[0855] d L can be the distance between the virtual neighboring pixel N i and the virtual neighboring pixel L.

[0856] For example, the relationship between the virtual neighboring pixel M i , the virtual neighboring pixel R, and the virtual neighboring pixel G can be represented by the following Equation 20.

[0857] [Equation 20]

[0858]

[0859] d G can be the distance between the virtual neighboring pixel M i and the virtual neighboring pixel G.

[0860] d R can be the distance between the virtual neighboring pixel M i and the virtual neighboring pixel R.

[0861] Figure 26 Shows bidirectional intra prediction according to an example.

[0862] The processing unit may derive a predicted value for a target pixel using at least one of the reconstructed neighboring pixels and virtual neighboring pixels located in two prediction directions of the bidirectional intra prediction mode.

[0863] The processing unit may derive a predicted value for target pixel X using one or more of two reference pixels located in two prediction directions of the bidirectional intra prediction mode.

[0864] The two reference pixels may include reference pixel Ref_A and reference pixel Ref_B.

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

[0866] The two reference pixels may be reconstructed neighboring pixels. For example, as Figure 26 shown, both Ref_A and Ref_B may be neighboring pixels.

[0867] Figure 27 Shows bidirectional intra prediction using virtual neighboring pixels according to an example.

[0868] The processing unit may derive a predicted value for target pixel X using one or more of two reference pixels located in two prediction directions of the bidirectional intra prediction mode.

[0869] The two reference pixels may include reference pixel Ref_A and reference pixel Ref_B.

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

[0871] At least one of the two reference pixels may be a virtual neighboring pixel. For example, as Figure 27 shown, Ref_A may be a neighboring pixel and Ref_B may be a virtual neighboring pixel.

[0872] Such reference pixels may be pixels at specific positions in each of two prediction directions of the bidirectional intra prediction. The processing unit may obtain the reference pixels by filtering one or more of the neighboring pixels and / or virtual neighboring pixels near the specific positions.

[0873] For example, when the specific position is not indicated by integer coordinates, the processing unit may obtain the reference pixels by filtering one or more of the neighboring pixels and / or virtual neighboring pixels near the specific positions.

[0874] For example, when the pixel at a specific position is unavailable, the processing unit can obtain a reference pixel by performing filtering on one or more of the neighboring pixels and / or virtual neighboring pixels near the specific position.

[0875] The neighboring pixels near the specific position can be the neighboring pixels adjacent to the specific position. The virtual neighboring pixels near the specific position can be the virtual neighboring pixels adjacent to the specific position.

[0876] The predicted value Pred_X derived for the target pixel can be a statistical value related to one or more of Ref_A and Ref_B, and the predicted value Pred_X can be derived based on the statistical value. Hereinafter, the statistical value in the embodiments can be at least one of an average value, a weighted average value, a maximum value, a minimum value, a mode value, a median value, and an interpolation value.

[0877] As illustrated in Equation 21 below, Ref_A and Ref_b can be used to derive the predicted value Pred_X for the target pixel.

[0878] [Equation 21]

[0879] Pred_X = F(Ref_A, Ref_B)

[0880] F() can be a specific function.

[0881] As described above, the processing unit can use one or more of the two reference pixels located in two prediction directions in the bi-directional intra-frame prediction mode to derive the predicted value for the target pixel X. Here, when the predicted value for the target pixel X is derived, the processing unit can apply weights to the two reference pixels located in the two prediction directions, respectively.

[0882] For example, the sum of the weights can be 1.

[0883] The two reference pixels can include the reference pixel Ref_A and the reference pixel Ref_B.

[0884] Ref_A and Ref_B can be pixels located in two prediction directions respectively derived and selected through the bi-directional intra-frame prediction of the target pixel.

[0885] For example, as Figure 26 shown, both Ref_A and Ref_B can be reconstructed neighboring pixels.

[0886] Optionally, in the example, as Figure 27 shown, Ref_A can be a reconstructed neighboring pixel, and Ref_B can be a virtual neighboring pixel.

[0887] As illustrated in Equation 22 below, the predicted value Pred_X for the target pixel can be derived using the weight for Ref_A and the weight for Ref_B.

[0888] [Equation 22]

[0889] Pred_X = Dir_A * Ref_A + Dir_B * Ref_B

[0890] Dir_A can be the weight for Ref_A. Dir_B can be the weight for Ref_B.

[0891] The sum of Dir_A and Dir_B can be 1.

[0892] When generating the derived predicted value Pred_X for the target block, the processing unit can use the above filtering to obtain the reference pixels and the weights for the reference pixels together.

[0893] Such reference pixels can be pixels at specific positions on each of the two prediction directions of bi - directional intra - prediction. The processing unit can obtain the reference pixels by performing filtering on one or more of the neighboring pixels and / or virtual neighboring pixels near the specific positions. In addition, the processing unit can apply the corresponding weights to the generated reference pixels.

[0894] Figure 28 Illustrates bi - directional intra - prediction using the distance between neighboring pixels and the target pixel according to an example.

[0895] Figure 29 Illustrates bi - directional intra - prediction using the distance between virtual neighboring pixels and the target pixel according to an example.

[0896] As described above, the processing unit can use one or more of the two reference pixels located on the two prediction directions of the bi - directional intra - prediction mode to derive the predicted value for the target pixel X. Here, the processing unit can use the weights according to the distance between the corresponding reference pixel and the target pixel for each of the two reference pixels located on the two prediction directions.

[0897] The two reference pixels can include reference pixel Ref_A and reference pixel Ref_B.

[0898] Ref_A and Ref_B can be pixels located on the two prediction directions respectively derived and selected through bi - directional intra - prediction of the target pixel.

[0899] For example, as Figure 28 shown, both Ref_A and Ref_B can be reconstructed neighboring pixels.

[0900] Optionally, in the example, asFigure 29 As shown, Ref_A can be a reconstructed neighboring pixel, and Ref_B can be a virtual neighboring pixel.

[0901] When generating the derived predicted value Pred_X for the target block, the processing unit can use the above filtering to obtain the reference pixels together with the weights according to the distances between the reference pixels and the target pixel.

[0902] Such reference pixels can be pixels at specific positions on each of the two prediction directions of bi-directional intra prediction. The processing unit can obtain the reference pixels 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 can apply the corresponding weights to the generated reference pixels.

[0903] As illustrated in Equation 23 below, one or more of Ref_A, Dis_A, Ref_B, and Dis_B can be used to derive the predicted value Pred_X for the target pixel.

[0904] [Equation 23]

[0905] Pred_X = F(Ref_A, Dis_A, Ref_B, Dis_B)

[0906] F() can be a specific function.

[0907] Dis_A can be the distance between the target pixel and Ref_A. Dis_B can be the distance between the target pixel and Ref_B.

[0908] The derived predicted value Pred_X for the target pixel can be a statistical value related to one or more of Ref_A, Dis_A, Ref_B, and Dis_B, and the predicted value Pred_X can be derived based on the statistical value.

[0909] As illustrated in Equation 24 below, the predicted value Pred_X for the target pixel can be derived based on the weights according to the distances between the target pixel and the corresponding reference pixels.

[0910] [Equation 24]

[0911]

[0912] The weight for one of the two reference pixels can be proportional to the distance between the other of the two reference pixels and the target pixel.

[0913] The weight for one of the two reference pixels can be inversely proportional to the sum of the distances from the target pixel to the two reference pixels.

[0914] For example, the weight for Ref_B can be given by the following Equation 25:

[0915] [Equation 25]

[0916]

[0917] For example, the weight for Ref_A can be given by the following Equation 26.

[0918] [Equation 26]

[0919]

[0920] As described above, the processing unit can use one or more of two reference pixels located in two prediction directions in the bi-directional intra prediction mode to derive a predicted value for the target pixel X. Here, the processing unit can use one or more of a distance weight and a direction weight for each of the two reference pixels in the two prediction directions.

[0921] The distance weight can be a weight based on the distance between the corresponding reference pixel and the target pixel. The direction weight can be a weight based on the direction from the target pixel to the corresponding reference pixel.

[0922] When generating the derived predicted value Pred_X for the target block, the processing unit can use the above filtering to obtain the reference pixel, the distance weight, and the direction weight together.

[0923] Such a reference pixel can be a pixel at a specific position in each of the two prediction directions of the bi-directional intra prediction. The processing unit can 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 can apply one or more of the distance weight and the direction weight to the generated reference pixel.

[0924] As illustrated in the following Equation 27, one or more of Ref_A, Dis_A, Dir_A, Ref_B, Dis_B, and Dir_B can be used to derive the predicted value Pred_X for the target pixel.

[0925] [Equation 27]

[0926] Pred_X = F(Ref_A, Dis_A, Dir_A, Ref_B, Dis_B, Dir_B)

[0927] F() can be a specific function.

[0928] Dis_A can be the distance between the target pixel and Ref_A. Dir_A can be the direction of Ref_A. Dir_A can be the direction from the target pixel to Ref_A. Dis_B can be the distance between the target pixel and Ref_B. Dir_B can be the direction of Ref_B. Dir_B can be the direction from the target pixel to Ref_B.

[0929] The derived predicted value Pred_X for the target pixel can 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 predicted value Pred_X can be derived based on the statistical value.

[0930] As illustrated in Equation 28 below, the predicted value Pred_X for the target pixel can be derived based on the distance from the target pixel to the reference pixel and the direction weight for the reference pixel.

[0931] [Equation 28]

[0932]

[0933] The weight for one of the two reference pixels can be proportional to the distance between the other of the two reference pixels and the target pixel.

[0934] In addition, the weight for one of the two reference pixels can be proportional to the direction weight for the one reference pixel.

[0935] The weight for one of the two reference pixels can be inversely proportional to the sum of the distances from the target pixel to the two reference pixels.

[0936] For example, the weight for Ref_B can be given by Equation 29 below:

[0937] [Equation 29]

[0938]

[0939] For example, the weight for Ref_A can be given by Equation 30 below:

[0940] [Equation 30]

[0941]

[0942] Derive the intra-frame prediction mode using MPM

[0943] When the intra prediction mode of a target block is determined, depending on the coding parameters associated with the target block, the likelihood that a particular intra prediction mode will be used for the intra prediction of the target block can be high or low. Considering this likelihood, an MPM list can be used.

[0944] The remaining modes can be the remaining intra prediction modes other than the MPMs in the MPM list. In other words, the remaining modes can be the remaining intra prediction modes after excluding one or more MPMs in the MPM list from all intra prediction modes.

[0945] According to the probability that the remaining mode will be used for the intra prediction of the target block, the remaining modes can be classified into a first set of remaining modes and a second set of remaining modes.

[0946] The remaining modes that are highly likely to be used for the intra prediction of the target block can be defined as the first set of remaining modes. The first set of remaining modes can be referred to as "likely remaining modes". In other words, the likely remaining modes can indicate the intra prediction modes among the remaining intra prediction modes (i.e., among all intra prediction modes other than the MPMs) that are highly likely to be used as the intra prediction mode of the target block.

[0947] The remaining modes among all the remaining modes that are not included in the first set of remaining modes can be defined as the second set of remaining modes. The second set of remaining modes can be referred to as "pure (true) remaining modes".

[0948] The remaining mode indicator can indicate the remaining mode among the remaining modes that will be used for the intra prediction of the target block. Optionally, the remaining mode indicator can indicate the remaining mode among the likely remaining modes that will be used for the intra prediction of the target block.

[0949] Figure 30 Illustrates the determination of the intra prediction mode using the remaining mode according to an embodiment.

[0950] In step 3010, the processing unit can derive one or more MPMs for the target block.

[0951] The processing unit can derive one or more MPMs in the MPM list for the target block.

[0952] In step 3020, the processing unit can determine whether the intra prediction mode of the target block is one of the MPMs.

[0953] The processing unit can use the MPM usage indicator to determine whether the intra prediction mode of the target block is one of the MPMs. The processing unit can obtain the MPM usage indicator from the bitstream.

[0954] For example, the MPM usage indicator may have a name such as "prev_intra_pred_mode flag".

[0955] When the value of the MPM usage indicator is the first value (e.g., "1"), the processing unit may determine that the intra prediction mode of the target block is one of the MPMs in the MPM list.

[0956] When the value of the MPM usage indicator is the second value (e.g., "0"), the processing unit may determine that the intra prediction mode of the target block is not one of the MPMs in the MPM list.

[0957] If it is determined that the intra prediction mode of the target block is one of the MPMs in the MPM list, step 3030 may be executed.

[0958] If it is determined that the intra prediction mode of the target block is not one of the MPMs in the MPM list, step 3040 may be executed.

[0959] In step 3030, the processing unit may use the MPM indicator to determine the intra prediction mode of the target block.

[0960] The processing unit may obtain the MPM indicator from the bitstream.

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

[0962] For example, the MPM indicator may be an index for the MPM list.

[0963] In step 3040, the processing unit may derive one or more possible remaining modes for the target block.

[0964] The processing unit may derive one or more possible remaining modes from the list of possible remaining modes for the target block.

[0965] In step 3050, the processing unit may use the remaining mode indicator to determine the intra prediction mode of the target block.

[0966] The processing unit may obtain the remaining mode indicator from the bitstream.

[0967] The processing unit may determine the possible remaining mode indicated by the remaining mode indicator among one or more possible remaining modes in the list of possible remaining modes as the intra prediction mode of the target block.

[0968] For example, the remaining mode indicator may be an index of the list of possible remaining modes.

[0969] As described above, the intra prediction mode of the target block can be determined based on a plurality of different lists corresponding to the MPM list and the possible remaining mode list.

[0970] Figure 31 FIG. shows the derivation of the MPM after determining whether to use the MPM and the determination of the intra prediction mode using the remaining modes according to an embodiment.

[0971] As referred to above Figure 30 The order of step 3010 and step 3020 described above can be changed.

[0972] In step 3110, the processing unit can determine whether the MPM is used to perform intra prediction for the target block.

[0973] Here, the fact that the MPM is used to perform intra prediction for the target block can indicate: 1) the case where the intra prediction mode of the target block is one of the MPMs in the MPM, 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.

[0974] The processing unit can use the MPM usage indicator to determine whether the MPM is used to perform intra prediction for the target block. The processing unit can obtain the MPM usage indicator from the bitstream.

[0975] For example, the MPM usage indicator can have a name such as "prev_intra_pred_mode flag".

[0976] When the value of the MPM usage indicator is the first value (e.g., "1"), the processing unit can determine that the MPM is used to perform intra prediction for the target block.

[0977] When the value of the MPM usage indicator is the second value (e.g., "0"), the processing unit can determine that the MPM is not used to perform intra prediction for the target block.

[0978] The processing unit can 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 can 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 can determine that the MPM is not used to perform intra prediction for the target block.

[0979] If it is determined that the MPM is used to perform intra prediction for the target block, step 3120 can be executed.

[0980] If it is determined that the MPM is not used to perform intra prediction for the target block, the processing can be terminated, and intra prediction based on an additional scheme can be executed.

[0981] In step 3120, the processing unit may derive one or more MPMs for the target block.

[0982] The processing unit may derive one or more MPMs in the MPM list for the target block.

[0983] In step 3130, the processing unit may determine whether the possible remaining mode is used to perform intra prediction for the target block.

[0984] Optionally, the processing unit may determine which one of the MPM and the possible remaining mode is used to perform intra prediction for the target block.

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

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

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

[0988] 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 executed.

[0989] In an example, if it is determined that the MPM is used to perform intra prediction for the target block, step 3140 may be executed.

[0990] 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 executed.

[0991] 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 executed.

[0992] Step 3140 may correspond to step 3030. The repeated description will be omitted here.

[0993] Step 3150 may correspond to step 3040. The repeated description will be omitted here.

[0994] The possible remaining mode may be derived based on the MPMs derived in step 3120. The relationship between the MPM and the possible remaining mode and the derivation of the possible remaining mode under the relationship will be described in detail below.

[0995] Step 3160 may correspond to step 3050. Repeated descriptions will be omitted here.

[0996] Steps 3040 and 3150 may be selectively performed. In an example, the processing unit may use a residual mode usage indicator to determine whether the intra prediction mode of the target block is one of the possible residual modes. The processing unit may obtain the residual mode usage indicator from the bitstream. When the value of the residual mode usage indicator is a first value (e.g., "1"), the processing unit may determine that the intra prediction mode of the target block is one of the possible residual modes. When the value of the residual mode usage indicator is a second value (e.g., "0"), the processing unit may determine that the intra prediction mode of the target block is not one of the possible residual modes. If it is determined that the intra prediction mode of the target block is one of the possible residual modes, step 3040 or 3150 may be performed. If it is determined that the intra prediction mode of the target block is not one of the possible residual modes, the processing may be terminated, and additional intra prediction that neither uses MPM nor uses possible residual modes may be processed.

[0997] Derivation of possible remaining modes

[0998] Figure 32 Blocks for deriving MPM candidates according to an example are shown.

[0999] The processing unit may derive one or more of the remaining intra prediction modes other than MPM among all intra prediction modes as possible residual modes.

[1000] The number of possible residual modes may be predefined. For example, the number of possible residual modes may be 2 or 3.

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

[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 residual modes may be 3.

[1003] Six MPM candidates (i.e., candModeList[0] to candModeList[5]) may be derived as described below.

[1004] 1) When the intra prediction mode candIntraPredModeA of neighboring block A of the target block and the intra prediction mode candIntraPredModeB of neighboring block B of the target block are the same, and the intra prediction mode candIntraPredModeA of neighboring block A is greater than INTRA_DC, six MPM candidates may be derived as shown in Code 1 below.

[1005] [Code 1]

[1006] candModeList[0] = the intra prediction mode of neighboring block A (candIntraPredModeA)

[1007] candModeList[1] = INTRA_PLANAR

[1008] candModeList[2] = INTRA_DC

[1009] candModeList[3] = 2 + ((candIntraPredModeA + 61) % 64)

[1010] candModeList[4] = 2 + ((candIntraPredModeA - 1) % 64)

[1011] candModeList[5] = 2 + ((candIntraPredModeA + 60) % 64)

[1012] 2) When the above conditions in 1) are not satisfied (i.e., when the intra prediction mode candIntraPredModeA of neighboring block A and the intra prediction mode candIntraPredModeB of neighboring block B are different from each other and the intra prediction mode candIntraPredModeA of neighboring block A or the intra prediction mode candIntraPredModeB of neighboring block B is greater than INTRA_DC), the MPM candidates can be derived as shown in Code 2 to Code 7 below:

[1013] [Code 2]

[1014] minAB = candModeList[(candModeList[0] > candModeList[1])? 1 : 0]

[1015] maxAB = candModeList[(candModeList[0] > candModeList[1])? 0 : 1]

[1016] 2 - 1) When the intra prediction mode candIntraPredModeA of neighboring block A and the intra prediction mode candIntraPredModeB of neighboring block B are both greater than INTRA_DC, the MPM candidates can be derived as shown in Code 3 below:

[1017] [Code 3]

[1018] candModeList[0] = candIntraPredModeA

[1019] candModeList[1] = candIntraPredModeB

[1020] candModeList[2] = INTRA_PLANAR

[1021] candModeList[3] = INTRA_DC

[1022] When the difference between the derived MaxAB and MinAB falls within the range from 2 to 62, the fifth MPM candidate and the sixth MPM candidate can be derived as shown in the following Code 4:

[1023] [Code 4]

[1024] candModeList[4] = 2 + ((maxAB + 61) % 64)

[1025] candModeList[5] = 2 + ((maxAB - 1) % 64)

[1026] When the difference between the derived MaxAB and MinAB does not fall within the range from 2 to 62, the fifth MPM candidate and the sixth MPM candidate can be derived as shown in the following Code 5:

[1027] [Code 5]

[1028] candModeList[4] = 2 + ((maxAB + 60) % 64)

[1029] candModeList[5] = 2 + ((maxAB) % 64)

[1030] 2-2) When the condition in 2-1) is not satisfied (i.e., when at least one of the intra prediction modes candIntraPredModeA of the neighboring block A and candIntraPredModeB of the neighboring block B is greater than INTRA_DC), six MPM candidates can be derived as shown in the following Code 6:

[1031] [Code 6]

[1032] candModeList[0] = candIntraPredModeA

[1033] candModeList[1] = candIntraPredModeB

[1034] candModeList[2] = 1 - minAB

[1035] candModeList[3] = 2 + ((maxAB + 61) % 64)

[1036] candModeList[4] = 2 + ((maxAB - 1) % 64)

[1037] candModeList[5] = 2 + ((maxAB + 60) % 64)

[1038] 3) When the above conditions in 1) and 2) are not satisfied, six MPM candidates can be derived as shown in the following Code 7:

[1039] [Code 7]

[1040] candModeList[0] = candIntraPredModeA

[1041] candModeList[1] = (candModeList[0] == INTRA_PLANAR)? INTRA_DC : INTRA_PLANAR

[1042] candModeList[2] = INTRA_ANGULAR50

[1043] candModeList[3] = INTRA_ANGULAR18

[1044] candModeList[4] = INTRA_ANGULAR46

[1045] candModeList[5] = INTRA_ANGULAR54

[1046] The processing unit can derive possible remaining modes based on the spatial neighboring blocks and temporal neighboring blocks of the target block.

[1047] The processing unit can derive at least one intra prediction mode that does not belong to the MPM among the intra prediction modes of the spatial neighboring blocks of the target block and the intra prediction modes of the temporal neighboring blocks of the target block as possible remaining modes.

[1048] For example, when the number of the intra prediction mode of one of the neighboring blocks of the target block is 30 and the number of another intra prediction mode is 40, and when the 30th intra prediction mode belongs to the MPM and the 40th intra prediction mode does not belong to the MPM, the 40th intra prediction mode can be derived as a possible remaining mode.

[1049] The processing unit may derive possible remaining modes based on the MPMs selected from all the MPMs.

[1050] The selected MPMs may be a predefined number of MPMs that are sequentially previous. Here, the sequentially previous MPMs may represent intra prediction modes defined by a smaller number of binary bits. Optionally, the sequentially previous MPMs may be the MPMs with the lowest indices in the MPM list.

[1051] In an embodiment, the predefined number of the selected MPMs may be "1".

[1052] The number of the derived possible remaining modes may be the sum of the number of the first MPM and the offset. 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 prediction mode may be derived as a possible remaining mode.

[1053] The number of the derived possible remaining modes may 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 thus the 29th intra prediction mode may be derived as a possible remaining mode.

[1054] The number of the derived possible remaining modes may be: 1) the sum of the number of the first MPM and the offset, and 2) the difference between the number of the first MPM and the offset. In an example, when the number of the first MPM is 30, the 29th intra prediction mode and the 31st intra prediction mode may be derived as possible remaining modes.

[1055] The number of the derived 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.

[1056] When 1) the intra prediction mode having the number corresponding to the sum of the number of the first MPM and the first offset or 2) the intra prediction mode having the number corresponding to the difference between the number of the first MPM and the first offset is one of the existing MPMs, 1) the intra prediction mode having the number corresponding to the sum of the number of the first MPM and the second offset or 2) the intra prediction mode having the number corresponding to the difference between the number of the first MPM and the second offset may be derived as possible remaining modes. For example, the second offset may be 2. Optionally, the second offset may be different from the first offset. Optionally, 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.

[1057] For example, when the 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, the intra prediction mode having a number corresponding to the sum of the number of the first MPM and the second offset can be derived as a possible remaining mode.

[1058] For example, when the intra 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, the intra 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.

[1059] In an embodiment, the predefined number of selected MPMs may be '3'.

[1060] For example, the processing unit may determine the number of possible remaining modes by adding the offset to the numbers of the first MPM, the second MPM, and the third MPM among one or more MPMs in the MPM list or by subtracting the offset from the numbers of the first MPM, the second MPM, and the third MPM.

[1061] For example, when the numbers of the first MPM, the second MPM, and the third MPM are 30, 40, and 50 respectively, the derived numbers of possible remaining modes may be 31, 41, and 51 respectively.

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

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

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

[1065] The processing unit may derive possible remaining modes based on the direction of the MPM.

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

[1067] For example, the processing unit may derive the intra prediction mode having a direction that does not belong to the direction of the MPMs in the specified direction as a possible remaining mode based on the direction of the MPM.

[1068] For example, when all MPMs are intra prediction modes with horizontal directivity, an intra prediction mode with vertical directivity can be derived as a possible remaining mode. An intra prediction mode with horizontal directivity can be an intra prediction mode having a slope with a change in the horizontal component greater than a change in the vertical component. An intra prediction mode with vertical directivity can be an intra prediction mode having a slope with a change in the vertical component greater than a change in the horizontal component.

[1069] For example, when all MPMs are intra prediction modes with vertical directivity, an intra prediction mode with horizontal directivity or a horizontal intra prediction mode can be derived as a possible remaining mode.

[1070] For example, when all MPMs are intra prediction modes with horizontal directivity, an intra prediction mode with vertical directivity or a vertical intra prediction mode can be derived as a possible remaining mode.

[1071] The processing unit can derive a possible remaining mode based on the statistical values of the selected MPMs. The selected MPMs can be a predefined number of MPMs in the front in order.

[1072] In other words, an intra prediction mode having a number corresponding to the statistical value can be derived as a possible remaining mode.

[1073] For example, an intra prediction mode having a number that is the average of the number of the first MPM and the number of the second MPM can be derived as a possible remaining mode. When the number of the first MPM is 30 and the number of the second MPM is 40, the 35th intra prediction mode can be derived as a possible remaining mode.

[1074] When deriving a possible remaining mode based on the statistical values of the selected MPMs, the processing unit can exclude the DC mode and the planar mode that are non-directional modes. Optionally, when selecting a predefined number of MPMs in the front in order from all MPMs, if there is an MPM that is a non-directional mode among the predefined number of MPMs in the front in order, the processing unit can not select the corresponding MPM that is a non-directional mode, but can select a subsequent MPM that is a directional mode.

[1075] For example, the processing unit may calculate the average of the first two MPMs in order among a total of six MPMs, and may derive an intra prediction mode having a number corresponding to the average as a possible remaining mode. When the six MPMs respectively indicate a DC mode, a mode No. 30, a planar mode, a mode No. 10, a mode No. 50, and a mode No. 52, the MPM that is the DC mode and the MPM that is the planar mode may be excluded from the selection. The mode No. 30 MPM and the mode No. 10 MPM as the first two MPMs in order may be selected due to such exclusion, and the average of 30 and 10 is 20, so the intra prediction mode No. 20 may be derived as a possible remaining mode.

[1076] The processing unit may derive a possible remaining mode based on the statistical values of all MPMs. The number of the intra prediction mode derived as a possible remaining mode may be the statistical value. For example, the total number of MPMs may be 6, and the statistical value may be its average.

[1077] When deriving a possible remaining mode based on the statistical values of the selected MPMs, the processing unit may exclude the DC mode and the planar mode as non-directional modes.

[1078] For example, the processing unit may exclude the DC mode and the planar mode from all MPMs, and may derive a possible remaining mode based on the statistical values of the remaining MPMs. The intra prediction mode having a number corresponding to the statistical value may be derived as a possible remaining mode.

[1079] The processing unit may use a possible remaining mode candidate list to derive a possible remaining mode.

[1080] The possible remaining mode candidate list may include one or more possible remaining mode candidates. The possible remaining mode candidate list may be equivalently defined by the encoding device 1600 and the decoding device 1700.

[1081] The processing unit may sequentially search for possible remaining mode candidates existing 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.

[1082] Sequentially searching for possible remaining mode candidates may mean that possible remaining mode candidates having a smaller index in the possible remaining mode candidate list are searched earlier than possible remaining mode candidates having a larger index.

[1083] The number of possible remaining mode candidates among the possible remaining mode candidates in the possible remaining mode candidate list that are derived as possible remaining modes may be predefined.

[1084] For example, when the possible residual mode candidates are defined in the order of the intra prediction mode No. 30, the intra prediction mode No. 40, the intra prediction mode No. 50, the intra prediction mode No. 20, and the intra prediction mode No. 10, and the intra prediction mode No. 30 and the intra prediction mode No. 40 belong to the MPM, if the number of possible residual mode candidates derived as possible residual modes is 1, the intra prediction mode No. 50 can be derived as a possible residual mode.

[1085] Optionally, as described above, when the possible residual mode candidates are defined and the intra prediction mode No. 30 and the intra prediction mode No. 40 belong to the MPM, if the number of possible residual mode candidates derived as possible residual modes is 3, the intra prediction mode No. 50, the intra prediction mode No. 20, and the intra prediction mode No. 10 can be derived as the first possible residual mode, the second possible residual mode, and the third possible residual mode, respectively.

[1086] The processing unit can derive at least one intra prediction mode as a possible residual mode based on the number of intra prediction modes among the residual mode candidates.

[1087] In an example, among the 61 residual mode candidates obtained by excluding six MPM candidate modes from a total of 67 intra prediction modes, the first possible residual mode, the second possible residual mode, and the third possible residual mode can be separately derived in ascending order from the mode with the smallest intra prediction mode number. In the example, when the number of intra prediction modes is 67 and the number of MPMs is 6 (i.e., 20, 30, 0, 1, 31, 32), the first possible residual mode can be defined as the three residual modes with the smallest intra prediction mode numbers among the residual modes (2, 3, 4,..., 19, 21, 22,..., 29, 33, 34,..., 66), that is, the residual modes (2, 3, 4).

[1088] In an example, among the 61 residual mode candidates obtained by excluding six MPM candidate modes from a total of 67 intra prediction modes, the first possible residual mode, the second possible residual mode, and the third possible residual mode can be separately derived in descending order from the mode with the largest intra prediction mode number.

[1089] Determine the intra-frame prediction mode using the remaining mode indicator

[1090] Figure 33 Shows the binarization of the residual mode indicator according to the example.

[1091] In Figure 33 it, the symbol and the truncated binary code of the residual mode indicator are depicted, and the residual mode indicated by the symbol and the truncated binary code is depicted.

[1092] The processing unit may use the residual mode indicator to determine the intra prediction mode of the target block.

[1093] The intra prediction modes indicated by the residual mode indicator may include both the probable residual mode and the pure residual mode. In other words, the residual mode indicator may indicate one of the probable residual mode and the pure residual mode as the intra prediction mode of the target block.

[1094] The residual mode indicator may be a binarized value using the truncated binary coding method.

[1095] As Figure 33 shown, the number of binary bits in the probable residual mode and the number of binary bits in the pure residual mode may be different from each other.

[1096] For example, the number of probable residual modes may be 2.

[1097] For example, assuming that the total number of intra prediction modes is 67 and the number of MPMs is 6, the number of probable residual modes may be 2, and the number of pure residual modes may be 59. In other words, the intra prediction modes among all the intra prediction modes that do not belong to the MPM may be classified into two probable residual modes and 59 pure residual modes.

[1098] The probable residual mode may have five binary bits, and the pure residual mode may have six binary bits.

[1099] In an embodiment, the binary bits for the two probable residual modes may be defined as "00000" and "00001". "00000" may indicate the first probable residual mode. "00001" may indicate the second probable residual mode.

[1100] The binary bits for the 59 pure residual modes may be defined as six binary bits other than "000000", "000001", "000010", and "000011". For example, the binary bits for the pure residual mode may include "000100", "000101", etc.

[1101] As described above, the processing unit may use the binarized value to encode and / or decode the residual mode indicator.

[1102] In another embodiment, the binary bits for the two probable residual modes may be defined as "11110" and "11111". "11110" may indicate the first probable residual mode. "11111" may indicate the second probable residual mode.

[1103] The binary bits for 59 pure residual modes can be defined as six binary bits except for "111100", "111101", "111110", and "111111". For example, the binary bits for pure residual modes can include "111000", "111001", etc.

[1104] As described above, the processing unit can use the binarized value to encode and / or decode the residual mode indicator.

[1105] When the total number of intra prediction modes is 67 and the number of MPMs is 6, the number of possible residual modes can be 3 and the number of pure residual modes can be 58. In other words, the intra prediction modes that do not belong to the MPM among all intra prediction modes can be classified into three possible residual modes and 58 pure residual modes.

[1106] The possible residual modes can have five binary bits, and the pure residual modes can have six binary bits.

[1107] In an embodiment, the binary bits for three possible residual modes can be defined as "00000", "00001", and "00010". "00000" can indicate the first possible residual mode. "00001" can indicate the second possible residual mode. "00010" can indicate the third possible residual mode.

[1108] The binary bits for 58 pure residual modes can be defined as the sum of the binarized value and an offset of 3. For example, the binary bits for pure residual modes can include "000110" (= "000011" + "000011"), "000111" (= "000100" + "000011"), "001000", "001001", etc.

[1109] As described above, the processing unit can use the binarized value to encode and / or decode the residual mode indicator.

[1110] Figure 34 It is a flowchart of a target block prediction method and a bitstream generation method according to an embodiment.

[1111] The target block prediction method and the bitstream generation method according to the present embodiment can be executed by the encoding device 1600. This embodiment can be part of a target block encoding method or a video encoding method.

[1112] In step 3410, the processing unit 1610 can determine the intra prediction mode to be applied to the encoding of the target block.

[1113] Step 3410 can correspond to step 1810 described above with reference to Figure 18 description. In addition, step 3410 can correspond to that described above with reference toFigure 30 The described steps 3010, 3020, 3030, 3040, and 3050 correspond. In addition, step 3410 may correspond to the steps 3110, 3120, 3130, 3140, and 3150 described above with reference to Figure 31 The described steps 3110, 3120, 3130, 3140, and 3150 correspond.

[1114] The determined intra prediction mode may be 1) a bi - directional intra prediction mode and / or 2) an intra prediction mode using a residual mode.

[1115] Intra prediction may be 1) bi - directional intra prediction and / or 2) intra prediction using a residual mode.

[1116] Among the intra prediction modes available for the target block, the processing unit 1610 may determine the intra prediction mode for the target block by considering the rate - distortion cost of the intra prediction mode.

[1117] In step 3420, the processing unit 1610 may perform intra prediction for the target block using the determined intra prediction mode.

[1118] Step 3420 may correspond to step 1820 described above with reference to Figure 18 The described step 1820.

[1119] Information about the encoded target block may be generated by performing intra prediction for the target block using an intra prediction mode.

[1120] A prediction block may be generated via intra prediction of the target block using an intra prediction mode, and a residual block may be generated as the 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.

[1121] Information about the encoded target block may include the transform and quantization coefficients of the target block. Information about the encoded target block may include the coding parameters of the target block.

[1122] In step 3430, the processing unit 1610 may generate a bitstream.

[1123] The bitstream may include information about the encoded target block.

[1124] The bitstream may include prediction information. The prediction information may be information for bi - directional intra prediction and / or intra prediction using a residual mode. In other words, the prediction information may include the coding parameters related to the target block required for intra prediction as described in the embodiments.

[1125] For example, the prediction information may include 1) a unidirectional / bidirectional classification indicator, 2) an intra prediction mode indicator, 3) weights for reference pixels, 4) an MPM usage indicator, 5) an MPM indicator, 6) a predefined angle α, etc. for bi-directional intra prediction.

[1126] For example, the prediction information may include 1) an MPM usage indicator, 2) an MPM indicator, 3) a residual mode indicator, 4) a residual mode usage indicator, etc. for intra prediction using the residual mode.

[1127] The prediction information may be generated in step 3430, or may be generated at least partially in steps 3410 and 3420.

[1128] The processing unit 1610 may store the generated bitstream in the memory 1640. Optionally, the communication unit 1620 may send the bitstream to the decoding device 1700.

[1129] The processing unit 1610 may perform entropy coding on the prediction information and may generate a bitstream including the entropy-coded prediction information.

[1130] The embodiments may be combined with the operations of the encoding device 100 described above with reference to Figure 1 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 coding unit 150. In addition, before, after, and simultaneously with the execution of steps 3410, 3420, and 3430, operations performed by other components of the encoding device 100 may be executed.

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

[1132] The target block prediction method using a bitstream according to the present embodiment may be executed by the decoding device 1700. The embodiment may be part of a target block decoding method or a video decoding method.

[1133] In step 3510, the communication unit 1720 may obtain a bitstream. The communication unit 1720 may receive the bitstream from the encoding device 1600.

[1134] The bitstream may include information about the encoded target block.

[1135] The information about the encoded target block may include the transform and quantization coefficients of the target block. The information about the encoded target block may include the coding parameters of the target block.

[1136] The bitstream may include prediction information. The prediction information may be information for bidirectional intra prediction and / or intra prediction using the 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.

[1137] For example, the prediction information may include 1) unidirectional / bidirectional classification indicator, 2) intra prediction mode indicator, 3) weights for reference pixels, 4) MPM usage indicator, 5) MPM indicator, 6) predefined angle α, etc. for bidirectional intra prediction.

[1138] For example, the prediction information may include 1) MPM usage indicator, 2) MPM indicator, 3) residual mode indicator, 4) residual mode usage indicator, etc. for intra prediction using the residual mode.

[1139] The processing unit 1710 may store the obtained bitstream in the memory 1740.

[1140] 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-coded prediction information of the bitstream.

[1141] In step 3520, the processing unit 1710 may determine the intra prediction mode to be applied to the decoding of the target block.

[1142] Step 3520 may correspond to step 1810 described above with reference to Figure 18 In addition, step 3520 may correspond to step 3010, step 3020, step 3030, step 3040, and step 3050 described above with reference to Figure 30 In addition, step 3520 may correspond to step 3110, step 3120, step 3130, step 3140, and step 3150 described above with reference to Figure 31 The determined intra prediction mode may be 1) bidirectional intra prediction mode and / or 2) intra prediction mode using the residual mode.

[1143] The intra prediction may be 1) bidirectional intra prediction and / or 2) intra prediction using the residual mode.

[1144] The intra prediction may be 1) bidirectional intra prediction and / or 2) intra prediction using the residual mode.

[1145] The processing unit 1710 may determine the intra prediction mode of the target block based on the prediction information.

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

[1147] Step 3530 may correspond to that described above with reference toFigure 18 corresponds to the described step 1820. In addition, in step 3530, a prediction block may be generated by performing intra prediction on a target block using an intra prediction mode, and a reconstructed block may be generated as the sum of the prediction block and the reconstructed residual block.

[1148] The described embodiments may be combined with the operation of the decoding device 200 described above with reference to Figure 2 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 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 executed.

[1149] In the embodiments described above, although the method has been described based on a flowchart of a series of steps or units, the present disclosure is not limited to the order of the described steps, and some steps may be executed in an order different from the order of the described steps or simultaneously with other steps. In addition, those skilled in the art will understand that the steps shown in the flowchart are not exclusive, and may further include other steps, or one or more steps in the flowchart may be deleted without departing from the scope of the present disclosure.

[1150] The embodiments according to the present disclosure described above may be implemented as a program executable 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 alone 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 of ordinary skill in the computer software field.

[1151] 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 bitstream, and the bitstream may contain the information described above in the embodiments of the present invention.

[1152] The computer-readable storage medium may include a non-transitory computer-readable medium.

[1153] Examples of computer-readable storage media can include all types of hardware devices that are specifically configured to record and run program instructions, such as magnetic media (such as hard disks, floppy disks, and magnetic tapes), optical media (such as compact disc (CD)-ROMs and digital versatile discs (DVDs)), magneto-optical media (such as floppy optical discs, ROMs, RAMs, and flash memories). Examples of program instructions include machine code (such as the code created by a compiler) and high-level language code that can be executed by a computer using an interpreter. The hardware devices can be configured to operate as one or more software modules to perform the operations of the present disclosure, and vice versa.

[1154] 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 an 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.

[1155] Therefore, it should be understood that the spirit of the present embodiment is not limited to the above embodiments, and the appended claims and their equivalents and modifications thereto fall within the scope of the present disclosure.

Claims

1. A decoding method, comprising: receiving a bitstream including intra prediction mode information; using the intra prediction mode information to determine an intra prediction mode for a target block; and performing intra prediction for the target block using a plurality of reference pixels determined by the intra prediction mode, wherein the plurality of reference pixels includes 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, the Y coordinate of the first reference pixel and the Y coordinate of the second reference pixel are different from each other, generating a prediction block through the intra prediction, the intra prediction mode indicates the direction of the intra prediction, and the reference pixels in the plurality of reference pixels are used to determine values of a plurality of prediction pixels in the prediction block determined according to the direction.

2. The decoding method according to claim 1, wherein the first reference pixel and the second reference pixel are determined by the direction of the intra prediction mode.

3. The decoding method according to claim 2, wherein performing the intra prediction using a first weight value for a first reference value determined by the first reference pixel and a second weight value for a second reference value determined by the second reference pixel.

4. The decoding method according to claim 3, wherein the first weight value is determined based on the distance between a target pixel of the target block and the first reference pixel, and the second weight value is determined based on the distance between the target pixel and the second reference pixel.

5. The decoding method according to claim 4, wherein the first weight value and the second weight value are determined based on the direction.

6. The decoding method according to claim 2, wherein the direction is a diagonal direction.

7. The decoding method according to claim 2, wherein performing the intra prediction through a plurality of different prediction methods.

8. The decoding method according to claim 1, wherein determining whether at least one first prediction mode is used as the intra prediction mode for the target block, in a case where it is determined that the at least one first prediction mode is not used for the target block, using a list including one or more second prediction modes for the intra prediction for the target block, and the at least one first prediction mode is not included in the list.

9. The decoding method according to claim 8, wherein deriving the one or more second prediction modes in the list based on prediction modes of neighboring blocks of the target block.

10. The decoding method according to claim 9, wherein determining whether to perform the intra prediction using a list including one or more most probable modes (MPMs), in a case where the intra prediction is not performed using the list, performing the intra prediction using a selected remaining mode indicated by a remaining mode indicator among a plurality of remaining modes, the plurality of remaining modes does not include the one or more MPMs, and binarizing a value of the remaining mode indicator using a truncated binary coding method.

11. An encoding method, comprising: determining an intra prediction mode for a target block; and Perform intra prediction for a target block using a plurality of reference pixels determined by the intra prediction mode, wherein the plurality of reference pixels includes 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 is different from the X coordinate of the second reference pixel, the Y coordinate of the first reference pixel is different from the Y coordinate of the second reference pixel, generate a prediction block through the intra prediction, the intra prediction mode indicates the direction of the intra prediction, and the reference pixels among the plurality of reference pixels are used to determine values of a plurality of prediction pixels in the prediction block determined according to the direction.

12. The encoding method according to claim 11, wherein, the first reference pixel and the second reference pixel are determined by the direction of the intra prediction mode.

13. The encoding method according to claim 12, wherein, perform the intra prediction using a first weight value for a first reference value determined by the first reference pixel and a second weight value for a second reference value determined by the second reference pixel, the first weight value is determined based on the distance between a target pixel of the target block and the first reference pixel, and the second weight value is determined based on the distance between the target pixel and the second reference pixel.

14. The encoding method according to claim 11, wherein, perform the intra prediction through a plurality of different prediction methods.

15. The encoding method according to claim 11, wherein, determine whether the intra prediction mode for the target block is at least one first prediction mode, in a case where the intra prediction mode is not the at least one first prediction mode, the intra prediction mode for the target block is a prediction mode in a list including one or more second prediction modes, and the at least one first prediction mode is not included in the list.

16. A method for storing a bitstream to generate a computer-readable recording medium storing the bitstream, the method comprises: determine an intra prediction mode for a target block; perform intra prediction for the target block using a plurality of reference pixels determined by the intra prediction mode; and store a bitstream including intra prediction mode information indicating the intra prediction mode for the target block in a computer-readable recording medium, wherein the plurality of reference pixels includes 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 is different from the X coordinate of the second reference pixel, the Y coordinate of the first reference pixel is different from the Y coordinate of the second reference pixel, generate a prediction block through the intra prediction, the intra prediction mode indicates the direction of the intra prediction, and the reference pixels among the plurality of reference pixels are used to determine values of a plurality of prediction pixels in the prediction block determined according to the direction.

17. A method for transmitting a bitstream, the method comprises: transmit a bitstream to a video decoding device, wherein the bitstream includes intra prediction mode information, Among them, the intra prediction mode information is information used to determine the intra prediction mode for a target block. Among them, the intra prediction mode is information used to determine a plurality of reference pixels for intra prediction for a target block. Among them, the plurality of reference pixels include a first reference pixel and a second reference pixel. Among them, the first reference pixel and the second reference pixel are not adjacent to the target block. Among them, the X coordinate of the first reference pixel is different from the X coordinate of the second reference pixel. Among them, the Y coordinate of the first reference pixel is different from the Y coordinate of the second reference pixel. Among them, a prediction block is generated through the intra prediction. Among them, the intra prediction mode indicates the direction of the intra prediction, and Among them, the reference pixels among the plurality of reference pixels are used to determine the values of a plurality of prediction pixels in the prediction block determined according to the direction.

Citation Information

Patent Citations

  • Prediction image generation method, image coding method, image decoding method, and prediction image generation apparatus

    US20150271514A1

  • Method and device for encoding and decoding intra-frame prediction

    WO2016195460A1