Method, apparatus, and recording medium for image encoding / decoding

By using the cross-component prediction method to optimize the chrominance signal processing using the luminance signal, the problem of low efficiency in high-resolution image coding is solved, and more efficient image encoding and decoding is achieved.

CN120814232APending Publication Date: 2025-10-17ELECTRONICS & TELECOMM RES INST
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202480016584.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-07-03
Filing Date
2024-01-04
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

The existing technology lacks an effective chrominance signal prediction method when processing high-resolution and high-definition images, resulting in low coding efficiency.

Method used

A cross-component prediction method is adopted, and the information of the luminance signal is used to determine the reference area and representative value, generate the chrominance prediction block, and optimize the processing process of the chrominance signal through techniques such as template matching and deep neural network downsampling.

Benefits of technology

It improves the efficiency of image encoding and decoding, enhances the processing effect of chrominance signals, and enhances image quality and encoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120814232A_ABST
    Figure CN120814232A_ABST
Patent Text Reader

Abstract

Disclosed are a method, an apparatus, and a recording medium for image encoding / decoding. The method for image encoding / decoding includes the steps of determining a prediction scheme for a chroma block, determining information for deriving a cross-component prediction model, and generating a chroma prediction block by using the cross-component prediction model. The chroma prediction block is derived by various prediction schemes such as a cross-component linear model (CCLM), a gradient linear model (GLM), a filter-based linear model (FLM), and a convolutional cross-component model (CCCM).
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates generally to a method, apparatus, and storage medium for image encoding / decoding. More particularly, the present disclosure relates to a method, apparatus, and storage medium for predicting a chroma signal.

[0002] This application claims the benefit of Korean Patent Application No. 10-2023-0001455, filed on January 4, 2023, Korean Patent Application No. 10-2023-0086030, filed on July 3, 2023, and Korean Patent Application No. 10-2024-0001582, filed on January 4, 2024, the entire contents of which are incorporated herein by reference. BACKGROUND

[0003] With the continued development of the information and communication industry, broadcast services supporting high definition (HD) resolution have been popularized throughout the world. Through this popularization, a large number of users have become accustomed to high resolution and high definition images and / or videos.

[0004] To meet the demand for high definition from users, a large number of institutions have accelerated the development of next-generation imaging devices. In addition to high definition TV (HDTV) and full high definition (FHD) TV, users' interest in UHD TV, in which the resolution is more than four times that of full high definition (FHD) TV, has also increased. As interest has increased, image encoding / decoding techniques for images with higher resolution and higher definition are now needed.

[0005] As an image compression technique, there are various techniques such as an inter prediction technique, an intra prediction technique, a transform, a quantization technique, and an entropy encoding technique.

[0006] The inter prediction technique is a technique for predicting the value of a pixel included in a current picture using a picture before the current picture and / or a picture after the current picture. The intra prediction technique is a technique for predicting the value of a pixel included in a current picture using information about a pixel in the current picture. The transform and quantization technique can be a technique for compressing the energy of a residual signal. The entropy encoding technique is a technique for allocating a short code word to a frequently occurring value and a long code word to a less frequently occurring value.

[0007] By utilizing these image compression techniques, data about an image can be efficiently compressed, transmitted, and stored. SUMMARY

[0008] TECHNICAL PROBLEM

[0009] Embodiments aim to provide an apparatus, method, and storage medium that perform processing on a chroma signal by utilizing information of a luma signal.

[0010] Embodiments aim to provide an apparatus, a method and a storage medium for performing prediction on chroma signals based on a cross-component approach.

[0011] Technical solutions

[0012] According to an aspect, there is provided an image decoding method comprising determining a prediction method for a chroma block; determining information for deriving a cross-component prediction model; and generating a chroma prediction block using the cross-component prediction model.

[0013] The information for deriving the cross-component prediction model can comprise a reference region and a representative value.

[0014] The reference region and the representative value can be determined based on a size of the block.

[0015] The reference region and the representative value can be determined based on a prediction mode of the block.

[0016] The reference region can be determined based on template matching.

[0017] The prediction method can be determined using a model derived from a previously decoded block.

[0018] The chroma prediction block can be generated using a prediction block generated by a method other than the cross-component prediction model.

[0019] According to another aspect, there is provided an image encoding method comprising determining a prediction method for a chroma block; determining information for deriving a cross-component prediction model; and generating a chroma prediction block using the cross-component prediction model.

[0020] The information for deriving the cross-component prediction model can comprise a reference region and a representative value.

[0021] The reference region and the representative value can be determined based on a size of the block.

[0022] The reference region and the representative value can be determined based on a prediction mode of the block.

[0023] The reference region can be determined based on template matching.

[0024] The prediction method can be determined using a model derived from a previously encoded block.

[0025] The chroma prediction block can be generated using a prediction block generated by a method other than the cross-component prediction model.

[0026] According to another aspect, there is provided a computer readable storage medium for storing a bitstream for image decoding, wherein the bitstream comprises encoding information based on which a prediction method for a chroma block is determined, information for deriving a cross-component prediction model is determined, and a chroma prediction block is generated using the cross-component prediction model.

[0027] The information for deriving a cross-component prediction model can comprise a reference region and a representative value.

[0028] The reference region and the representative value can be determined based on a size of the block.

[0029] The reference region and the representative value can be determined based on a prediction mode of the block.

[0030] The reference region can be determined based on template matching.

[0031] The prediction method can be determined using a model derived from a previously decoded block.

[0032] Advantageous effects

[0033] There is provided an apparatus, method and storage medium that performs processing on a chroma signal by utilizing information of a luminance signal.

[0034] There is provided an apparatus, method and storage medium that performs prediction on a chroma signal based on a cross-component method. BRIEF DESCRIPTION OF DRAWINGS

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

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

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

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

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

[0040] Figure 6 shows a division of a block according to an example;

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

[0042] Figure 8 is a diagram showing reference samples used in an intra prediction process;

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

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

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

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

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

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

[0049] Figure 15 shows a vertical scan according to an example;

[0050] Figure 16 is a configuration diagram of an encoding apparatus according to an embodiment;

[0051] Figure 17 is a configuration diagram of a decoding apparatus according to an embodiment;

[0052] Figure 18 is a flowchart showing a target block prediction method and a bitstream generation method according to an embodiment;

[0053] Figure 19 is a flowchart showing a target block prediction method using a bitstream according to an embodiment;

[0054] Figure 20 shows scaling according to an example;

[0055] Figure 21 shows an index of a neighboring block according to an example;

[0056] Figure 22 shows details of an encoding parameter according to an example;

[0057] Figure 23 shows a value of an index according to an example;

[0058] Figure 24 shows an index of a neighboring block and a parameter value of an encoding parameter according to an example;

[0059] Figure 25 shows a configuration of a template in inter prediction according to an example;

[0060] Figure 26 Configuration of a template in intra prediction according to an example is shown;

[0061] Figure 27 Configuration of a template in bilateral matching according to an example is shown;

[0062] Figure 28 First configuration of a template in template matching according to an example is shown;

[0063] Figure 29 Second configuration of a template in template matching according to an example is shown;

[0064] Figure 30 First configuration of a template with alternating empty lines in template matching according to an example is shown;

[0065] Figure 31 Second configuration of a template with alternating empty lines in template matching according to an example is shown;

[0066] Figure 32 Second configuration of a template with alternating empty pixels in template matching according to an example is shown;

[0067] Figure 33 Second configuration of a template with alternating empty pixels in template matching according to an example is shown;

[0068] Figure 34 Configuration of a template in bilateral matching according to an example is shown;

[0069] Figure 35 Configuration of a template with alternating empty lines in bilateral matching according to an example is shown;

[0070] Figure 36 Configuration of a template with alternating empty pixels in bilateral matching according to an example is shown;

[0071] Figure 37 Configuration of a template when performing intra prediction in an inter image according to an example is shown;

[0072] Figure 38 Configuration of a template when performing inter prediction on an inter image according to an example is shown;

[0073] Figure 39 Flowchart of a prediction method according to an embodiment is shown;

[0074] Figure 40 Downsampling based on a deep neural network according to an example is shown;

[0075] Figure 41 Sample value range divided into N groups according to an example is shown;

[0076] Figure 42 A range of sample values divided into two groups is shown according to an example;

[0077] Figure 43 A model derived for a new group between sample value mean values of a plurality of groups is shown according to an example;

[0078] Figure 44 A model derived for a new group between sample value mean values of a plurality of groups is shown according to an example;

[0079] Figure 45 A luma block and a luma block corresponding to a chroma block are shown according to an example;

[0080] Figure 46 A chroma block is shown according to an example;

[0081] Figure 47 A chroma prediction block is shown according to an example;

[0082] Figure 48 A luma block and a luma block corresponding to a chroma block are shown according to an example;

[0083] Figure 49 A chroma block is shown according to an example;

[0084] Figure 50 Four chroma prediction blocks are shown according to an example;

[0085] Figure 51 A region in a luma block and a region in a luma block directly corresponding to a chroma block are shown according to an example;

[0086] Figure 52 A region in a chroma block is shown according to an example;

[0087] Figure 53 A region in a luma block directly corresponding to a chroma block is shown according to an example;

[0088] Figure 54 A region in a chroma block is shown according to an example;

[0089] Figure 55 A chroma prediction block and a chroma template are shown according to an example;

[0090] Figure 56 A flowchart of a chroma prediction method according to an example;

[0091] Figure 57 A chroma prediction mode table is reconstructed based on a model according to an example;

[0092] Figure 58 A prediction mode table is reconstructed using a lowest error cost according to an example;

[0093] Figure 59 Reconstruction of a prediction mode table using error cost below or equal to average according to an example is shown;

[0094] Figure 60 Gradient detection filter or gradient detection pattern according to an example is shown;

[0095] Figure 61 Gradient block derived using luma block and four gradient detection filters according to an example is shown;

[0096] Figure 62 Region in luma block and region in gradient block derived using four gradient detection filters according to an example is shown;

[0097] Figure 63 Region in gradient block derived using four gradient detection filters according to an example is shown;

[0098] Figure 64 Region in chroma block according to an example is shown;

[0099] Figure 65 Chroma prediction template and chroma template derived using four gradient based linear models according to an example is shown;

[0100] Figure 66 Flowchart of a chroma prediction method according to an example is shown;

[0101] Figure 67 Reconstruction of a chroma prediction mode table based on models according to an example is shown;

[0102] Figure 68 Reconstruction of a prediction mode table using lowest error cost according to an example is shown;

[0103] Figure 69 Reconstruction of a prediction mode table using error cost below or equal to average according to an example is shown;

[0104] Figure 70 Form of luma samples corresponding to chroma samples and application of filters according to an example is shown;

[0105] Figure 71 Chroma samples according to an example is shown;

[0106] Figure 72 Filter shape and position of filter coefficients according to an example is shown;

[0107] Figure 73 Shape of filter according to an example is shown;

[0108] Figure 74a to Figure 74r Shape of various filters according to an example is shown;

[0109] Figure 75 Filter set 1 is shown according to an example;

[0110] Figure 76 Filter set 2 is shown according to an example;

[0111] Figure 77 Filter set 1 is shown according to an example;

[0112] Figure 78 Filter set 2 is shown according to an example;

[0113] Figure 79 Filter set 3 is shown according to an example;

[0114] Figure 80 Filter set 4 is shown according to an example;

[0115] Figure 81 Filter according to a direction of an intra prediction mode is shown according to an example;

[0116] Figure 82 Luma samples corresponding to chroma samples and a form of applying a filter is shown according to an example;

[0117] Figure 83 Chroma samples are shown according to an example;

[0118] Figure 84 Filter shape and location of filter coefficients are shown according to an example;

[0119] Figure 85 Location of downsampled luma samples and location of chroma samples corresponding to luma samples are shown according to an example;

[0120] Figure 86 Downsampled filter F1() is shown according to an example;

[0121] Figure 87 Downsampled filter F2() is shown according to an example;

[0122] Figure 88 Downsampled filter F3() is shown according to an example;

[0123] Figure 89 Downsampled filter F4() is shown according to an example;

[0124] Figure 90 Downsampled filter F5() is shown according to an example;

[0125] Figure 91 Model and multiple pieces of information for the model are shown according to an example;

[0126] Figure 92 shows down-sampled luma samples and surrounding samples corresponding to a position of a chroma sample according to an example;

[0127] Figure 93 is a first graph showing values for setting a representative value according to an example;

[0128] Figure 94 is a second graph showing values for setting a representative value according to an example;

[0129] Figure 95 is a third graph showing values for setting a representative value according to an example;

[0130] Figure 96 is a fourth graph showing values for setting a representative value according to an example;

[0131] Figure 97 is a fifth graph showing values for setting a representative value according to an example;

[0132] Figure 98 shows determining a number of reference lines and a number of reference samples according to a partition shape of a block according to an example;

[0133] Figure 99 shows a current block and a neighboring block of the current block according to an example;

[0134] Figure 100 shows a current block and a reference region for the current block according to an example;

[0135] Figure 101 shows determining a number of reference lines and a number of reference samples according to an intra prediction mode according to an example;

[0136] Figure 102 shows changing a reference region to include a region detected by a matching method according to an example;

[0137] Figure 103 shows adjusting a reference region using a position indicated by a region detected by a matching method as a reference according to an example;

[0138] Figure 104 shows a configuration of a reference region according to an example;

[0139] Figure 105 shows a reference block for configuring a reference region according to an example;

[0140] Figure 106 shows a combination of reference regions according to an example;

[0141] Figure 107 shows a position of a non-adjacent block for determining a reference region according to an example;

[0142] Figure 108 showing a size and shape of a block at a location of a non-adjacent block according to an example;

[0143] Figure 109 showing a location of a non-adjacent block according to an example;

[0144] Figure 110 showing a selection range of a reference block according to an example;

[0145] Figure 111 showing a filtering of a prediction sample according to an example;

[0146] Figure 112 showing a generation of a prediction block using a hybrid according to an example;

[0147] Figure 113 showing a filtering for a prediction block according to an example;

[0148] Figure 114 showing a generation of a prediction block using a weighted sum of prediction blocks generated by utilizing multiple models according to an example;

[0149] Figure 115 showing a filtering for a prediction sample and a chroma block according to an example.

[0150] Figure 116 showing a generation of a prediction block using a weighted sum of prediction blocks generated by utilizing multiple models according to an example;

[0151] Figure 117 showing a generation of a prediction signal using signals generated by different cross-component prediction models for a sample according to an example;

[0152] Figure 118 showing a U prediction signal using a color component prediction model correction between a luma signal and a chroma signal according to an example;

[0153] Figure 119 showing a Y prediction signal using a color component prediction model correction between a luma signal and a chroma signal according to an example;

[0154] Figure 120 showing a U prediction signal using a color component prediction model correction between chroma signals according to an example;

[0155] Figure 121 showing a V prediction signal using a color component prediction model correction between chroma signals according to an example;

[0156] Figure 122 showing a gradient pattern according to an example;

[0157] Figure 123 chroma samples for deriving a linear model according to an example;

[0158] Figure 124 luma samples for deriving a linear model according to an example;

[0159] Figure 125 non-downsampled luma samples according to an example;

[0160] Figure 126 filters for samples in CCLM according to an example;

[0161] Figure 127 templates for a block according to an example;

[0162] Figure 128 various downsample filters used in cross component models according to an example;

[0163] Figure 129 positions of chroma samples according to an example;

[0164] Figure 130 spatial part of a convolution filter according to an example;

[0165] Figure 131 reference region for BVG-CCCM according to an example;

[0166] Figure 132 positions for deriving a block vector from a collocated luma block according to an example;

[0167] Figure 133 positions of temporal candidates according to an example;

[0168] Figure 134 positions of shifted temporal candidates according to an example;

[0169] Figure 135 positions for selecting neighboring motion vectors;

[0170] Figure 136 deriving shifted temporal candidates based on current motion vectors according to an example;

[0171] Figure 137 decoding method according to an example; and

[0172] Figure 138 luma samples related to chroma samples according to an example. DETAILED DESCRIPTION

[0173] The present application can be variously changed and various embodiments can have various embodiments, and specific embodiments will be described in detail below with reference to the accompanying drawings. However, it should be understood that these embodiments are not intended to limit the present application to a specific disclosed form, and they include all changes, equivalents or modifications included in the spirit and scope of the present application.

[0174] The following exemplary embodiments will be described with reference to the accompanying drawings, which show specific embodiments. The embodiments are described in such a manner that those of ordinary skill in the art to which the present disclosure pertains can easily implement the embodiments. It should be noted that various embodiments differ from each other, but need not be mutually exclusive. For example, the specific shapes, structures, and characteristics described herein can be implemented as other embodiments without departing from the spirit and scope of the embodiments related to one embodiment. In addition, it should be understood that the position or arrangement of each component in each disclosed embodiment can be changed without departing from the spirit and scope of the embodiments. Therefore, the accompanying detailed description is not intended to limit the scope of the present disclosure, and the scope of the exemplary embodiments is only limited by the appended claims and their equivalents as long as they are appropriately described.

[0175] In the drawings, like reference numerals are used to designate the same or similar functions throughout the various aspects. The shapes, sizes, etc. of components in the drawings can be exaggerated so that the description is clear.

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

[0177] It will be understood that when a component is referred to as being "connected" or "coupled" to another component, the two components can be directly connected or coupled to each other, or intervening components can be present between the two components. On the other hand, it will be understood that when a component is referred to as being "directly connected or coupled" to another component, no intervening components are present between the two components.

[0178] Components described in the embodiments are independently shown to indicate different characteristic functions, but this does not mean that each component is formed of a single hardware or software. That is, a plurality of components are arranged and included individually for the convenience of description. For example, at least two components of the plurality of components can be integrated into a single component. Conversely, one component can be divided into a plurality of components. Embodiments in which a plurality of components are integrated or embodiments in which some components are separated are included in the scope of the present specification as long as the essence of the present specification is not deviated.

[0179] The terms used in the embodiments are merely used to describe specific embodiments, and are not intended to limit the present application. A singular expression includes a plural expression, unless specifically described otherwise in the context. In the embodiments, it is understood that the terms such as "include" or "have" are merely intended to indicate that there exists the features, numbers, steps, operations, components, parts, or combinations thereof, and are not intended to exclude the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof. That is, in the embodiments, the expression that a component "includes" a specific component means that another component can be included in the scope of the present application or the technical spirit of the present application, but does not exclude the presence of components other than the specific component.

[0180] In the embodiments, the term "at least one" can mean one of a number (such as 1, 2, 3, and 4) or more. In the embodiments, the term "a plurality of" can mean one of two or more (such as 2, 3, and 4).

[0181] Some components of the embodiments are not essential components for performing essential functions, but can be optional components for improving performance. The embodiments can be implemented using only essential components for implementing the nature of the embodiments. For example, a structure including only essential components (excluding optional components for improving performance) is also included in the scope of the embodiments.

[0182] The 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 implement the embodiments. In the following description of the embodiments, detailed descriptions of known functions or configurations which are deemed to make the gist of the present specification ambiguous will be omitted. Also, the same reference numerals are used throughout the drawings to designate the same components, and repeated descriptions of the same components will be omitted.

[0183] Hereinafter, "image" can mean a single picture constituting a video, or can mean a video itself. For example, "encoding and / or decoding of an image" can mean "encoding and / or decoding of a video", and can also mean "encoding and / or decoding of any one of a plurality of images constituting a video".

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

[0185] Hereinafter, a target picture can be an encoding target picture as a target to be encoded and / or a decoding target picture as a target to be decoded. Also, a target picture can be an input picture input to an encoding apparatus or an input picture input to a decoding apparatus. Also, a target picture can be a current picture, i.e., a target to be currently encoded and / or decoded. For example, the terms "target picture" and "current picture" can be used to have the same meaning and can be used interchangeably with each other.

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

[0187] Hereinafter, a target block can 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. Also, a target block can be a current block, i.e., a target to be currently encoded and / or decoded. Here, the terms "target block" and "current block" can be used to have the same meaning and can be used interchangeably with each other. A current block can represent an encoding target block as an encoding target during encoding and / or a decoding target block as a decoding target during decoding. Also, a current block can be at least one of an encoding block, a prediction block, a residual block, and a transform block.

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

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

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

[0191] When a variable such as i or j is used to indicate a row, a column, or an index, a value i can be an integer 0 or an integer greater than 0, or can be an integer 1 or an integer greater than 1. In other words, in embodiments, each of rows, columns, and indices can be counted from 0, or can be counted from 1.

[0192] In an embodiment, the term "one or more" or the term "at least one" can mean the term "a plurality of". The term "one or more" or the term "at least one" can be used interchangeably with "a plurality of".

[0193] Hereinafter, terms to be used in an embodiment will be described.

[0194] Encoder: An encoder means an apparatus for performing encoding. That is, the encoder can mean an encoding device.

[0195] Decoder: A decoder means an apparatus for performing decoding. That is, the decoder can mean a decoding device.

[0196] Unit: A unit can mean a unit of image encoding and decoding. The terms "unit" and "block" can be used with the same meaning and can be used interchangeably with each other.

[0197] - A unit can be an array of samples of MxN. Each of M and N can be a positive integer. The unit can generally mean an array of samples in a two-dimensional form.

[0198] - In the encoding and decoding process of an image, a "unit" can be an area generated by partitioning one image. In other words, a "unit" can be an area designated in one image. A single image can be partitioned into a plurality of units. Alternatively, one image can be partitioned into subparts, and a unit can mean each partitioned subpart when encoding or decoding is performed on the partitioned subparts.

[0199] - In the encoding and decoding process of an image, a predefined process can be performed on each unit according to the type of the unit.

[0200] - According to a function, a unit type can be classified as a macro unit, a coding unit (CU), a prediction unit (PU), a residual unit, a transform unit (TU), etc. Alternatively, according to a function, a unit can mean a block, a macroblock, a coding tree unit, a coding tree block, a coding unit, a coding block, a prediction unit, a prediction block, a residual unit, a residual block, a transform unit, a transform block, etc. For example, a target unit, which is a target of encoding and / or decoding, can be at least one of a CU, a PU, a residual unit, and a TU.

[0201] - The term "unit" can mean information including a block of a luma component, a block of a chroma component corresponding to the block of the luma component, and syntax elements for the respective blocks, such that the unit is designated to be distinguished from the block.

[0202] - The size and shape of a unit can be variously implemented. Also, a unit can have any one of various sizes and shapes. In particular, the shape of a unit can include not only a square but also geometric shapes that can be expressed in two dimensions (2D), such as a rectangle, a trapezoid, a triangle, and a pentagon.

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

[0204] - One unit can be partitioned into sub-units, each of which has a size smaller than that of the related unit.

[0205] Depth: The depth can represent the degree to which a unit is partitioned. Also, the depth of a unit can indicate the level at which the corresponding unit exists when a unit is represented by a tree structure.

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

[0207] - In a tree structure, the depth of a root node can be considered to be the smallest and the depth of a leaf node can be considered to be the largest. The root node can be the highest (top) node. The leaf node can be the lowest node.

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

[0209] In a tree structure, a top node can correspond to an initial node before being partitioned. The top node can be referred to as a "root node". Also, the root node can have a minimum depth value. Here, the depth of the top node can be a level "0".

[0210] - A node having a depth of a level "1" can represent a unit generated when an initial unit is partitioned once. A node having a depth of a level "2" can represent a unit generated when an initial unit is partitioned twice.

[0211] - A leaf node having a depth of a level "n" can represent a unit generated when an initial unit is partitioned n times.

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

[0213] - QT depth can denote a depth for a quad partition. BT depth can denote a depth for a binary partition. TT depth can denote a depth for a ternary partition.

[0214] - Sample: A sample can be a basic unit constituting a block. A sample can be expressed with a value from 0 to 2 Bd -1 according to a bit depth (Bd).

[0215] - A sample can be a pixel or a pixel value.

[0216] - Hereinafter, the terms “pixel” and “sample” can be used with the same meaning and can be used interchangeably with each other.

[0217] Coding Tree Unit (CTU): A CTU can be constituted by a single luma component (Y) coding tree block and two chroma components (i.e., Cb, Cr) coding tree blocks related to the luma component coding tree block. In addition, a CTU can denote information including the above-described blocks and syntax elements for each block.

[0218] - One or more partitioning methods, such as a quad tree (QT), a binary tree (BT), and a ternary tree (TT), can be used to partition each coding tree unit (CTU) in order to configure sub-units, such as coding units, prediction units, and transform units. A quad tree can denote a quad-ary tree. In addition, one or more partitioning methods can be used to partition each coding tree unit with a multi-type tree (MTT).

[0219] - “CTU” can be used as a term designating a pixel block serving as a processing unit in image decoding and encoding processes, such as in the case of partitioning an input image.

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

[0221] Neighbor block: A neighbor block (or a neighboring block) can denote a block adjacent to a target block. A neighbor block can denote a reconstructed neighbor block.

[0222] Hereinafter, the terms “neighbor block” and “adjacent block” can be used with the same meaning and can be used interchangeably with each other.

[0223] A neighbor block can denote a reconstructed neighbor block.

[0224] Spatial neighbor block: A spatial neighbor block can be a block spatially adjacent to a target block. A neighbor block can include a spatial neighbor block.

[0225] - A target block and a spatial neighbor block can be included in a target picture.

[0226] - A spatial neighboring block can mean a block that is in contact with a boundary of the target block or a block that is located within a predetermined distance from the target block.

[0227] - A spatial neighboring block can mean a block that is adjacent to a vertex of the target block. Here, a block that is adjacent to a vertex of the target block can mean 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.

[0228] A temporal neighboring block: A temporal neighboring block can be a block that is adjacent in time to the target block. A neighboring block can include a temporal neighboring block.

[0229] - A temporal neighboring block can include a col block.

[0230] - A col block can be a block in a previously reconstructed col picture. A position of the col block in the col picture can correspond to a position of the target block in the target picture. Alternatively, 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 a reference picture list.

[0231] - A temporal neighboring block can be a block that is adjacent in time to a spatial neighboring block of the target block.

[0232] A prediction mode: A prediction mode can be information indicating a mode used for intra prediction or a mode used for inter prediction.

[0233] A prediction unit: A prediction unit can be a basic unit for prediction such as inter prediction, intra prediction, inter compensation, intra compensation, and motion compensation.

[0234] - A single prediction unit can be divided into a plurality of partitions or sub-prediction units having smaller sizes. The plurality of partitions can also be a basic unit in performing prediction or compensation. The partitions generated by dividing the prediction unit can also be prediction units.

[0235] A prediction unit partition: A prediction unit partition can be a shape into which a prediction unit is divided.

[0236] A reconstructed neighboring unit: A reconstructed neighboring unit can be a unit that has been decoded and reconstructed, which is adjacent to a target unit.

[0237] - A reconstructed neighboring unit can be a unit that is adjacent to a target unit in space or adjacent to the target unit in time.

[0238] - A reconstructed spatial neighboring unit can be a unit included in a target picture, which has been reconstructed through encoding and / or decoding.

[0239] - The reconstructed temporal neighbor can be a unit included in the reference picture that has been reconstructed by encoding and / or decoding. The position of the reconstructed temporal neighbor in the reference picture 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. Further, the reconstructed temporal neighbor can be a block neighboring a corresponding block in the reference picture. Here, the position of the corresponding block in the reference picture can correspond to the position of the target block in the target picture. Here, the fact that the positions of the blocks correspond to each other can mean that the positions of the blocks are the same, can mean that one block is included in the other block, or can mean that one block occupies a specific position in the other block.

[0240] Sub-picture: A picture can be divided into one or more sub-pictures. A sub-picture can consist of one or more parallel block rows and one or more parallel block columns.

[0241] - A sub-picture can be a region in a picture having a square shape or a rectangular (i.e., non-square rectangular) shape. Further, a sub-picture can include one or more CTUs.

[0242] - A sub-picture can be a rectangular region of one or more slices in a picture.

[0243] - A sub-picture can include one or more parallel blocks, one or more bricks, and / or one or more slices.

[0244] Parallel block: A parallel block can be a region in a picture having a square shape or a rectangular (i.e., non-square rectangular) shape.

[0245] - A parallel block can include one or more CTUs.

[0246] - A parallel block can be partitioned into one or more bricks.

[0247] Brick: A brick can represent one or more CTU rows in a parallel block.

[0248] - A parallel block can be partitioned into one or more bricks. Each brick can include one or more CTU rows.

[0249] - A parallel block that is not partitioned into two parts can also represent a brick.

[0250] Slice: A slice can include one or more parallel blocks in a picture. Alternatively, a slice can include one or more bricks in a parallel block.

[0251] - A sub-picture can include one or more slices that collectively cover a rectangular region of a picture. Thus, each sub-picture boundary is also always a slice boundary, and each vertical sub-picture boundary is also always a vertical parallel block boundary.

[0252] Parameter set: A parameter set can correspond to header information in the internal structure of a bitstream.

[0253] - A parameter set can include at least one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), an adaptation parameter set (APS), a decoding parameter set (DPS), etc.

[0254] - Information signaled by each parameter set can be applied to pictures that refer to the corresponding parameter set. For example, information in a VPS can be applied to pictures that refer to the VPS. Information in an SPS can be applied to pictures that refer to the SPS. Information in a PPS can be applied to pictures that refer to the PPS.

[0255] - Each parameter set can refer to a higher parameter set. For example, a PPS can refer to an SPS. An SPS can refer to a VPS.

[0256] - In addition, a parameter set can include a parallel block group, slice header information, and parallel block header information. A parallel block group can be a group including a plurality of parallel blocks. In addition, the meaning of "parallel block group" can be the same as the meaning of "slice".

[0257] Rate-distortion optimization: An encoding device can use rate-distortion optimization in order to provide high coding efficiency by utilizing a combination of a size of a coding unit (CU), a prediction mode, a size of a prediction unit (PU), motion information, and a size of a transform unit (TU).

[0258] - A rate-distortion optimization scheme can calculate a rate-distortion cost of each combination to select an optimal combination from among the combinations. The rate-distortion cost can be calculated using the equation "D + λ * R". In general, a combination that minimizes the rate-distortion cost can be selected as the optimal combination under the rate-distortion optimization scheme.

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

[0260] - R can represent the rate, which can represent a bit rate using relevant context information.

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

[0262] - An encoding device can perform processes such as inter prediction and / or intra prediction, transform, quantization, entropy encoding, inverse quantization (dequantization), and / or inverse transform in order to calculate accurate D and R. These processes can greatly increase the complexity of the encoding device.

[0263] bitstream: A bitstream can denote a stream comprising bits of encoded picture information.

[0264] parse: A parse can be a decision of a value of a syntax element made by performing entropy decoding on a bitstream. Alternatively, the term "parse" can denote such entropy decoding itself.

[0265] symbol: A symbol can be at least one of a syntax element, an encoding parameter, and a transform coefficient of an encoding target unit and / or a decoding target unit. Further, a symbol can be a target of entropy encoding or a result of entropy decoding.

[0266] reference picture: A reference picture can be a picture referred to by a unit in order to perform inter prediction or motion compensation. Alternatively, a reference picture can be a picture comprising a reference unit referred to by a target unit in order to perform inter prediction or motion compensation.

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

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

[0269] - A type of a reference picture list can include a combined list (LC), a list 0 (L0), a list 1 (L1), a list 2 (L2), a list 3 (L3), etc.

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

[0271] inter prediction indicator: An inter prediction indicator can indicate an inter prediction direction for a target unit. Inter prediction can be one of a uni-prediction and a bi-prediction. Alternatively, an inter prediction indicator can denote a number of reference pictures used to generate a prediction unit of a target unit. Alternatively, an inter prediction indicator can denote a number of prediction blocks used for inter prediction or motion compensation of a target unit.

[0272] prediction list utilization flag: A prediction list utilization flag can indicate whether at least one reference picture in a certain reference picture list is used to generate a prediction unit.

[0273] - An inter prediction indicator can be derived using a prediction list utilization flag. Conversely, a prediction list utilization flag can be derived using an inter prediction indicator. For example, a case where a prediction list utilization flag indicates "0" (as a first value) can indicate that, for a target unit, no reference picture in a reference picture list is used to generate a prediction block. A case where a prediction list utilization flag indicates "1" (as a second value) can indicate that, for a target unit, a prediction unit is generated using a reference picture list.

[0274] Reference picture index: A reference picture index can refer to an index indicating a particular reference picture in a reference picture list.

[0275] Picture order count (POC): A POC value of a picture can represent an order in which the corresponding picture is displayed.

[0276] Motion vector (MV): A motion vector can be a 2D vector used for inter prediction or motion compensation. A motion vector can represent an offset between a target image and a reference image.

[0277] For example, an MV can be represented in the form of (mv x , mv y ). mv x may indicate a horizontal component, and mv y may indicate a vertical component.

[0278] Search range: A search range can be a 2D region in which a search for an MV is performed during inter prediction. For example, a size of the search range can be MxN. M and N can be positive integers, respectively.

[0279] Motion vector candidate: A motion vector candidate can be a block used as a prediction candidate when a motion vector is predicted or a motion vector of a block used as a prediction candidate.

[0280] A motion vector candidate can be included in a motion vector candidate list.

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

[0282] Motion vector candidate index: A motion vector candidate index can be an indicator used to indicate a motion vector candidate in a motion vector candidate list. Alternatively, a motion vector candidate index can be an index of a motion vector predictor.

[0283] Motion information: 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, and a motion vector, a reference picture index, and an inter prediction indicator.

[0284] Merge candidate list: A merge candidate list can be a list configured using one or more merge candidates.

[0285] Merge candidate: The merge candidate can be a spatial merge candidate, a temporal merge candidate, a combined merge candidate, a combined bi-predictive merge candidate, a history-based candidate, an average merge candidate based on an average of two candidates, a zero merge candidate, etc. The merge candidate can include an inter prediction indicator, and can include motion information such as prediction type information, a reference picture index for each list, a motion vector, a prediction list utilization flag, and an inter prediction indicator.

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

[0287] The merge index can indicate a reconstructed unit for deriving a merge candidate among reconstructed units spatially adjacent to a target unit and reconstructed units temporally adjacent to the target unit.

[0288] The merge index can indicate at least one of pieces of motion information of the merge candidate.

[0289] Transform unit: The transform unit can be a basic unit of residual signal encoding and / or residual signal decoding such as transform, inverse transform, quantization, inverse quantization, transform coefficient encoding, and transform coefficient decoding. A single transform unit can be partitioned into a plurality of sub-transform units having smaller sizes. Here, the transform can include one or more of a primary transform and a secondary transform, and the inverse transform can include one or more of a primary inverse transform and a secondary inverse transform.

[0290] Scaling: The scaling can mean a process of multiplying a factor to a transform coefficient level.

[0291] The transform coefficient can be generated as a result of scaling the transform coefficient level. The scaling can also be referred to as "dequantization".

[0292] Quantization parameter (QP): The quantization parameter can be a value used to generate a transform coefficient level for a transform coefficient in quantization. Alternatively, the quantization parameter can also be a value used to generate a transform coefficient by scaling a transform coefficient level in dequantization. Alternatively, the quantization parameter can be a value mapped to a quantization step size.

[0293] Variable delta quantization parameter: The variable delta quantization parameter can mean a difference between a quantization parameter of a target unit and a predicted quantization parameter.

[0294] Scan: The scan can mean a method of arranging an order of coefficients in a unit, a block, or a matrix. For example, a method for arranging a 2D array in the form of a one-dimensional (1D) array can be referred to as "scan". Alternatively, a method for arranging a 1D array in the form of a 2D array can also be referred to as "scan" or "inverse scan".

[0295] Transform coefficient: The transform coefficient can be a coefficient value generated when a transform is performed by an encoding apparatus. Alternatively, the transform coefficient can be a coefficient value generated when at least one of entropy decoding and inverse quantization is performed by a decoding apparatus.

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

[0297] Quantized level: The quantized level can be a value generated when a quantization is performed by an encoding apparatus on a transform coefficient or a residual signal. Alternatively, the quantized level can be a value targeted for inverse quantization when inverse quantization is performed by a decoding apparatus.

[0298] A quantized transform coefficient level as a result of a transform and quantization can also be included in the meaning of the quantized level.

[0299] Non-zero transform coefficient: The non-zero transform coefficient can be a transform coefficient having a value other than 0, or can be a transform coefficient level having a value other than 0. Alternatively, the non-zero transform coefficient can be a transform coefficient whose magnitude of a value is not 0, or can be a transform coefficient level whose magnitude of a value is not 0.

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

[0301] Quantization matrix coefficient: The quantization matrix coefficient can be each element in a quantization matrix. The quantization matrix coefficient can also be referred to as a "matrix coefficient."

[0302] Default matrix: The default matrix can be a quantization matrix that is predefined by an encoding apparatus and a decoding apparatus.

[0303] Non-default matrix: The non-default matrix can be a quantization matrix that is not predefined by an encoding apparatus and a decoding apparatus. The non-default matrix can represent a quantization matrix signaled from the encoding apparatus to the decoding apparatus by a user.

[0304] Most probable mode (MPM): The MPM can represent an intra prediction mode that is highly probable to be used for intra prediction for a target block.

[0305] An encoding apparatus and a decoding apparatus can determine one or more MPMs based on a coding parameter related to a target block and a property of an entity related to the target block.

[0306] The encoding apparatus and the decoding apparatus can determine one or more MPMs based on an intra prediction mode of a reference block. The reference block can include a plurality of reference blocks. The plurality of reference blocks can include a spatial neighboring block adjacent to a left side of the target block and a spatial neighboring block adjacent to an upper side of the target block. In other words, depending on which intra prediction modes have been used for the reference blocks, one or more different MPMs can be determined.

[0307] - The one or more MPMs can be determined in the same way in both the encoding apparatus and the decoding apparatus. That is, the encoding apparatus and the decoding apparatus can share the same MPM list including the one or more MPMs.

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

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

[0310] - Since the MPM list is determined in the same way in both the encoding apparatus and the decoding apparatus, the MPM list itself can not need to be transmitted from the encoding apparatus to the decoding apparatus.

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

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

[0313] - The MPM usage indicator can be signaled from the encoding apparatus to the decoding apparatus.

[0314] Signaling: The "signaling" can mean that information is transmitted from the encoding apparatus to the decoding apparatus. Alternatively, the "signaling" can mean that information is included in a bitstream or a recording medium by the encoding apparatus. The information signaled by the encoding apparatus can be used by the decoding apparatus.

[0315] - The encoding apparatus can generate encoded information by performing encoding on the information to be signaled. The encoded information can be transmitted from the encoding apparatus to the decoding apparatus. The decoding apparatus can obtain the information by decoding the transmitted encoded information. Here, the encoding can be entropy encoding, and the decoding can be entropy decoding.

[0316] Selective signaling: information can be selectively signaled. Selective signaling for information can mean that an encoding apparatus selectively includes information in a bitstream or a recording medium (according to a certain condition). Selective signaling for information can mean that a decoding apparatus selectively extracts information from a bitstream (according to a certain condition).

[0317] Omission of signaling: signaling for information can be omitted. Omission of signaling for information about information can mean that an encoding apparatus does not include information in a bitstream or a recording medium (according to a certain condition). Omission of signaling for information can mean that a decoding apparatus does not extract information from a bitstream (according to a certain condition).

[0318] Statistical value: a variable, an encoding parameter, a constant, or the like can have a calculable value. A statistical value can be a value generated by performing a calculation (operation) on a value of a specified target. For example, a statistical value can indicate one or more of an average value, a weighted average value, a weighted sum, a minimum value, a maximum value, a mode, a median, and an interpolation value of a value of a certain variable, a certain encoding parameter, a certain constant, or the like.

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

[0320] The encoding apparatus 100 can be an encoder, a video encoding apparatus, or an image encoding apparatus. A video can include one or more images (pictures). The encoding apparatus 100 can sequentially encode one or more images of a video.

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

[0322] The encoding apparatus 100 can perform encoding on a target image using an intra mode and / or an inter mode. In other words, a prediction mode of a target block can be one of an intra mode and an inter mode.

[0323] Hereinafter, the terms "intra mode", "intra prediction mode", "intra-picture mode", and "intra prediction mode" can be used with the same meaning and can be used interchangeably with each other.

[0324] Hereinafter, the terms "inter mode", "inter prediction mode", "inter picture mode", and "inter picture prediction mode" can be used with the same meaning and can be used interchangeably with each other.

[0325] Hereinafter, the term "picture" can indicate only a partial picture, or can indicate a block. In addition, the processing of "picture" can indicate sequential processing of a plurality of blocks.

[0326] In addition, the encoding apparatus 100 can generate a bitstream including encoded information by encoding the target picture, and can output and store the generated bitstream. The generated bitstream can be stored in a computer-readable storage medium, and can be streamed through a wired and / or wireless transmission medium.

[0327] When the intra mode is used as the prediction mode, the switcher 115 can switch to the intra mode. When the inter mode is used as the prediction mode, the switcher 115 can switch to the inter mode.

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

[0329] When the prediction mode is the intra mode, the intra prediction unit 120 can use pixels of a previously encoded / decoded neighboring block adjacent to the target block as reference samples. The intra prediction unit 120 can perform spatial prediction on the target block using the reference samples, and can generate prediction samples for the target block via the spatial prediction. The prediction samples can represent samples in the prediction block.

[0330] The inter prediction unit 110 can include a motion prediction unit and a motion compensation unit.

[0331] When the prediction mode is the inter mode, the motion prediction unit can search for a region that best matches the target block in the reference picture in a motion prediction process, and can derive a motion vector for the target block and the found region based on the found region. Here, the motion prediction unit can use a search range as a target region for the search.

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

[0333] Since the decoded picture is stored, the reference picture buffer 190 can be a decoded picture buffer (DPB).

[0334] The motion compensation unit can generate a prediction block for the target block by performing motion compensation using a motion vector. Here, the motion vector can be a two-dimensional (2D) vector used for inter prediction. Also, the motion vector can indicate an offset between the target picture and the reference picture.

[0335] When the motion vector has a value other than an integer, the motion prediction unit and the motion compensation unit can generate the prediction block by applying an interpolation filter to a partial region of the reference picture. To perform inter prediction or motion compensation, it can 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 and compensating for motion of a PU included in a CU based on the CU, and inter prediction or motion compensation can be performed according to the mode.

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

[0337] The residual signal can be a difference between an original signal and a prediction signal. Alternatively, the residual signal can be a signal generated by transforming or quantizing a difference between the original signal and the prediction signal or a signal generated by transforming and quantizing the difference. The residual block can be a residual signal for a block unit.

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

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

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

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

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

[0343] Quantized transform coefficient levels or quantized levels can be generated by performing quantization on the transform coefficients. Hereinafter, in embodiments, each of the quantized transform coefficient levels and the quantized levels can also be referred to as a "transform coefficient".

[0344] The quantization unit 140 can generate quantized transform coefficient levels (i.e., quantized levels or quantized coefficients) by quantizing the transform coefficients according to a quantization parameter. The quantization unit 140 can output the generated quantized transform coefficient levels. In this case, the quantization unit 140 can quantize the transform coefficients using a quantization matrix.

[0345] The entropy encoding unit 150 can generate a bitstream by performing probability distribution-based entropy encoding based on values calculated by the quantization unit 140 and / or encoding parameter values calculated in the encoding process. The entropy encoding unit 150 can output the generated bitstream.

[0346] The entropy encoding unit 150 can perform entropy encoding on information about pixels of an image and information required to decode the image. For example, the information required to decode the image can include syntax elements, etc.

[0347] When entropy encoding is applied, fewer bits can be allocated to a symbol that occurs more frequently, and more bits can be allocated to a symbol that occurs less frequently. Since a symbol is expressed by this allocation, the size of a bit string for a target symbol to be encoded can be reduced. Accordingly, the compression performance of video encoding can be improved by entropy encoding.

[0348] In addition, in order to perform entropy encoding, the entropy encoding unit 150 can use an encoding method such as exponential Golomb, context adaptive variable length coding (CAVLC), or context adaptive binary arithmetic coding (CABAC). For example, the entropy encoding unit 150 can perform entropy encoding using a variable length coding / code (VLC) table. For example, the entropy encoding unit 150 can derive a binarization method for a target symbol. In addition, the entropy encoding unit 150 can derive a probability model for a target symbol / bin. The entropy encoding unit 150 can perform arithmetic encoding using the derived binarization method, probability model, and context model.

[0349] The entropy encoding unit 150 can transform coefficients in the form of a 2D block into the form of a 1D vector by a transform coefficient scanning method in order to encode quantized transform coefficient levels.

[0350] The encoding parameter can be information required for encoding and / or decoding. The encoding parameter can include information encoded by the encoding apparatus 100 and transmitted from the encoding apparatus 100 to a decoding apparatus, and can also include information that can be derived in the encoding or decoding process. For example, the information transmitted to the decoding apparatus can include syntax elements.

[0351] The coding parameters can include not only information (or flags or indices) such as syntax elements coded by the encoding apparatus and signaled to the decoding apparatus by the encoding apparatus, but also information derived in the encoding or decoding process. Furthermore, the coding parameters can include information required for encoding or decoding an image. For example, the coding parameters can include at least one value, a combination of the following, or statistics: a size of a unit / block, a shape / form of a unit / block, a depth of a unit / block, partition information of a unit / block, a partition structure of a unit / block, information indicating whether a unit / block is partitioned in a quad-tree structure, information indicating whether a unit / block is partitioned in a binary-tree structure, a partition direction (horizontal direction or vertical direction) of a binary-tree structure, a partition form (symmetric partition or asymmetric partition) of a binary-tree structure, information indicating whether a unit / block is partitioned in a ternary-tree structure, a partition direction (horizontal direction or vertical direction) of a ternary-tree structure, a partition form (symmetric partition or asymmetric partition, etc.) of a ternary-tree structure, information indicating whether a unit / block is partitioned in a multi-type tree structure, a combination and direction (horizontal direction or vertical direction, etc.) of partitioning of a multi-type tree structure, a partition form (symmetric partition or asymmetric partition, etc.) of a multi-type tree structure, a partition tree (binary tree or ternary tree) of a multi-type tree form, a prediction type (intra prediction or inter prediction), an intra prediction mode / direction, an intra luma prediction mode / direction, an intra chroma prediction mode / direction, intra partition information, inter partition information, an encoding block partition flag, a prediction block partition flag, a transform block partition flag, a reference sample filtering method, a reference sample filter tap, a reference sample filter coefficient, a prediction block filtering method, a prediction block filter tap, a prediction block filter coefficient, a prediction block boundary filtering method, a prediction block boundary filter tap, a prediction block boundary filter coefficient, an inter prediction mode, motion information, a motion vector, a motion vector difference, a reference picture index, an inter prediction direction, an inter prediction indicator, a prediction list utilization flag, a reference picture list, a reference image, a POC, a motion vector predictor, a motion vector prediction index, a motion vector prediction candidate, a motion vector candidate list, information indicating whether a merge mode is used, a merge index, a merge candidate, a merge candidate list, information indicating whether a skip mode is used, a type of an interpolation filter, a tap of an interpolation filter, a filter coefficient of an interpolation filter, a size of a motion vector, an accuracy 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, first transform selection information (or a first transform index), second transform selection information (or a second transform index), information indicating a presence or absence of a residual signal, an encoding block pattern, an encoding block flag, a quantization parameter, a residual quantization parameter, a quantization matrix, information on an in-loop filter, information indicating whether an in-loop filter is applied, a coefficient of an in-loop filter, a tap of an in-loop filter, a shape / form of an in-loop filter, information indicating whether a deblocking filter is applied,coefficients of a deblocking filter, taps of a deblocking filter, strength of a deblocking filter, shape / form of a deblocking filter, information indicating whether an adaptive sample offset is applied, value of an adaptive sample offset, category of an adaptive sample offset, type of an adaptive sample offset, information indicating whether an adaptive loop filter is applied, coefficients of an adaptive loop filter, taps of an adaptive loop filter, shape / form of an adaptive loop filter, binarization / debinarization method, context model, context model decision method, context model update method, information indicating whether a regular mode is performed, information indicating whether a bypass mode is performed, significant coefficient flag, last significant coefficient flag, coding flag of a coefficient group, position of a last significant coefficient, information indicating whether a value of a coefficient is greater than 1, information indicating whether a value of a coefficient is greater than 2, information indicating whether a value of a coefficient is greater than 3, residual coefficient value information, sign information, reconstructed luma sample, reconstructed chroma sample, context bin, bypass bin, residual luma sample, residual chroma sample, transform coefficient, luma transform coefficient, chroma transform coefficient, quantization step, luma quantization step, chroma quantization step, transform coefficient level, transform coefficient level scanning method, size of a motion vector search region on a decoder side, shape / form of a motion vector search region on a decoder side, number of times of motion vector search on a decoder side, size of a CTU, minimum block size, maximum block size, maximum block depth, minimum block depth, picture display / output order, slice identification information, slice type, slice partition information, parallel block group identification information, parallel block group type, parallel block group partition information, parallel block identification information, parallel block type, parallel block partition information, picture type, bit depth, input sample bit depth, reconstructed sample bit depth, residual sample bit depth, transform coefficient bit depth, quantization step bit depth, information on a luma signal, information on a chroma signal, color space of a target block, and color space of a residual block. In addition, the above-mentioned encoding parameter-related information can be included in the encoding parameter. Information used for calculating and / or deriving the above-mentioned encoding parameter can be included in the encoding parameter. Information calculated or derived using the above-mentioned encoding parameter can be included in the encoding parameter.

[0352] The first transform selection information can indicate a first transform applied to the target block.

[0353] The second transform selection information can indicate a second transform applied to the target block.

[0354] The residual signal can represent a difference between the original signal and the prediction signal. Alternatively, the residual signal can be a signal generated by transforming a difference between the original signal and the prediction signal. Alternatively, the residual signal can be a signal generated by transforming and quantizing a difference between the original signal and the prediction signal. The residual block can be a residual signal for a block.

[0355] Here, signaling information can mean that the encoding apparatus 100 includes entropy-encoded information generated by performing entropy encoding on a flag or an index in a bitstream, and can mean that the decoding apparatus 200 acquires information by performing entropy decoding on the entropy-encoded information extracted from the bitstream. Here, the information can include a flag, an index, or the like.

[0356] A signal can mean information to be signaled. Hereinafter, information for an image and a block can be referred to as a "signal". Also, hereinafter, the terms "information" and "signal" can be used to have the same meaning, and can be used interchangeably with each other. For example, a certain signal can be a signal representing a certain block. An original signal can be a signal representing a target block. A prediction signal can be a signal representing a prediction block. A residual signal can be a signal representing a residual block.

[0357] A bitstream can include information based on a certain syntax. The encoding apparatus 100 can generate a bitstream including information according to a certain syntax. The decoding apparatus 200 can acquire information from a bitstream according to a certain syntax.

[0358] Since the encoding apparatus 100 performs encoding via inter prediction, an encoded target image can be used as a reference image for another image to be processed subsequently. Accordingly, the encoding apparatus 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.

[0359] A quantized level can be inverse quantized by the inverse quantization unit 160, and can be inverse transformed by the inverse transformation unit 170. The inverse quantization unit 160 can generate inverse quantized coefficients by performing inverse transformation with respect to the quantized level. The inverse transformation unit 170 can generate inverse quantized and inverse transformed coefficients by performing inverse transformation with respect to the inverse quantized coefficients.

[0360] The inverse quantized and inverse transformed coefficients can be added to a prediction block by the adder 175. The inverse quantized and inverse transformed coefficients and the prediction block are added, and then a reconstructed block can be generated. Here, the inverse quantized and / or inverse transformed coefficients can mean coefficients to which one or more of inverse quantization and inverse transformation are performed, and can also mean a reconstructed residual block. Here, the reconstructed block can mean a restored block or a decoded block.

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

[0362] The deblocking filter can remove block distortion occurring at a boundary between blocks in the reconstructed picture. In order to determine whether to apply the deblocking filter, the number of columns or rows included in a block and including pixels based on which it is determined whether to apply the deblocking filter to a target block can be decided.

[0363] When the deblocking filter is applied to the target block, the applied filter can differ according to the strength of deblocking filtering required. In other words, among different filters, a filter decided in consideration of the strength of deblocking filtering can be applied to the target block. When the deblocking filter is applied to the target block, one or more filters among a long tap filter, a strong filter, a weak filter, and a Gaussian filter can be applied to the target block according to the strength of deblocking filtering required.

[0364] In addition, when vertical filtering and horizontal filtering are performed on the target block, horizontal filtering and vertical filtering can be performed in parallel.

[0365] The SAO can add an appropriate offset to a pixel value in order to compensate for encoding error. The SAO can perform correction on an image to which deblocking is applied based on a pixel, in which the correction uses an offset of a difference between an original image and the image to which deblocking is applied. In order to perform offset correction for an image, a method for dividing pixels included in the image into a certain number of regions, determining a region to which an offset is to be applied among the divided regions, and applying the offset to the determined region can be used, and a method for applying an offset in consideration of edge information of each pixel can also be used.

[0366] The ALF can 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 can be determined, and filtering can be performed differently for each group. Information related to whether to apply the adaptive loop filter can be signaled for each CU. Such information can be signaled for a luma signal. The shape of the ALF to be applied to each block and filter coefficients can differ for each block. Alternatively, an ALF having a fixed form can be applied to a block regardless of the characteristics of the block.

[0367] A non-local filter can perform filtering based on a reconstructed block similar to a target block. A region similar to the target block can be selected from a reconstructed picture, and filtering of the target block can be performed using statistical properties of the selected similar region. Information about whether to apply the non-local filter can be signaled for a coding unit (CU). Further, the shape of the non-local filter to be applied to a block and filter coefficients of the non-local filter can differ depending on the block.

[0368] A reconstructed block or a reconstructed picture filtered by the filter unit 180 can be stored in the reference picture buffer 190 as a reference picture. The reconstructed block filtered by the filter unit 180 can be a part of the reference picture. In other words, the reference picture can be a reconstructed picture composed of the reconstructed block filtered by the filter unit 180. The stored reference picture can be subsequently used for inter prediction or motion compensation.

[0369] Figure 2 FIG. 1 is a block diagram illustrating a configuration of an encoding apparatus to which an embodiment of the disclosure is applied.

[0370] The decoding apparatus 200 can be a decoder, a video decoding apparatus, or an image decoding apparatus.

[0371] Referring to Figure 2 , the decoding apparatus 200 can include an entropy decoding unit 210, an inverse quantization (dequantization) 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.

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

[0373] The decoding apparatus 200 can perform decoding on the bitstream in an intra mode and / or an inter mode. Further, the decoding apparatus 200 can generate a reconstructed picture or a decoded picture via the decoding, and can output the reconstructed picture or the decoded picture.

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

[0375] The decoding device 200 can acquire a reconstructed residual block by decoding the input bitstream, and can generate a prediction block. When the reconstructed residual block and the prediction block are acquired, the decoding device 200 can generate a reconstructed block, which is a target to be decoded, by adding the reconstructed residual block to the prediction block.

[0376] The entropy decoding unit 210 can generate a symbol by performing entropy decoding on the bitstream based on a probability distribution of the bitstream. The generated symbol can include a symbol in the form of a quantized transform coefficient level (i.e., a quantized level or a quantized coefficient). Here, the entropy decoding method can be similar to the entropy encoding method described above. That is, the entropy decoding method can be an inverse process of the entropy encoding method described above.

[0377] The entropy decoding unit 210 can change a coefficient having a one-dimensional (1D) vector form into a 2D block shape by a transform coefficient scanning method, in order to decode the quantized transform coefficient level.

[0378] For example, the coefficients of a block can be changed into a 2D block shape by scanning the block coefficients using a right-up diagonal scanning. Alternatively, which one of the right-up diagonal scanning, the vertical scanning, and the horizontal scanning is to be used can be determined according to a size of a corresponding block and / or an intra prediction mode.

[0379] The quantized coefficient can be dequantized by the dequantization unit 220. The dequantization unit 220 can generate a dequantized coefficient by performing dequantization on the quantized coefficient. Further, the dequantized coefficient can be inverse transformed by the inverse transform unit 230. The inverse transform unit 230 can generate a reconstructed residual block by performing inverse transform on the dequantized coefficient. As a result of performing dequantization and inverse transform on the quantized coefficient, the reconstructed residual block can be generated. Here, when the reconstructed residual block is generated, the dequantization unit 220 can apply a quantization matrix to the quantized coefficient.

[0380] When the intra mode is used, the intra prediction unit 240 can generate a prediction block by performing spatial prediction for a target block, in which the spatial prediction uses pixel values of a previously decoded neighboring block adjacent to the target block.

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

[0382] When the inter mode is used, the motion compensation unit can generate a prediction block by performing motion compensation for a target block, in which the motion compensation uses a motion vector and a reference image stored in the reference picture buffer 270.

[0383] The motion compensation unit can apply an interpolation filter to a partial region of the reference picture when the motion vector has a value other than an integer, and can generate the prediction block using the reference picture to which the interpolation filter is applied. To perform the motion compensation, the motion compensation unit can determine 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 motion compensation method for a PU included in a CU based on the CU, and can perform the motion compensation according to the determined mode.

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

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

[0386] The filter unit can output the reconstructed picture.

[0387] The reconstructed picture and / or the reconstructed block filtered by the filter unit 260 can be stored in a reference picture buffer 270 as a reference picture. The reconstructed block filtered by the filter unit 260 can be a part of the reference picture. In other words, the reference picture can be an image composed of the reconstructed block filtered by the filter unit 260. The stored reference picture can be subsequently used for inter prediction or motion compensation.

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

[0389] Figure 3 An example in which a single unit is partitioned into a plurality of sub-units can be schematically illustrated.

[0390] To efficiently partition an image, a coding unit (CU) can be used in encoding and decoding. The term "unit" can be used to collectively designate 1) a block including image samples and 2) syntax elements. For example, "partition of a unit" can mean "partition of a block corresponding to the unit."

[0391] The CU can be used as a basic unit for image encoding / decoding. The 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, which one of the intra mode and the inter mode is to be applied to each CU can be determined.

[0392] Further, the CU can be a basic unit to which a transform coefficient is predicted, transformed, quantized, inverse-transformed, dequantized, and encoded / decoded.

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

[0394] Partitioning a unit can mean partitioning a block corresponding to the unit. The block partitioning information can include depth information about a depth of the unit. The depth information can indicate a number of times the unit is partitioned and / or a degree to which the unit is partitioned. A single unit can be hierarchically partitioned into a plurality of sub-units while the single unit has depth information based on a tree structure.

[0395] Each partitioned sub-unit can have depth information. The depth information can be information indicating a size of a CU. The depth information can be stored for each CU.

[0396] Each CU can have depth information. When the CU is partitioned, the depth of the CU generated from the partitioning can increase by 1 from the depth of the partitioned CU.

[0397] The partition structure can represent a distribution of coding units (CUs) in the LCU 310 for efficient encoding of an image. Such a distribution can be determined according to whether a single CU will be partitioned into a plurality of CUs. The number of CUs generated by the partitioning can be a positive integer 2 or more, including 2, 3, 4, 8, 16, etc.

[0398] According to the number of CUs generated by the partitioning, the horizontal size and the vertical size of each CU generated by the partitioning can be smaller than the horizontal size and the vertical size of the CU before the partitioning. For example, the horizontal size and the vertical size of each CU generated by the partitioning can be half of the horizontal size and the vertical size of the CU before the partitioning.

[0399] Each partitioned CU can be recursively partitioned into four CUs in the same manner. At least one of the horizontal size and the vertical size of each partitioned CU can be reduced via the recursive partitioning compared to at least one of the horizontal size and the vertical size of the CU before the partitioning.

[0400] The partitioning of the CU can be recursively performed until a predefined depth or a predefined size.

[0401] For example, the depth of the CU can have a value ranging from 0 to 3. The size of the CU can range from a size of 64x64 to a size of 8x8 depending on the depth of the CU.

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

[0403] Partitioning can be performed starting at the LCU 310, and the depth of a CU can increase by 1 each time the horizontal size and / or the vertical size of the CU is reduced by partitioning.

[0404] For example, for each depth, a CU that is not partitioned can have a size of 2N×2N. Also, in the case of a CU that is partitioned, a CU having a size of 2N×2N can be partitioned into four CUs each having a size of N×N. Each time the depth increases by 1, the value of N can be halved.

[0405] Referring to Figure 3 , an LCU having a depth of 0 can have 64×64 pixels or a block of 64×64. 0 can be a minimum depth. An SCU having a depth of 3 can have 8×8 pixels or a block of 8×8. 3 can be a maximum depth. Here, a CU having a block of 64×64 as the LCU can be represented with a depth of 0. A CU having a block of 32×32 can be represented with a depth of 1. A CU having a block of 16×16 can be represented with a depth of 2. A CU having a block of 8×8 as the SCU can be represented with a depth of 3.

[0406] Information about whether a corresponding CU is partitioned can be represented with partition information of the CU. The partition information can be 1-bit information. All CUs except for the SCU can include the partition information. For example, the value of the partition information of a CU that is not partitioned can be a first value. The value of the partition information of a CU that is partitioned can be a second value. When the partition information indicates whether a CU is partitioned, the first value can be "0" and the second value can be "1".

[0407] For example, when a single CU is partitioned into four CUs, the horizontal size and the vertical size of each of the four CUs generated by the partitioning can be half of the horizontal size and the vertical size of the CU before being partitioned. When a CU having a size of 32×32 is partitioned into four CUs, each of the four CUs partitioned can have a size of 16×16. When a single CU is partitioned into four CUs, the CU can be considered to have been partitioned in a quad-tree structure. In other words, it can be considered that quad-tree partitioning has been applied to the CU.

[0408] For example, when a single CU is partitioned into two CUs, each of the two CUs generated by the partitioning can have a horizontal size or a vertical size that is half of the horizontal size or the vertical size of the CU before being partitioned. When a CU having a size of 32x32 is vertically partitioned into two CUs, each of the two partitioned CUs can have a size of 16x32. When a CU having a size of 32x32 is horizontally partitioned into two CUs, each of the two partitioned CUs can have a size of 32x16. When a single CU is partitioned into two CUs, the CU can be considered to have been partitioned in a binary tree structure. In other words, the binary tree partitioning can be considered to have been applied to the CU.

[0409] For example, when a single CU is partitioned (or divided) into three CUs, the original CU before being partitioned is partitioned such that its horizontal size or vertical size is divided in a ratio of 1:2:1, thus enabling three sub-CUs to be generated. For example, when a CU having a size of 16x32 is horizontally partitioned into three sub-CUs, the three sub-CUs generated by the partitioning can have sizes of 16x8, 16x16, and 16x8, respectively, in a direction from top to bottom. For example, when a CU having a size of 32x32 is vertically partitioned into three sub-CUs, the three sub-CUs generated by the partitioning can have sizes of 8x32, 16x32, and 8x32, respectively, in a direction from left to right. When a single CU is partitioned into three CUs, the CU can be considered to have been partitioned in a ternary tree form. In other words, the ternary tree partitioning can be considered to have been applied to the CU.

[0410] Both the quad-tree partitioning and the binary tree partitioning are applied to Figure 3 LCU 310 of FIG. 1.

[0411] In the encoding apparatus 100, a coding tree unit (CTU) 320 having a size of 64x64 can be partitioned into a plurality of smaller CUs by a recursive quad-tree structure. A single CU can be partitioned into four CUs having the same size. Each CU can be recursively partitioned and can have a quad-tree structure.

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

[0413] Figure 3 The coding tree unit (CTU) 320 of FIG. 3 is an example of a CTU to which all of the quad-tree partitioning, the binary tree partitioning, and the ternary tree partitioning are applied.

[0414] As described above, to partition a CTU, at least one of the quad-tree partitioning, the binary tree partitioning, and the ternary tree partitioning can be applied to the CTU. The partitioning can be applied based on a certain priority.

[0415] For example, the quad-tree partitioning can be preferentially applied to the CTU. The CU that cannot be further partitioned in the quad-tree form can correspond to a leaf node of the quad-tree. The CU corresponding to the leaf node of the quad-tree can be a root node of the binary tree and / or the ternary tree. That is, the CU corresponding to the leaf node of the quad-tree can be partitioned in the binary tree form or the ternary tree form, or can not be further partitioned. In this case, each CU generated by applying the binary tree partitioning or the ternary tree partitioning to the CU corresponding to the leaf node of the quad-tree is prevented from being again partitioned in the quad-tree, thereby efficiently performing the partitioning of the block and / or the signaling of the block partitioning information.

[0416] The quad-partition information can be used to signal the partitioning of the CU corresponding to each node of the quad-tree. The quad-partition information having a first value (e.g., "1") can indicate that the corresponding CU is partitioned in the quad-tree form. The quad-partition information having a second value (e.g., "0") can indicate that the corresponding CU is not partitioned in the quad-tree form. The quad-partition information can be a flag having a specific length (e.g., 1 bit).

[0417] There can be no priority between the binary tree partitioning and the ternary tree partitioning. That is, the CU corresponding to the leaf node of the quad-tree can be partitioned in the binary tree form or the ternary tree form. Furthermore, the CU generated by the binary tree partitioning or the ternary tree partitioning can be further partitioned in the binary tree form or the ternary tree form, or can not be further partitioned.

[0418] The partitioning performed when there is no priority between the binary tree partitioning and the ternary tree partitioning can be referred to as "multi-type tree partitioning". That is, the CU corresponding to the leaf node of the quad-tree can be a root node of the multi-type tree. The partitioning of the CU corresponding to each node of the multi-type tree can be signaled using at least one of information indicating whether the CU is partitioned in the multi-type tree, partitioning direction information, and partitioning tree information. For the partitioning of the CU corresponding to each node of the multi-type tree, the information indicating whether the partitioning in the multi-type tree is performed, the partitioning direction information, and the partitioning tree information can be sequentially signaled.

[0419] For example, the information indicating whether the CU is partitioned in the multi-type tree and having a first value (e.g., "1") can indicate that the corresponding CU is partitioned in the multi-type tree form. The information indicating whether the CU is partitioned in the multi-type tree and having a second value (e.g., "0") can indicate that the corresponding CU is not partitioned in the multi-type tree form.

[0420] When the CU corresponding to each node of the multi-type tree is partitioned in the multi-type tree form, the corresponding CU can further include the partitioning direction information.

[0421] The partition direction information can indicate a partition direction of the multi-type tree partition. The partition direction information having a first value (e.g., "1") can indicate that the corresponding CU is partitioned in a vertical direction. The partition direction information having a second value (e.g., "0") can indicate that the corresponding CU is partitioned in a horizontal direction.

[0422] When the CU corresponding to each node of the multi-type tree is partitioned in the form of the multi-type tree, the corresponding CU can further include partition tree information. The partition tree information can indicate a tree used for the multi-type tree partition.

[0423] For example, the partition tree information having a first value (e.g., "1") can indicate that the corresponding CU is partitioned in the form of a binary tree. The partition tree information having a second value (e.g., "0") can indicate that the corresponding CU is partitioned in the form of a ternary tree.

[0424] Here, each of the above-described information indicating whether the partition in the form of the multi-type tree is performed, the partition tree information, and the partition direction information can be a flag having a specific length (e.g., 1 bit).

[0425] At least one of the above-described quad partition information, the information indicating whether the partition in the form of the multi-type tree is performed, the partition direction information, and the partition tree information can be entropy encoded and / or entropy decoded. To perform the entropy encoding / entropy decoding of such information, information of a neighboring CU adjacent to the target CU can be used.

[0426] For example, it can be considered that a probability that a partition form (i.e., partition / non-partition, partition tree, and / or partition direction) of a left CU and / or an upper CU is similar to a partition form of a target CU is high. Accordingly, based on the information of the neighboring CU, context information for the entropy encoding and / or the entropy decoding of the information of the target CU can be derived. Here, the information of the neighboring CU can include at least one of 1) quad partition information of the neighboring CU, 2) information indicating whether the neighboring CU is partitioned in the form of the multi-type tree, 3) partition direction information of the neighboring CU, and 4) partition tree information of the neighboring CU.

[0427] In another embodiment of the binary tree partition and the ternary tree partition, the binary tree partition can be preferentially performed. That is, the binary tree partition can be first applied, and then a CU corresponding to a leaf node of the binary tree can be set as a root node of the ternary tree. In this case, quad tree partition or binary tree partition can not be performed on a CU corresponding to a node of the ternary tree.

[0428] A CU that is not further partitioned by quad-tree partitioning, binary-tree partitioning, and / or ternary-tree partitioning can be a unit of encoding, prediction, and / or transform. That is, the CU can not be further partitioned for prediction and / or transform. Accordingly, a partitioning structure for partitioning the CU into prediction units (PUs) or transform units (TUs), partitioning information thereof, and / or the like can not exist in a bitstream.

[0429] However, when the size of the CU that is a unit of partitioning is greater than the size of the maximum transform block, the CU can be recursively partitioned until the size of the CU becomes less than or equal to the size of the maximum transform block. For example, when the size of the CU is 64x64 and the size of the maximum transform block is 32x32, the CU can be partitioned into four 32x32 blocks in order to perform transform. For example, when the size of the CU is 32x64 and the size of the maximum transform block is 32x32, the CU can be partitioned into two 32x32 blocks.

[0430] In this case, information indicating whether the CU is partitioned for transform can not be separately signaled. In the case of not being signaled, whether the CU is partitioned can be determined via a comparison between the horizontal size (and / or the vertical size) of the CU and the horizontal size (and / or the vertical size) of the maximum transform block. For example, when the horizontal size of the CU is greater than the horizontal size of the maximum transform block, the CU can be vertically bisected. Also, when the vertical size of the CU is greater than the vertical size of the maximum transform block, the CU can be horizontally bisected.

[0431] Information on the maximum size and / or the minimum size of the CU and information on the maximum size and / or the minimum size of the transform block can be signaled or determined at a level higher than the level of the CU. For example, the higher level can be a sequence level, a picture level, a parallel block level, a parallel block group level, or a slice level. For example, the minimum size of the CU can be set to 4x4. For example, the maximum size of the transform block can be set to 64x64. For example, the maximum size of the transform block can be set to 4x4.

[0432] Information on the minimum size of the CU corresponding to a leaf node of the quad-tree (i.e., the minimum size of the quad-tree) and / or information on the maximum depth of a path from a root node to a leaf node of the multi-type tree (i.e., the maximum depth of the multi-type tree) can be signaled or determined at a level higher than the level of the CU. For example, the higher level can be a sequence level, a picture level, a slice level, a parallel block group level, or a parallel block level. The information on the minimum size of the quad-tree and / or the information on the maximum depth of the multi-type tree can be separately signaled or determined at each of an intra-slice level and an inter-slice level.

[0433] Information on a difference between a size of a CTU and a maximum size of a transform block can be signaled or determined at a level higher than a CU. For example, the higher level can be a sequence level, a picture level, a slice level, a parallel block group level, or a parallel block level. Information on a maximum size of a CU corresponding to each node of a binary tree (i.e., a maximum size of a binary tree) can be determined based on the size of the CTU and the information of the difference. A maximum size of a CU corresponding to each node of a ternary tree (i.e., a maximum size of a ternary tree) can have different values according to a type of a slice. For example, the maximum size of a ternary tree at an intra-slice level can be 32x32. For example, the maximum size of a ternary tree at an inter-slice level can be 128x128. For example, a minimum size of a CU corresponding to each node of a binary tree (i.e., a minimum size of a binary tree) and / or a minimum size of a CU corresponding to each node of a ternary tree (i.e., a minimum size of a ternary tree) can be set to a minimum size of a CU.

[0434] In another example, a maximum size of a binary tree and / or a maximum size of a ternary tree can be signaled or determined at a slice level. Further, a minimum size of a binary tree and / or a minimum size of a ternary tree can be signaled or determined at a slice level.

[0435] Based on the various block sizes and depths described above, quad partition information, information indicating whether partitioning by multi-type tree is performed, partition tree information, and / or partition direction information can or can not be present in a bitstream.

[0436] For example, when a size of a CU is not greater than a minimum size of a quad tree, the CU can not include quad partition information, and quad partition information of the CU can be inferred to be a second value.

[0437] For example, when a size (horizontal size and vertical size) of a CU corresponding to each node of a multi-type tree is greater than a maximum size (horizontal size and vertical size) of a binary tree and / or a maximum size (horizontal size and vertical size) of a ternary tree, the CU can not be partitioned in a binary tree form and / or a ternary tree form. With this determination, information indicating whether partitioning by multi-type tree is performed can not be signaled, but can be inferred to be a second value.

[0438] Alternatively, when the size (horizontal size and vertical size) of the CU corresponding to each node of the multi-type tree is equal to the minimum size (horizontal size and vertical size) of the binary tree, or when the size (horizontal size and vertical size) of the CU is equal to twice the minimum size (horizontal size and vertical size) of the ternary tree, the CU can not be partitioned in the form of the binary tree and / or the ternary tree. Through this determination, the information indicating whether the partitioning by the multi-type tree is performed can not be signaled but can be inferred as the second value. The reason for this is that, when the CU is partitioned in the form of the binary tree and / or the ternary tree, a CU smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree is generated.

[0439] Alternatively, the binary tree partitioning or the ternary tree partitioning can be limited based on the size of the virtual pipeline data unit (i.e., the size of the pipeline buffer). For example, when the CU is partitioned into sub-CUs that do not fit in the size of the pipeline buffer by the binary tree partitioning or the ternary tree partitioning, the binary tree partitioning or the ternary tree partitioning can be limited. The size of the pipeline buffer can be equal to the maximum size of the transform block (e.g., 64x64).

[0440] For example, when the size of the pipeline buffer is 64x64, the following partitioning can be limited.

[0441] - the ternary tree partitioning for the CU of N x M (where N and / or M is 128)

[0442] - the horizontal binary tree partitioning for the CU of 128 x N (where N <= 64)

[0443] - the vertical binary tree partitioning for the CU of N x 128 (where N <= 64)

[0444] Alternatively, when the depth of the CU corresponding to each node of the multi-type tree is equal to the maximum depth of the multi-type tree, the CU can not be partitioned in the form of the binary tree and / or the ternary tree. Through this determination, the information indicating whether the partitioning by the multi-type tree is performed can not be signaled but can be inferred as the second value.

[0445] Alternatively, the information indicating whether the partitioning by the multi-type tree is performed can be signaled only when at least one of the vertical binary tree partitioning, the horizontal binary tree partitioning, the vertical ternary tree partitioning, and the horizontal ternary tree partitioning is possible for the CU corresponding to each node of the multi-type tree. Otherwise, the CU can not be partitioned in the form of the binary tree and / or the ternary tree. Through this determination, the information indicating whether the partitioning by the multi-type tree is performed can not be signaled but can be inferred as the second value.

[0446] Alternatively, for a CU corresponding to each node of the multi-type tree, the partition direction information can be signaled only when both vertical binary tree partitioning and horizontal binary tree partitioning are possible or only when both vertical ternary tree partitioning and horizontal ternary tree partitioning are possible. Otherwise, the partition direction information can not be signaled but can be inferred as a value indicating a direction in which the CU can be partitioned.

[0447] Alternatively, for a CU corresponding to each node of the multi-type tree, the partition tree information can be signaled only when both vertical binary tree partitioning and vertical ternary tree partitioning are possible or only when both horizontal binary tree partitioning and horizontal ternary tree partitioning are possible. Otherwise, the partition tree information can not be signaled but can be inferred as a value indicating a tree to which partitioning of the CU can be applied.

[0448] Figure 4 is a diagram showing a form of a prediction unit that a coding unit can include.

[0449] In a CU partitioned out from an LCU, the CU that is no longer partitioned can be divided into one or more prediction units (PUs). Such division is also referred to as "partitioning".

[0450] A PU can be a basic unit for prediction. The PU can be encoded and decoded in any one of a skip mode, an inter mode, and an intra mode. The PU can be partitioned into various shapes according to the respective modes. For example, the target block described above with reference to Figure 1 The target block described above with reference to Figure 2 The target block described above with reference to

[0451] A CU can not be divided into PUs. When a CU is not divided into PUs, the size of the CU and the size of the PU can be equal to each other.

[0452] In the skip mode, there can be no partitioning in a CU. In the skip mode, a 2N x 2N mode 410 in which the size of the PU and the size of the CU are the same as each other can be supported without partitioning.

[0453] In the inter mode, there can be eight types of partitioning shapes in a CU. For example, in the inter mode, a 2N x 2N mode 410, a 2N x N mode 415, an N x 2N mode 420, an N x N mode 425, a 2N x nU mode 430, a 2N x nD mode 435, an nL x 2N mode 440, and an nR x 2N mode 445 can be supported.

[0454] In the intra mode, a 2N x 2N mode 410 and an N x N mode 425 can be supported.

[0455] In the 2Nx2N mode 410, a PU of size 2Nx2N can be coded. The PU of size 2Nx2N can represent a PU having the same size as the CU. For example, the PU of size 2Nx2N can have a size of 64x64, 32x32, 16x16, or 8x8.

[0456] In the NxN mode 425, a PU of size NxN can be coded.

[0457] For example, in intra prediction, when the size of a PU is 8x8, four partitioned PUs can be coded. Each of the partitioned PUs can have a size of 4x4.

[0458] When a PU is coded in the intra mode, the PU can be coded using any of a plurality of intra prediction modes. For example, the HEVC technique can provide 35 intra prediction modes, and a PU can be coded in any of the 35 intra prediction modes.

[0459] Which of the 2Nx2N mode 410 and the NxN mode 425 is to be used for coding a PU can be determined based on a rate-distortion cost.

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

[0461] In addition, the coding device 100 can sequentially perform a coding operation on each of the PUs obtained by the NxN partitioning. Here, the coding operation can be an operation of coding the PU in each of a plurality of intra prediction modes that can be used by the coding device 100. Through the coding operation, an optimal intra prediction mode for the PU of size NxN can be derived. The optimal intra prediction mode can be an intra prediction mode that results in a minimum rate-distortion cost when coding the PU of size NxN among the plurality of intra prediction modes that can be used by the coding device 100.

[0462] The coding device 100 can determine which of the PU of size 2Nx2N and the PU of size NxN is to be coded based on a comparison between a rate-distortion cost of the PU of size 2Nx2N and a rate-distortion cost of the PU of size NxN.

[0463] A single CU can be partitioned into one or more PUs, and a PU can be partitioned into a plurality of PUs.

[0464] 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 through the partitioning can be half of the horizontal size and the vertical size of the PU before being partitioned. When a PU having a size of 32x32 is partitioned into four PUs, the size of each of the four partitioned PUs can be 16x16. When a single PU is partitioned into four PUs, it can be considered that the PU has been partitioned in a quad-tree structure.

[0465] 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 through the partitioning can be half of the horizontal size or the vertical size of the PU before being partitioned. When a PU having a size of 32x32 is partitioned into two PUs vertically, the size of each of the two partitioned PUs can be 16x32. When a PU having a size of 32x32 is partitioned into two PUs horizontally, the size of each of the two partitioned PUs can be 32x16. When a single PU is partitioned into two PUs, it can be considered that the PU has been partitioned in a binary-tree structure.

[0466] Figure 5 is a diagram illustrating a form of a transform unit that can be included in a coding unit.

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

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

[0469] In a CU partitioned from an LCU, a CU that is no longer partitioned into a CU can be partitioned into one or more TUs. Here, the partitioning structure of a TU can be a quad-tree structure. For example, as shown in Figure 5 As shown in, a single CU 510 can be partitioned one or more times according to a quad-tree structure. Through such partitioning, the single CU 510 can be composed of TUs having various sizes.

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

[0471] Alternatively, a single CU can be divided into one or more TUs based on the number of vertical lines and / or horizontal lines that divide the CU.

[0472] The 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 apparatus 100 to the decoding apparatus 200. Alternatively, the size and / or shape of each TU can be derived from information about the size and / or shape of the CU.

[0473] The CU can not be divided into TUs. When the CU is not divided into TUs, the size of the CU and the size of the TUs can be equal to each other.

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

[0475] For example, when a single TU is partitioned into four TUs, the horizontal size and the vertical size of each of the four TUs generated by the partitioning can be half of the horizontal size and the vertical size of the TU before the partitioning. When a TU having a size of 32x32 is partitioned into four TUs, the size of each of the four partitioned TUs can be 16x16. When a single TU is partitioned into four TUs, it can be considered that the TU has been partitioned in a quad-tree structure.

[0476] 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 the partitioning. When a TU having a size of 32x32 is vertically partitioned into two TUs, the size of each of the two partitioned TUs can be 16x32. When a TU having a size of 32x32 is horizontally partitioned into two TUs, the size of each of the two partitioned TUs can be 32x16. When a single TU is partitioned into two TUs, it can be considered that the TU has been partitioned in a binary tree structure.

[0477] The CU can be divided in a different manner from that shown in Figure 5

[0478] For example, a single CU can be divided into three CUs. The horizontal size or the vertical size of the three CUs generated by the division can be 1 / 4, 1 / 2, and 1 / 4, respectively, of the horizontal size or the vertical size of the original CU before the division.

[0479] For example, when a CU having a size of 32x32 is vertically divided into three CUs, the sizes of the three CUs generated by the division can be 8x32, 16x32, and 8x32, respectively. In this manner, when a single CU is divided into three CUs, it can be considered that the CU has been divided in a ternary tree form.

[0480] ​One of the example partition forms (i.e., quad-tree partition, binary-tree partition, and ternary-tree partition) can be applied to the partition of a CU, and a plurality of partition schemes can be combined and used together for the partition of a CU. Here, the case where a plurality of partition schemes are combined and used together can be referred to as a "compound tree form partition".

[0481] Figure 6 A partition of a block according to an example is shown.

[0482] In a video encoding and / or decoding process, as shown in Figure 6 A target block can be partitioned. For example, the target block can be a CU.

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

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

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

[0486] The "QB_flag" can be a flag indicating which one of the quad-tree 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 quad-tree form. A QB_flag value of 1 can indicate that the block is partitioned in the binary-tree form. Alternatively, 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 quad-tree form.

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

[0488] The "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 a block is divided in a binary tree form. A binarytree_flag value of 0 can indicate that a block is not divided in a binary tree form.

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

[0490] For example, division information of a block in Figure 6 may be derived by signaling at least one of a quadtree_flag, a binarytree_flag, and a Btype_flag, as shown in Table 1 below.

[0491] Table 1

[0492]

[0493] For example, division information of a block in Figure 6 may be derived by signaling at least one of a split_flag, a QB_flag, and a Btype_flag, as shown in Table 2 below.

[0494] Table 2

[0495]

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

[0497] When a size of a block falls within a certain range, division in only a quadtree form is possible. For example, the certain range can be defined by at least one of a maximum block size and a minimum block size capable of division in only a quadtree form.

[0498] The information indicating the maximum block size and the minimum block size capable of being split only in the quad-tree form can be signaled from the encoding apparatus 100 to the decoding apparatus 200 through a bitstream. Also, this information can be signaled for at least one of units such as a video, a sequence, a picture, a parameter, a parallel block group, and a slice (or a segment).

[0499] Alternatively, the maximum block size and / or the minimum block size can be a fixed size defined in advance by the encoding apparatus 100 and the decoding apparatus 200. For example, when the size of a block is greater than 64x64 and less than 256x256, split only in the quad-tree form is possible. In this case, the split_flag can be a flag indicating whether split in the quad-tree form is performed.

[0500] When the size of a block is greater than the maximum size of a transform block, split only in the quad-tree form is possible. Here, a sub-block generated by the split can be at least one of a CU and a TU.

[0501] In this case, the split_flag can be a flag indicating whether a CU is split in the quad-tree form.

[0502] When the size of a block falls within a certain range, split only in the binary-tree form or the ternary-tree form is possible. For example, the certain range can be defined by at least one of a maximum block size and a minimum block size capable of being split only in the binary-tree form or the ternary-tree form.

[0503] The information indicating the maximum block size and / or the minimum block size capable of being split only in the binary-tree form or in the ternary-tree form can be signaled from the encoding apparatus 100 to the decoding apparatus 200 through a bitstream. Also, this information can be signaled for at least one of units such as a sequence, a picture, and a slice (or a segment).

[0504] Alternatively, the maximum block size and / or the minimum block size can be a fixed size defined in advance by the encoding apparatus 100 and the decoding apparatus 200. For example, when the size of a block is greater than 8x8 and less than 16x16, split only in the binary-tree form is possible. In this case, the split_flag can be a flag indicating whether split in the binary-tree form or the ternary-tree form is performed.

[0505] The above description of the split in the quad-tree form can be equally applied to the binary-tree form and / or the ternary-tree form.

[0506] The partitioning of a block can be restricted by a previous partitioning. For example, when a block is partitioned in a certain binary tree form and a plurality of sub-blocks are generated from the partitioning, each sub-block can be further partitioned only in a certain tree form. Here, the certain tree form can be at least one of a binary tree form, a ternary tree form, and a quad tree form.

[0507] When a horizontal size or a vertical size of a partitioned block is a size that cannot be further divided, the above-described indicator can not be signaled.

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

[0509] From Figure 7 the center of the diagram, arrows radially extending indicate prediction directions of intra prediction modes. Further, numbers appearing near the arrows indicate examples of mode values assigned to the intra prediction modes or the prediction directions of the intra prediction modes.

[0510] In Figure 7 , the number 0 can represent a planar mode as a non-directional intra prediction mode. The number 1 can represent a DC mode as a non-directional intra prediction mode.

[0511] Intra encoding and / or decoding can be performed using reference samples of neighboring blocks of a target block. The neighboring blocks can be reconstructed neighboring blocks. The reference samples can represent neighboring samples.

[0512] For example, the intra encoding and / or decoding can be performed using values of the reference samples included in the reconstructed neighboring blocks or encoding parameters of the reconstructed neighboring blocks.

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

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

[0515] 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 4×4, 8×8, 16×16, 32×32, 64×64, etc.

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

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

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

[0519] The intra prediction mode can be a non-directional mode or a directional mode.

[0520] For example, intra prediction modes may include Figure 7 The numbers 0 to 66 shown in the figure correspond to two non-directional modes and 65 directional modes.

[0521] For example, in the case of using a specific intra prediction method, the intra prediction mode may include Figure 7 The numbers -14 to 80 shown correspond to two non-directional modes and 93 directional modes.

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

[0523] A directional mode may be a prediction mode with a specific direction or a specific angle. A directional mode may also be referred to as an "angle mode."

[0524] The intra-frame prediction mode may be represented by at least one of a mode number, a mode value, a mode angle, and a mode direction. In other words, the terms "intra-frame prediction mode (mode) number", "intra-frame prediction mode (mode) value", "intra-frame prediction mode (mode) angle", and "intra-frame prediction mode (mode) direction" may be used to have the same meaning and may be used interchangeably.

[0525] The number of intra prediction modes may be M. The value of M may be 1 or greater. In other words, the number of intra prediction modes may be M, where M includes the number of non-directional modes and the number of directional modes.

[0526] The number of intra prediction modes can be fixed as M regardless of the size of the block and / or the color component. For example, the number of intra prediction modes can be fixed as any one of 35 and 67 regardless of the size of the block.

[0527] Alternatively, the number of intra prediction modes can be different according to the shape of the block, the size of the block, and / or the type of the color component.

[0528] For example, in Figure 7 , the direction prediction mode as shown by the dotted line can be applied only to the prediction for the non-square block.

[0529] For example, the larger the size of the block, the more the number of intra prediction modes. Alternatively, the larger the size of the block, the less the number of intra prediction modes. When the size of the block is 4x4 or 8x8, the number of intra prediction modes can be 67. When the size of the block is 16x16, the number of intra prediction modes can be 35. When the size of the block is 32x32, the number of intra prediction modes can be 19. When the size of the block is 64x64, the number of intra prediction modes can be 7.

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

[0531] For example, in a vertical mode in which the mode value is 50, prediction can be performed in a vertical direction based on pixel values of reference samples. For example, in a horizontal mode in which the mode value is 18, prediction can be performed in a horizontal direction based on pixel values of reference samples.

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

[0533] An intra prediction mode located at the right side with respect to the vertical mode can be referred to as a "vertical-right side mode". An intra prediction mode located below the horizontal mode can be referred to as a "horizontal-down mode". For example, in Figure 7 , the intra prediction mode in which the mode value is one of 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, and 66 can be a vertical-right side mode. The intra prediction mode in which the mode value is one of 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, and 17 can be a horizontal-down mode.

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

[0535] The directional modes can include an angular mode. Among the plurality of intra prediction modes, the remaining modes other than the DC mode and the planar mode can be the directional modes.

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

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

[0538] In order to perform the intra prediction on the target block, a step of checking whether or not the samples included in the reconstructed neighboring blocks can be used as the reference samples of the target block can be performed. When there is a sample that cannot be used as the reference sample of the target block among the samples in the neighboring blocks, a value generated via interpolation and / or copying of at least one sample value among the samples included in the reconstructed neighboring blocks can replace the sample value of the sample that cannot be used as the reference sample. When the value generated via the copying and / or the interpolation replaces the sample value of the existing sample, the sample can be used as the reference sample of the target block.

[0539] When the intra prediction is used, a filter can be applied to at least one of the reference samples and the prediction samples based on at least one of the size of the target block and the intra prediction mode.

[0540] The type of the filter to be applied to at least one of the reference samples and the prediction samples can be different according to at least one of the intra prediction mode of the target block, the size of the target block, and the shape of the target block. The type of the filter can be classified according to one or more of the length of the filter tap, the value of the filter coefficient, and the filter strength. The length of the filter tap can indicate the number of the filter taps. Also, the number of the filter taps can indicate the length of the filter.

[0541] When the intra prediction mode is the planar mode, a weighted sum of the upper reference sample of the target block, the left reference sample of the target block, the upper right reference sample of the target block, and the lower left reference sample of the target block can be used to generate the sample value of the prediction target block according to the position of the prediction target sample in the prediction block when the prediction block of the target block is generated.

[0542] When the intra prediction mode is the DC mode, an average 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 a particular row or a particular column in the target block. The particular row can be one or more rows above the reference sample. The particular column can be one or more columns to the left of the reference sample.

[0543] When the intra prediction mode is the directional mode, the top reference sample, the left reference sample, the top-right reference sample, and / or the bottom-left reference sample of the target block can be used to generate the prediction block.

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

[0545] 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 information for the prediction can be entropy encoded / entropy decoded.

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

[0547] 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 the plurality of neighboring blocks can be signaled.

[0548] When the intra prediction modes of the target block and the neighboring blocks are not the same as each other, information about the intra prediction mode of the target block can be encoded and / or decoded using entropy encoding and / or entropy decoding.

[0549] Figure 8 is a diagram showing reference samples used in an intra prediction process.

[0550] Reconstructed reference samples used for intra prediction of a target block can include a bottom-left reference sample, a left reference sample, a top-left corner reference sample, a top reference sample, and a top-right reference sample.

[0551] For example, the left reference sample can denote a reconstructed reference pixel adjacent to the left side of the target block. The top reference sample can denote a reconstructed reference pixel adjacent to the top of the target block. The top-left corner reference sample can denote a reconstructed reference pixel located at the top-left corner of the target block. The bottom-left reference sample can denote a reference sample among samples located on the same line as a left-side sample line composed of the left reference sample, which is located below the left-side sample line. The top-right reference sample can denote a reference sample among samples located on the same line as an upper sample line composed of the top reference sample, which is located to the right of the upper sample line.

[0552] When the size of the target block is NxN, the number of the bottom-left reference samples, the left reference samples, the top reference samples, and the top-right reference samples can each be N.

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

[0554] The reference samples used for intra prediction on the target block can vary depending on the intra prediction mode of the target block. The direction of the intra prediction mode can represent a dependency between the reference samples and the pixels of the prediction block. For example, the value of a specified reference sample can 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 can be samples and pixels that are located on a straight line in the direction of the intra prediction mode. In other words, the value of the specified reference sample can be copied as the value of a pixel located in the direction opposite to the direction of the intra prediction mode. Alternatively, the value of a pixel in the prediction block can be the value of a reference sample located in the direction of the intra prediction mode relative to the position of the pixel.

[0555] In an example, when the intra prediction mode of the target block is a vertical mode, the top reference samples can be used for intra prediction. When the intra prediction mode is a vertical mode, the value of a pixel in the prediction block can be the value of a reference sample vertically located above the position of the pixel. Thus, the top reference samples adjacent to the top of the target block can be used for intra prediction. Furthermore, the values of the pixels in a row of the prediction block can be the same as the values of the pixels of the top reference samples.

[0556] In an example, when the intra prediction mode of the target block is a horizontal mode, the left reference samples can be used for intra prediction. When the intra prediction mode is a horizontal mode, the value of a pixel in the prediction block can be the value of a reference sample horizontally located to the left of the position of the pixel. Thus, the left reference samples adjacent to the left of the target block can be used for intra prediction. Furthermore, 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 samples.

[0557] In an example, when the mode value of the intra prediction mode of the current block is 34, at least some of the left reference samples, the top-left corner reference sample, and at least some of the top reference samples can be used for intra prediction. When the mode value of the intra prediction mode is 34, the value of a pixel in the prediction block can be the value of a reference sample diagonally located at the top-left corner of the pixel.

[0558] Furthermore, in the case of the intra prediction mode whose mode value is a value ranging from 52 to 66, at least some of the top-right reference samples can be used for intra prediction.

[0559] Further, in case of the intra prediction mode whose mode value is a value ranging from 2 to 17, at least some of the left-bottom reference samples can be used for the intra prediction.

[0560] Further, in case of the intra prediction mode whose mode value is a value ranging from 19 to 49, the top-left corner reference sample can be used for the intra prediction.

[0561] The number of reference samples used for determining the pixel value of one pixel in the prediction block can be 1 or 2 or more.

[0562] As described above, the pixel value of a pixel in the prediction block can be determined according to 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 positions can be used for determining the pixel value of the pixel in the prediction block.

[0563] 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 based on two reference samples closest to the position of the reference sample can be generated. The value of the interpolated reference sample can be used for determining 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 interpolation based on the values of the two samples can be generated.

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

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

[0566] For example, in case of the directional intra prediction, the longer the distance between the pixels of the prediction block and the reference samples, the greater the prediction error that can occur. Such a prediction error can cause discontinuity between the generated prediction block and the neighboring blocks.

[0567] In order to reduce the prediction error, a filtering operation for the prediction block can be used. The filtering operation can be configured to adaptively apply a filter to the area of the prediction block that is considered to have a greater prediction error. For example, the area that is considered to have a greater prediction error can be the boundary of the prediction block. Further, the area of the prediction block that is considered to have a greater prediction error can be different according to the intra prediction mode, and the characteristics of the filter can also be different according to the intra prediction mode.

[0568] AsFigure 8 For intra prediction of the target block, at least one of the reference lines 0 to 3 can be used.

[0569] In Figure 8 Each of the reference lines in the reference line set can indicate a reference sample line including one or more reference samples. When the number of the reference line is smaller, the reference sample line closer to the target block can be indicated.

[0570] The samples in the segment A and the segment F can be obtained by padding, instead of from the reconstructed neighboring blocks, where the padding uses the samples in the segment B and the segment E closest to the target block.

[0571] Index information indicating the reference sample line to be used for the intra prediction of the target block can be signaled. The index information can indicate the reference sample line among the plurality of reference sample lines to be used for the intra prediction of the target block. For example, the index information can have a value corresponding to any one of 0 to 3.

[0572] When the upper boundary of the target block is a boundary of the CTU, only the reference sample line 0 can be available. Thus, in this case, the index information can not be signaled. When an additional reference sample line other than the reference sample line 0 is used, the filtering of the prediction block to be described later can not be performed.

[0573] In the case of inter-color intra prediction, the prediction block of the target block of the second color component can be generated based on the corresponding reconstructed block of the first color component.

[0574] For example, the first color component can be a luma component, and the second color component can be a chroma component.

[0575] To perform the inter-color intra prediction, parameters of a linear model between the first color component and the second color component can be derived based on a template.

[0576] The template can include reference samples above the target block (upper reference samples) and / or reference samples to the left of the target block (left reference samples), and can include upper reference samples and / or left reference samples of the reconstructed block of the first color component corresponding to the reference samples.

[0577] For example, the parameters of the linear model can be derived using the following values: 1) a value of a sample of the first color component having a maximum value among the samples in the template, 2) a value of a sample of the second color component corresponding to the sample of the first color component, 3) a value of a sample of the first color component having a minimum value among the samples in the template, and 4) a value of a sample of the second color component corresponding to the sample of the first color component.

[0578] When the parameters of the linear model are derived, a prediction block of the target block can be generated by applying the corresponding reconstructed block to the linear model.

[0579] According to the image format, sub-sampling can be performed on the samples neighboring the reconstructed block of the first color component and the corresponding reconstructed block of the first color component. For example, when one sample of the second color component corresponds to four samples of the first color component, one corresponding sample can be calculated by performing sub-sampling on the four samples of the first color component. When sub-sampling is performed, the derivation of the parameters of the linear model and the inter-color intra prediction can be performed based on the corresponding sample that is sub-sampled.

[0580] Information about whether to perform the inter-color intra prediction and / or the range of the template can be signaled in the intra prediction mode.

[0581] The target block can be partitioned into two or four sub-blocks in a horizontal direction and / or a vertical direction.

[0582] The sub-blocks generated by the partitioning can be reconstructed sequentially. That is, when intra prediction is performed on each sub-block, a sub-prediction block of the sub-block can be generated. In addition, when dequantization (inverse quantization) and / or inverse transformation are performed on each sub-block, a sub-residual block for the corresponding sub-block can be generated. The reconstructed sub-block can be generated by adding the sub-prediction block to the sub-residual block. The reconstructed sub-block can be used as a reference sample for the intra prediction of a sub-block having a next priority.

[0583] The sub-block can be a block including a certain number (e.g., 16) or more samples. For example, when the target block is an 8×4 block or a 4×8 block, the target block can be partitioned into two sub-blocks. In addition, when the target block is a 4×4 block, the target block cannot be partitioned into sub-blocks. When the target block has another size, the target block can be partitioned into four sub-blocks.

[0584] Information about whether to perform the intra prediction based on the sub-blocks and / or information about the partitioning direction (horizontal direction or vertical direction) can be signaled.

[0585] Such sub-block-based intra prediction can be limited so that it is performed only when the reference sample line 0 is used. When the sub-block-based intra prediction is performed, filtering of a prediction block, which will be described below, can not be performed.

[0586] A final prediction block can be generated by performing filtering on the prediction block generated via the intra prediction.

[0587] The filtering can be performed by applying a certain weight to a filtering target sample, a left reference sample, an upper reference sample, and / or a top-left reference sample, which are targets to be filtered.

[0588] The weight for filtering and / or the reference sample (e.g., the range of the reference sample, the position of the reference sample, etc.) can be determined based on at least one of the block size, the intra prediction mode, and the position of the filtered target sample in the prediction block.

[0589] For example, the filtering can be performed only in a certain intra prediction mode (e.g., a DC mode, a planar mode, a vertical mode, a horizontal mode, a diagonal mode, and / or a neighboring diagonal mode).

[0590] The neighboring diagonal mode can be a mode having a number obtained by adding k to the number of the diagonal mode, and can be a mode having a number obtained by subtracting k from the number of the diagonal mode. In other words, the number of the neighboring diagonal mode can be a sum of the number of the diagonal mode and k, or can be a difference between the number of the diagonal mode and k. For example, k can be a positive integer of 8 or less.

[0591] The intra prediction mode of the target block can be derived using the intra prediction modes of the neighboring blocks present around the target block, and the derived intra prediction mode can be entropy encoded and / or entropy decoded.

[0592] For example, when the intra prediction mode of the target block is the same as the intra prediction modes of the neighboring blocks, a certain flag information can be used to signal information indicating that the intra prediction mode of the target block is the same as the intra prediction modes of the neighboring blocks.

[0593] Further, for example, indicator information of the neighboring blocks in which the intra prediction mode is the same as the intra prediction mode of the target block can be signaled among the intra prediction modes of the plurality of neighboring blocks.

[0594] For example, when the intra prediction mode of the target block is different from the intra prediction modes of the neighboring blocks, information about the intra prediction mode of the target block can be entropy encoded and / or entropy decoded by performing entropy encoding and / or entropy decoding based on the intra prediction modes of the neighboring blocks.

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

[0596] Figure 9 The rectangles shown in FIG. 1 can represent images (or pictures). Further, in FIG. 1, arrows can represent prediction directions. An arrow pointing from a first picture to a second picture indicates that the second picture refers to the first picture. That is, each image can be encoded and / or decoded according to the prediction direction. Figure 9 In FIG. 1, arrows can represent prediction directions. An arrow pointing from a first picture to a second picture indicates that the second picture refers to the first picture. That is, each image can be encoded and / or decoded according to the prediction direction.

[0597] Pictures can be classified into Intra Picture (I-picture), uni-predicted picture or predictively coded picture (P-picture), and bi-predicted picture or bi-predictively coded picture (B-picture) according to a coding type. Each picture can be coded and / or decoded according to the coding type of each picture.

[0598] When a target picture, which is a target to be coded, is an I-picture, the target picture can be coded using data included in the picture itself without inter prediction referring to other pictures. For example, an I-picture can be coded via intra prediction only.

[0599] When a target picture is a P-picture, the target picture can be coded via inter prediction using a reference picture existing in one direction. Here, the one direction can be a forward direction or a backward direction.

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

[0601] P-pictures and B-pictures coded and / or decoded using reference pictures can be regarded as pictures using inter prediction.

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

[0603] Inter prediction or motion compensation can be performed using a reference picture and motion information.

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

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

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

[0607] A spatial candidate can be a reconstructed block neighboring the target block in space.

[0608] The temporal candidate can be a reconstructed block corresponding to the target block in a collocated picture (col picture) that is reconstructed previously.

[0609] In inter prediction, the encoding apparatus 100 and the decoding apparatus 200 can improve encoding efficiency and decoding efficiency by using motion information of the spatial candidate and / or the 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".

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

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

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

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

[0614] Inter 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 prediction can generate a prediction block for the target block using the selected reference block.

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

[0616] The spatial candidate can be a block that 1) exists in the target picture, 2) has been reconstructed previously via encoding and / or decoding, and 3) is adjacent to the target block or located at a corner of the target block. Here, the "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, the "block located at a corner of the target block" can have the same meaning as the "block adjacent to a corner of the target block". The meaning of the "block located at a corner of the target block" can be included in the meaning of the "block adjacent to the target block".

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

[0618] Each of the encoding apparatus 100 and the decoding apparatus 200 can identify a block existing in the col picture in a position corresponding to the target block in space. 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.

[0619] Each of the encoding apparatus 100 and the decoding apparatus 200 can determine a col block existing at a pre-defined related position for the identified block as a temporal candidate. The pre-defined related position can be a position existing inside and / or outside the identified block.

[0620] For example, the col block can 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 with (nPSW, nPSH), the first col block can be a block located at coordinates (xP + nPSW, yP + nPSH). The second col block can be a block located at coordinates (xP + (nPSW >> 1), yP + (nPSH >> 1)). When the first col block is not available, the second col block can be selectively used.

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

[0622] The ratio of the motion vector of the target block with respect to the motion vector of the col block can be the same as the ratio of the first temporal distance with respect to the second temporal distance. The first temporal distance can be the distance between the reference picture and the target picture of the target block. The second temporal distance can be the distance between the reference picture and the col picture of the col block.

[0623] The scheme for deriving the motion information can vary according to the inter prediction mode of the target block. For example, as the inter prediction mode applied to inter prediction, there can be an advanced motion vector predictor (AMVP) mode, a merge mode, a skip mode, a merge mode with motion vector difference, a sub-block merge mode, a triangle partition mode, an inter-intra combined prediction mode, an affine inter mode, a current picture reference mode, etc. The merge mode can also be referred to as a "motion merge mode". Each mode will be described in detail below.

[0624] 1) AMVP mode

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

[0626] 1-1) Creation of a list of prediction motion vector candidates

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

[0628] Hereinafter, the terms "prediction motion vector (candidate)" and "motion vector (candidate)" can be used with the same meaning and can be used interchangeably with each other.

[0629] Hereinafter, the terms "prediction motion vector candidate" and "AMVP candidate" can be used with the same meaning and can be used interchangeably with each other.

[0630] Hereinafter, the terms "prediction motion vector candidate list" and "AMVP candidate list" can be used with the same meaning and can be used interchangeably with each other.

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

[0632] The temporal candidate can include a col block and a block neighboring the col block. In other words, a motion vector of the col block or a motion vector of the block neighboring the col block can be referred to as a "temporal prediction motion vector candidate".

[0633] The zero vector can be a (0, 0) motion vector.

[0634] The prediction motion vector candidate can be a motion vector predictor used for predicting a motion vector. Furthermore, in the encoding device 100, each prediction motion vector candidate can be an initial search position for a motion vector.

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

[0636] The encoding apparatus 100 can determine a motion vector to be used for encoding the target block using a list of prediction motion vector candidates in a search range. Also, the encoding apparatus 100 can determine a prediction motion vector candidate to be used as a prediction motion vector of the target block among the prediction motion vector candidates existing in the list of prediction motion vector candidates.

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

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

[0639] 1-3) Transmission of inter prediction information

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

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

[0642] Hereinafter, the terms "prediction motion vector index" and "AMVP index" can be used with the same meaning and can be used interchangeably with each other.

[0643] Also, the inter prediction information can include a residual signal.

[0644] When the mode information indicates that the AMVP mode is used, the decoding apparatus 200 can acquire the prediction motion vector index, the MVD, the reference direction, and the reference picture index from the bitstream through entropy decoding.

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

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

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

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

[0649] The encoding apparatus 100 can generate an entropy-encoded prediction motion vector index by applying entropy encoding to the prediction motion vector index, and can generate a bitstream including the entropy-encoded prediction motion vector index. The entropy-encoded prediction motion vector index can be signaled from the encoding apparatus 100 to the decoding apparatus 200 through the bitstream. The decoding apparatus 200 can extract the entropy-encoded prediction motion vector index from the bitstream, and can acquire the prediction motion vector index by applying entropy decoding to the entropy-encoded prediction motion vector index.

[0650] The motion vector actually to be used for inter-predicting the target block can not match the prediction motion vector. To indicate a difference between the motion vector actually to be used for inter-predicting the target block and the prediction motion vector, an MVD can be used. The encoding apparatus 100 can derive the prediction motion vector similar to the motion vector actually to be used for inter-predicting the target block so as to use the smallest MVD possible.

[0651] A motion vector difference (MVD) can be a difference between a motion vector of a target block and a prediction motion vector. The encoding apparatus 100 can calculate the MVD, and can generate an entropy-encoded MVD by applying entropy encoding to the MVD. The encoding apparatus 100 can generate a bitstream including the entropy-encoded MVD.

[0652] The MVD can be transmitted from the encoding apparatus 100 to the decoding apparatus 200 through the bitstream. The decoding apparatus 200 can extract the entropy-encoded MVD from the bitstream, and can acquire the MVD by applying entropy decoding to the entropy-encoded MVD.

[0653] The decoding apparatus 200 can derive the motion vector of the target block by summing the MVD and the prediction motion vector. In other words, the motion vector of the target block derived by the decoding apparatus 200 can be a sum of the MVD and the motion vector candidate.

[0654] In addition, the encoding apparatus 100 can generate an entropy-encoded MVD resolution information by applying entropy encoding to the calculated MVD resolution information, and can generate a bitstream including the entropy-encoded MVD resolution information. The decoding apparatus 200 can extract the entropy-encoded MVD resolution information from the bitstream, and can acquire the MVD resolution information by applying entropy decoding to the entropy-encoded MVD resolution information. The decoding apparatus 200 can adjust the resolution of the MVD using the MVD resolution information.

[0655] In addition, the encoding device 100 can calculate the MVD based on the affine model. The decoding device 200 can derive the affine control motion vectors of the target block by the sum of the MVD and the affine control motion vector candidates, and can derive the motion vectors of the sub-blocks using the affine control motion vectors.

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

[0657] The reference direction indicates only a list of reference pictures to be used for predicting the target block, and can not mean that the direction of the reference pictures is restricted to a forward direction or a backward direction. In other words, each of the reference picture list L0 and the reference picture list L1 can include pictures in the forward direction and / or the backward direction.

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

[0659] The reference picture index can indicate a reference picture for predicting the target block among the reference pictures existing in the reference picture list. The encoding device 100 can generate an entropy-encoded reference picture index by applying entropy encoding to the reference picture index, and can generate a bitstream including the entropy-encoded reference picture index. The entropy-encoded reference picture index can be signaled from the encoding device 100 to the decoding device 200 through the bitstream. The decoding device 200 can extract the entropy-encoded reference picture index from the bitstream, and can acquire the reference picture index by applying entropy decoding to the entropy-encoded reference picture index.

[0660] 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, it can be that the target block specifies two prediction blocks. For example, a (final) prediction block of the target block can be generated using an average or a weighted sum of the two prediction blocks for the target block.

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

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

[0663] Since the prediction motion vector index and the MVD are coded, and the motion vector of the target block itself is not coded, the number of bits transmitted from the encoding device 100 to the decoding device 200 can be reduced, and the coding efficiency can be improved.

[0664] For the target block, the motion information of the reconstructed neighboring block can be used. In a certain inter prediction mode, the encoding device 100 can not code the actual motion information of the target block separately. The motion information of the target block is not coded, but additional information can be coded, which enables the motion information of the target block to be derived using the motion information of the reconstructed neighboring block. Since the additional information is coded, the number of bits transmitted to the decoding device 200 can be reduced, and the coding efficiency can be improved.

[0665] For example, as the inter prediction mode in which the motion information of the target block is not directly coded, there can be a skip mode and / or a merge mode. Here, each of the encoding device 100 and the decoding device 200 can use an identifier and / or an index indicating a unit among the reconstructed neighboring units whose motion information is to be used as the motion information of the target unit.

[0666] 2) Merge mode

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

[0668] When using the merge mode, the encoding device 100 can predict the motion information of the target block using the motion information of a spatial candidate and / or the motion information of a temporal candidate. The spatial candidate can include reconstructed spatial neighboring blocks adjacent to the target block in space. The spatial neighboring blocks can include a left neighboring block and an above neighboring block. The temporal candidate can include a col block. The terms "spatial candidate" and "spatial merge candidate" can be used to have the same meaning and can be used interchangeably with each other. The terms "temporal candidate" and "temporal merge candidate" can be used to have the same meaning and can be used interchangeably with each other.

[0669] The encoding device 100 can acquire a prediction block via prediction. The encoding device 100 can code a residual block that is a difference between the target block and the prediction block.

[0670] 2-1) Creation of a list of merge candidates

[0671] When using the merge mode, each of the encoding apparatus 100 and the decoding apparatus 200 can create a merge candidate list using motion information of a spatial candidate and / or motion information of a temporal candidate. The motion information can include 1) a motion vector, 2) a reference picture index, and 3) a reference direction. The reference direction can be uni-directional or bi-directional. The reference direction can indicate an inter prediction indicator.

[0672] The merge candidate list can include a merge candidate. The merge candidate can be motion information. In other words, the merge candidate list can be a list in which a plurality of pieces of motion information is stored.

[0673] The merge candidate can be motion information of a plurality of temporal candidates and / or spatial candidates. In other words, the merge candidate list can include motion information of a temporal candidate and / or a spatial candidate, etc.

[0674] In addition, the merge candidate list can include a new merge candidate generated by combining the merge candidates already existing in the merge candidate list. In other words, the merge candidate list can include new motion information generated by combining a plurality of pieces of motion information previously existing in the merge candidate list.

[0675] In addition, the merge candidate list can include a history-based merge candidate. The history-based merge candidate can be motion information of a block that is encoded and / or decoded before a target block.

[0676] In addition, the merge candidate list can include a merge candidate based on an average of two merge candidates.

[0677] The merge candidate can be a specific mode of deriving inter prediction information. The merge candidate can be information indicating a specific mode of deriving inter prediction information. The inter prediction information of a target block can be derived according to the specific mode indicated by the merge candidate. In addition, the specific mode can include a process of deriving a series of inter prediction information. Such a specific mode can be an inter prediction information derivation mode or a motion information derivation mode.

[0678] The inter prediction information of the target block can be derived according to a mode indicated by a merge candidate selected among the merge candidates in the merge candidate list through a merge index.

[0679] For example, the motion information derivation mode in the merge candidate list can be at least one of 1) a motion information derivation mode for a sub-block unit and 2) an affine motion information derivation mode.

[0680] In addition, the merge candidate list can include motion information of a zero vector. The zero vector can also be referred to as a "zero merge candidate".

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

[0682] The motion information can include 1) a motion vector, 2) a reference picture index, and 3) a reference direction. The reference direction can also be referred to as an "inter prediction indicator". The reference direction can be uni-directional or bi-directional. The uni-directional reference direction can indicate L0 prediction or L1 prediction.

[0683] The merge candidate list can be created before performing prediction in the merge mode.

[0684] The number of merge candidates in the merge candidate list can be predefined. Each of the encoding apparatus 100 and the decoding apparatus 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 apparatus 100 and the merge candidate list of the decoding apparatus 200 can be made identical to each other using the predefined scheme and the predefined priority.

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

[0686] 2-2) Search for a motion vector using the list of merge candidates

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

[0688] In addition, the encoding apparatus 100 can determine whether to encode a target block using the merge mode.

[0689] 2-3) Transmission of inter prediction information

[0690] The encoding apparatus 100 can generate a bitstream including inter prediction information required for inter prediction. The encoding apparatus 100 can generate entropy-encoded inter prediction information by performing entropy encoding on the inter prediction information, and can transmit the bitstream including the entropy-encoded inter prediction information to the decoding apparatus 200. The entropy-encoded inter prediction information can be signaled by the encoding apparatus 100 to the decoding apparatus 200 through the bitstream. The decoding apparatus 200 can extract the entropy-encoded inter prediction information from the bitstream, and can acquire the inter prediction information by applying entropy decoding to the entropy-encoded inter prediction information.

[0691] The decoding apparatus 200 can perform inter prediction on the target block using the inter prediction information of the bitstream.

[0692] The inter prediction information can include 1) mode information indicating whether a merge mode is used, 2) a merge index, and 3) correction information.

[0693] In addition, the inter prediction information can include a residual signal.

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

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

[0696] The merge index can indicate a merge candidate to be used for prediction of the target block among the merge candidates included in the merge candidate list. Alternatively, the merge index can indicate a block to be merged with the target block among neighboring blocks spatially or temporally adjacent to the target block.

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

[0698] The correction information can be information for correcting a motion vector. The encoding apparatus 100 can generate the correction information. The decoding apparatus 200 can correct a motion vector of a merge candidate selected by the merge index based on the correction information.

[0699] The correction information can include at least one of information indicating whether correction is to be performed, correction direction information, and correction size information. A prediction mode in which a motion vector is corrected based on the signaled correction information can be referred to as a "merge mode with a motion vector difference."

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

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

[0702] A motion vector of the target block can be specified by a motion vector, a reference picture index, and a reference direction of the merge candidate indicated by the merge index.

[0703] 3) Skip mode

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

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

[0706] When the skip mode is used, the encoding apparatus 100 can transmit information about a block, among blocks that are spatial candidates or temporal candidates, whose motion information is to be used as motion information of the target block, to the decoding apparatus 200 through a bitstream. The encoding apparatus 100 can generate entropy-encoded information by performing entropy encoding on the information, and can signal the entropy-encoded information to the decoding apparatus 200 through the bitstream. The decoding apparatus 200 can extract the entropy-encoded information from the bitstream, and can acquire the information by applying entropy decoding to the entropy-encoded information.

[0707] Also, when the skip mode is used, the encoding apparatus 100 can not transmit other syntax information, such as an MVD, to the decoding apparatus 200. For example, when the skip mode is used, the encoding apparatus 100 can not signal syntax elements related to at least one of an MVD, a coded block flag, and a transform coefficient level, to the decoding apparatus 200.

[0708] 3-1) Creation of a list of merge candidates

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

[0710] Alternatively, the skip mode can use an additional candidate list different from the candidate list of the merge mode. In this case, in the following description, the merge candidate list and the merge candidate can be replaced with a skip candidate list and a skip candidate, respectively.

[0711] A merge candidate list can be created before performing prediction in skip mode.

[0712] 3-2) Search for a motion vector using the list of merge candidates

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

[0714] In addition, the encoding apparatus 100 can determine whether to encode the target block using skip mode.

[0715] 3-3) Transmission of inter prediction information

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

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

[0718] The skip index can be the same as the merge index described above.

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

[0720] The decoding apparatus 200 can acquire the skip index from the bitstream only when the mode information indicates that skip mode is used. As described above, the merge index and the skip index can be the same as each other. The decoding apparatus 200 can acquire the skip index from the bitstream only when the mode information indicates that merge mode or skip mode is used.

[0721] The skip index can indicate a merge candidate to be used for prediction on the target block among the merge candidates included in the merge candidate list.

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

[0723] The decoding apparatus 200 can 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.

[0724] A motion vector of the target block can be specified by a motion vector, a reference picture index, and a reference direction of the merge candidate indicated by the skip index.

[0725] 4) Current picture reference mode

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

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

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

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

[0730] For example, the fixed position can be a position in which a value of the reference picture index is 0 or a last position.

[0731] When the target picture exists in an arbitrary position in the reference picture list, an additional reference picture index indicating such an arbitrary position can be signaled by the encoding device 100 to the decoding device 200.

[0732] 5) Sub-block merge mode

[0733] The sub-block merge mode can be a mode in which motion information is derived from sub-blocks of a CU.

[0734] When the sub-block merge mode is applied, a col-sub-block of a target sub-block in a reference image (i.e., a temporal merge candidate based on a sub-block) and / or an affine control point motion vector merge candidate can be used to generate a sub-block merge candidate list.

[0735] 6) Triangular partition mode

[0736] In the triangular partitioning mode, a target block can be partitioned in a diagonal direction, and sub-target blocks generated by the partitioning can be generated. For each sub-target block, motion information of the corresponding sub-target block can be derived, and a prediction sample of each sub-target block can be derived using the derived motion information. A prediction sample of the target block can be derived by a weighted sum of the prediction samples of the sub-target blocks generated by the partitioning.

[0737] 7) Combined inter-intra prediction mode

[0738] The combined inter-intra prediction mode can be a mode in which a prediction sample of a target block is derived using a weighted sum of a prediction sample generated via inter prediction and a prediction sample generated via intra prediction.

[0739] In the above-described mode, the decoding device 200 can autonomously correct the derived motion information. For example, the decoding device 200 can search for motion information having a minimum sum of absolute difference (SAD) in a certain region based on a reference block indicated by the derived motion information, and can derive the found motion information as corrected motion information.

[0740] In the above-described mode, the decoding device 200 can use optical flow to compensate for the prediction samples derived via inter prediction.

[0741] In the above-described AMVP mode, merge mode, skip mode, etc., index information of a list can be used to specify motion information among a plurality of pieces of motion information in the list to be used to predict a target block.

[0742] To improve coding efficiency, the encoding device 100 can signal only an index of an element in a list that generates a minimum cost in inter prediction of a target block. The encoding device 100 can code the index, and can signal the coded index.

[0743] Therefore, it must be possible to derive the above-described lists (i.e., the prediction motion vector candidate list and the merge candidate list) based on the same data using the same scheme by the encoding device 100 and the decoding device 200. Here, the same data can include a reconstructed picture and a reconstructed block. Further, to specify an element using an index, it is necessary to fix the order of elements in a list.

[0744] Figure 10 A spatial candidate according to an embodiment is shown.

[0745] In Figure 10 A position of a spatial candidate is shown in

[0746] A large block at the center of the figure can represent a target block. Five small blocks can represent spatial candidates.

[0747] A coordinate of the target block can be (xP, yP), and a size of the target block can be represented by (nPSW, nPSH).

[0748] A spatial candidate A0 can be a block adjacent to a lower left corner of the target block. A0 can be a block that occupies a pixel located at a coordinate (xP-1, yP+nPSH).

[0749] A spatial candidate A1 can be a block adjacent to a left side of the target block. A1 can be a lowermost block among blocks adjacent to the left side of the target block. Alternatively, A1 can be a block adjacent to a top of A0. A1 can be a block that occupies a pixel located at a coordinate (xP-1, yP+nPSH-1).

[0750] The spatial candidate B0 can be a block adjacent to the top-left corner of the target block. B0 can be a block that occupies the pixel located at the coordinates (xP-1, yP-1).

[0751] The spatial candidate B1 can be a block adjacent to the top of the target block. B1 can be the rightmost block among the blocks adjacent to the top of the target block. Alternatively, B1 can be a block adjacent to the left side of B0. B1 can be a block that occupies the pixel located at the coordinates (xP+nPSW-1, yP-1).

[0752] The spatial candidate B2 can be a block adjacent to the top-left corner of the target block. B2 can be a block that occupies the pixel located at the coordinates (xP-1, yP-1).

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

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

[0755] Hereinafter, the candidate block can include the spatial candidate and the temporal candidate.

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

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

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

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

[0760] Step 4) When the prediction mode of the PU including the candidate block is an intra prediction mode, the availability of the candidate block can be set to "false". When the PU including the candidate block does not use inter prediction, the availability of the candidate block can be set to "false".

[0761] Figure 11 An order of adding the motion information of the spatial candidate to the merge list according to an embodiment is shown.

[0762] As Figure 11As shown in the above Table 1, when the pieces of motion information of the spatial candidates are added to the merge list, the order of A1, B1, B0, A0, and B2 can be used. That is, the pieces of motion information of the available spatial candidates can be added to the merge list in the order of A1, B1, B0, A0, and B2.

[0763] Method for deriving a merge list in merge and skip modes

[0764] 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 transmitted from the encoding apparatus 100 to the decoding apparatus 200. The slice header of a slice can include N. In other words, the maximum number of merge candidates in the merge list for a target block of a slice can be set through the slice header. For example, the value of N can be basically 5.

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

[0766] Step 1) Among the spatial candidates, the available spatial candidates can be added to the merge list. The pieces of motion information of the available spatial candidates can be added to the merge list in the order shown in the above Table 1. 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 can 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". Figure 11

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

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

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

[0770] The target slice can be a slice including a target block.

[0771] The combined motion information can be a combination of L0 motion information and L1 motion information. The L0 motion information can be motion information referring to only an L0 reference picture list. The L1 motion information can be motion information referring to only an L1 reference picture list.​

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

[0773] The combined motion information can include one or more pieces of combined motion information. When the combined motion information is generated, 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 to be used in a step of generating the combined motion information can be defined in advance. The one or more pieces of combined motion information can be generated in a predefined order via combined bi-prediction using a pair of different motion information in the merge list. One motion information in the pair of different motion information can be L0 motion information, and the other motion information in the pair of different motion information can be L1 motion information.

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

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

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

[0777] The zero vector motion information can be motion information in which a motion vector is a zero vector.

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

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

[0780] The reference direction of the zero vector motion information can be bidirectional. Both of the motion vectors can be zero vectors. The number of the zero vector motion information can be the smaller one of the number of the reference pictures in the reference picture list L0 and the number of the reference pictures in the reference picture list L1. Alternatively, when the number of the reference pictures in the reference picture list L0 and the number of the reference pictures in the reference picture list L1 are not the same as each other, the reference direction as unidirectional can be used for the reference picture index which can be applied to only a single reference picture list.

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

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

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

[0784] Method for deriving a list of prediction motion vector candidates in AMVP mode

[0785] A maximum number of the prediction motion vector candidates in the prediction 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.

[0786] The multiple pieces of motion information (i.e., the prediction motion vector candidates) can be added to the prediction motion vector candidate list in the order of the following steps 1) to 3).

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

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

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

[0790] The maximum number of pieces of motion information to be added can be N.

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

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

[0793] The zero vector motion information can include one or more pieces of zero vector motion information. The reference picture indexes of the one or more pieces of zero vector motion information can be different from each other.

[0794] The encoding apparatus 100 and / or the decoding apparatus 200 can sequentially add the pieces of zero vector motion information to the prediction motion vector candidate list while changing the reference picture indexes.

[0795] When the zero vector motion information overlaps with other motion information already existing in the prediction motion vector candidate list, the zero vector motion information can not be added to the prediction motion vector candidate list.

[0796] The above description of the zero vector motion information made in connection with the merge list can also be applied to the zero vector motion information. The repetitive description thereof will be omitted.

[0797] The order of the above-described steps 1) to 3) is only exemplary and can be changed. In addition, some of the steps can be omitted according to a predefined condition.

[0798] Figure 12 A transform and quantization process according to an example is illustrated.

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

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

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

[0802] A transform kernel for the transform can include various DCT kernels such as a discrete cosine transform (DCT) type 2 (DCT-II) and a discrete sine transform (DST) kernel.

[0803] The transform kernels can perform a separable transform or a two-dimensional (2D) non-separable transform on the residual signal. The separable transform can refer to a transform that performs a one-dimensional (1D) transform on the residual signal in each of a horizontal direction and a vertical direction.

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

[0805] Table 3

[0806] Set of transforms Transform candidate 0 DST-VII, DCT-VIII 1 DST-VII, DST-I 2 DST-VII, DCT-V

[0807] Table 4

[0808] Set of transforms Transform candidate 0 DST-VII, DCT-VIII, DST-I 1 DST-VII, DST-I, DCT-VIII 2 DST-VII, DCT-V, DST-I

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

[0810] Table 5 below shows an example of a transform set to be applied to a horizontal direction and a transform set to be applied to a vertical direction according to an intra prediction mode.

[0811] Table 5

[0812]

[0813]

[0814] In Table 5, the numbers of the vertical transform set and the horizontal transform set to be applied to the horizontal direction of the residual signal according to the intra prediction mode of the target block are shown.

[0815] As Fig. 4 and Fig. 5As illustrated in the middle, a set of transforms 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 apparatus 100 can perform the transform and the inverse transform on the residual signal using a transform included in the set of transforms corresponding to the intra prediction mode of the target block. Also, the decoding apparatus 200 can perform the inverse transform on the residual signal using a transform included in the set of transforms corresponding to the intra prediction mode of the target block.

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

[0817] For example, when the size of the target block is 64x64, a set of transforms each having three transforms can be configured according to the intra prediction mode. An optimal transform method can be selected from a total of nine multi-transform methods generated by combinations of three transforms in the horizontal direction and three transforms in the vertical direction. Through such an optimal transform method, the residual signal can be encoded and / or decoded, and thus the encoding efficiency can be improved.

[0818] Here, information indicating which one of a plurality of transforms belonging to each set of transforms has been used for at least one of the vertical transform and the horizontal transform can be entropy encoded and / or entropy decoded. Here, truncated unary binarization can be used to encode and / or decode such information.

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

[0820] The transform can include at least one of a first transform and a secondary transform. A transform coefficient can be generated by performing the first transform on the residual signal, and a secondary transform coefficient can be generated by performing the secondary transform on the transform coefficient.

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

[0822] The secondary transform can be a transform for improving the energy concentration of the transform coefficient generated by the first transform. Like the first transform, the secondary transform can be a separable transform or a non-separable transform. Such a non-separable transform can be a non-separable secondary transform (NSST).

[0823] The first transform can be performed using at least one of a plurality of predefined transform methods. For example, the predefined plurality of transform methods can include a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loeve transform (KLT), etc.

[0824] Further, the first transform can be a transform having various types according to a kernel function defining a discrete cosine transform (DCT) or a discrete sine transform (DST).

[0825] For example, the transform type can be determined based on at least one of 1) a prediction mode of the target block (e.g., one of intra prediction and inter prediction), 2) a size of the target block, 3) a shape of the target block, 4) an intra prediction mode of the target block, 5) a component of the target block (e.g., one of a luma component and a chroma component), and 6) a partition type applied to the target block (e.g., one of a quad tree, a binary tree, and a ternary tree).

[0826] For example, the first transform can include transforms such as DCT-2, DCT-5, DCT-7, DST-7, DST-1, DST-8, and DCT-8 according to the transform kernels presented in Table 6 below. In Table 6 below, various transform types and transform kernel functions for multiple transform selection (MTS) are exemplified.

[0827] The MTS can refer to a selection of a combination of one or more DCT and / or DST kernels in order to transform a residual signal in a horizontal and / or vertical direction.

[0828] Table 6

[0829]

[0830] In Table 6, i and j can be integer values equal to or greater than 0 and less than or equal to N-1.

[0831] A secondary transform can be performed on the transform coefficients generated by performing the first transform.

[0832] As in the first transform, a transform set can also be defined in the secondary transform. The method for deriving and / or determining the above-described transform set can be applied not only to the first transform but also to the secondary transform.

[0833] The first transform and the secondary transform can be determined for a specific target.

[0834] For example, the first transform and the secondary transform can be applied to a signal component corresponding to one or more of a luma component and a chroma component. Whether to apply the first transform and / or the secondary transform can be determined according to at least one of coding parameters for the target block and / or a neighboring block. For example, whether to apply the first transform and / or the secondary transform can be determined according to a size and / or a shape of the target block.

[0835] In the encoding device 100 and the decoding device 200, transform information indicating a transform method to be used for a target can be derived by utilizing the specified information.

[0836] For example, the transform information can include a transform index to be used for the primary transform and / or the secondary transform. Alternatively, the transform information can indicate that the primary transform and / or the secondary transform is not used.

[0837] For example, when the target of the primary transform and the secondary transform is a target block, a transform method indicated by the transform information to be applied to the primary transform and / or the secondary transform can be determined according to at least one of coding parameters for the target block and / or a block neighboring the target block.

[0838] Alternatively, the transform information indicating a transform method for a specific target can be signaled from the encoding device 100 to the decoding device 200.

[0839] For example, for a single CU, whether to use the primary transform, an index indicating the primary transform, whether to use the secondary transform, and an index indicating the secondary transform can be derived as the transform information by the decoding device 200. Alternatively, for a single CU, the transform information indicating whether to use the primary transform, an index indicating the primary transform, whether to use the secondary transform, and an index indicating the secondary transform can be signaled.

[0840] Quantized transform coefficients (i.e., quantized levels) can be generated by performing quantization on a result generated by performing the first transform and / or the secondary transform or performing quantization on the residual signal.

[0841] Fig. 13 A diagonal scan according to an example is shown.

[0842] Fig. 14 A horizontal scan according to an example is shown.

[0843] Fig. 15 A vertical scan according to an example is shown.

[0844] The quantized transform coefficients can be scanned via at least one of a (top right) diagonal scan, a vertical scan, and a horizontal scan 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).

[0845] Each scan can be initiated at a specific starting point and can be terminated at a specific ending point.

[0846] For example, the quantized transform coefficients can be changed into a 1D vector form by scanning the coefficients of the block using a diagonal scan. Fig. 13 Alternatively, a horizontal scan or a vertical scan can be used according to the size of the block and / or the intra prediction mode, without using the diagonal scan. Fig. 14 Fig. 15 The vertical scan can be an operation of scanning the 2D block type coefficients in a column direction. The horizontal scan can be an operation of scanning the 2D block type coefficients in a row direction.

[0847] The vertical scan can be an operation of scanning the 2D block type coefficients in a column direction. The horizontal scan can be an operation of scanning the 2D block type coefficients in a row direction.

[0848] In other words, which one of the diagonal scan, the vertical scan, and the horizontal scan will be used can be determined according to the size of the block and / or the inter prediction mode.

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

[0850] 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 a minimum block size or a minimum block shape.

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

[0852] For example, as shown in Fig. 13 , Fig. 14 and Fig. 15 , when the size of the target block is 8x8, the quantized transform coefficients can be generated by a first transform, a secondary transform, and quantization of a residual signal of the target block. Thus, one of three types of scan orders can be applied to four 4x4 sub-blocks, and the quantized transform coefficients can also be scanned for each 4x4 sub-block according to the scan order.

[0853] The encoding apparatus 100 can generate entropy-encoded quantized transform coefficients by performing entropy encoding on the scanned quantized transform coefficients, and can generate a bitstream including the entropy-encoded quantized transform coefficients.

[0854] ​The decoding apparatus 200 can extract the entropy-encoded quantized transform coefficients from the bitstream and can generate the quantized transform coefficients by performing entropy-decoding on the entropy-encoded quantized transform coefficients. The quantized transform coefficients can be arranged in the form of 2D blocks via inverse scanning. Here, as a method of inverse scanning, at least one of a right-up diagonal scanning, a vertical scanning, and a horizontal scanning can be performed.

[0855] In the decoding apparatus 200, dequantization can be performed on the quantized transform coefficients. The result generated by performing the dequantization can be subjected to a secondary inverse transform according to whether the secondary inverse transform is performed. Further, the result generated by performing the secondary inverse transform can be subjected to a first inverse transform according to whether the first inverse transform is to be performed. The reconstructed residual signal can be generated by performing the first inverse transform on the result generated via the secondary inverse transform.

[0856] For the luminance component reconstructed via intra prediction or inter prediction, inverse mapping with dynamic range can be performed before loop filtering.

[0857] The dynamic range can be divided into 16 equal segments, and a mapping function of a corresponding segment can be signaled. Such a mapping function can be signaled at a slice level or a parallel tile group level.

[0858] An inverse mapping function for performing inverse mapping can be derived based on the mapping function.

[0859] Loop filtering, storage of a reference picture, and motion compensation can be performed in the inverse mapping region.

[0860] The prediction block generated via inter prediction can be transformed to the mapping region by using mapping of the mapping function, and the transformed prediction block can be used to generate a reconstructed block. However, since intra prediction is performed in the mapping region, the prediction block generated via intra prediction can be used to generate a reconstructed block without the need for mapping and / or inverse mapping.

[0861] For example, when the target block is a residual block of a chroma component, the residual block can be transformed to the inverse mapping region by scaling the chroma component of the mapping region.

[0862] Whether scaling is available can be signaled at a slice level or a parallel tile group level.

[0863] For example, scaling can be applied only to a case where mapping is available for a luminance component and a partition of the luminance component and a partition of a chroma component follow the same tree structure.

[0864] Scaling can be performed based on an average value of values of samples in a luminance prediction block corresponding to a chroma prediction block. Here, when the target block uses inter prediction, the luminance prediction block can denote a mapped luminance prediction block.

[0865] The values required for scaling can be derived by using an index reference lookup table of a segment to which an average value of sample values of the luma prediction block belongs.

[0866] The residual block can be transformed to the inverse mapping region by scaling the residual block using the finally derived values. Thereafter, for the blocks of the chroma components, the reconstruction, the intra prediction, the inter prediction, the loop filtering, and the storage of the reference picture can be performed in the inverse mapping region.

[0867] For example, information indicating whether mapping and / or inverse mapping of the luma component and the chroma component is available can be signaled by a sequence parameter set.

[0868] A prediction block of the target block can be generated based on a block vector. The block vector can indicate a displacement between the target block and a reference block. The reference block can be a block in a target picture.

[0869] In this way, a prediction mode in which the prediction block is generated by referring to the target picture can be referred to as an "intra block copy (IBC) mode".

[0870] The IBC mode can be applied to a CU having a certain size. For example, the IBC mode can be applied to a CU of MxN. Here, M and N can be less than or equal to 64.

[0871] The IBC mode can include a skip mode, a merge mode, an AMVP mode, etc. In the case of the skip mode or the merge mode, a merge candidate list can be configured, and a merge index is signaled, and thus a single merge candidate can be designated among the merge candidates present in the merge candidate list. A block vector of the designated merge candidate can be used as a block vector of the target block.

[0872] In the case of the AMVP mode, a differential block vector can be signaled. In addition, a prediction block vector can be derived from a left neighboring block and an upper neighboring block of the target block. In addition, an index indicating which neighboring block will be used can be signaled.

[0873] The prediction block in the IBC mode can be included in the target CTU or the left CTU, and can be limited to a block within a previously reconstructed region. For example, the value of the block vector can be limited such that the prediction block of the target block is located in a certain region. The certain region can be a region defined by three 64x64 blocks that are encoded and / or decoded before a 64x64 block including the target block. In this way, the value of the block vector is limited, and thus memory consumption and device complexity caused by implementation of the IBC mode can be reduced.

[0874] Fig. 16 is a configuration diagram of an encoding apparatus according to an embodiment.

[0875] The encoding apparatus 1600 can correspond to the encoding apparatus 100 described above.

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

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

[0878] The processing unit 1610 can generate and process signals, data, or information input to the encoding apparatus 1600, output from the encoding apparatus 1600, or used in the encoding apparatus 1600, and can 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 can be performed by the processing unit 1610.

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

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

[0881] The program modules can be physically stored in various types of well-known storage devices. Also, at least some of the program modules can be stored in a remote storage device capable of communicating with the encoding apparatus 1600.

[0882] The program modules can include, but are not limited to, routines, sub-routines, programs, objects, components, and data structures for performing functions or operations according to embodiments or for implementing abstract data types according to embodiments.

[0883] The program modules can be implemented using instructions or codes executed by at least one processor of the encoding apparatus 1600.

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

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

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

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

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

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

[0890] The communication related to the data or information of the encoding device 1600 can be performed by the communication unit 1620.

[0891] For example, the communication unit 1620 can transmit a bitstream to a decoding device 1700, which will be described later.

[0892] Fig. 17 is a configuration diagram of a decoding device according to an embodiment.

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

[0894] 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, which communicate with each other through a bus 1790. The decoding device 1700 can further include a communication unit 1720 connected to a network 1799.

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

[0896] The processing unit 1710 can generate and process signals, data, or information input to the decoding apparatus 1700, output from the decoding apparatus 1700, or used in the decoding apparatus 1700, and can 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 can be performed by the processing unit 1710.

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

[0898] At least some of the entropy decoding unit 210, the dequantization unit 220, the inverse transform unit 230, the intra prediction unit 240, the inter prediction unit 250, the summer 255, the switch 245, the filter unit 260, and the reference picture buffer 270 of the decoding apparatus 200 can be program modules, and can communicate with external devices or systems. The program modules can be included in the decoding apparatus 1700 in the form of an operating system, an application program module, or other program modules.

[0899] The program modules can be physically stored in various types of well-known storage devices. Also, at least some of the program modules can be stored in a remote storage device capable of communicating with the decoding apparatus 1700.

[0900] The program modules can include, but are not limited to, routines, sub-routines, programs, objects, components, and data structures for performing functions or operations according to embodiments or for implementing abstract data types according to embodiments.

[0901] The program modules can be implemented using instructions or codes executed by at least one processor of the decoding apparatus 1700.

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

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

[0904] The storage unit can store data or information for operations of the decoding device 1700. In an embodiment, the data or information of the decoding device 1700 can be stored in the storage unit.

[0905] For example, the storage unit can store a picture, a block, a list, motion information, inter prediction information, a bitstream, etc.

[0906] The decoding device 1700 can be implemented in a computer system including a computer readable storage medium.

[0907] The storage medium can store at least one module required for operations of the decoding device 1700. The memory 1730 can store the at least one module and can be configured such that the at least one module is executed by the processing unit 1710.

[0908] The communication related to the data or information of the decoding device 1700 can be performed through the communication unit 1720.

[0909] For example, the communication unit 1720 can receive a bitstream from the encoding device 1600.

[0910] Hereinafter, the processing unit can represent the processing unit 1610 of the encoding device 1600 and / or the processing unit 1710 of the decoding device 1700. For example, with respect to a function related to prediction, the processing unit can represent the switch 115 and / or the switch 245. With respect to a function related to inter prediction, the processing unit can represent the inter prediction unit 110, the subtractor 125, and the adder 175, and can represent the inter prediction unit 250 and the adder 255. With respect to a function related to intra prediction, the processing unit can represent the intra prediction unit 120, the subtractor 125, and the adder 175, and can represent the intra prediction unit 240 and the adder 255. With respect to a function related to transform, the processing unit can represent the transform unit 130 and the inverse transform unit 170, and can represent the inverse transform unit 230. With respect to a function related to quantization, the processing unit can represent the quantization unit 140 and the inverse quantization unit 160, and can indicate the inverse quantization unit 220. With respect to a function related to entropy encoding and / or entropy decoding, the processing unit can represent the entropy encoding unit 150 and / or the entropy decoding unit 210. With respect to a function related to filtering, the processing unit can represent the filter unit 180 and / or the filter unit 260. With respect to a function related to a reference picture, the processing unit can indicate the reference picture buffer 190 and / or the reference picture buffer 270.

[0911] Fig. 18 FIG. 32 is a flowchart illustrating a target block prediction method and a bitstream generation method according to an embodiment.

[0912] A target block prediction method and a bitstream generation method according to an embodiment can be performed by the encoding apparatus 1600. The embodiment can be part of a target block encoding method or a video encoding method.

[0913] In step 1810, the processing unit 1610 can determine prediction information to be applied to encoding of the target block.

[0914] The prediction information can include information for the prediction described above. For example, the prediction information can include inter prediction information. For example, the prediction information can include intra prediction information.

[0915] In step 1820, the processing unit 1610 can perform prediction on the target block using the information about the target block and the determined prediction information.

[0916] A predicted block can be generated by the prediction on the target block.

[0917] A residual block, which is a difference between the target block and the predicted block, can be generated. Information about the target block can be generated by applying a transform and quantization to the residual block.

[0918] The information about the target block can include transform coefficients and quantized coefficients for the target block. The information about the target block can include the prediction information.

[0919] Further, a reconstructed block, which is a sum of the predicted block and the reconstructed residual block, can be generated.

[0920] In step 1830, the processing unit 1610 can generate a bitstream.

[0921] The bitstream can include the information about the target block. Further, the bitstream can include the information described above in the embodiments. For example, the bitstream can include an encoding parameter related to the target block and / or a property of the target block.

[0922] The information included in the bitstream can be generated in step 1830, or the information included in the bitstream can be at least partially generated in steps 1810 and 1820.

[0923] The processing unit 1610 can store the generated bitstream in the storage 1640. Alternatively, the communication unit 1620 can transmit the bitstream to the decoding apparatus 1700.

[0924] The bitstream can include encoded information about the target block. The processing unit 1610 can generate the encoded information about the target block by performing entropy encoding on the information about the target block.

[0925] Fig. 19 FIG. 19 is a flowchart of a target block prediction method using a bitstream according to an embodiment.

[0926] A target block prediction method using a bitstream according to an embodiment can be performed by the decoding device 1700. The embodiment can be part of a target block decoding method or a video decoding method.

[0927] In step 1910, the communication unit 1720 can obtain a bitstream. The communication unit 1720 can receive the bitstream from the encoding device 1600.

[0928] The bitstream can include information about a target block.

[0929] The information about the target block can include transform coefficients and quantized coefficients for the target block. The information about the target block can include prediction information.

[0930] In addition, the bitstream can include the information described above in the embodiments. For example, the bitstream can include encoding parameters related to the target block and / or properties of the target block.

[0931] The computer-readable storage medium can include the bitstream, and prediction and decoding of the target block can be performed using the information about the target block included in the bitstream.

[0932] The bitstream can include encoding information about the target block. The processing unit 1710 can generate information about the target block by performing entropy decoding on the encoding information about the target block.

[0933] The processing unit 1710 can store the obtained bitstream in the memory 1740.

[0934] In step 1920, the processing unit 1710 can determine prediction information to be applied to decoding of the target block.

[0935] The processing unit 1710 can determine the prediction information using the methods used in the above-described embodiments.

[0936] The processing unit 1710 can determine the prediction information for the target block based on information related to the prediction method obtained from the bitstream.

[0937] The prediction information can include inter prediction information. The prediction information can include intra prediction information.

[0938] In step 1930, the processing unit 1710 can perform prediction on the target block using the information about the target block and the determined prediction information.

[0939] In step 1930, a predicted block can be generated by performing prediction on the target block using the prediction information.

[0940] Further, a reconstructed block, which is a sum of a prediction block and a reconstructed residual block, can be generated.

[0941] Prediction of chroma blocks

[0942] To reduce the amount of bits required for encoding / decoding in a prediction method for a chroma block, a cross-component prediction method such as a cross-component linear model (CCLM), a gradient linear model (GLM), a filter-based linear model (FLM), and a convolution cross-component model (CCCM) can be used to perform chroma prediction.

[0943] In an embodiment, prediction of a chroma block can be performed using information of a luma block. With this prediction, the amount of bits required for prediction of a chroma block can be reduced, and the efficiency of signaling / encoding / decoding in a chroma block can be improved.

[0944] In an embodiment, "luma" can refer to "brightness". "Chroma" can refer to "color".

[0945] Information in embodiments

[0946] In an embodiment, block information can refer to at least one of information of a neighboring block, information of a reference block, and information of a current block. In an embodiment, a current block can refer to a target block.

[0947] Further, the block information can include at least one of the encoding parameters.

[0948] The encoding parameters can include at least one of a plurality of pieces of information used in inter prediction, intra prediction, transformation, inverse transformation, quantization, inverse quantization, entropy encoding / decoding, and loop filtering.

[0949] The encoding parameters can further include a block index, an intra prediction mode candidate list, an intra prediction candidate index, etc.

[0950] A block shape in the encoding parameters can indicate which one of a square and a non-square is a shape of a block.

[0951] A motion vector can be a motion vector for at least one of L0, L1, L2, and L3.

[0952] A motion vector difference can be a motion vector difference for at least one of L0, L1, L2, and L3.

[0953] A reference picture index can be a reference picture index for at least one of L0, L1, L2, and L3.

[0954] The precision of the motion vector representation can be a motion vector representation unit represented by n times a sample point and 1 / n times a sample point (such as an integer sample point, 1 / 2 sample point, 1 / 4 sample point, 1 / 8 sample point, 1 / 16 sample point, and 1 / 32 sample point). n can be a positive integer. Further, n can be determined based on at least one of the encoding parameter and the encoding parameter of the candidate. Further, n can be preset by the encoding apparatus 1600 and the decoding apparatus 1700, and can be a value signaled from the encoding apparatus 1600 to the decoding apparatus 1700.

[0955] Terminology in embodiments

[0956] In an embodiment, the statistical value can indicate one or more of a mean value, a weighted mean value, a weighted sum value, a minimum value, a maximum value, a mode, a median, and an interpolation value of a specific value. The specific value can be a value such as a variable, an encoding parameter, a constant, and a predefined value described in an embodiment.

[0957] In an embodiment, the error cost (or error) can be a value derived from a difference between one or more pixel values of a target. For a target, the error cost can be calculated using the following methods:

[0958] - Sum of Absolute Difference (SAD)

[0959] - Sum of Absolute Error (SAE)

[0960] - Mean Absolute Difference (MAD)

[0961] - Mean Absolute Error (MAE)

[0962] - Sum of Squared Difference (SSD)

[0963] - Sum of Squared Error (SSE)

[0964] - Mean Squared Difference (MSD)

[0965] - Mean Squared Error (MSE)

[0966] - Mean Reduced Sum of Absolute Difference (MR-SAD)

[0967] - Sum of Absolute Transformed Difference (SATD)

[0968] - Rate Distortion Cost (RD Cost)

[0969] The prediction information in an embodiment can include information used in inter prediction. The prediction information can include motion information.

[0970] In an embodiment, motion information can refer to information including or derivable using at least one of: prediction list utilization flags, reference picture list information, reference pictures, motion vector candidates, motion vector candidate indices, merge candidates, and merge indices, and motion vectors, reference picture indices, and inter prediction indicators.

[0971] Intra prediction information in an embodiment can refer to information including or derivable using at least one of: intra luma prediction modes / directions, intra chroma prediction modes / directions, intra prediction mode candidate lists (e.g., MPM candidate lists in most probable modes (MPMs)), intra prediction mode candidate indices (e.g., MPM indices in MPMs), intra partition information, gradients, and / or prediction modes derived by decoder-side intra mode derivation methods, prediction modes derived by template-based intra mode derivation (TIMD) methods.

[0972] In an embodiment, a prediction mode can refer to an intra prediction mode or an intra prediction direction.

[0973] In an embodiment, candidate list management can include processes such as: configuring a candidate list, reducing a candidate list, adding a candidate to a candidate list, and removing a candidate from a candidate list.

[0974] In an embodiment, a final candidate list can refer to a list including final candidates (or candidate blocks) used in a reference block determination step to determine reference blocks.

[0975] Scaling

[0976] Fig. 20 Scaling according to an example is shown.

[0977] In Fig. 20 In an embodiment, curr blk can refer to a current block.

[0978] col blk can be a reference block at a (co-located) position.

[0979] curr pic can refer to a current picture including a current block.

[0980] curr ref can refer to a reference picture of a current picture.

[0981] col pic can refer to a reference picture in which a block referenced by a current block exists.

[0982] col ref can refer to a reference picture for a reference block.

[0983] In an embodiment, a scaling factor can be a value used to scale various encoding parameters including motion information.

[0984] As Fig. 20 indicated, the scaling factor can refer to a ratio of a distance tb between a current picture and a reference picture for the current picture and a distance td between a reference block and a reference picture for the reference block.

[0985] The scaling factor can be defined by the following [Equation 1]:

[0986] [Equation 1]

[0987]

[0988] The weight w can be a value greater than 0. w can be a value preset by the encoding apparatus 1600 and / or the decoding apparatus 1700. In addition, w can be a value signaled from the encoding apparatus 1600 to the decoding apparatus 1700.

[0989] By using different weights, at least one scaling factor can be derived.

[0990] In addition, when the scaling factor is applied, at least one scaling factor can be used.

[0991] Prediction mode

[0992] In an embodiment, a decoder-side intra mode derivation (DIMD) method can refer to a method of deriving a prediction mode by calculating gradients of surrounding pixels in intra prediction and adding the derived prediction mode to an MPM list, thereby improving MPM prediction efficiency. Here, at the decoder side, a prediction mode derived by calculating gradients of surrounding pixels can be added when configuring the MPM list.

[0993] Here, the surrounding pixels can be pixels around the current block. The neighboring pixels can include pixels adjacent to the current block. The surrounding pixels can be pixels satisfying a certain condition related to a distance to the current block. For example, the surrounding pixels can be pixels having a distance to the current block less than or equal to a certain value. The distance can be a horizontal distance and / or a vertical distance, and can be a result value using an equation of the horizontal distance and the vertical distance.

[0994] An intra template matching (ITM) method in an embodiment can refer to a method for configuring a current template for a current block using surrounding pixels in intra prediction, deriving a region in a reconstructed region in a current picture most similar to the current template as a reference template, and using a reference block of the reference template as a prediction block for the current block. Here, a relative positional relationship between the current block and the current template can be the same as a relative positional relationship between the reference block and the reference template. In other words, as in the case of determining pixels in the current template based on a relative position to the current block, the reference block can be determined based on a relative position to the reference template.

[0995] In an embodiment, a template-based intra mode derivation (TIMD) method can refer to a method of generating templates for prediction modes present in an MPM list, calculating error costs of respective templates, and deriving a prediction mode based on the calculated error costs.

[0996] Determination using threshold

[0997] In an embodiment, the "determination based on a comparison with a specific value" can be determined based on at least one of the following conditions.

[0998] Here, the specific value can be a threshold value.

[0999] Here, BLK j may be a candidate / block to be compared with a threshold value. P k may be a parameter to be compared. TH i may be a threshold value as a specific value. j can be an index of a candidate / block to be compared. k can be an index of a parameter to be compared. i can be an index of a threshold value. Each of k, i, and j can be a positive integer including 0.

[1000] [Condition 1]

[1001] As shown in [Equation 2] below, when a parameter of a block / candidate to be compared is the same as a threshold value, the block / candidate can be determined as a target for a specific process.

[1002] [Equation 2]

[1003] BLK j _P k = TH i

[1004] [Condition 2]

[1005] As shown in [Equation 3] below, when a parameter of a block / candidate to be compared is less than a threshold value, the block / candidate can be determined as a target for a specific process.

[1006] [Equation 3]

[1007] BLK j _P k < TH i

[1008] [Condition 3]

[1009] As shown in [Equation 4] below, when a parameter of a block / candidate to be compared is greater than a threshold value, the block / candidate can be determined as a target for a specific process.

[1010] [Equation 4]

[1011] BLK j _P k >TH i

[1012] [Condition 4]

[1013] As shown in [Equation 5] and [Equation 6] below, when the parameter of the block / candidate to be compared exists between the threshold values, the block / candidate can be determined as a target for a specific process. [Equation 5] can indicate a case where two threshold values exist. [Equation 6] can indicate a case where three threshold values exist.

[1014] [Equation 5]

[1015] TH1 < BLK j _P k <TH2, (where, TH2 > TH1)

[1016] [Equation 6]

[1017] TH1 < BLK j-1 _P k <TH2 < BLK j _P k <TH3 (where, TH2 > TH1 & TH3 > TH2, BLK j _P k > BLK j-1 _P k )

[1018] [Condition 5]

[1019] The difference between the parameter of the block / candidate to be compared and the threshold value can be reordered in descending order, and the block / candidate corresponding to the first n differences in the reordered difference can be determined as a target for a specific process.

[1020] [Condition 6]

[1021] The difference between the parameter of the block / candidate to be compared and the threshold value can be sorted in descending order, and the block / candidate corresponding to the last v differences in the sorted difference can be determined as a target for a specific process.

[1022] Here, n and v can be values preset by the encoding apparatus 1600 and the decoding apparatus 1700, and can be values signaled from the encoding apparatus 1600 to the decoding apparatus 1700.

[1023] Each of the parameter and the threshold value can include at least one or more values.

[1024] The threshold-based determination can be performed using at least one of the above conditions.

[1025] The threshold value can be a value preset by the encoding apparatus 1600 and the decoding apparatus 1700, and can be a value signaled from the encoding apparatus 1600 to the decoding apparatus 1700.

[1026] Fig. 21 An index of a neighboring block according to an example is shown.

[1027] Fig. 22 Details of an encoding parameter according to an example are shown.

[1028] Fig. 23 A value of an index according to an example is shown.

[1029] Fig. 24 An index of an encoding parameter of a neighboring block and a parameter value according to an example are shown.

[1030] For example, Fig. 21 to Fig. 24 The plurality of pieces of information exemplified in the above can be used for "determination based on comparison with a specific value".

[1031] For example, when a threshold value TH2 (= 5) is used, a parameter to be compared is P3 (= a candidate index in a candidate list), a second threshold value in [Condition 4] is T1 (= 10), n in [Condition 5] is 1, and v in [Condition 5] is 2, the neighboring blocks determined by the above [Condition 1] to [Condition 5] are as follows:

[1032] A neighboring block determined by [Condition 1]: BLK1

[1033] A neighboring block determined by [Condition 2]: BLK2

[1034] A neighboring block determined by [Condition 3]: BLK3

[1035] A neighboring block determined by [Condition 4]: BLK3

[1036] A neighboring block determined by [Condition 5]: BLK2

[1037] A neighboring block determined by [Condition 6]: BLK3 and BLK1

[1038] Matching method

[1039] Fig. 25 A configuration of a template in inter prediction according to an example is shown.

[1040] Fig. 26 A configuration of a template in intra prediction according to an example is shown.

[1041] Fig. 27 A configuration of a template in bilateral matching according to an example is shown.

[1042] In an embodiment, the matching technique can refer to a method of calculating an error cost while adjusting a position of a template by utilizing a template defined between comparison targets, and can include template matching (TM), bilateral matching (BM), etc.

[1043] As shown in Fig. 25 and Fig. 26 , template matching can configure a current template for a current block using surrounding pixels of the current block, and can configure a reference template matching the current template using pixels in a search area of a reference image.

[1044] As shown in Fig. 27 , bilateral matching can configure a template using pixels in a reference image. Here, at least one of reconstructed pixels in a current image or a reference image can be used to configure the template.

[1045] Fig. 28 A first configuration of a template in template matching according to an example is illustrated.

[1046] Fig. 29 A second configuration of a template in template matching according to an example is illustrated.

[1047] Fig. 30 A first configuration of a template with alternating empty lines in template matching according to an example is illustrated.

[1048] Fig. 31 A second configuration of a template with alternating empty lines in template matching according to an example is illustrated.

[1049] Fig. 32 A second configuration of a template with alternating empty pixels in template matching according to an example is illustrated.

[1050] Fig. 33 A second configuration of a template with alternating empty pixels in template matching according to an example is illustrated.

[1051] In Fig. 28 to Fig. 33 , a large rectangle in the lower right portion can denote a block. The block can be a current block. Small rectangles can indicate pixels of a template. An area of the small rectangles can indicate the template. An area adjacent to a top of the block can be an above (top) template. An area adjacent to a left side of the block can be a left template. Small shaded rectangles can indicate pixels used to configure the template. Small white rectangles can indicate pixels not used to configure the template.

[1052] Fig. 34 A configuration of a template in bilateral matching according to an example is illustrated.

[1053] Fig. 35 A configuration of a template with alternating empty lines in bilateral matching according to an example is illustrated.

[1054] Fig. 36 A configuration of a template with alternating empty pixels in a bilateral matching according to an example is shown.

[1055] In Fig. 34 to Fig. 36 , a large rectangle can represent a template. Small rectangles can indicate pixels of the template. Small shaded rectangles can indicate pixels used to configure the template. Small white rectangles can indicate pixels not used to configure the template.

[1056] In this matching technique, as Fig. 30 , Fig. 31 , Fig. 32 , Fig. 33 , Fig. 35 and Fig. 36 shown, a template can be configured to have alternating empty lines or empty pixels.

[1057] Each template can be configured to have one or more empty pixels or one or more empty lines.

[1058] The number of pixels, the number of lines, and the shape of the template constituting the respective template can be determined differently based on the coding parameters.

[1059] For example, the shape of the template can be configured differently according to the partition shape of the current block or the neighboring block, the size of the current block or the neighboring block, a statistical value of the size.

[1060] For example, a template having a side with a size equal to the size of a side in contact with the current block or the neighboring block can be configured.

[1061] For example, a template having a side with a size smaller than the size of a side in contact with the current block or the neighboring block can be configured.

[1062] For example, a template having a side with a size greater than the size of a side in contact with the current block or the neighboring block can be configured.

[1063] For example, a template can be configured using the maximum, minimum, and median of the size of the sides of each of the current block and the neighboring block as the size of each side.

[1064] For example, when the size of the current block or the neighboring block is smaller than a threshold value, the template can be configured by reducing lines or pixels, or the size of the template can be reduced.

[1065] In an embodiment, reducing lines (or pixels) can mean removing some of the plurality of lines (or pixels). Alternatively, reducing lines (or pixels) can mean reducing the number of lines (pixels) by applying interpolation, sampling, and / or filtering to the plurality of lines (or pixels).

[1066] For example, when the size of the current block or the neighboring block is smaller than a threshold value, the template can be configured by increasing lines or pixels, or the size of the template can be reduced.

[1067] In an embodiment, increasing the line (or pixel) can mean duplicating some of the plurality of lines (or pixels). Alternatively, increasing the line (or pixel) can mean increasing the number of lines (pixels) by applying interpolation, sampling, and / or filtering to the plurality of lines (or pixels).

[1068] For example, when the size of the current block or the neighboring block is greater than a threshold, the template can be configured by reducing the line or pixel, or the size of the template can be reduced.

[1069] For example, when the size of the current block or the neighboring block is greater than a threshold, the template can be configured by increasing the line or pixel, or the size of the template can be reduced.

[1070] The threshold value can be a value preset by the encoding apparatus 1600 and the decoding apparatus 1700, and can be a value signaled from the encoding apparatus 1600 to the decoding apparatus 1700.

[1071] For example, the shape of the template can be differently configured according to the motion information of the neighboring block or a statistical value of the motion information.

[1072] For example, when one of the statistical values of the motion vector of the neighboring block is less than a threshold, the template can be configured by reducing the line or pixel, or the size of the template can also be reduced.

[1073] For example, when one of the statistical values of the motion vector of the neighboring block is less than a threshold, the template can be configured by increasing the line or pixel, or the size of the template can also be increased.

[1074] For example, when one of the statistical values of the motion vector of the neighboring block is greater than a threshold, the template can be configured by reducing the line or pixel, or the size of the template can also be reduced.

[1075] For example, when one of the statistical values of the motion vector of the neighboring block is greater than a threshold, the template can be configured by reducing the line or pixel, or the size of the template can also be reduced.

[1076] The threshold value can be a value preset by the encoding apparatus 1600 and the decoding apparatus 1700, and can be a value signaled from the encoding apparatus 1600 to the decoding apparatus 1700.

[1077] Fig. 37 A configuration of a template when intra prediction is performed in an inter picture is illustrated according to an example.

[1078] Fig. 38 A configuration of a template when inter prediction is performed on an inter picture is illustrated according to an example.

[1079] The number of pixels and the number of lines constituting the template and the shape of the template can be differently determined based on the prediction mode of the current block or the neighboring block.

[1080] For example, when inter prediction is performed on the current block, at least one of the blocks determined to use inter prediction can be selected, and the template can be configured using the selected block.

[1081] For example, when intra prediction is performed on the current block, at least one of the blocks determined to use inter prediction can be selected, and the template can be configured using the selected block.

[1082] For example, when intra prediction is performed on the current block (in an inter image (inter frame)), at least one of the blocks determined to use inter prediction can be selected, and the template can be configured using the selected block.

[1083] For example, when intra prediction is performed on the current block (in an inter image (inter frame)), at least one of the blocks determined to use intra prediction can be selected, and the template can be configured using the selected block.

[1084] The number of pixels and the number of lines constituting the template and the shape of the template can be determined differently based on the positions of the pixels, the distances between the pixels, the partition region, etc.

[1085] For example, the shape of the template can be configured differently according to the distance from the center of the search region.

[1086] For example, when the distance from the center of the search region to the position where matching is performed is less than a threshold value, the template can be configured by reducing the lines or the pixels, or the size of the template can be reduced.

[1087] For example, when the distance from the center of the search region to the position where matching is performed is less than a threshold value, the template can be configured by increasing the lines or the pixels, or the size of the template can be increased.

[1088] For example, when the distance from the center of the search region to the position where matching is performed is greater than a threshold value, the template can be configured by reducing the lines or the pixels, or the size of the template can be reduced.

[1089] For example, when the distance from the center of the search region to the position where matching is performed is greater than a threshold value, the template can be configured by increasing the lines or the pixels, or the size of the template can be increased.

[1090] The threshold value can be a value preset by the encoding apparatus 1600 and the decoding apparatus 1700, and can be a value signaled from the encoding apparatus 1600 to the decoding apparatus 1700.

[1091] For example, the shape of the template can be configured differently according to the distance from the pixel where matching is first performed.

[1092] For example, when the distance from the pixel where matching is first performed is less than a threshold value, the template can be configured by reducing the lines or the pixels, or the size of the template can be reduced.

[1093] For example, when the distance from the pixel for which matching is first performed is less than a threshold value, the template can be configured by increasing lines or pixels, or the size of the template can be increased.

[1094] For example, when the distance from the pixel for which matching is first performed is greater than a threshold value, the template can be configured by decreasing lines or pixels, or the size of the template can be decreased.

[1095] For example, when the distance from the pixel for which matching is first performed is greater than a threshold value, the template can be configured by increasing lines or pixels, or the size of the template can be increased.

[1096] The threshold value can be a value preset by the encoding apparatus 1600 and the decoding apparatus 1700, and can be a value signaled from the encoding apparatus 1600 to the decoding apparatus 1700.

[1097] For example, when the search area is divided into a plurality of partition areas, the shape of the template can be differently configured for each partition area.

[1098] The number of pixels and the number of lines constituting the respective templates and the shape of the template can be differently determined based on the step of performing matching.

[1099] For example, when a neighboring block having the lowest error cost is searched using template matching, template matching can be performed only for a specific position belonging to a defined pattern within a search range, as in the case of the pattern matching method, to reduce complexity.

[1100] Here, the pattern matching method can be performed by the following steps.

[1101] [Step 1]

[1102] First, sparse matching can be performed by performing matching using a large pattern in a search area, or by performing matching after a distance between positions to which matching is applied is set to a large value.

[1103] [Step 2]

[1104] Next, based on the position having the lowest error cost derived at [Step 1], fine matching can be performed by performing matching using a small pattern or by performing matching after a distance between positions to which matching is applied is set to a small value.

[1105] A matching area performed at [Step 2] can be determined based on the position derived at [Step 1]. The position derived at [Step 1] can be a position having the lowest error cost among positions in a search area.

[1106] In [step 1], the template can be configured by reducing lines or pixels, or the size of the template can be reduced.

[1107] In [step 2], the template can be configured by increasing lines or pixels, or the size of the template can be enlarged.

[1108] Further, in [step 1], the template can be configured by increasing lines or pixels, or the size of the template can be enlarged, and in step [step 2], the template can be configured by reducing lines or pixels, or the size of the template can be reduced.

[1109] The matching based on the matching technique can be performed at at least one pixel position within the search range.

[1110] For example, the matching can be performed on at least one of the pixel positions derived from the candidates in the candidate list.

[1111] For example, the matching can be performed on at least one of the pixel positions existing within a certain distance from the current block.

[1112] For example, the matching can be performed on at least one of the pixel positions existing outside a certain distance from the current block.

[1113] For example, when the search range is partitioned, the matching can be performed on at least one of the pixel positions within a certain partitioned region among the partitioned regions.

[1114] For example, the matching can be performed on at least one of the pixel positions belonging to a certain pattern.

[1115] For example, the matching can be performed on at least one of the pixel positions derived from a block (or a candidate) having the same or similar encoding parameter values as the encoding parameter values of the current block.

[1116] For example, when the motion information of a pixel position is the same as or similar to the motion information of a block including the pixel position, the matching can be performed at the pixel position.

[1117] For example, when the prediction information of a pixel position is the same as or similar to the prediction information of a block including the pixel position, the matching can be performed at the pixel position. The prediction information can be inter prediction information and / or intra prediction information.

[1118] When the prediction direction of a pixel position is the same as or similar to the prediction direction of a block including the pixel position, the matching can be performed at the pixel position.

[1119] When the intra prediction mode of a pixel position is the same as or similar to the intra prediction mode of a block including the pixel position, the matching can be performed at the pixel position.

[1120] The processing in the template matching and the bilateral matching described above can be performed based on the statistical values of the candidate coding parameters. For example, the statistical values described above can be the statistical values of the candidate coding parameters, and can include the statistical values of the candidate coding parameters.

[1121] The threshold value can be a value preset by the encoding apparatus 1600 and the decoding apparatus 1700, and can be a value signaled from the encoding apparatus 1600 to the decoding apparatus 1700.

[1122] Fig. 39 is a flowchart of a prediction method according to an embodiment.

[1123] Steps 3910, 3920, and 3930 can be performed by each of the encoding apparatus 1600 and the decoding apparatus 1700. Steps 3910, 3920, and 3930 can be performed by the processing unit 1610 of the encoding apparatus 1600 and the processing unit 1710 of the decoding apparatus 1700.

[1124] Determining prediction information at steps 1810 and 1820 can include steps 3910 and 3920, which will be described later.

[1125] Performing prediction at steps 1920 and 1930 can include step 3930, which will be described later.

[1126] Alternatively, the setting and deriving information related to prediction described at steps 3910, 3920, and 3930 can be included in each of steps 1810 and 1939.

[1127] Alternatively, performing prediction at steps 3910, 3920, and 3930 can be included in each of steps 1820 and 1930.

[1128] At step 3910, a prediction method and / or a prediction model for the chroma signal can be determined.

[1129] The prediction model can be a cross-component prediction model. In an embodiment, the prediction model can be abbreviated as model.

[1130] At step 3920, information required to derive the prediction model can be determined.

[1131] The information required to derive the prediction model can include a reference region and a representative value.

[1132] At step 3930, a chroma prediction signal can be generated using the cross-component prediction model. The chroma prediction signal can include a chroma prediction block.

[1133] The bitstream can include the encoding information.

[1134] Each of steps 3910, 3920, and 3930 can be performed based on the encoding information. The information generated in steps 3910, 3920, and 3930 can be generated based on the encoding information. In step 3910, the prediction method for the chroma signal can be determined based on the encoding information. In step 3920, the information required to derive the prediction model can be determined based on the encoding information. In step 3930, the chroma prediction signal can be generated using the prediction model based on the encoding information.

[1135] Determination of prediction method for chroma signals

[1136] Hereinafter, the determination of the prediction method for the chroma signal in step 3910 will be described.

[1137] In an embodiment, the current chroma block can be a chroma block that is a target of current encoding / decoding / signalization / prediction. The current chroma block can refer to a current chroma prediction block.

[1138] In determining the prediction method for the chroma signal, the prediction signal (or prediction block) can be generated based on the cross-color component correlation.

[1139] In predicting the chroma signal based on the cross-color component correlation, the prediction signal can be derived based on a cross-component linear model (CCLM).

[1140] The CCLM-based chroma signal prediction method can generate a chroma prediction block for chroma prediction using sample values of reconstructed chroma samples adjacent to the current chroma block and reconstructed luma samples at positions corresponding to the reconstructed chroma samples.

[1141] In an embodiment, the sample can include 1) a pixel, 2) a statistical value of pixel values of one or more pixels, and 3) encoding information derived from one or more pixels. The encoding information can include an encoding parameter, and in an embodiment, can include information for encoding / decoding / signalization.

[1142] The linear regression model can be derived using 1) a correlation between surrounding pixels of the luma block and surrounding pixels of the chroma block or 2) a statistical value such as a maximum value and a minimum value, as shown in [Equation 7] below, and model coefficients a and b can be calculated. The current chroma prediction block can be derived using values of the model coefficients a and b and pixels in the luma block.

[1143] [Equation 7]

[1144] C'(i,j) = a*L'(i,j) + b or C'(x,y) = a*L(x,y) + b

[1145] C(i,j) can denote a current chroma prediction block or a sample in the current chroma prediction block. L'(i,j) can denote a reconstructed luma sample / block corresponding to a position of the current chroma prediction block.

[1146] In an embodiment, the model can refer to a linear regression model. The model coefficient values can include values of model coefficients a and b.

[1147] However, L'(i,j) can refer to a luma sample of a luma block adjusted to have the same size as the chroma block by sub-sampling, down-sampling, etc. L(x,y) can denote a luma sample of a luma block having a size different from that of the chroma block.

[1148] Accordingly, the luma sample position (x,y) of the luma sample L(x,y) corresponding to the chroma sample C'(i,j) and the chroma sample position (i,j) can be different from each other.

[1149] In deriving the model coefficients of [Equation 7], the model coefficients can be derived for the U signal and the V signal, respectively.

[1150] In deriving the model coefficients of [Equation 7], the model coefficients applied to both the U signal and the V signal can be derived.

[1151] Whether to apply the model can be determined separately for each of the U signal and the V signal. Information indicating whether the model is applied can be encoded / decoded / signaled.

[1152] To derive values of the model coefficients a and b, information on one or more of the following can be used: 1) surrounding samples of the current chroma prediction block, 2) surrounding samples of a luma block corresponding to a position of the current chroma prediction block, and 3) a reference line index of the corresponding luma block.

[1153] The reference line can refer to a plurality of reference lines as described above with reference to Fig. 8 The reference line index can indicate a reference line index of the plurality of reference lines used for encoding / decoding / signaling for the block. The reference line can also refer to a neighboring sample line or a neighboring sample line of the block.

[1154] When determining the reference line used to derive the model coefficients, N or more lines can be used as the reference line. Here, N can be a positive number of 0 or more. N can be a value preset by the encoding apparatus 1600 and / or the decoding apparatus 1700, and can be a value signaled from the encoding apparatus 1600 to the decoding apparatus 1700.

[1155] In an embodiment, the neighboring block or sample position to be used can be determined based on the chroma format.

[1156] For example, in the YUV 4:4:4 or YUV 4:2:2 format, a reference line of a luma block indicated by a reference line index of the luma block and a reference line of a chroma block corresponding to the reference line can be used. Here, the reference lines corresponding to each other can refer to the reference lines having positions with respect to the block. Alternatively, the reference lines corresponding to each other can refer to the reference lines having the same number, as shown in Equation 7 below. Fig. 8

[1157] For example, in the YUV 4:2:0 format, an index of a reference line of a chroma block (=IntraChromaRefLineIdx) can be derived as shown in Equation 8 below.

[1158] [Equation 8]

[1159] IntraChromaRefLineIdx = floor(IntraLumaRefLineIdx / 2)

[1160] IntraLumaRefLineIdx can be an index of a neighboring sample line of the chroma block.

[1161] By using only specific samples in the luma reference line reconstructed based on the sub-sampling scheme, the number of luma samples and the number of chroma samples can be adjusted to be the same as each other. In other words, a luma sample corresponding to each chroma sample can be determined. Here, the specific sample can be an even-numbered (or odd-numbered) pixel in the reference line.

[1162] In addition, the luma sample at the specific sample position can be determined as a sample corresponding to the chroma sample.

[1163] For example, when the size of the luma block is 2Mx2N and the size of the chroma block is MxN, the samples at positions of (M+N)*X1 / 8, (M+N)*X2 / 8, (M+N)*X3 / 8, and (M+N)*X4 / 8 in the luma block can be determined as the luma samples corresponding to the chroma samples.

[1164] Here, Xi can be a specific constant for determining the sample position. i can be an integer of 1 or more. As the number of samples increases, the number of specific constants can be increased.

[1165] For example, as exemplified above, in the case of using 4 samples, the constants substituted for X1 to X4 can be arbitrarily determined as in the case of (1, 3, 5, 7), (2, 4, 6, 8). Alternatively, the constants substituted for X1 to X4 can be differently determined based on the encoding information of the neighboring block.

[1166] N luma samples can be used to derive a luma sample corresponding to one chroma sample. N can be a specific positive integer. ​

[1167] Fig. 40 Downsampling based on a deep neural network is shown according to an example.

[1168] For example, down-sampling can be used to determine luma samples corresponding to chroma samples.

[1169] Down-sampling can be performed based on various filters, such as filters in the following [Equation 9], [Equation 10], and [Equation 11].

[1170] [Equation 9]

[1171]

[1172] [Equation 10]

[1173]

[1174] [Equation 11]

[1175] F_dS3 = (1 2 1)

[1176] Down-sampling can be performed by filtering based on a deep neural network (DNN) as shown. Fig. 40

[1177] A statistical value of one or more of the N luma samples can be calculated, and at least one of the statistical values can be used to derive a representative luma sample. The representative luma sample can be used to replace a luma sample.

[1178] In an embodiment, the statistical value can include a mean value, a maximum value, a minimum value, and a median value of the samples.

[1179] For example, when luma samples corresponding to neighboring samples c(0,-1) of a current chroma block are L(-1,-2), L(0,-2), L(1,-2), L(-1,-1), L(0,-1), and L(1,-1), candidate values for deriving a representative value can be extracted using the corresponding luma samples. The representative value can include a mean value, a maximum value, a minimum value, a median value, etc.

[1180] The candidate values for deriving a representative value can refer to a statistical value. The representative value can refer to a sample value of a luma sample corresponding to a chroma sample used to derive a model coefficient.

[1181] For example, as a reference line of a chroma sample, a reference line of a chroma block can be derived using the following [Equation 12].

[1182] [Equation 12]

[1183] ​c(0,-1) = (L(-1,-2) + 2*L(0,-2) + L(1,-2) + L(-1,-1) + 2*L(0,-1) + L(1,-1) + 4) » 3.

[1184] ">>" can denote a right shift operator.

[1185] A luma sample corresponding to a chroma sample can be changed. Also, an equation for deriving a chroma prediction sample can be changed. Information about a luma sample corresponding to a neighboring sample of a current chroma block or information about an equation for deriving a neighboring sample of the current chroma block can be signaled from the encoding apparatus 1600 to the decoding apparatus 1700.

[1186] The threshold value can be a value preset by the encoding apparatus 1600 and the decoding apparatus 1700, and can be a value signaled from the encoding apparatus 1600 to the decoding apparatus 1700. Alternatively, a position of a sample described in the embodiments can be derived using encoding information of a surrounding sample or block.

[1187] Generation of chroma prediction blocks

[1188] When values of model coefficients a and b are derived, a current chroma prediction block can be generated using [Equation 7] or the like.

[1189] As shown in [Equation 13], [Equation 14], and [Equation 15], at least one of N representative values (e.g., a first representative value, a second representative value, a third representative value, and a fourth representative value) selected or derived can be used to derive a and b values. N can be a positive integer. For example, N can be 2 or 4.

[1190] [Equation 13]

[1191] a = (CMAX - CMIN) / (LMAX - LMIN)

[1192] [Equation 14]

[1193] b = CMIN - a * LMIN

[1194] [Equation 15]

[1195] a = Log2(CMAX - CMIN) - Log2(LMAX - LMIN) » k

[1196] A first representative value (= LMAX) can refer to a value of an x-axis of a maximum value. A second representative value (= CMAX) can refer to a value of a y-axis of the maximum value. A third representative value (= LMIN) can refer to a value of an x-axis of a minimum value. A fourth representative value (= CMIN) can refer to a value of a y-axis of the minimum value.

[1197] For example, to derive b in [Equation 3], values of LMAX and CMAX can be used.

[1198] In [Equation 13], a division operation is used, and thus it can be difficult to implement using integer units. Accordingly, the division operation can be replaced with a multiplication operation and a shift operation (= »).

[1199] In [Equation 15], a value of a can be derived by using a subtraction operation using a subtraction operation of Log2, while avoiding the use of a division operation in [Equation 13].

[1200] Since the value is derived through Log2, normalization of the value a can be performed by using a value of k for a shift operation (= »).

[1201] Derivation of chroma signals / samples / blocks using multiple models

[1202] In an embodiment, in CCLM-based chroma signal prediction, a plurality of models can be used to derive a chroma signal / pixel / block.

[1203] The plurality of models can be derived from luminance pixels at different positions, respectively.

[1204] For example, one model can be derived from pixels at even-numbered pixels in a reference line. In addition, another model can be derived from pixels at odd-numbered pixels in the reference line.

[1205] For example, pixels above a luminance block and pixels to the left of the luminance block can be separated from each other, and different models can be separately derived using the separated pixels.

[1206] Derivation of multiple models based on statistical values of luma samples

[1207] The plurality of models can be derived based on statistical values of luminance pixels.

[1208] For example, an average value of the luminance pixels can be used as a threshold value. Pixels having a pixel value less than or equal to the threshold value and pixels having a pixel value exceeding the threshold value can be separated from each other. Different models can be derived from the separated pixels.

[1209] For example, pixel values of the luminance pixels can be sorted in a certain order. For example, the certain order can be an order close to an average value. In the sorted luminance pixels, the first N pixels and the last S pixels can be selected. Different models can be separately derived using the first N pixels and the last S pixels.

[1210] Here, N and S can be values preset by the encoding apparatus 1600 and the decoding apparatus 1700, and can be values signaled from the encoding apparatus 1600 to the decoding apparatus 1700.

[1211] A plurality of models can be derived based on the defined threshold value.

[1212] For example, a certain value can be used as the threshold value. Samples having sample values less than or equal to the threshold value and samples having sample values exceeding the threshold value can be separated from each other. Different models can be derived from the separated samples.

[1213] The threshold value can be a value preset by the encoding apparatus 1600 and the decoding apparatus 1700, and can be a value signaled from the encoding apparatus 1600 to the decoding apparatus 1700.

[1214] In an embodiment, the sample value range can be a range from a minimum value to a maximum value of the sample values. Alternatively, the sample value range can be a range between the minimum value and the maximum value of the sample values.

[1215] For example, the sample value range can be divided into N groups. Different models can be derived for the groups, respectively, by using samples of the divided groups. In other words, a model of a group can be derived based on samples of the divided group.

[1216] Here, N can be a value preset by the encoding apparatus 1600 and the decoding apparatus 1700, and can be a value signaled from the encoding apparatus 1600 to the decoding apparatus 1700.

[1217] Fig. 41 A sample value range divided into N groups according to an example is illustrated.

[1218] For example, as illustrated in FIG. 1A, samples can be divided into units of groups. Fig. 41

[1219] When samples are divided into units of groups, for each group, a model for each group can be derived using a statistical value of samples in the corresponding group. Different models for respective groups can be derived according to the statistical value of samples in the group.

[1220] For example, an average value of samples in each group can be derived.

[1221] A new sample group can be generated based on the average value of samples in the group. Different models can be derived for the sample groups, respectively.

[1222] Fig. 42 A sample value range divided into two groups according to an example is illustrated.

[1223] An average value of samples in each group can be derived.

[1224] ​In an embodiment, the sample value average of each group may represent the average value of the samples in the corresponding group. The total sample value average may represent the average value of all samples. The sample value average may include the sample value average of (one or more) groups and the total sample value average.

[1225] For each group, samples whose sample values ​​are less than or equal to the sample value average and samples whose sample values ​​are greater than the sample value average can be respectively divided into sample groups.

[1226] For example, Fig. 42 As shown, group 1 of samples whose sample values ​​are less than or equal to the sample value average and group 2 of samples whose sample values ​​are greater than the sample value average can be configured based on the sample value average.

[1227] Different models can be derived for the divided sample point groups.

[1228] Fig. 43 The model derived for a new group between the mean values ​​of the sample values ​​according to the example is shown.

[1229] The range between two sample value averages can be defined as a new group. In other words, the new group can include samples whose sample values ​​are within the average of the two sample value averages. Alternatively, the new group can include samples whose sample values ​​are greater than one sample value average and less than or equal to the next sample value average.

[1230] In other words, the new group may be determined using the average of the sample values ​​of the previous groups.

[1231] Here, as Fig. 43 As shown, the average value of the total sample values ​​can also be used as the average value of the sample values ​​based on which the groups are divided.

[1232] Different models can be derived for each of the newly divided groups.

[1233] Fig. 44 A model derived for a new group between the sample value means of the group according to an example is shown.

[1234] The range between the sample value averages of two groups can be defined as a new group. In other words, the new group can include samples whose sample values ​​are within the average of the sample values ​​of the two existing groups. Alternatively, the new group can include samples whose sample values ​​are greater than the sample value average of one existing group and less than or equal to the sample value average of the next existing group.

[1235] In other words, the new group may be determined using the average of the sample values ​​of the previous groups.

[1236] Here, as Fig. 44 As shown, the average value of the total sample values ​​may not be used as the average value of the sample values ​​based on which the groups are divided.

[1237] Different models can be derived for the divided new groups, respectively.

[1238] Derivation of multiple models

[1239] When multiple models are derived, a model derived from a previously encoded / decoded block can be used.

[1240] In an embodiment, the term "a model derived from a block" can refer to "a model derived for a block" or "a derived model of a block", and the terms "a model from a block", "a model for a block", and "a model of a block" can be used interchangeably with each other.

[1241] In an embodiment, the derivation of a model can refer to the calculation of a model.

[1242] For example, for each block, a model derived from the block can be stored. A model derived from each encoded / decoded block can be stored. When a current block is encoded / decoded, a model of another block stored can be loaded and can be used for the current block.

[1243] In an embodiment, "a particular model is used for a block" can mean that the particular model is used as a model of the block.

[1244] Here, the storage of a model can be performed for each of all blocks. Alternatively, a model of a block can be stored only when a cross-component model-based chroma mode is used as a chroma mode of the block.

[1245] When a reference block for deriving a model of a current block is determined, at least one block can be selected from among neighboring blocks or non-neighboring blocks of the current block, and the selected block can be used as the reference block. Here, the storage of model coefficients in the embodiment can be applied to the derivation of a model.

[1246] Further, when a reference block for deriving a model is determined, at least one block can be selected from among blocks in a reference picture, and the selected block can be used as the reference block. Here, the storage of model coefficients in the embodiment can be applied to the derivation of a model.

[1247] When multiple models are derived, a model derived from a block having a size different from a size of a current block can be used.

[1248] For example, the positions of a reference region or reference samples can be changed according to the size of a block, and different models can be configured according to the positions of the reference regi...

Claims

1. An image decoding method, comprising: determining a prediction method for a chroma block; determining information for deriving a cross-component prediction model; and A chroma prediction block is generated using the cross-component prediction model.

2. The image decoding method according to claim 1, wherein: The information used to derive the cross-component prediction model includes a reference region and a representative value.

3. The image decoding method according to claim 2, wherein: The reference area and the representative value are determined based on the size of a block.

4. The image decoding method according to claim 2, wherein: The reference area and the representative value are determined based on a prediction mode of a block.

5. The image decoding method according to claim 2, wherein: The reference region is determined based on template matching. The decoding method according to claim 1 , wherein: The prediction method is determined using a model derived from previously decoded blocks.

7. The image decoding method according to claim 1, wherein: The chroma prediction block is generated using a prediction block generated by a method other than the cross-component prediction model.

8. An image encoding method, comprising: determining a prediction method for a chroma block; determining information for deriving a cross-component prediction model; and A chroma prediction block is generated using the cross-component prediction model.

9. The image encoding method according to claim 8, wherein: The information used to derive the cross-component prediction model includes a reference region and a representative value.

10. The image encoding method according to claim 9, wherein: The reference area and the representative value are determined based on the size of a block.

11. The image encoding method according to claim 9, wherein: The reference area and the representative value are determined based on a prediction mode of a block.

12. The image encoding method according to claim 9, wherein: The reference region is determined based on template matching.

13. The image encoding method according to claim 8, wherein: The prediction method is determined using a model derived from previously encoded blocks.

14. The image encoding method according to claim 8, wherein: The chroma prediction block is generated using a prediction block generated by a method other than the cross-component prediction model.

15. A computer-readable storage medium for storing a bit stream for image decoding, wherein: The bitstream includes coding information, determining a prediction method for a chroma block based on the coding information, determining information used to derive a cross-component prediction model, and A chroma prediction block is generated using the cross-component prediction model.

16. The computer-readable storage medium of claim 15, wherein: The information used to derive the cross-component prediction model includes a reference region and a representative value.

17. The computer-readable storage medium of claim 16, wherein: The reference area and the representative value are determined based on the size of a block.

18. The computer-readable storage medium of claim 16, wherein: The reference area and the representative value are determined based on a prediction mode of a block.

19. The computer-readable storage medium of claim 16, wherein: The reference region is determined based on template matching.

20. The computer-readable storage medium of claim 15, wherein: The prediction method is determined using a model derived from previously decoded blocks.

Citation Information

Patent Citations

  • Damping apparatus and window including same

    KR1020230001455A

  • Structure for Stack the Parcel to the Cargo

    KR1020230086030A

  • Apparatus for processing substrate and method of processing substrate

    KR1020240001582A