Method of decoding and encoding video and method of transmitting bitstream

By using weighted prediction parameters and motion information in video coding, inter-frame prediction and intra-frame prediction are improved, the efficiency problem when brightness changes is solved, and the overall efficiency of video coding is improved.

CN114584766BActive Publication Date: 2026-02-03KONINKLIJKE PHILIPS NV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210313456.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2016-04-29
Filing Date
2017-04-28
Publication Date
2026-02-03
Estimated Expiration
2037-04-28

AI Technical Summary

Technical Problem

Existing video coding technologies suffer from low inter-frame prediction efficiency and inaccurate motion information when brightness changes, and insufficient coding efficiency in intra-frame prediction mode, resulting in low encoding/decoding efficiency.

Method used

By determining the brightness changes of the current block and its neighboring blocks, weighted prediction parameters and motion information are used to improve inter-frame and intra-frame prediction, and the current block is divided into multiple sub-blocks for accurate prediction.

Benefits of technology

It improves the efficiency of intra-frame/inter-frame prediction, enhances the accuracy of motion vectors, improves encoding/decoding efficiency, and effectively encodes intra-frame prediction modes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114584766B_ABST
    Figure CN114584766B_ABST
Patent Text Reader

Abstract

A method of decoding a video, a method of encoding a video, and a method of transmitting a bitstream generated by an image encoding method are disclosed. The method of decoding a video includes determining a prediction mode for a current block as an inter prediction mode, determining whether motion information of the current block is merged with a neighboring block adjacent to the current block based on the prediction mode for the current block being the inter prediction mode, obtaining the motion information of the current block and a weighted prediction parameter based on a determination result, selecting a reference block of the current block based on the motion information, generating a prediction block of the current block by applying the weighted prediction parameter to the reference block, obtaining a residual block of the current block by performing a transform on dequantized transform coefficients of the current block, and reconstructing the current block based on the residual block and the prediction block.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the application with national application number 201780040691.X, international application date of April 28, 2017, national entry date of December 28, 2018, and invention title "Method and apparatus for encoding / decoding video signals". Technical Field

[0002] This invention relates to methods and apparatus for encoding / decoding video signals. Background Technology

[0003] Recently, the demand for multimedia data, such as video, has been growing rapidly on the Internet. However, the speed of channel bandwidth evolution is struggling to keep up with the rapidly increasing volume of multimedia data. Therefore, the Video Coding Experts Group (VCEG) of the International Organization for Standardization (ITU-T) and the MPEG (Moving Picture Experts Group) of ISO / IEC established HEVC (High Efficiency Video Coding) version 1 in February 2014.

[0004] HEVC defines methods for intra-frame prediction, inter-frame prediction, transform, quantization, entropy coding, and in-loop filtering. Inter-frame prediction means performing prediction using reconstructed video and motion information such as motion vectors, reference video indexes, and prediction directions (inter-frame prediction indicators).

[0005] Inter-frame prediction can achieve high prediction efficiency when the correlation between videos is high. However, when the correlation between videos decreases due to brightness changes (e.g., during fade-in or fade-out), the inter-frame prediction results may be incorrect.

[0006] Furthermore, to achieve high coding efficiency through inter-frame prediction or intra-frame prediction, more accurate motion information or a more precise intra-frame prediction mode is required. This increases the amount of data transmitted to the decoding device.

[0007] Therefore, efforts have been made to improve the accuracy of inter-frame prediction and reduce the amount of overhead that needs to be transmitted from the encoding device to the decoding device. Summary of the Invention

[0008] Technical issues

[0009] Therefore, the purpose of this invention is to improve the efficiency of intra-frame prediction / inter-frame prediction when encoding / decoding video.

[0010] Another objective of this invention is to improve inter-frame prediction efficiency by using weights when encoding / decoding video.

[0011] Furthermore, another objective of the present invention is to improve the accuracy of motion vectors by using reconstructed information adjacent to the current block.

[0012] Another objective of this invention is to improve encoding / decoding efficiency by correcting intra-frame prediction results during video encoding / decoding.

[0013] Furthermore, another objective of this invention is to efficiently encode intra-frame prediction modes when encoding / decoding video.

[0014] Furthermore, another objective of this invention is to improve encoding / decoding efficiency by dividing the current block into multiple sub-blocks and performing predictions for each sub-block.

[0015] Technical solution

[0016] The method for decoding video signals according to the present invention may include the steps of: determining whether there is a brightness change between a current image including the current block and a reference image of the current image; when it is determined that there is a brightness change between the current image and the reference image, determining a candidate weight prediction parameter for the current block; determining a weight prediction parameter for the current block based on index information for specifying any one of the candidate weight prediction parameters; and performing prediction on the current block based on the weight prediction parameter.

[0017] The video decoding method and apparatus according to the present invention can determine whether the current block is merged with the adjacent block adjacent to the current block; obtain motion information and weight prediction parameters of the current block based on the determination result; select a reference block of the current block based on the motion information; and generate a prediction block of the current block by applying the weight prediction parameters to the reference block.

[0018] In the video decoding method and apparatus according to the present invention, when it is determined that the current block is merged with the adjacent block, the weight prediction parameter of the current block can be set to be the same as the weight prediction parameter of the adjacent block.

[0019] In the video decoding method and apparatus according to the present invention, when it is determined that the current block will not be merged with the adjacent block, the weight prediction parameters of the current block are obtained from the information decoded from the bitstream.

[0020] In the video decoding method and apparatus according to the present invention, the motion information may include a motion vector, wherein the precision of the motion vector may be adjusted upward based on the reconstructed pixels adjacent to the current block.

[0021] The video decoding method and apparatus according to the present invention can: decode information of the intra-prediction mode of the current block; perform intra-prediction on the current block by using the intra-prediction mode of the current block; determine whether to correct the prediction sample generated as a result of performing intra-prediction; and correct the prediction sample according to the determination result.

[0022] In the video decoding method and apparatus according to the present invention, decoding information of the intra-prediction mode of the current block may include: generating candidate modes of the current block; determining whether there is a candidate mode that is the same as the intra-prediction mode of the current block; and determining the intra-prediction mode of the current block based on the determination result.

[0023] In the video decoding method and apparatus according to the present invention, the candidate mode can be determined based on the usage frequency of at least one of the upper adjacent block adjacent to the upper part of the current block and the left adjacent block adjacent to the left side of the current block.

[0024] In the video decoding method and apparatus according to the present invention, decoding information of the intra-prediction mode of the current block may include: decoding the difference between the intra-prediction modes of the current block and the previous block; and determining the intra-prediction mode of the current block based on the intra-prediction mode of the previous block and the difference.

[0025] The video decoding method and apparatus according to the present invention can: determine motion information and weight prediction parameters of the current block; and encode information representing whether the motion information and weight prediction parameters of the current block are merged with neighboring blocks adjacent to the current block. A predicted block for the current block can be generated by applying the weight prediction parameters to a reference block selected based on the motion information.

[0026] In the video decoding method and apparatus according to the present invention, when the current block is merged with the adjacent block, the weight prediction parameter of the current block can be set to be the same as the weight prediction parameter of the adjacent block.

[0027] In the video decoding method and apparatus according to the present invention, when the current block is not merged with the adjacent block, the method may further include encoding information related to the weight prediction parameters of the current block.

[0028] In the video decoding method and apparatus according to the present invention, the motion information may include a motion vector, and the method may further include encoding information representing whether the precision of the motion vector is adjusted upward based on the reconstructed pixels adjacent to the current block.

[0029] The video decoding method and apparatus according to the present invention can: determine the intra-frame prediction mode of the current block; correct prediction samples generated based on the intra-frame prediction mode; and encode information representing whether the prediction samples are corrected based on the prediction samples and the corrected prediction samples.

[0030] The video decoding method and apparatus according to the present invention may further: generate candidate modes for the current block; determine whether there is a candidate mode that is the same as the intra-prediction mode of the current block; and based on the determination result, encode information representing whether there is a candidate mode that is the same as the intra-prediction mode of the current block.

[0031] In the video decoding method and apparatus according to the present invention, the candidate mode can be determined based on the usage frequency of at least one of the upper adjacent block adjacent to the upper part of the current block and the left adjacent block adjacent to the left side of the current block.

[0032] The video decoding method and apparatus according to the present invention can also encode the difference between the intra-prediction modes of the current block and the previous block.

[0033] Beneficial effects

[0034] This invention can improve the efficiency of intra-frame prediction / inter-frame prediction when encoding / decoding video.

[0035] In addition, this invention can improve inter-frame prediction efficiency by using weights when encoding / decoding video.

[0036] Furthermore, the present invention can improve the accuracy of motion vectors by using reconstructed information adjacent to the current block.

[0037] In addition, the present invention can improve encoding / decoding efficiency by correcting intra-frame prediction results during video encoding / decoding.

[0038] Furthermore, this invention can effectively encode intra-frame prediction modes when encoding / decoding video.

[0039] Furthermore, this invention can improve encoding / decoding efficiency by dividing the current block into multiple sub-blocks and performing predictions for each sub-block. Attached Figure Description

[0040] Figure 1 This is a block diagram illustrating a video encoding apparatus according to an embodiment of the present invention.

[0041] Figure 2 This is a block diagram illustrating a video decoding device according to an embodiment of the present invention.

[0042] Figure 3 This is a schematic diagram illustrating the configuration of a motion estimation method according to an embodiment of the present invention.

[0043] Figure 4 This is a diagram illustrating an example of the position of an adjacent block according to an embodiment of the present invention, from which motion information is obtained for application to the current block.

[0044] Figure 5 It is a diagram that includes examples of aspects such as the current video of the current block and the brightness changes between the current blocks.

[0045] Figure 6 This is a diagram illustrating an example of performing intra-frame prediction using a planar mode.

[0046] Figure 7This is a diagram illustrating an example of performing intra-frame prediction using DC mode.

[0047] Figure 8 This is a diagram illustrating an example of performing intra-frame prediction using horizontal and vertical prediction modes.

[0048] Figure 9 This is a diagram illustrating an example of the brightness variation between the current video and the reference video, including the current block.

[0049] Figure 10 This is a flowchart illustrating a method for applying weight prediction parameters to the current block in a video coding device.

[0050] Figure 11 This is a flowchart of the encoding weight prediction parameters.

[0051] Figure 12 This is a flowchart of the process of decoding weight prediction parameters in a decoding device.

[0052] Figure 13 This is a diagram showing an example of deriving the weight prediction parameters for the current block.

[0053] Figure 14 This is another example of a diagram showing the derived weight prediction parameters for the current block.

[0054] Figure 15 This is a diagram illustrating an example of deriving weight prediction parameters using at least one of the left reconstructed pixel regions and the upper reconstructed pixel regions.

[0055] Figure 16 This is a graph showing the set of weighted prediction parameters.

[0056] Figure 17 This is a graph showing the pixel locations used for regression analysis.

[0057] Figure 18 This is a diagram showing a flowchart of the process of determining whether to use the correction coefficients of the current block.

[0058] Figure 19 This is a diagram illustrating an example of determining the correction coefficients for the current block.

[0059] Figure 20 It is a diagram showing various forms of reconstructed pixel regions.

[0060] Figure 21 This is a flowchart illustrating a method for encoding information related to correction coefficients.

[0061] Figure 22 This is a diagram illustrating a flowchart of a process for determining whether to perform correction for the current block in the decoding device.

[0062] Figure 23 This is a flowchart illustrating a process in an encoding device of determining whether to perform intra-prediction mode prediction on the current block by using the reconstructed pixel regions of the current block.

[0063] Figure 24 This is a diagram illustrating a method for performing intra-frame prediction modes using indexes.

[0064] Figure 25 This is a diagram illustrating an example of a method for determining the intra-prediction mode of the current block, rather than using a prediction method that executes the intra-prediction mode.

[0065] Figure 26 This is a diagram illustrating a method for predicting the intra-prediction mode of the current block by using the reconstructed pixel region of the current block.

[0066] Figure 27 This is a flowchart illustrating information related to the method of encoding and determining the intra-prediction mode of the current block.

[0067] Figure 28 This is a flowchart illustrating the intra-prediction mode for decoding the current block.

[0068] Figure 29 This is a diagram illustrating a method for performing intra-frame prediction by reconstructing pixel regions.

[0069] Figure 30 This is a flowchart illustrating a method for determining the intra-prediction of the current block by reconstructing pixel regions.

[0070] Figure 31 This is a flowchart illustrating a method for encoding information related to performing or not performing intra-frame prediction using reconstructed pixel regions.

[0071] Figure 32 This is a flowchart illustrating a method for decoding information related to whether or not to perform intra-frame prediction using reconstructed pixel regions.

[0072] Figure 33 This is a diagram illustrating a method of performing inter-frame prediction on the current block by using reconstructed pixels adjacent to the current block.

[0073] Figure 34 This is a diagram illustrating an example of motion estimation that can be performed in an encoding or decoding device.

[0074] Figure 35 This is a diagram illustrating the determination of a 4×4 size prediction block using motion vectors estimated in units of 1 / 4 position pixels.

[0075] Figure 36This is a diagram illustrating a flowchart of a process for determining whether to perform inter-frame prediction using reconstructed pixel regions.

[0076] Figure 37 This is a flowchart illustrating the inter-frame prediction method for encoding the current block.

[0077] Figure 38 This is a flowchart illustrating the inter-frame prediction method for decoding the current block.

[0078] Figure 39 This is a diagram illustrating an example of improving the motion vector of the current block by using reconstructed pixel regions.

[0079] Figure 40 This is a diagram illustrating the flowchart of determining motion vectors in an encoding device.

[0080] Figure 41 This is a flowchart illustrating the selection of the optimal motion vector in the encoding device when the values ​​of the base precision K and the additional precision L are adaptively selected on a block-by-block basis.

[0081] Figure 42 This is a graph showing the optimal motion vector for encoding the current block.

[0082] Figure 43 This is a graph showing the optimal motion vector for decoding the current block.

[0083] Figure 44 This is a flowchart illustrating the process of obtaining improved motion vectors in a decoding device.

[0084] Figure 45 This is a flowchart illustrating the process of encoding intra-prediction information for each sub-block when the current block is divided into multiple sub-blocks.

[0085] Figure 46 and 47 This is a diagram illustrating an example of dividing the current block into multiple sub-blocks.

[0086] Figure 48 This is a diagram illustrating an example of determining the weights of sub-blocks.

[0087] Figure 49 This is a flowchart illustrating the information related to the encoding and weights to be applied to each sub-block.

[0088] Figure 50 This is a diagram illustrating the encoding of the intra-prediction mode for the currently encoded sub-block.

[0089] Figure 51 This is a diagram illustrating an example of the sub-block residual intra-prediction mode.

[0090] Figure 52This is a diagram illustrating the flowchart of encoding the intra-prediction mode for the current block.

[0091] Figure 53 This is a diagram illustrating an example of determining intra-frame prediction on a sub-block basis.

[0092] Figure 54 This is a diagram illustrating the flowchart of encoding the intra-prediction mode of a sub-block.

[0093] Figure 55 This is a diagram that shows in detail an example of encoding the intra-prediction mode for each sub-block.

[0094] Figure 56 This is a flowchart illustrating the intra-frame prediction information of a decoded sub-block in a decoding device.

[0095] Figure 57 This is a flowchart illustrating the decoding process related to weights.

[0096] Figure 58 This is a flowchart illustrating the process of decoding the intra-prediction mode of the currently decoded sub-block.

[0097] Figure 59 This is a diagram illustrating another example of the intra-prediction mode for a decoded sub-block.

[0098] Figure 60 This is a diagram illustrating an example of determining whether to use curve mode.

[0099] Figure 61 This is a flowchart illustrating the encoding of the intra-prediction mode for each sub-block using information from the curve pattern.

[0100] Figure 62 This is a flowchart illustrating the process of decoding the intra-prediction mode of each sub-block using information from the curve pattern.

[0101] Figures 63 to 65 This diagram illustrates the method of performing intra-frame prediction on sub-blocks when a transform is performed in an upper-level block unit. Detailed Implementation

[0102] Preferred embodiments of the invention will now be explained with reference to the accompanying drawings. While the invention can have various modifications and configurations, certain embodiments have been described and explained herein. However, this should not be construed as limiting the invention to any specifically disclosed configuration, but rather should be understood to include all modifications, equivalents, or substitutions that may be included within the concept and scope of the invention.

[0103] It will be understood that while the terms “first,” “second,” etc., may be used herein to describe various elements, these elements should not be limited by these terms. These terms are used only to distinguish one element from another. For example, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element, without departing from the scope of the invention. As used herein, the term “and / or” includes any and all combinations of one or more of the associated listed items.

[0104] It should be understood that when a component is referred to as being "connected" or "coupled" to another component, it can be directly connected or coupled to the other component or there may be an intermediary component. Conversely, when a component is referred to as being "directly connected" or "directly coupled" to another component, there is no intermediary component.

[0105] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used herein, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprising,” “including,” and “including,” when used herein, specify the presence of the stated features, integers, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, element components, and / or groups thereof.

[0106] In the following, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. For the purpose of a thorough understanding of the invention, the same reference numerals designate the same parts in the drawings, and repeated descriptions of the same parts will be omitted.

[0107] Figure 1 This is a block diagram illustrating a video encoding device according to an embodiment of the present invention.

[0108] Reference Figure 1 The video encoding device 100 may include a video segmentation unit 110, prediction units 120 and 125, a transform unit 130, a quantization unit 135, a rearrangement unit 160, an entropy coding unit 165, an inverse quantization unit 140, an inverse transform unit 145, a filtering unit 150, and a memory 155.

[0109] Shown independently Figure 1Each configuration component shown is intended to indicate different and specific functions within the video encoding device, but this does not imply that each component unit is formed by a separate piece of hardware or software. That is, component units are arranged and included for ease of description, and at least two component units may form one component unit, or a component unit may be divided into multiple component units to perform their own functions. Unless departing from the spirit of the invention, embodiments in which component units are integrated and embodiments in which component units are separated are included within the scope of the invention.

[0110] Furthermore, some elements may not serve as essential elements for performing the necessary functions of the present invention, but may serve as optional elements to improve performance. The present invention can be implemented by including only the essential elements necessary to achieve the spirit of the invention while excluding elements used to improve performance, and structures that include only the essential elements while excluding optional elements used to improve performance are also included within the scope of the present invention.

[0111] Video partitioning unit 110 can divide the input video into at least one block. Here, a block can mean a coding unit (CU), a prediction unit (PU), or a transform unit (TU). Partitioning can be performed based on quadtrees or binary trees. Quadtree partitioning is a method of dividing an upper-level block into four lower-level blocks, the width and height of which are half the size of the upper-level block. Binary tree partitioning is a method of dividing an upper-level block into two lower-level blocks, the width or height of which is half the size of the upper-level block. By performing the above quadtree- or binary tree-based partitioning, the block can have a square or non-square form.

[0112] In the following embodiments of the present invention, the encoding unit may be used as a unit for performing encoding or as a unit for performing decoding.

[0113] Prediction units 120 and 125 may include an inter-frame prediction unit 120 that performs inter-frame prediction, and an intra-frame prediction unit 125 that performs intra-frame prediction. It can be determined whether inter-frame prediction or intra-frame prediction is used for the prediction unit, and details based on each prediction method (e.g., intra-frame prediction mode, motion vectors, reference video, etc.) can be determined. Here, the processing unit performing the prediction may differ from the processing unit determined by the prediction method and details. For example, the prediction method and prediction mode may be determined in the prediction unit, and the prediction may be performed in the transformation unit.

[0114] The residual value (residual block) between the predicted block and the original block can be input to the transform unit 130. Additionally, prediction mode information, motion vector information, etc., used for prediction can be encoded in the entropy coding unit 165 and passed to the decoder along with the residual value. When using a specific coding mode, prediction units 120 and 125 may not generate a prediction block, and the original block can be encoded as is and transmitted to the decoding unit.

[0115] The inter-frame prediction unit 120 can predict the prediction unit based on information from one of the previous and subsequent videos of the current video, or, if necessary, based on information from a portion of the encoded area in the current video. The inter-frame prediction unit 120 may include a reference video interpolation unit, a motion information generation unit, and a motion compensation unit.

[0116] In the reference video interpolation unit, reference video information can be provided from memory 155, and pixel information equal to or less than integer pixels can be generated from the reference video. In the case of luminance pixels, to generate pixel information equal to or less than integer pixels in a 1 / 4 pixel unit, an 8-tab interpolation filter based on DCT with different filtering coefficients can be used. In the case of chroma signals, to generate pixel information equal to or less than integer pixels in a 1 / 8 pixel unit, a 4-tap interpolation filter based on DCT with different filtering coefficients can be used.

[0117] The motion information generation unit can generate motion information based on the reference video interpolated by the reference video interpolation unit. Here, motion information means motion vectors, reference video indexes, prediction directions, etc. Various methods can be used to estimate motion vectors, such as full-search-based block matching (FBMA), three-step search (TSS), and novel three-step search (NTS). Furthermore, the motion vector can have motion vector values ​​in 1 / 2 or 1 / 4 pixel units based on the interpolated pixels. During inter-frame prediction, the current prediction unit can be predicted using a method different from the method used to generate motion information. Various methods can be used to generate motion information, such as merging motion vectors from adjacent blocks, motion estimation methods (e.g., AMVP (Adaptive Motion Vector Prediction)), etc.

[0118] In an embodiment, Figure 3 This is a diagram illustrating an example of generating motion information through motion estimation. Motion estimation determines the motion vector, reference video index, and inter-frame prediction direction of the current block based on determining when a reference block within the reference video that is the same as or similar to the prediction block has been completed, or which encoding and decoding has been completed.

[0119] When using the AMVP method, the encoding device can generate a motion vector prediction (MV) block by predicting the estimated motion vectors in the current block and encode the difference between the motion vectors and the generated predicted motion vectors (MVD: motion vector difference).

[0120] The method of using motion vectors from neighboring blocks is to apply motion information from neighboring blocks adjacent to the current block to the current block. Here, neighboring blocks can include spatially adjacent blocks and temporally adjacent blocks located at the same position as the current block in the reference video. In an embodiment, Figure 4 This is a diagram showing examples of adjacent blocks to the current block. The encoding device can apply [encoding parameters] to the current block. Figure 4 The motion information of the current block is determined by analyzing the motion information of its neighboring blocks (spatial neighboring blocks: A to E, temporal neighboring blocks: Col). Here, Col refers to a block in the reference video that is at the same or similar location as the current block.

[0121] Intra-prediction unit 125 can generate prediction units based on information of reference pixels adjacent to the current block, which serve as pixel information in the current video. When the neighboring block of the current prediction unit is the block to which inter-frame prediction is performed, such that the reference pixel is a pixel reconstructed by performing inter-frame prediction, it can be replaced by using reference pixels included in the block to which inter-frame prediction is performed as the reference pixel information of the neighboring block to which intra-frame prediction is performed. In other words, when a reference pixel is unavailable, it can be replaced by using at least one of the available reference pixels, while using the information of the unavailable reference pixel.

[0122] During intra-frame prediction, the prediction mode can include a directional prediction mode that uses reference pixel information based on the prediction direction, and a non-directional mode that does not use direction information when performing prediction. The mode used to predict luminance information can be different from the mode used to predict chrominance information. To predict chrominance information, intra-frame prediction mode information used to predict luminance information or luminance signal information can be used.

[0123] In an embodiment, Figure 5 This is a diagram illustrating an example of intra-frame prediction mode.

[0124] In the figure Figure 5 The diagram shows 35 intra-frame prediction modes. Here, modes 0 and 1 can be non-directional prediction modes (or angleless prediction modes), and represent planar mode and DC mode, respectively. Modes from 2 to 34 represent directional prediction modes (or angled prediction modes).

[0125] exist Figure 5The diagram illustrates 35 intra-prediction modes, but a larger number or a smaller number of intra-prediction modes can be used. In this embodiment, 67 intra-prediction modes or 19 intra-prediction modes can be used to encode the current block.

[0126] Alternatively, the number of intra-prediction modes available for the block to be encoded may vary depending on the size or form of the block to be encoded.

[0127] Figure 6 This is a diagram illustrating an example of performing intra-frame prediction using a planar mode.

[0128] In planar mode, predicted pixels can be generated based on vertical and horizontal predicted pixels.

[0129] Here, the horizontally predicted pixel P1 can be generated by performing linear interpolation on the reconstructed pixel at the same position as P1 on the Y-axis and the reconstructed pixel T existing in the upper right of the current block.

[0130] The vertically predicted pixel P2 can be generated by performing linear interpolation on the reconstructed pixel at the same position as P2 on the X-axis and the reconstructed pixel L that exists in the lower left of the current block.

[0131] Predicted pixels can be generated based on the average of the horizontally predicted pixel P1 and the vertically predicted pixel P2.

[0132] Figure 7 This is a diagram illustrating an example of performing intra-frame prediction using DC mode.

[0133] In DC mode, predicted pixels can be generated based on the average value of the reconstructed pixels adjacent to the current block. Because predicted pixels are generated by using the average value of the reconstructed pixels adjacent to the current block, the predicted pixels in the prediction block have uniform pixel values.

[0134] Figure 8 This is a diagram illustrating an example of performing intra-frame prediction using horizontal and vertical prediction modes.

[0135] In the horizontal prediction mode ( Figure 5 As shown in mode 10), a predicted pixel can be generated by copying the reference pixel value located in the horizontal direction (i.e., the reference pixel adjacent to the left of the current block).

[0136] In the vertical prediction mode ( Figure 5 As shown in mode 26), a predicted pixel can be generated by copying the reference pixel value located in the vertical direction (i.e., the reference pixel adjacent to the top edge of the current block).

[0137] As described above, in directional prediction mode, reference pixels located in the direction indicated by the directional prediction mode can be generated as predicted pixels. When there are at least two reference pixels in the direction indicated by the directional prediction mode, predicted pixels can be generated by interpolating the at least two reference pixels.

[0138] Intra-prediction methods can generate prediction blocks after applying AIS (Adaptive Intra-Smoothing) to reference pixels according to the prediction mode. The type of AIS filter applied to the reference pixel can vary. To perform intra-prediction, the intra-prediction mode of the current prediction unit can be predicted from the intra-prediction modes of prediction units adjacent to the current prediction unit. When the intra-prediction mode of the current prediction unit is predicted using information from the intra-prediction modes predicted from neighboring prediction units, and the intra-prediction modes of the current prediction unit and neighboring prediction units are the same, information indicating that the prediction modes of the current prediction unit and neighboring prediction units are the same can be transmitted using predetermined flag information. Alternatively, when the intra-prediction modes of the current prediction unit and neighboring prediction units are different, the prediction mode information of the current block can be encoded by performing entropy coding.

[0139] Furthermore, based on the prediction units generated in prediction units 120 and 125, the residual block includes residual value information as the difference between the prediction unit to which the prediction is performed and the original block of the prediction unit. The generated residual block can be input to transformation unit 130.

[0140] In the transform unit 130, residual blocks including residual data can be transformed using transform methods such as DCT, DST, and KLT (Karhenen Loeve transform). Here, the transform method can be determined based on the intra-prediction mode of the prediction unit used to generate the residual blocks. For example, DCT can be used in the horizontal direction, and DST can be used in the vertical direction, depending on the intra-prediction mode.

[0141] Quantization unit 135 can perform quantization on values ​​transformed from the frequency domain in transform unit 130. The quantization coefficients can vary depending on the block or importance of the video. The values ​​calculated in quantization unit 135 can be provided to dequantization unit 140 and rearrangement unit 160.

[0142] Transform unit 130 or quantization unit 135, or both, may be optionally included in video encoding device 100. In other words, video encoding device 100 may perform at least one of transformation and quantization on the residual data of the residual block, or it may encode the residual block by skipping both transformation and quantization. In video encoding device 100, at least one of transformation and quantization may not be performed, and the block that is not transformed and quantized and is input to entropy encoding unit 165 is generally referred to as a transform block.

[0143] The rearrangement unit 160 rearranges the coefficient values ​​of the quantized residuals.

[0144] The rearrangement unit 160 can transform coefficients in two-dimensional block form into unidirectional vector form by using a coefficient scanning method. For example, in the rearrangement unit 160, a scan is performed from DC coefficients to coefficients in the high-frequency region using a predetermined scan type to transform them into 1D vector form.

[0145] Entropy coding unit 165 can perform entropy coding based on the value calculated by rearrangement unit 160. Entropy coding can use various coding methods, such as exponential Golomb, context-adaptive variable-length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc.

[0146] Entropy coding unit 165 can encode various types of information, such as residual coefficient information, prediction mode information, partitioning unit information, prediction unit information, transmission unit information, motion vector information, reference video information, block interpolation information, and filtering information input from rearrangement unit 160 and prediction units 120 and 125, including coding unit and block type information. Entropy coding unit 165 can encode flags indicating whether a coefficient representing a transform block is 0 in some block units within the transform block, flags indicating whether the absolute value of a coefficient is greater than 1, flags indicating whether the absolute value of a coefficient is greater than 2, etc. Entropy coding unit 165 encodes the sign of coefficients other than 0. Furthermore, for coefficients with an absolute value greater than 2, the residual value obtained by subtracting 2 from the absolute value can be encoded.

[0147] In the entropy coding unit 165, the coefficient values ​​of the coding unit input from the rearrangement unit 160 can be entropy encoded.

[0148] In the dequantization unit 140 and the inverse transform unit 145, the value quantized in the quantization unit 135 is dequantized, and the value transformed in the transform unit 130 is inversely transformed. The residual values ​​generated in the dequantization unit 140 and the inverse transform unit 145 can be combined with the prediction blocks generated for each prediction unit using prediction units 120 and 125, so that a reconstruction block can be generated.

[0149] The filtering unit 150 may include at least one of a deblocking filter, an offset correction unit, and an ALF (adaptive loop filter).

[0150] Deblocking filters can remove block distortion caused by boundaries between blocks in a reconstructed video. To determine whether to apply a deblocking filter, the decision can be based on the pixels in some rows or columns included in the block. When applying a deblocking filter to a block, a strong or weak filter can be applied depending on the intensity of the deblocking filter. Furthermore, when applying deblocking filters, horizontal and vertical filtering can be performed in parallel while vertical and horizontal filtering are being performed.

[0151] The offset correction unit can utilize the original video to correct the offset in the pixel units of the video being deblocked. To perform offset correction on a specific video, the pixels included in the video can be divided into arbitrary regions, the regions where offset correction will be performed can be determined, and then an offset can be applied to the corresponding regions or an offset can be applied taking into account the edge information of each pixel.

[0152] ALF (Adaptive Loop Filtering) can be performed based on the comparison between the reconstructed video and the original video. By dividing the pixels included in the video into predetermined groups and determining the individual filter to be applied to each group, different filtering can be performed on each group. In the case of a luma signal, information about whether to apply ALF can be transmitted to each coding unit (CU), and the form and filter coefficients of the ALF filter to be applied can vary according to each block. Alternatively, the same form (fixed form) of the ALF filter can be applied regardless of the characteristics of the target block to which it is applied.

[0153] The memory 155 can store reconstructed blocks or video calculated using the filtering unit 150, and provide the stored reconstructed blocks or video to the prediction units 120 and 125 when performing inter-frame prediction.

[0154] Figure 2 This is a block diagram illustrating a video decoding device according to an embodiment of the present invention.

[0155] See Figure 2 The video decoder 200 may include an entropy decoding unit 210, a rearrangement unit 215, an inverse quantization unit 220, an inverse transform unit 225, prediction units 230 and 235, a filtering unit 240, and a memory 245.

[0156] When a video bitstream is input from a video encoder, the input bitstream can be decoded by reversing the processing of the video encoder.

[0157] The entropy decoding unit 210 can perform entropy decoding by reversing the entropy encoding performed in the entropy encoding unit of the video encoder. For example, various methods can be applied, such as Exponential Columbus, Context Adaptive Variable Length Coding (CAVLC), and Context Adaptive Binary Arithmetic Coding (CABAC), in association with the methods performed in the video encoder. The entropy decoding unit 210 can decode flags indicating whether the coefficients of a transform block are 0 in some block units within the transform block, flags indicating whether the absolute value of a coefficient is greater than 1, flags indicating whether the absolute value of a coefficient is greater than 2, etc. Furthermore, the entropy decoding unit 210 can decode the coefficient signal for coefficients other than 0. For coefficients with an absolute value greater than 2, the remaining value obtained by subtracting 2 from the absolute value can be decoded.

[0158] In the entropy decoding unit 210, information related to intra-frame prediction and inter-frame prediction performed during encoding can be decoded.

[0159] Rearrangement unit 215 can rearrange the bitstream entropy-decoded in entropy decoding unit 210 based on the rearrangement method used in the encoding unit. Rearrangement can be performed on coefficients in 2D block form by reconstructing coefficients represented in 1D vector form. Information related to the coefficient scan performed in the encoding unit can be provided in rearrangement unit 215, and rearrangement can be performed by using a scan method that reverses the scan order performed in the corresponding encoding unit.

[0160] The dequantization unit 220 can perform dequantization based on the quantization parameters provided from the encoder and the coefficient values ​​of the rearranged block.

[0161] The inverse transform unit 225 can perform an inverse transform on the dequantized transform coefficients using a predetermined transform method. Here, the transform method can be determined based on information such as the prediction method (inter-frame / intra-frame prediction), block size / format, and intra-frame prediction mode.

[0162] Prediction units 230 and 235 can generate prediction blocks based on information about generating prediction blocks provided by entropy decoding unit 210, and video information provided by memory 245 or previously decoded blocks.

[0163] Prediction units 230 and 235 may include a PU determination unit, an inter-frame prediction unit, and an intra-frame prediction unit. The PU determination unit may: receive various types of information, such as prediction unit information input from the entropy decoding unit 210, prediction mode information of the intra-frame prediction method, and motion prediction-related information of the inter-frame prediction method; determine the prediction unit in the current coding unit; and determine whether to perform inter-frame prediction or intra-frame prediction on the prediction unit. The inter-frame prediction unit 230 may perform inter-frame prediction on the current prediction unit by using information required for inter-frame prediction of the current prediction unit provided from the video encoder, based on information included in a video preceding or following the current video that includes the current prediction unit. Alternatively, it may perform inter-frame prediction based on information from a reconstructed portion of the current video that includes the current prediction unit.

[0164] To perform inter-frame prediction, the method of using either a merging method or a motion estimation method can be determined based on the coding unit as the method for generating motion information of the prediction units included in the corresponding coding unit.

[0165] Intra-prediction unit 235 can generate prediction blocks based on pixel information within the current video. When the prediction unit is one that performs intra-prediction, intra-prediction can be performed based on intra-prediction mode information provided by the video encoder. Intra-prediction unit 235 may include an AIS (Adaptive Intra-Smoothing) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter performs filtering on the reference pixels of the current block, and the AIS filter can be applied by determining whether to apply the filter based on the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixels of the current block using the prediction mode of the prediction unit provided by the video encoder and the AIS filtering information. When the prediction mode of the current block is a mode that does not perform AIS filtering, the AIS filter may not be applied.

[0166] Based on pixel values ​​obtained by interpolating reference pixels, when the prediction unit's prediction mode is an intra-prediction prediction unit, the reference pixel interpolation unit can generate reference pixels with pixel units having integer values ​​equal to or less than integer values ​​by performing reference pixel interpolation. When the current prediction unit's prediction mode is the current prediction unit generating a prediction block instead of performing interpolation on reference pixels, interpolation of reference pixels is not required. When the current block's prediction mode is DC mode, the DC filter can generate the prediction block through filtering.

[0167] The reconstructed block or video can be provided to the filtering unit 240. The filtering unit 240 may include a deblocking filter, an offset correction unit, and an ALF.

[0168] The video encoder can provide information about whether to apply a deblocking filter to a corresponding block or video, and if so, whether to apply a strong or weak filter. In the video decoder's deblocking filter, information about the deblocking filter can be obtained from the video encoder, and deblocking filtering for the corresponding block can be performed in the video decoder.

[0169] The offset correction unit can perform offset correction on the reconstructed video based on the offset correction type and offset value information applied to the video during encoding.

[0170] ALF can be applied to the coding unit based on information provided by the encoder, such as whether ALF is applied and ALF coefficient information. Such ALF information can be provided by including it in a specific parameter set.

[0171] The memory 245 can store reconstructed video or blocks for use as reference video or reference blocks. Additionally, the memory 245 can provide the reconstructed video to the output unit.

[0172] In the embodiments described below, "current block" can mean the target block to be encoded / decoded. Furthermore, depending on the encoding / decoding process, the current block can mean a code tree block, an encoded block, a prediction block, or a transform block.

[0173] Figure 9 It is a diagram showing aspects of the brightness variation between the current video and the reference video, including the current block.

[0174] When inter-frame prediction is performed on the current block, and the brightness variation between the current video and the reference video increases, the brightness variation between the selected prediction blocks in the current block and the reference video can also increase. Therefore, the error caused by inter-frame prediction of the current block increases, and thus the energy of the residual signal of the current block can be expected to increase. Furthermore, with the increase in the energy of the residual signal, an increase in the error caused by quantization can be expected. As a result, when a brightness variation occurs between the current video and the reference video, the error in the residual block will increase compared to the case where no brightness variation occurs.

[0175] Therefore, in this invention, brightness variations between videos can be estimated to generate weighted prediction parameters, and a method for performing inter-frame prediction using these weighted prediction parameters is provided. By using the weighted prediction parameters during inter-frame prediction, significant energy increases in residual blocks can be prevented, and thus prediction efficiency can be improved.

[0176] The following text, with reference to the figure, will describe in detail the performance of inter-frame prediction using weighted prediction parameters.

[0177] Figure 10This is a flowchart illustrating a method for applying weight prediction parameters to the current block in a video encoding device.

[0178] In S1001, the encoding device can set the motion information and weight prediction information (weight prediction parameters, weight prediction control information) of neighboring blocks as the motion information and weight prediction information of the current block, and encode them when performing inter-frame prediction on the current block. Here, the weight prediction control information indicates whether the weight prediction parameters are used when performing inter-frame prediction, and the weight prediction parameters can be the weight values ​​used when performing inter-frame prediction. Here, the encoding device can calculate the cost (cost A) when using the inter-frame prediction block of the current block by using the motion information and weight prediction information derived from neighboring blocks.

[0179] Here, adjacent blocks can include spatially adjacent blocks that are adjacent to the current block, and temporally adjacent blocks in the reference video that have the same or similar positions as the current block. In the embodiment, spatially adjacent blocks A to E Figure 4 The temporally adjacent block Col shown can be defined as the adjacent block of the current block.

[0180] Subsequently, in S1002, the encoding device can determine the best motion information for the current block by performing motion estimation, temporarily generate a prediction block for the current block using the estimated motion information, and estimate the weight prediction parameters for the current block based on the generated prediction block.

[0181] The weighted prediction parameters may include at least one of a multiplication parameter multiplied by the predicted pixel and an addition parameter added to the predicted pixel. Here, the multiplication and addition parameters can be derived based on regression analysis. In an embodiment, Equation 1 below illustrates an example of a regression analysis model.

[0182] [Formula 1]

[0183] e 2 =∑[Y-(wX+o)] 2

[0184] In Formula 1, Y represents the original data of the current block, X represents the data of the prediction block temporarily generated for the current block, w represents the slope of the regression line, o represents the intercept value of the regression line, and e represents the prediction error of the regression line. In the embodiment, Y is the original pixel value of the current block and may have the range of all or part of the current block, and X is the pixel value of the prediction block temporarily generated for the current block and may have the range of all or part of the prediction block.

[0185] The weighted prediction parameters can be obtained by performing partial differentiation on Equation 1 for each of w and o. In an embodiment, the w and o that minimize the square of the error e when performing partial differentiation on Equation 1 for each of w and o can be set as multiplication and addition parameters, respectively.

[0186] The weight prediction parameter value calculated based on Formula 1 can have a real value. The weight prediction parameter can be set to a real value calculated based on Formula 1, or it can be set to an integer value obtained by converting the real value calculated based on Formula 1 into an integer value. In an embodiment, the weight prediction parameter can be derived as an integer value derived by multiplying the real value calculated based on Formula 1 by 2N. The parameter N used to convert the weight prediction parameter into an integer value can be encoded in a block unit, region unit, or upper-layer header. Alternatively, the encoding and decoding devices can use a preset N. In the embodiments described below, it is assumed that an integer value multiplied by 2N is used for the weight prediction parameter.

[0187] To estimate the weight prediction parameters of the current block, a regression analysis model described in Equation 1 can be used. However, the method for estimating the weight prediction parameters of the current block is not limited to the example above. Methods other than regression analysis models can be used to estimate the weight prediction parameters of the current block.

[0188] In S1003, when the weight prediction parameters of the current block have been estimated, the encoding device can calculate the cost (cost B) when the estimated weight prediction parameters are applied to the prediction block temporarily generated for the current block, and the cost (cost C) when the estimated weight prediction parameters are not applied.

[0189] The encoding device can determine whether to use the weight prediction parameters of the current block and whether to use the weight prediction parameters of the current block that combine adjacent blocks by comparing these two costs.

[0190] In an embodiment, in S1004, firstly, the encoding device can determine whether applying the estimated weight prediction parameters to the current block is the optimal situation by comparing the cost (cost B) when the estimated weight prediction parameters are applied to the current block with the cost (cost B) when the estimated weight prediction parameters are not applied.

[0191] In addition, in S1005, the encoding device can: when applying motion information and weight prediction parameters of neighboring blocks, compare the best case of cost B and cost C with cost (cost A); and determine whether to use the estimated motion information and estimated weight prediction information in the current block, or to combine the weight prediction information with the motion information existing in neighboring blocks, or to use the weight prediction information.

[0192] The encoding weight prediction information in the encoding device will then be described.

[0193] Figure 11 It is a diagram showing a flowchart of encoding weight prediction information.

[0194] In S1101, the encoding device may encode information indicating whether the motion information and weight prediction information of the current block are merged with an adjacent block. This information may be a 1-bit flag, but is not limited thereto.

[0195] In S1102, when it is determined that the motion information and weight prediction information of the current block are merged with an adjacent block, in S1103, the encoding device may encode information for identifying the adjacent block merged with the current block. Here, the information for identifying the adjacent block may be index information, which represents the index of the adjacent block merged with the current block among the adjacent blocks.

[0196] Meanwhile, in S1102, when it is determined that the motion information and weight prediction information of the current block are not merged with an adjacent block, in S1104, the encoding device may encode the motion information for encoding the current block, and in S1105, the encoding device may encode information indicating whether to use the weight prediction parameters of the current block (i.e., weight prediction control information). This information may be a 1-bit flag, but is not limited thereto.

[0197] In S1106, when it is determined not to use the weight prediction parameters of the current block, the encoding device may not encode information related to the weight prediction parameters.

[0198] Meanwhile, in S1106, when it is determined to use the weight prediction parameters of the current block, in S1107, the encoding device may encode the information of the weight prediction parameters of the current block.

[0199] Here, the information of the weight prediction parameters may be the weight prediction parameters or the difference of the weight prediction parameters. In an embodiment, the encoding device may set 1<<N as the predicted value of the weight prediction parameters according to N used for converting the weight prediction parameters into integer values, and encode the difference between the weight prediction parameters and the predicted value. When encoding at least one of the multiplication parameter and addition parameter of the weight prediction parameters, the encoding using the predicted value and the difference may be applied. In an embodiment, the multiplication parameter may be encoded by using the difference between the multiplication parameter and the predicted value. Meanwhile, the addition parameter may be encoded as it is.

[0200] The encoding device can encode the difference between the weight prediction parameters of the current block and the weight prediction parameters of the adjacent blocks. For example, suppose inter-frame prediction is performed for the current block using the previously used direction, and its weight prediction parameters are (59, 4). Here, w in the weight prediction parameters denoted as (w, o) can represent a multiplication parameter, and o can represent an addition parameter. Suppose inter-frame prediction is performed along the previously used direction for adjacent blocks A to E, and Col, and their prediction parameters are (51, 0), (62, 4), (59, 4), (64, -1), (59, 2), and (70, 4).

[0201] The encoding device can encode information related to the weight prediction parameter of the current block by using the weight prediction parameter of the neighboring block with the lowest cost among the neighboring blocks, the weight prediction parameter of the neighboring block whose difference from the weight prediction parameter of the current block is minimized, or the weight prediction parameter of the neighboring block determined to be the best after considering the difference from the weight prediction parameter of the current block and the overhead of the allocated index. In an embodiment, when the encoding device selects the weight prediction parameter of block C among the weight prediction parameters of blocks A to E and Col, the weight prediction parameter of block C (i.e., (59, 4)) can be set to the predicted value, and the difference (0, 0) with the weight prediction parameter of the current block can be encoded. In addition, the encoding device can encode index information for identifying the selected neighboring block (e.g., C). Here, when calculating the cost for selecting the best candidate, the cost can be determined after calculation using the index information and the difference with the weight parameter.

[0202] exist Figure 10 and 11 In this embodiment, when the current block merges with a neighboring block, the motion information and weight prediction parameters of the current block can be set for the neighboring block. In another embodiment, the encoding device can determine whether each of the motion information and weight prediction parameters of the current block is merged with a neighboring block. In this embodiment, the motion information of the current block can be set to the motion information of the neighboring blocks. Meanwhile, the weight prediction parameters of the current block can be set to estimated values. Here, regardless of whether the motion information of the current block is merged with a neighboring block, or whether the weight prediction parameters of the current block are merged with a neighboring block, the weight prediction parameters derived by estimation can be encoded in separate information.

[0203] An example of decoding weight prediction parameters in a decoding device will then be described.

[0204] Figure 12 This is a flowchart illustrating the decoding weight prediction parameters in a decoding device.

[0205] In S1201, the decoding device may decode information indicating whether the motion information and weight prediction information of the current block are merged with an adjacent block. This information may be a 1-bit flag, but is not limited thereto.

[0206] In S1202, when it is determined that the motion information and weight prediction information of the current block have been merged with an adjacent block, in S1203, the decoding device may decode information for identifying the adjacent block merged with the current block. Here, the information for identifying the adjacent block may be index information that represents the index of the adjacent block merged with the current block among the adjacent blocks. The decoding device may set the motion information and weight prediction information of the adjacent block specified by the index information as the motion information and weight prediction information of the current block.

[0207] Meanwhile, in S1202, when it is determined that the motion information and weight prediction information of the current block have not been merged with an adjacent block, in S1204, the decoding device may decode the motion information used when decoding the current block, and in S1205, the decoding device may decode information indicating whether to use the weight prediction parameter of the current block (i.e., weight prediction control information). This information may be a 1-bit flag, but is not limited thereto.

[0208] In S1206, when it is determined not to use the weight prediction parameter of the current block, the decoding device may not decode information related to the weight prediction parameter.

[0209] Meanwhile, in S1206, when it is determined to use the weight prediction parameter of the current block, in S1207, the decoding device may decode the information of the weight prediction parameter of the current block.

[0210] Here, the information of the weight prediction parameter may represent the weight prediction parameter or the difference between the weight prediction parameter and the predicted value of the weight prediction parameter. In an embodiment, the decoding device may use 1<<N as the predicted value of the weight prediction parameter based on the parameter N used to transform the weight prediction parameter into an integer value. The decoding device may obtain the weight prediction parameter of the current block by adding the predicted value of the weight prediction parameter and the weight prediction parameter difference decoded from the bitstream.

[0211] When decoding is performed for at least one of the multiplication parameter and addition parameter of the weight prediction parameter, decoding using the predicted value and the difference may be applied. In an embodiment, the multiplication parameter may be decoded by using the predicted value and the difference. Meanwhile, the addition parameter may be used for the value decoded as it is from the bitstream.

[0212] The information associated with the weight prediction parameters and transmitted via a bitstream represents the difference between the weight prediction parameters of the current block and those of neighboring blocks. Here, the decoding device can decode the identification information that identifies neighboring blocks, and obtain the weight prediction parameters of the current block by adding the difference between the weight prediction parameters of the neighboring blocks specified by the decoded identification information and the decoded weight prediction parameters.

[0213] When the weight prediction parameters for the current block are obtained, inter-frame prediction for the current block can be performed using the weight prediction parameters. In an embodiment, the decoding device can perform inter-frame prediction by applying the weight prediction parameters to the prediction block of the current block. Specifically, the decoding device can perform inter-frame prediction for the current block by multiplying the pixels included in the prediction block with a multiplication parameter and adding the addition parameter to the multiplication result.

[0214] exist Figure 12 When a current block merges with an adjacent block, motion information and weight prediction parameters for the current block can be set for the adjacent blocks. In another embodiment, the decoding device can separately decode whether the motion information of the current block is merged with the adjacent block, and whether the weight prediction parameters of the current block are merged with the adjacent block. Based on each piece of information, it can be determined whether to merge the motion information of the current block with the adjacent block, and whether to merge the weight prediction parameters of the current block with the adjacent block.

[0215] In the above embodiments, it has been described that the weight prediction parameters of the current block are obtained, thereby the encoding device encodes information related to the weight prediction parameters into a bit stream, and the decoding device decodes the information related to the weight prediction parameters from the bit stream.

[0216] Unlike the example above, the encoding and decoding devices can derive the weight prediction parameters using the same method, but there are no weight prediction parameters for encoding / decoding the current block. Here, the previous reference can be omitted. Figure 11 and 12 Encoding / decoding of the weight prediction parameters.

[0217] In an embodiment, Figure 13 This is a diagram showing an example of deriving the weight prediction parameters for the current block.

[0218] A predicted block for the current block can be generated based on a reference block in the reference video, indicated by the motion vector of the current block. The encoding and decoding devices can then use reconstructed pixels adjacent to the current block within the current video (in... Figure 13 In the middle, the pixels marked "B" and the reconstructed pixels adjacent to the reference block in the reference video (i.e., the prediction block of the current block) Figure 13 In the middle, the pixel marked "A" is used to derive the weight prediction parameters for the current block.

[0219] In an embodiment, the weight prediction parameters for the current block can be derived by applying the reconstructed pixel B adjacent to the current block to Y and the reconstructed pixel A adjacent to the reference block (i.e., the prediction block of the current block) to X in Equation 1. In an embodiment, w and o, calculated by applying the reconstructed pixels adjacent to the current block and the reconstructed pixels adjacent to the reference block, can be set as multiplication parameters and addition parameters, respectively.

[0220] In the above embodiments, weight prediction parameters are derived by using reconstructed pixels included in lines adjacent to the current block and the reference block. Unlike the example shown above, weight prediction parameters can be derived by using reconstructed pixels included in multiple lines adjacent to the current block and the reference block. Whether multiple lines are used, or the number of lines used to estimate the weight prediction parameters, can be transmitted to the decoding device either in blocks or through encoding in the upper-layer header.

[0221] Figure 14 This is another example of a diagram showing the derived weight prediction parameters for the current block.

[0222] The encoding and decoding devices can derive the weight prediction parameters for the current block based on the trends of neighboring pixels present in each of the current and reference blocks.

[0223] In an embodiment, the encoding device and the decoding device may derive a first weight prediction parameter based on neighboring pixels adjacent to the current block or the reference block, and may derive a second weight prediction parameter based on a second neighboring pixel that is not adjacent to the current block or the reference block but is adjacent to a neighboring pixel adjacent to the current block or the reference block.

[0224] In the embodiments, Figure 14 In the example shown, the encoding and decoding devices can generate a first weight prediction parameter based on the neighboring pixel A adjacent to the current block and the neighboring pixel C adjacent to the reference block (prediction block), and generate a second weight prediction parameter based on the neighboring pixel B that is not adjacent to the current block but is adjacent to the neighboring pixel A of the adjacent current block, and the neighboring pixel D that is not adjacent to the reference block but is adjacent to the neighboring pixel C of the adjacent reference block.

[0225] The weight prediction parameters for the current block can be derived by applying the difference between the first and second weight prediction parameters to the first weight prediction parameter. In an embodiment, when the first weight prediction parameter is (59, 4) and the second weight prediction parameter is (59, 5), the difference between the first and second weight prediction parameters is (0, -1). Therefore, by applying the difference to the first weight prediction parameter, the weight prediction parameters for the current block can be determined as (59, 3).

[0226] In another embodiment, weighted prediction parameters can be set for each location of a pixel within the prediction block. Assuming the difference between the first and second weighted prediction parameters is (0, -1), the weighted prediction parameters applied to the prediction block can be variably set according to the pixel location within the prediction block. In an embodiment, the weighted prediction parameters applied to pixels present at the edges of the prediction block can be determined as (59, 3) obtained by applying the difference to the first weighted prediction parameter. Here, pixels present at the edges of the prediction block can include pixels adjacent to the left boundary and the top boundary of the prediction block (e.g., in...). Figure 14 (The pixel at the location marked "a" in the text).

[0227] For pixels present at the edge of the prediction block and their adjacent pixels, weighted prediction parameters obtained by applying the difference to weighted prediction parameters applied to pixels present at the edge of the prediction block can be applied. In an embodiment, the difference between pixels present at the edge of the prediction block and their adjacent pixels (e.g., Figure 14 The weight prediction parameter applied to the pixel marked "b" in the prediction block can be determined as (59, 2), which is obtained by applying the difference to the weight prediction parameter (59, 3) applied to the pixel located at the edge of the prediction block.

[0228] As described above, when a pixel location becomes farther away from the edge of the prediction block, different weight prediction parameters can be applied to each pixel location by repeatedly applying the difference between the first and second weight prediction parameters. Therefore, in Figure 14 In the example shown, the weight prediction parameter (59, 3) can be applied to the pixel at position "a", the weight prediction parameter (59, 2) can be applied to the pixel at position "b", the weight prediction parameter (59, 1) can be applied to the pixel at position "c", and the weight prediction parameter (59, 0) can be applied to the pixel at position "d".

[0229] In the above embodiment, the weight prediction parameters are estimated using two lines adjacent to the current block and the reference block. Unlike the example shown above, the weight prediction parameters can be estimated using at least two lines adjacent to the current block and the reference block. Whether at least two lines are used, or the number of lines used to estimate the weight prediction parameters, can be transmitted to the decoding device either in blocks or through encoding in the upper-layer header.

[0230] exist Figure 13 and Figure 14In the example shown, whether the weight prediction parameters of the current block are determined by using the weight prediction parameters of neighboring pixels present in the current block and the reference block respectively, and whether the weight prediction parameters of the current block are determined by reflecting the trend of the weight prediction parameters of pixels adjacent to the current block and the reference block, can be encoded on a block-by-block basis or through the upper-layer header. Alternatively, the encoding and decoding devices can consistently use one of these two methods.

[0231] In another embodiment, the weight prediction parameters can be derived by using either the reconstructed pixel region adjacent to the left of the current block and the reference block, or the reconstructed pixel region adjacent to the top of the current block and the reference block.

[0232] In an embodiment, Figure 15 This is a diagram illustrating an example of deriving weight prediction parameters using one of the left-side reconstructed pixel regions and the top-side reconstructed pixel regions.

[0233] First, the encoding device can derive the first weight prediction parameters by using pixels A and C included in the reconstructed pixel region adjacent to the upper edge of the current block and the reference block.

[0234] Subsequently, the encoding device can derive the second weighted prediction parameters by using pixels B and D included in the reconstructed pixel region adjacent to the left of the current block and the reference block.

[0235] Subsequently, the encoding device can determine the optimal weight prediction parameters for the current block by comparing the first weight prediction parameters and the second weight prediction parameters.

[0236] Here, the encoding device can encode information indicating which region among the left and upper reconstructed pixel regions of the current block and the reference block is used, or information indicating the best weight prediction parameter of the current block between the first weight prediction parameter and the second weight prediction parameter, and transmit it to the decoding device.

[0237] In another embodiment, the encoding and decoding devices can estimate weight prediction parameters by using one of a fixed region between the upper reconstructed pixel region and the left reconstructed pixel region, depending on the block form. For example, when the currently encoded block has a horizontally elongated rectangular form, the weight prediction parameters are estimated using the upper reconstructed pixel region, and when the currently encoded block has a vertically elongated rectangular form, the weight prediction parameters are estimated using the left reconstructed pixel region. Alternatively, when the currently encoded block has a square form, the weight prediction parameters are estimated using both the left and upper reconstructed pixel regions.

[0238] The encoding device can configure a set of weight prediction parameters, which includes multiple weight prediction parameters, by using weight prediction parameters estimated using reconstructed pixel regions, and determine the optimal weight prediction parameters for the current block based on the set of weight prediction parameters.

[0239] In an embodiment, Figure 16 This is a view showing the set of weighted prediction parameters.

[0240] The encoding device can derive weight prediction parameters (w, o) by using reconstructed pixel regions adjacent to the current block and the reference block, and generate additional weight prediction parameters by applying offsets to the derived weight values.

[0241] In an embodiment, such as Figure 16 As shown, at least one of the offsets α and β is applied to the estimated weight prediction parameters (w, o) to generate five additional weight prediction parameters. Here, it is assumed that the initial values ​​of α and β are each set to 1. Unlike the example shown above, α and β may tend to gradually increase or decrease. When the candidate order included in the set of weight prediction parameters is not limited to the example above, the order can be changed by using any method.

[0242] The encoding device can determine the optimal weight prediction parameters for the current block from the weight prediction parameter set and encode information identifying the determined weight prediction parameters (e.g., index information). Additionally, the encoding device can encode information on the offset used to generate the weight prediction parameter set or the number of weight prediction parameters, either on a block-by-block basis or via the upper-layer header.

[0243] The decoding device can configure the weight prediction parameters using the same method used in the encoding device, and obtain the weight prediction parameters for the current block based on the received index information.

[0244] The range of neighboring pixels adjacent to the current block or reference block and used to derive the weight prediction parameters of the current block can be limited to a portion of the pixels adjacent to the current block or reference block.

[0245] In an embodiment, Figure 17 This is a view showing the locations of the pixels used for regression analysis. As... Figure 17 In the example shown in (a), to derive the weight prediction parameters for the current block, all neighboring pixels adjacent to either the current block or the reference block can be used. Alternatively, as Figure 17 In the examples shown in (b) and (c), a portion of the neighboring pixels adjacent to the current block or reference block can be used to derive the weight prediction parameters for the current block or reference block.

[0246] Alternatively, the encoding device may encode information indicating the sampling method of neighboring pixels used to estimate weight prediction parameters. In an embodiment, the encoding device may encode information indicating the sampling method of neighboring pixels used to estimate weight prediction parameters. Figure 17 Information on which method is used to sample adjacent samples in examples (a) to 17(c).

[0247] exist Figure 17 In the examples shown in (a) through 17(c), only neighboring pixels adjacent to the current block or reference block are used. However, pixels that are not adjacent to the current block or reference block but are adjacent to neighboring pixels of the adjacent current block or reference block may also be used to determine the weight prediction parameters. In an embodiment, for the weight prediction parameters of the current block, pixels included in the top M columns or left N rows of the current block or reference block (where M and N are integers equal to or greater than 2) may be used.

[0248] Furthermore, the range of neighboring pixels used to derive the weight prediction parameters for the current block can be extended to a range where the width of the current block is extended by a factor of K or the height of the current block is extended by a factor of L (K and L are integers equal to or greater than 1). In an embodiment, when the position of the top-left pixel of the current block or reference block is (0, 0), the top neighboring pixels at positions (-1, -1) to (2K-1, -1) and the left neighboring pixels at positions (-1, -1) to (-1, 2L-1) can be used to derive the weight prediction parameters for the current block.

[0249] When the prediction block used to generate the current block is used for intra-frame prediction, the reconstructed pixel values ​​of the current block can be considered to perform corrections on the prediction block. The method for performing corrections on prediction blocks generated through intra-frame prediction will be described in detail below.

[0250] Figure 18 This is a view showing a flowchart illustrating the method for determining whether to apply correction coefficients to the current block.

[0251] First, in S1801, the encoding device can determine whether to encode the current block using intra-frame prediction. When the current block is encoded using intra-frame prediction, in S1802, the cost (cost A) of using intra-frame prediction can be calculated.

[0252] During this process, if the current block is not encoded via intra-frame prediction in S1801, the process can be terminated. Figure 18 The flowchart.

[0253] When the current block is encoded via intra-frame prediction, in S1803, correction can be performed on the predicted block of the current block, which is generated as a result of intra-frame prediction, by using reconstructed pixel regions adjacent to the current block. Here, the reconstructed pixel regions may include neighboring pixels adjacent to the current block.

[0254] Then, in S1804, the encoding device can calculate the cost (cost B) of performing correction on the current block.

[0255] Subsequently, in S1805, the encoding device can determine whether to apply correction to the current block by comparing the cost (cost A) calculated by performing intra-frame prediction on the current block and the cost (cost B) calculated by applying correction to the predicted block generated as a result of performing intra-frame prediction. For example, when cost A is greater than cost B, it can be determined that correction using the reconstructed pixel region will not be applied to the current block. Meanwhile, when cost B is greater than cost A, it can be determined that correction using the reconstructed pixel region will be applied to the current block.

[0256] Figure 19 This is a diagram illustrating an example of determining the correction coefficients for the current block.

[0257] When intra-frame prediction is used for the current block, the coding device can calculate the standard deviation of the reconstructed pixel regions adjacent to the current block. exist Figure 19 In this context, the reconstructed pixel region includes adjacent pixels adjacent to the left boundary of the current block, adjacent pixels adjacent to the top boundary of the current block, adjacent pixels adjacent to the top corner of the current block, etc. The size or form of the reconstructed pixel region is not limited to the example shown above.

[0258] In an embodiment, Figure 20 It is a view that shows various forms of reconstructed pixel regions.

[0259] exist Figure 20 In the example shown, M, N, O, P, etc., represent pixel spacing. Assuming O and P are less than the horizontal and vertical lengths of the current block, respectively, O and P can have negative values. Figure 20 The examples shown illustrate various scenarios where pixel regions can be configured to reconstruct themselves, but the reconstructed pixel regions can be configured according to... Figure 20 The examples shown are set in different sizes or formats.

[0260] Additionally, by performing subsampling, the standard deviation of the reconstructed pixel region can be calculated using a subset of pixels included in the reconstructed pixel region. In an embodiment, as referenced... Figure 11 The encoding device can calculate the standard deviation by using a portion of the reconstructed pixels adjacent to the current block, or by using M or more rows or N or more columns adjacent to the boundary of the current block. Alternatively, it can use adjacent pixels within a range that expands the width of the current block by a factor of K or the height of the current block by a factor of L to calculate the standard deviation.

[0261] Subsequently, the encoding device can determine, from among the blocks encoded / decoded before the current block that were encoded by intra-frame prediction and have the same intra-frame prediction mode as the current block, the block having the most similar reconstructed pixel region to the current block. In an embodiment, the encoding device can determine the block with a standard deviation that is the same as or similar to the standard deviation of the reconstructed pixel region of the current block. The reconstructed pixel region is adjacent to the block. In the embodiment, in Figure 19 In the example shown, when block 1 uses the same intra-prediction mode as the current block, and the standard deviation of the reconstructed pixel region B of block 1 is most similar to the standard deviation of the reconstructed pixel region A of the current block encoded using the same intra-prediction mode as the current block, it can be determined that block 1 has the most similar features to the current block. Here, the encoding device can determine the correction coefficients of the current block by using the reconstructed pixel region A of the current block and the reconstructed pixel region B of block 1.

[0262] Here, the encoding device can determine a reconstructed pixel region similar to the reconstructed pixel region of the current block from a reconstructed pixel region having the same size or form as the reconstructed pixel region.

[0263] The correction coefficients may include at least one of multiplicative coefficients and additive coefficients. Here, the multiplicative and additive coefficients can be derived based on regression analysis. In an embodiment, the multiplicative and additive coefficients can be calculated based on Equation 1 above. When calculating the correction coefficients using Equation 1, Y can represent pixels included in the reconstructed pixel region A of the current block, and X can represent pixels included in the reconstructed pixel region B of a block having similar characteristics to the current block (i.e., block 1). The correction coefficients can be obtained by performing partial differentiation on Equation 1 with respect to w and o. In an embodiment, after performing partial differentiation on Equation 1 with respect to w and o, w and o that minimize the squared values ​​of the error can be derived, and the derived w can be set as the multiplicative coefficient, and the derived o can be set as the additive coefficient.

[0264] When deriving correction coefficients, correction can be performed on the current block by applying the correction coefficients to the residual block of a block having characteristics similar to the current block (i.e., block 1), and to the prediction block of the current block generated as a result of performing intra-frame prediction. In an embodiment, the intra-frame prediction block of the current block can be corrected using the following formula 2.

[0265] [Formula 2]

[0266] P'=P+(wD Block1 +o)

[0267] In Equation 2, P' represents the new predicted block of the current block to which the correction is applied, and D block1 This indicates that it has a connection with the current block (i.e., Figure 19 The residual block is a block with similar features to block 1). Additionally, P represents the predicted block of the current block generated as a result of performing intra-frame prediction, and w and o represent correction coefficients.

[0268] In Formula 2, correction is performed on the current block using the residuals of blocks with similar characteristics to the current block, the predicted block of the current block, and the correction coefficient of the current block. However, a different method can be used to perform correction on the current block. In an embodiment, correction of the current block can be performed using the predicted block of a block with similar characteristics to the current block, or correction can be performed without using a block with similar characteristics to the current block.

[0269] In the example above, correction of the current block is performed using both multiplication and addition coefficients; however, correction of the current block can be performed using either multiplication or addition coefficients. In this embodiment, correction of the current block can be performed using multiplication coefficients without addition coefficients. Here, the derivation of "o" can be omitted in Equation 1, and the addition of addition coefficients to the prediction block to which multiplication coefficients are applied can be omitted in Equation 2.

[0270] In the example above, the block with the most similar features to the current block is determined from the blocks decoded before the current block. Here, the encoding device can set multiple regions for a slice or image that includes the current block, and encode information including the region containing the block with the most similar features to the current block, and transmit it to the decoding device. Here, the decoding device can determine the block with the most similar features to the current block within the set regions.

[0271] Additionally, the encoding device can determine a single reconstructed pixel region having a standard deviation that is the same as or similar to the standard deviation of the reconstructed pixel region of the current block, or determine multiple reconstructed pixel regions having a standard deviation that is the same as or similar to the standard deviation of the reconstructed pixel region of the current block. In an embodiment, the encoding device can determine multiple (N) reconstructed pixel regions having a standard deviation that is the same as or similar to the standard deviation of the reconstructed pixel region of the current block. When multiple (N) reconstructed pixel regions are determined, multiple blocks adjacent to the determined reconstructed pixel regions can be set as candidate blocks, and information about the block among the multiple candidate blocks used to determine the correction coefficient of the current block can be encoded. Here, this information can be index information used to specify any one of the multiple candidate blocks (or multiple standard deviations). The N candidate blocks can be encoded on a block-by-block basis or through an upper-layer header.

[0272] In the example above, the standard deviation of the reconstructed pixel region of the current block is calculated, and then the block most similar to the current block is determined by using the calculated standard deviation. Unlike the example above, the most similar reconstructed pixel region to the current block can be determined by using the average of the pixel values ​​in the reconstructed pixel region, or by measuring similarity using the SAD (sum of absolute differences) or SSD (sum of squared differences) between the reconstructed pixel regions.

[0273] In the example above, candidate blocks for the current block (i.e., candidate blocks for determining the correction coefficients of the current block) are determined from among blocks encoded using the same intra-prediction mode as the current block. In another embodiment, the encoding device may use blocks with intra-prediction modes similar to the current block as candidate blocks for the current block. Here, blocks with intra-prediction modes similar to the current block can be encoded using the intra-prediction mode and a threshold (e.g., ±N) within the intra-prediction mode of the current block. Alternatively, blocks encoded by intra-prediction can be used as candidate blocks for the current block regardless of whether the intra-prediction mode is the same as or similar to that of the current block.

[0274] Figure 21 This is a flowchart illustrating a method for encoding information related to correction coefficients.

[0275] In S2101, the encoding device can encode information about whether to encode the current block via intra-frame prediction. In S2102, when the current block is encoded via intra-frame prediction, in S2103, the encoding device can encode information about whether to perform correction on the current block by using the reconstructed pixel region.

[0276] In S2104, when the correction of the current block is performed using the reconstructed pixel region, in S2105, the encoding device can encode information for deriving the correction coefficients of the current block. In an embodiment, when multiple candidates exist for deriving the correction coefficients of the current block (e.g., when multiple candidate blocks exist for deriving the correction coefficients of the current block), the encoding device can encode identification information identifying the block among the multiple candidates for deriving the correction coefficients of the current block. Here, the identification information can be index information representing any one of the multiple candidates. In an embodiment, when there are N candidates, the index information can represent any one from 0 to N-1.

[0277] Figure 22 This is a diagram illustrating a flowchart of a process for determining whether to perform correction for the current block in the decoding device.

[0278] Reference Figure 22First, in S2201, the decoding device can decode information indicating whether the current block is encoded via intra-frame prediction.

[0279] In S2202, when the current block is encoded via intra-frame prediction, in S2203, the decoding device can decode information indicating whether the correction using the reconstructed pixel region is used for the current block. Here, the information can be a 1-bit flag, but is not limited to this.

[0280] In S2204, when it is determined that correction should be performed on the current block, in S2205, the decoding device can derive the correction coefficients of the current block using the same method used in the encoding device. In an embodiment, the decoding device can determine the block among the blocks decoded before the current block that has the most similar characteristics to the current block, and derive the correction coefficients of the current block by using the determined block.

[0281] In another embodiment, the decoding device may obtain the correction coefficient of the current block based on information transmitted from the encoding device. Here, the information transmitted from the encoding device may include information identifying a region that includes a block having features most similar to the current block, or identification information identifying a block among a plurality of candidate blocks that has features most similar to the current block.

[0282] The encoding device can directly encode the correction coefficients of the current block and transmit them to the decoding device. Here, the decoding device can decode the correction coefficients from the bitstream and perform correction on the current block using the decoded correction coefficients.

[0283] When the correction coefficients for the current block are obtained, the decoding device can perform correction on the current block using the obtained correction coefficients. In this embodiment, correction can be performed using Formula 2 described above.

[0284] Corrections for the current block can be applied between color components. In an embodiment, when the video has a Y, Cb, and Cr format, the Cb and Cr chrominance signals tend to be similar. Therefore, when the encoding order is Y, Cb, and Cr, for the Cr component, the correction coefficients applied to the Cb video can be used as is, or a reconstructed pixel region in the Cb video that is similar to the reconstructed pixel region of the current block can be determined.

[0285] In an embodiment, the encoding device can set up a reconstructed pixel region adjacent to the current block of the Cr component, and after using... Figure 2The motion estimation method shown identifies the reconstructed pixel region in the decoded Cb video that is most similar to the neighboring pixel region of the current block. Here, standard deviation comparison, SAD, or SSD, etc., can be used as indicators for determining similarity. When the reconstructed pixel region most similar to the reconstructed pixel region of the current block of the Cr component is determined from the Cb video, correction coefficients can be derived based on the determined reconstructed pixel region using Equation 1, and correction of the current block can be performed based on the derived correction coefficients using Equation 2.

[0286] In another embodiment, the correction coefficients for the current block, which is the Cr component, can be derived by using the reconstructed pixel region of the Cb component block at a preset location, instead of using the reconstructed pixel region of the Cr component. In this embodiment, the encoding device can perform correction using a prediction block that is the Cr component within the Cb video and a residual block of the Cb component existing at the same location.

[0287] The method for predicting the intra-prediction mode of the current block will then be described in detail.

[0288] Figure 23 This is a flowchart illustrating a process in an encoding device of determining whether to perform prediction on the intra-prediction mode of the current block by using the reconstructed pixel region of the current block.

[0289] First, in S2301, the encoding device can calculate the cost (cost A) of performing the prediction of the intra-prediction mode of the current block by using the intra-prediction modes of neighboring blocks adjacent to the current block. Performing the prediction of the intra-prediction mode of the current block by using the intra-prediction modes of neighboring blocks adjacent to the current block can be referred to as a method of predicting the intra-prediction mode by using an index. (Refer to...) Figure 24 This section describes in detail the method of predicting intra-frame prediction modes using indexes.

[0290] In S2302, when using a method that does not predict intra-prediction modes, the coding device can calculate the cost (hereinafter referred to as cost B). (See reference...) Figure 25 Describe in detail the method for determining the intra-prediction mode using a method that does not predict intra-prediction modes.

[0291] Then, in S2303, when using a method that predicts the intra-prediction mode of the current block by using the reconstructed pixel region of the current block, the encoding device can calculate the cost (hereinafter referred to as cost C). (Refer to...) Figure 26 A method for predicting the intra-prediction mode of the current block by using the reconstructed pixel region of the current block is described in detail.

[0292] Subsequently, in S2304, the encoding device can determine the best intra-prediction mode for the current block by comparing cost A, cost B, and cost C.

[0293] Figure 24 This is a view illustrating a method for predicting intra-frame prediction modes using indexes.

[0294] For ease of description, assume that the current block is encoded by intra-frame prediction, and that the intra-frame prediction modes of the block above the current block and the block to the left of the current block are A and B, respectively.

[0295] To predict the intra-prediction mode for the current block, the coding device can configure candidate modes by using the intra-prediction modes of neighboring blocks adjacent to the current block. Multiple candidate modes can exist. For ease of description, in this embodiment, it is assumed that the number of candidate modes is two, but more candidate modes can exist (e.g., between three and six, or more).

[0296] In an embodiment, the encoding device can determine whether A and B are the same, and if so, set A as the first candidate mode and any intra-frame prediction mode as the second candidate mode. When using at least three candidate modes, A can be set as the first candidate mode, and residual candidate modes can be set based on the priority among the arbitrary intra-frame prediction modes. Here, arbitrary prediction modes can include intra-frame prediction modes that have statistically high frequency. In an embodiment, arbitrary prediction modes can include non-directional prediction modes such as DC or planar modes, directional prediction modes similar to candidate modes, and directional prediction modes such as vertical, horizontal, or diagonal directions.

[0297] When A and B are different, A can be set as the first candidate pattern, and B can be set as the second candidate pattern. When using at least three candidate patterns, residual candidate patterns can be set based on the priority among any prediction patterns different from A and B.

[0298] Subsequently, the encoding device can encode information identifying candidate modes that are the same as the intra-prediction mode of the current block. Here, this information can be index information representing any one of multiple candidate modes.

[0299] The number of candidate patterns can be a preset value, or it can be encoded in blocks or transmitted to the decoding device via an upper-layer header. The same method for generating candidate patterns can be used in both the encoding and decoding devices.

[0300] When no candidate mode is available that is identical to the intra-prediction mode of the current block, the coding device may set cost A to a value greater than cost B and cost C, so that the method of predicting the intra-prediction mode by using index is not selected.

[0301] Figure 25 This is a diagram illustrating an example of determining the intra-prediction mode of the current block without using a method that predicts the intra-prediction mode.

[0302] When there is no candidate mode that is the same as the intra prediction mode of the current block, the coding device can directly encode the intra prediction mode of the current block by using the residual prediction mode, which is one of all the intra prediction modes available for the current block, excluding the candidate modes.

[0303] For example, when the number of intra-prediction modes available for the current block is ten and the number of candidate modes is two (e.g., first candidate mode A = mode 0, second candidate mode B = mode 3), the residual prediction modes other than the candidate modes become modes 1, 2, 4, 5, 6, 7, 8, and 9. The encoding device can number the residual prediction modes sequentially. For example, when A is less than B, residual prediction modes less than A have a normal index, residual prediction modes between A and B have an index reduced by 1, and residual prediction modes greater than B have an index reduced by 2. Assuming A is mode 0 and B is mode 3, modes 1 and 2 can be reduced by 1 to have their indices changed to 0 and 1, respectively, and modes 4 through 9 can be reduced by 2 to have their indices changed to 2 through 7. Subsequently, the encoding device can encode the identification information of the intra-prediction mode of the current block among the residual prediction modes whose indices are being reallocated.

[0304] The decoding device can receive identification information from the encoding device and determine the intra-prediction mode of the current block based on the received identification information. Here, when the decoded residual prediction mode is less than the candidate modes, the residual prediction mode can be determined as the current intra-prediction mode. And when the residual prediction mode is greater than at least one of the candidate modes, the index of the residual prediction mode can be added to the number of candidate modes less than the residual prediction mode, and the result can be determined as the intra-prediction mode of the current block. In an embodiment, when candidate modes A and B are 3 and the residual prediction mode is 5, the intra-prediction mode of the current block can be mode 7 by adding 5 and 2.

[0305] Reference Figure 25 Examples described above are referenced. Figure 24 The description assumes that candidate modes include intra-prediction modes of neighboring blocks adjacent to the current block. In addition to the described examples, candidate modes may include intra-prediction modes of blocks with reconstructed pixel regions similar to the reconstructed pixel regions of the current block, which are neighboring pixels, as will be described later.

[0306] Figure 26This is a view illustrating a method for predicting the intra-prediction mode of the current block by using the reconstructed pixel region of the current block.

[0307] The encoding device can determine the region most similar to the reconstructed pixel region of the adjacent current block from the already encoded / decoded region. Here, the region determination can be performed on a block-by-block basis.

[0308] When the region most similar to the reconstructed pixel region of the neighboring current block is determined, the encoding device can predict the intra prediction mode of the current block based on the intra prediction mode of the block with the region most similar to the reconstructed pixel region of the neighboring current block.

[0309] In the embodiments, Figure 26 In the example shown, when the reconstructed pixel region most similar to the reconstructed pixel region A of the current block is B, the encoding device can encode the residual value between the intra-prediction mode of block 1 (which is a block with B as a reconstructed pixel region) and the intra-prediction mode of the current block.

[0310] The encoding device can identify multiple reconstructed pixel regions that are similar to the reconstructed pixel regions of the current block. Here, the number P of the identified reconstructed pixel regions can be a preset number, or it can be indicated by a signal on a block-by-block basis or via a higher-level header.

[0311] In the embodiments, Figure 26 In the example shown, when B and C are determined to be reconstructed pixel regions similar to the reconstructed pixel region A of the current block, the encoding device can predict the intra-prediction mode of the current block using the intra-prediction mode of either block 1 or block 2, where block 1 is the block with B as the reconstructed pixel region and block 2 is the block with C as the reconstructed pixel region. Here, the encoding device can encode an index representing the best block between block 1 and block 2 for predicting the intra-prediction mode of the current block (e.g., the block whose residual value with the intra-prediction mode of the current block becomes the smallest), and the difference between the intra-prediction mode of the block indicated by that index and the intra-prediction mode of the current block.

[0312] In the example above, index information representing any one of a plurality of blocks having features most similar to the current block is encoded. However, index information representing any one of the reconstructed pixel regions similar to the reconstructed pixel regions of the current block can be encoded. Here, the decoding device can select any one of the plurality of reconstructed pixel regions identified by the index information that is similar to the reconstructed pixel region of the current block, and decode the intra-prediction mode of the current block by using the intra-prediction mode of the block having the selected reconstructed pixel region as its neighboring pixels.

[0313] The encoding device can encode information indicating whether one or more reconstructed pixel regions (P reconstructed pixel regions) similar to the reconstructed pixel regions of the current block have been identified. Alternatively, the number of reconstructed regions to be identified can be adaptively determined in both the encoding and decoding devices under preset conditions.

[0314] Subsequently, examples will be provided to describe information related to the methods used to encode and determine the intra-prediction mode of the current block.

[0315] Figure 27 This is a view of a flowchart illustrating information related to the method of encoding and determining the intra-prediction mode of the current block.

[0316] First, in S2701, the encoding device can encode information indicating whether the method for predicting the intra-prediction mode of the current block is used. Here, the information can be a 1-bit flag, but is not limited to this.

[0317] In S2702, when the method of predicting the intra-prediction mode of the current block is used, in S2703, the encoding device can encode information indicating whether the method of predicting the intra-prediction mode by reconstructing pixel regions is used. Here, the information can be a 1-bit flag, but is not limited to this.

[0318] In S2704, when using the method of predicting an intra-prediction mode by reconstructing pixel regions, in S2705, information required for predicting the intra-prediction mode of the current block can be encoded. In an embodiment, when multiple reconstructed pixel regions similar to the reconstructed pixel regions of the current block are determined, identification information identifying a block among the multiple blocks having features similar to the current block that has an intra-prediction mode identical or similar to the intra-prediction mode of the current block can be encoded. Here, the identification information may be index information representing any one of the multiple candidate blocks. Additionally, the encoding device can encode the difference between the intra-prediction mode of the candidate block and the intra-prediction mode of the current block.

[0319] In S2704, when it is determined that the method of predicting the intra-prediction mode by reconstructing pixel regions is not used, the intra-prediction mode of the current block can be encoded by using a method that utilizes the intra-prediction modes of neighboring blocks adjacent to the current block. Therefore, in S2706, the encoding device can encode identification information that identifies a candidate mode among the candidate modes generated based on the intra-prediction modes of neighboring blocks that has the same intra-prediction mode as the current block.

[0320] In S2707, when the method of predicting intra-prediction modes is not used, the intra-prediction mode of the current block can be encoded by using the residual mode, which is excluded from the candidate modes, among the intra-prediction modes available for the current block.

[0321] Figure 28 This is a view showing a flowchart illustrating the intra-prediction mode for decoding the current block.

[0322] First, the decoding device can decode information from the bitstream indicating whether the current block is encoded via intra-frame prediction.

[0323] When the current block is encoded using intra-frame prediction, in S2801, the decoding device can decode information indicating whether the intra-frame prediction mode for predicting the current block is used. Here, the information can be a 1-bit flag, but is not limited to this.

[0324] In S2802, when the method for predicting the intra-prediction mode of the current block is used, in S2803, the decoding device can decode information indicating whether the intra-prediction mode of the current block is predicted by using the reconstructed pixel region of the current block. Here, the information can be a 1-bit flag, but is not limited to this.

[0325] In S2804, when using the method of predicting an intra-prediction mode by reconstructing pixel regions, in S2805, the information required for predicting the intra-prediction mode of the current block can be decoded. In this embodiment, when multiple reconstructed pixel regions similar to the reconstructed pixel regions of the current block are determined, identification information identifying a block among multiple blocks having features similar to the current block that has an intra-prediction mode identical or similar to the intra-prediction mode of the current block can be decoded. Here, the identification information may be index information representing any one of multiple candidate blocks. Furthermore, the decoding device can decode the difference between the intra-prediction mode of the candidate block identified from the identification information and the intra-prediction mode of the current block. The encoding device can determine the intra-prediction mode of the current block based on the decoded information.

[0326] In S2804, when it is determined that the method of predicting the intra-prediction mode by reconstructing pixel regions is not used, the decoding device can determine the intra-prediction mode of the current block by using a prediction method that utilizes the intra-prediction modes of neighboring blocks adjacent to the current block. In S2806, the decoding device can configure candidate modes by using the intra-prediction modes of neighboring blocks adjacent to the current block, and decode the identification information of candidate modes that have the same intra-prediction mode as the current block. The decoding device can then set the candidate mode indicated by the identification information as the intra-prediction mode of the current block.

[0327] When the method of predicting the intra-prediction mode is not used, in S2807, the decoding device can decode the residual mode information of the current block. Then, the decoding device can determine the intra-prediction mode of the current block based on the candidate mode and residual mode information of the current block.

[0328] In the above embodiments, a method for predicting the intra-prediction mode of the current block by using the intra-prediction mode of neighboring blocks adjacent to the current block, and a method for predicting the intra-prediction mode of the current block by using the intra-prediction mode of reconstructed pixel regions that are the same as or similar to the reconstructed pixel regions of the current block, have been described. These two methods are different prediction methods. In another embodiment, the two prediction methods can be integrated and used as a single prediction method. In an embodiment, when configured to use the method for predicting the intra-prediction mode of the current block, the encoding device can configure candidate modes based on the intra-prediction modes adjacent to the current block and the intra-prediction modes of blocks with reconstructed pixel regions similar to the reconstructed pixel regions of the current block as neighboring pixels. Here, candidate modes can include the intra-prediction modes of neighboring blocks and the intra-prediction modes of blocks with features similar to the current block, and can also include any intra-prediction mode. Here, the method of encoding and decoding the intra-prediction mode of the current block (i.e., S2703) can be omitted (S2803).

[0329] The method of performing intra-frame prediction by reconstructing pixel regions will then be described.

[0330] Figure 29 This is a view illustrating a method for performing intra-frame prediction by reconstructing pixel regions.

[0331] To derive the prediction block for the current block, the reconstructed pixel region most similar to the reconstructed pixel region of the neighboring current block can be determined. In an embodiment, when B is the reconstructed pixel region most similar to the reconstructed pixel region A of the block adjacent to the current block, the block having B as its reconstructed pixel region can be used as the prediction block for the current block.

[0332] When using reconstructed pixel regions, the reconstructed pixel region most similar to the current block's reconstructed pixel region can be determined within the current video, and the block to be used as the predicted block for the current block can be determined based on the determination result. Therefore, compared to general intra-frame prediction, no intra-frame prediction mode is required. Thus, intra-frame prediction can be performed without encoding the intra-frame prediction mode.

[0333] Here, to reduce encoding / decoding complexity, the area used to determine similar reconstructed pixel regions can be limited. Information representing the determined range can be transmitted to the decoding device either by encoding in blocks or via an upper-layer header. In an embodiment, the encoding device can set Q blocks reconstructed based on the current block and preceding the current block as the range of the determined region. Alternatively, the encoding device can include the size of the range of the region within a pixel unit, and encode information representing the size either by encoding in blocks or via an upper-layer header.

[0334] Figure 30This is a flowchart illustrating a method for determining an intra-frame prediction of the current block using reconstructed pixel regions.

[0335] First, in S3001, the encoding device can calculate the cost (cost A) when performing intra-frame prediction using the reconstructed pixel region, and in S3002, calculate the cost (cost B) when performing intra-frame prediction without using the reconstructed pixel region.

[0336] In S3003, the encoding device can compare cost A with cost B and determine whether to use the reconstructed pixel region to perform intra-frame prediction.

[0337] Figure 31 This is a flowchart illustrating a method for encoding information related to whether or not to perform intra-frame prediction using reconstructed pixel regions.

[0338] First, in S3101, the encoding device can use the reconstructed pixel region to encode information indicating whether intra-frame prediction is performed. This information can be a 1-bit flag, but is not limited to this.

[0339] In S3102, when performing intra-prediction using reconstructed pixel regions, the encoding device may not encode information related to the intra-prediction mode of the current block and may terminate the execution of the method.

[0340] During this process, in S3102, when performing intra-prediction without using reconstructed pixel regions, in S3103, the encoding device can encode information related to the intra-prediction mode of the current block. Here, the information related to the intra-prediction mode may include information indicating whether the intra-prediction mode of the current block is the same as that of the MPM candidate, MPM index, residual mode information, etc.

[0341] Figure 32 This is a view showing a flowchart of a method for decoding information related to whether or not intra-frame prediction is performed using reconstructed pixel regions.

[0342] First, in S3201, the decoding device can decode information indicating whether intra-frame prediction is performed by using reconstructed pixel regions. This information can be a 1-bit flag, but is not limited to this.

[0343] In S3202, when intra-frame prediction is performed by using reconstructed pixel regions, the decoding device can perform intra-frame prediction without decoding information related to the intra-frame prediction mode of the current block, and determine reconstructed pixel regions similar to the reconstructed pixel regions of the current block in the current video.

[0344] During this process, in S3202, when intra-prediction is performed without using reconstructed pixel regions, in S3203, the decoding device can decode information related to the intra-prediction mode of the current block. Here, the information related to the intra-prediction mode may include information indicating whether the intra-prediction mode of the current block is the same as MPM candidates, MPM indexes, residual mode information, etc. When the intra-prediction mode of the current block is obtained, the decoding device can perform intra-prediction on the current block using the obtained intra-prediction mode.

[0345] In the above embodiments, a method has been described for determining the most similar reconstructed pixel region within the current video by using the reconstructed pixel region adjacent to the current block and setting the corresponding block as the prediction block. However, instead of using this block as the prediction block for the current block, a method of setting a block as the reconstructed block for the current block can also be used. Here, information indicating whether a block having the most similar reconstructed pixel region to the reconstructed pixel region of the neighboring current block is used as the reconstructed block for the current block can be encoded. When a block having the most similar reconstructed pixel region to the reconstructed pixel region of the neighboring current block is used as the reconstructed block for the current block, the transform, quantization, and entropy coding of the transform coefficients can be omitted, thus allowing for efficient video coding.

[0346] The method of performing inter-frame prediction on the current block by using reconstructed pixel regions will then be described in detail.

[0347] Reference Figure 33 This describes a method for performing inter-frame prediction on the current block by using reconstructed pixels adjacent to the current block.

[0348] When encoding the current block, already encoded / decoded reconstructed pixels can exist adjacent to the current block. Here, the encoding device can begin motion estimation for the current block based on pixels included in any region among the reconstructed pixels adjacent to the current block.

[0349] In the embodiments, Figure 33 In the example shown, the encoding device can begin motion estimation from a region within the reference video that is at the same location as the reconstructed pixel region A of the neighboring current block. When a reconstructed pixel region B similar to the reconstructed pixel region A of the neighboring current block is determined, the encoding device can set the distance between A and B as the motion vector. The predicted block of the current block (i.e., the reference block within the reference video indicated by the motion vector) can then be determined by applying the motion vector estimated using the reconstructed pixel region to the current block.

[0350] Here, the reconstructed pixel regions adjacent to the current block and the determined reconstructed pixel regions must have the same size or form. Figure 33In this context, the reconstructed pixel region of the current block includes pixels adjacent to the upper boundary of the current block, pixels located at the left boundary of the current block, and pixels adjacent to the corners of the current block (e.g., the upper left corner, upper right corner, and lower left corner of the current block). However, the form of the reconstructed pixel region is not limited to this. In an embodiment, the reconstructed pixel region may have the following characteristics: Figure 18 The various sizes or forms mentioned.

[0351] Additionally, by performing subsampling, a reconstructed pixel region similar to the reconstructed pixel region of the current block can be determined by using a subset of pixels included in the reconstructed pixel region. In the embodiments, as referenced above... Figure 15 The encoding device can determine a reconstructed pixel region similar to a reconstructed pixel region of a neighboring current block by using a portion of the reconstructed pixels included in the reconstructed pixel region, or by using M or more rows or N or more columns adjacent to the current block. Alternatively, the encoding device can determine a reconstructed pixel region similar to a reconstructed pixel region of a neighboring current block by using neighboring pixels within a range that expands the width of the current block by a factor of K or the height of the current block by a factor of L.

[0352] The process of determining reconstructed pixel regions within a reference video that are similar to those in the current block can be performed by comparing the similarity within the reconstructed pixel regions. As an example related to the intra-frame prediction described above, similarity measures such as the standard deviation of the reconstructed pixel regions, the mean of the reconstructed pixels, the SAD (sum of absolute differences) or SSD (sum of squared differences) between the reconstructed pixel regions can be used to determine similarity.

[0353] When motion estimation is performed using the reconstructed pixel region of the current block, motion information is derived by using information from blocks that have already been encoded / decoded adjacent to the current block, and therefore no transfer of motion information (e.g., motion vectors) from the encoding device to the decoding device is required.

[0354] The encoding device can perform motion estimation using reconstructed pixel regions and determine the reference video of the current block, the prediction direction of the current block (e.g., previously used, subsequently used, or bidirectional prediction), or motion information such as motion vectors by using the case with minimum cost. The decoding device can also perform motion estimation using reconstructed pixel regions adjacent to the current block and determine the motion information of the current block by selecting the case with minimum cost using the same method used in the encoding device.

[0355] However, the complexity of the decoding device can increase significantly when motion estimation is performed on the entire reference video. To address this issue, information representing the regions used to determine similar reconstructed pixel areas can be encoded in blocks or via an upper-layer header, and this information can be transmitted to the decoding device. By limiting the regions used to determine similar reconstructed pixel areas, the complexity in the decoding device can be reduced. In an embodiment, the encoding device can encode information specifying the reference video (e.g., a reference video index) or information representing the locations where reference blocks are included in the reference video (e.g., slice or tile indexes). By transmitting the reference video and reference block location information to the decoding device, the computational load and complexity in the decoding device can be reduced.

[0356] Furthermore, the encoding device can encode information of any type among several specified motion estimation methods either on a block-by-block basis or via an upper-layer header. Here, the decoding device can determine whether to use the reconstructed pixel region of the current block to perform motion estimation based on the information transmitted from the encoding device.

[0357] Figure 34 This is a diagram illustrating an example of motion estimation that can be performed in an encoding or decoding device. In the preset diagram, it is assumed that the starting position for motion estimation is A. Furthermore, in the example shown, it is assumed that ① is an integer position pixel (integer pixel), ② is a 1 / 2 position pixel (half pixel), and ③ is a 1 / 4 position pixel (quarter pixel). Nine integer pixels are shown in the preset diagram, but more integer pixels could be used for motion estimation.

[0358] When the optimal motion vector indicator selects the best motion vector among multiple integer position pixels, motion estimation is performed in the 1 / 2 position pixel unit at adjacent positions based on a (eight of a and ②). When the optimal motion vector indicator selects position b among multiple 1 / 2 position pixels, motion estimation is performed in the 1 / 4 position pixel unit at adjacent positions based on b (eight of b and ③). When the optimal motion vector indicator, as a result of the motion estimation in the 1 / 4 position pixel unit, selects position c, the final motion vector is represented as (A->c). Here, coordinates can become negative to the left and upward, and positive to the right and downward, or vice versa. Figure 34 In the middle, motion estimation is performed up to 1 / 4 of the position pixels, but it can be done at 1 / 2... KMotion estimation is performed within the position pixel unit. Here, K is an integer equal to or greater than 0, and K can be set identically in both the encoding and decoding devices. Alternatively, K can be transmitted in blocks or via the upper-layer header. Here, when the motion vector obtained at position ① is mv_1, the motion vector obtained at position ② is mv_2, and the motion vector obtained at position ③ is mv_3, the final determined motion vector mv can be calculated as (mv_1<<(K))+(mv_2<<(K-1))+mv_3<<(K-2). This is to convert the motion vector mv to integer units instead of real numbers. Figure 34 In the example shown, the motion vector mv_1 from A to a is (-1, -1), the motion vector mv_2 from a to b is (0, -1), and the motion vector mv_3 from b to c is (1, 1). Figure 34 In this process, motion estimation is performed in units of 1 / 4 position pixels and K is assumed to be 2. Therefore, the final motion vector mv is determined as ((-1, -1)<<2)+((0, -1)<<1)+((1,1)<<0)=(-4, -4)+(0, -2)+(1,1)=(-3, -5).

[0359] When motion estimation is performed up to 1 / 8 of the position pixels, the final motion vector mv can be determined as (mv_1<<3)+(mv_2<<2)+mv_3<<1+mv_4. Here, mv_4 represents the motion vector estimated in units of 1 / 8 of the position pixels.

[0360] Figure 35 This is a view showing how a 4×4 size prediction block is determined by using motion vectors estimated in units of 1 / 4 position pixels.

[0361] In this diagram, circles represent integer position pixels, and triangles represent fractional position pixels. When assuming the final motion vector mv is (7, -10), the predicted block for the current block can include a block from the same position in the reference video as the current video, in 1 / 4 position pixels, a position that has moved 7 on the X-axis, and a position that has moved -10 on the Y-axis.

[0362] Figure 36 This is a view showing a flowchart of a process for determining whether to perform inter-frame prediction by using reconstructed pixel regions.

[0363] First, in S3601, the encoding device can calculate the cost (cost A) when performing inter-frame prediction without using reconstructed pixel regions. Performing inter-frame prediction without using reconstructed pixel regions means performing inter-frame prediction by using merge mode, AMVP mode, etc.

[0364] Subsequently, in S3602, the encoding device can calculate the cost (cost B) when performing inter-frame prediction by using the reconstructed pixel region.

[0365] Then, in S3603, the encoding device can compare cost A with cost B and select the optimal inter-frame prediction method for the current block. When cost A is less than cost B, the current block can be encoded using inter-frame prediction without using reconstructed pixel regions; and when cost A is greater than cost B, the current block can be encoded using inter-frame prediction with reconstructed pixel regions.

[0366] Figure 37 This is a view showing a flowchart illustrating the method of encoding inter-frame prediction for the current block.

[0367] First, in S3701, the encoding device can encode information specifying the inter-frame prediction method for the current block. This information may include a 1-bit flag indicating whether inter-frame prediction using reconstructed pixel regions is performed on the current block. Alternatively, this information may be index information specifying any of a plurality of inter-frame prediction modes that can be used by the current block (e.g., merge mode, AMVP mode, skip mode, or method using reconstructed pixel regions).

[0368] When it is determined in S3702 that inter-frame prediction using reconstructed pixel regions will be performed on the current block, the encoding device may omit encoding the motion information of the current block. Alternatively, information indicating the range of regions similar to the reconstructed pixel regions of the current block can be encoded in the block unit or the upper-layer header. By limiting the range used to determine the regions, the complexity of the decoding device can be reduced.

[0369] During this process, when it is determined in S3702 that no inter-frame prediction using the reconstructed pixel region is performed, in S3703, the encoding device can encode information that determines the motion information of the current block (e.g., information that specifies a block with the same motion information as the current block in merge mode, or information that specifies a reference video index among motion vector prediction candidates in AMVP mode, motion vector difference, etc.).

[0370] Figure 38 This is a view showing a flowchart illustrating the method of decoding to perform inter-frame prediction for the current block.

[0371] First, in S3801, the decoding device can decode information specifying the inter-frame prediction method for the current block. This information may include a 1-bit flag indicating whether inter-frame prediction using reconstructed pixel regions is performed on the current block. Alternatively, this information may be index information specifying any of a plurality of inter-frame prediction modes that can be used by the current block (e.g., merge mode, AMVP mode, skip mode, or method using reconstructed pixel regions).

[0372] Based on this information, the decoding device can determine the inter-frame prediction method for the current block. Here, when it is determined in S3802 that inter-frame prediction using reconstructed pixel regions will be performed on the current block, in S3803, the decoding device can obtain the motion information of the current block through motion estimation, rather than decoding the motion information of the current block from the bitstream. Here, the motion information of the current block can be obtained by determining the reconstructed pixel region within the reference video that is most similar to the reconstructed pixel region of the current block.

[0373] Alternatively, the decoding device can decode information in the block unit or upper-layer header that represents the range of regions similar to the reconstructed pixel regions of the current block. The decoding device can determine the reconstructed pixel regions within a finite range that are most similar to the reconstructed pixel regions of the current block.

[0374] During this process, when it is determined in S3802 that no inter-frame prediction using the reconstructed pixel region is performed, in S3804, the decoding device can decode information that determines the motion information of the current block (e.g., information that specifies a block with the same motion information as the current block in merge mode, or information that specifies any reference video index among the motion vector prediction candidates in AMVP mode, motion vector difference, etc.), and determine the motion information of the current block based on the decoded information.

[0375] In the above embodiments, the encoding and decoding devices determine the region within the reference video that is most similar to the reconstructed pixel region of the current block. However, unlike the example above, the encoding and decoding devices can determine multiple regions within the reference video that are similar to the reconstructed pixel region of the current block. Here, the encoding device can encode information about a region among multiple determined candidate regions used for inter-frame prediction of the current block. The decoding device can determine the motion information of the current block using the region specified by this information, and perform inter-frame prediction on the current block using the determined motion information.

[0376] The method for improving motion information by reconstructing pixel regions will then be described.

[0377] When determining the motion vector of the current block, the motion vector can be improved by using the same method in both the encoding and decoding devices. In an embodiment, in the encoding device, the use of 1 / 2 K Motion estimation of blocks in position pixel units, and can be achieved by using reconstructed pixel regions in 1 / 2 K+L Improved motion estimation results in the location unit. Here, K represents the accuracy of the motion vectors used when performing inter-frame prediction (i.e., motion vectors derived without using reconstructed pixel regions), and L represents the accuracy of the motion vectors that can be improved by using reconstructed pixel regions.

[0378] K and L can be encoded in the upper-layer header and transmitted to the decoding device, or they can be preset in both the encoding and decoding devices. For example, when K and L are preset to 2 and 1 respectively, even if the motion information estimated in the 1 / 4 position pixel unit in the encoding device is transmitted to the decoder, the motion information can be further improved in the 1 / 8 position pixel unit in the decoding device, in addition to the 1 / 4 position pixel unit.

[0379] When L, representing the degree of improvement in motion information, is set to 0, motion estimation is performed based on the motion vector of a 1 / 2K pixel unit, and motion estimation can be performed additionally within the 1 / 2K pixel unit by using reconstructed pixel regions. Alternatively, when L is 0, motion estimation is performed only for the current block, and motion estimation for reconstructed pixel regions may not be performed.

[0380] The same method can be used to improve motion vectors in both encoding and decoding devices, even if the estimated motion vectors are in the half-life. K Encoding in position pixel units, or in 1 / 2 K+L Motion vectors are used in the position pixel unit, and the encoding and decoding devices can store the motion vectors in 1 / 2 K+L In the position pixel unit.

[0381] Here, the encoded motion vector has 1 / 2 K The position pixel unit, therefore, when determining the motion vector of the current block using the motion vectors of its neighboring blocks, the accuracy of the motion vectors of the neighboring blocks can be 1 / 2. K Position pixel unit.

[0382] In an embodiment, Figure 39 This is a diagram illustrating an example of improving the motion vector of the current block by reconstructing pixel regions. For ease of description, it is assumed that the encoding precision K of the motion vector is 2, and the improvement precision L of the motion vector is 1.

[0383] Since the encoding precision of motion vectors is 2, the motion vector to be encoded represents a 1 / 4 pixel position.

[0384] Since the improved motion vector has a precision of 1, the improved motion vector represents a 1 / 8 pixel position.

[0385] Here, the reconstructed pixel region can be used identically in both the encoding and decoding devices, thus improving the motion vector without using additional information fragments. In the embodiment, when the motion vector to be encoded is (7, -10), the motion vector to be encoded is at a 1 / 4 pixel position, therefore it is the reference block (i.e., the original prediction block) represented by the encoded motion vector and... Figure 39 The example shown is the same.

[0386] During encoding / decoding, motion estimation can be performed on 1 / 8 position pixel units in eight directions, based on the number of pixels indicated by the interval motion vector, from the same positions of pixels included in the reconstructed pixel region of the current block within the reference video. Additional interpolation must be performed to generate the 1 / 8 position pixels. Figure 39 In the reconstructed pixel region, the pixels used to perform motion estimation to generate 1 / 8 position pixels are marked as rectangles.

[0387] When a 1 / 8 position pixel that is most similar to the pixel included in the reconstructed pixel region is detected, the motion vector of the current block can be improved based on the motion vector between the 1 / 4 position pixel and the 1 / 8 position pixel.

[0388] In the embodiments, Figure 39 In the example shown, when it is assumed that the pixel at the asterisk position in the reconstructed pixel region B is the 1 / 8 position pixel most similar to the pixels included in the reconstructed pixel region, the motion vector of the 1 / 8 position pixel is (-1, -1). Therefore, the motion vector of the current block can be improved by taking into account the motion vector (-1, -1) of the 1 / 8 position pixel. To make the precision of the encoded 1 / 4 position pixel motion vector match that of the 1 / 8 position pixel, a shift operation (<<1) can be performed on the 1 / 4 position pixel motion vector (7, -10). The motion vector of the current block can be improved by adding the calculated result to the 1 / 8 position pixel motion vector. Therefore, the motion vector of the current block can become ((7, -10)<<1+(-1, -1))=(13, -21).

[0389] K and L are set to 2 and 1 respectively, so the precision of the improved motion vector becomes 1 / 8 position, and the precision of the motion vector stored in the encoding and decoding devices also becomes 1 / 8 position.

[0390] The motion vector of the current block can be derived by using motion vectors from previous blocks predicted from inter-frames as motion vector candidates. Here, when motion vectors from previous blocks are used as motion vector candidates, scaling of the motion vectors from previous blocks can be performed to match the base precision K of the current block.

[0391] In this embodiment, it is assumed that the base precision K of all blocks is 2, the additional precision L of all blocks is 1, the motion vector obtained for the base precision K of the previous block is (7, -10), and the motion vector derived by the additional precision L is (3, -3). Here, the improved motion vector of the previous block can be transformed into (17, -23) by ((7, -10) << 1) + (3, -3).

[0392] However, since the base precision K of the current block is 2, instead of using the improved motion vectors of the previous block, the motion vectors of the previous block calculated based on the base precision can be used as motion vector candidates for the current block. In other words, (7, -10) can be used as a motion vector candidate for the current block instead of (17, -23).

[0393] When K and L are set differently for each block, the motion vector precision of previous blocks can be used as an arbitrary precision when deriving motion vector candidates for the current block. In this embodiment, by scaling the base precision K of the current block, motion vectors from previous blocks can be used as motion vector candidates for the current block.

[0394] Figure 40 It is a view of the flowchart for determining motion vectors in an encoding device.

[0395] First, in S4001, the encoding device can be 1 / 2 K Motion estimation is performed on a pixel-by-pixel basis, and a cost (hereinafter referred to as cost A) is calculated based on this cost. Then, in S4002, the encoding device can... K+L Motion estimation (or improvement) is performed in the pixel unit, and its computational cost is calculated (hereinafter referred to as cost B).

[0396] Subsequently, in S4003, the encoding device can compare cost A with cost B and determine whether to improve the motion vector of the current block. In an embodiment, when cost A is less than cost B, in S4004, the improved motion vector is set not to be used, and when cost B is less than cost A, in S4005, the improved motion vector is set to be used.

[0397] The encoding device can encode information indicating whether to use improved motion vectors, either in blocks or via an upper-layer header. This information can be a 1-bit flag, but is not limited to this. The decoding device can determine whether to improve the motion vectors based on the information received from the encoding device.

[0398] Alternatively, without encoding the information, the encoding and decoding devices can be configured to improve all motion vectors.

[0399] Figure 41 It is a flowchart view of the process of selecting the optimal motion vector in the encoding device when the values ​​of the base precision K and the additional precision L are adaptively selected on a block-by-block basis.

[0400] First, in S4101, the initial values ​​of the parameters used to select the optimal motion vector are shown.

[0401] exist Figure 41In this context, K represents the base precision, L represents the additional precision, END_K represents the maximum value of K, and END_L represents the maximum value of L. K, END_K, L, and END_L can be initialized to Val1, Val2, Val3, and Val4, respectively. Val1 to Val4 represent arbitrary integers and can be encoded through the upper-layer header.

[0402] BEST_K represents the optimal value K, and BEST_L represents the optimal value L. BEST_K and BEST_L can be initialized to Val1 and Val3 respectively.

[0403] MV_K represents the motion vector in a 1 / 2K pixel unit, and MV_L represents the motion vector in a 1 / 2K+L unit. Furthermore, BESTMV_K represents the optimal MV_K, and BESTMV_L represents the optimal MV_L. Each motion vector parameter can be initialized to (0,0).

[0404] COST represents the cost of performing prediction using MV_K and MV_L, and BEST_COST represents the optimal COST. COST can be initialized to 0, and BEST_COST can be initialized to the maximum value (MAX) that can be stored.

[0405] After initialization, the encoding device can be accessed via 1 / 2 K Motion estimation is performed in the location pixel unit to update MV_K. Alternatively, motion estimation can be further performed up to half based on the determined MV_K. K+L The unit is used to update MV_L. When MV_K and MV_L are exported, in S4102, the encoding device can select the final MV by using the exported MV_K and MV_L, and update the COST by calculating the cost using the selected MV.

[0406] The final MV can be obtained by matching the precision between MV_K and MV_L. In the embodiment, when K and L are both 2, MV_K is a motion vector of 1 / 4 pixel unit and MV_L is a motion vector of 1 / 16 pixel unit. When MV_K is (5,7) and MV_L is (3,7), by matching the precision of these two motion vectors, the final MV can be derived as ((5,7)<<2)+(3,7)=(25,35).

[0407] In S4103, the encoding device can compare the cost (i.e., COST) calculated using the final MV with BEST_COST, and in S4104, when COST is equal to or less than best_COST, BEST_COST can be updated to COST, and BESTMV_K and BESTMV_L can be updated to MV_K and MV_L respectively. Meanwhile, BEST_K and BEST_L can be updated to K and L respectively.

[0408] When a parameter update is performed in S4104, or when COST is greater than best_COST in S4103, K can be updated to K+a in S4105. Here, 'a' can be encoded in blocks or through the upper-layer header, and the encoding and decoding devices can be preset to arbitrary values ​​and used in the same way.

[0409] In S4106, the updated K and END_K can be compared, and when K is not greater than END_K, a return to S4102 can be executed so that MV and COST can be calculated again.

[0410] Alternatively, when K is greater than END_K, in S4107, K can be initialized to Val1, and L can be updated to L+b. Here, b can be encoded in blocks or through the upper-layer header, or the encoding and decoding devices can both be preset to arbitrary values ​​and used.

[0411] In S4108, the updated L and END_L can be compared, and when L is not greater than END_L, the execution returns to S1302, so that the calculation of MV and COST can be performed again.

[0412] When L is greater than END_L in S4108, the motion vector estimation algorithm can be terminated.

[0413] As mentioned above, by updating the values ​​of K and L with a and b, the MV and COST can be calculated for all possible K and L, thus allowing the selection of the optimal motion vector.

[0414] The encoding device can encode the best baseline precision (final BEST_K value), best additional precision (final BEST_L value), and motion vector information (final BESTMV_K value) derived according to the basic precision unit, and transmit them to the decoding device. Here, the decoding device can derive the basic precision information and motion vector information derived according to the basic precision unit, and improve the motion vector by using the additional precision information.

[0415] In another embodiment, the encoding device can encode the best base precision (the final value of BEST_K) and motion vector information (the final value of BESTMV_K) derived in base precision units and transmit them to the decoding device. Here, the decoding device can derive the best additional precision using the same method used in the encoding device and improve the motion vectors based on the derived additional precision.

[0416] In the embodiments described later, the encoding device encodes the best basic precision information and motion vector information derived in basic precision units and transmits them to the decoding device.

[0417] Figure 42 This is a view that shows the best motion vector for encoding the current block.

[0418] In S4201, when encoding the current block via inter-frame prediction, the encoding device can encode information indicating whether motion vector improvements are used. Here, the information indicating whether motion vectors are improved by using reconstructed pixel regions can be encoded on a block-by-block basis or via the upper-layer header.

[0419] When it is determined that the motion vector can be improved by using reconstructed pixel regions, in S4202, the encoding device can encode information related to the basic precision of the current block.

[0420] Here, information related to the base accuracy may include information representing the best base accuracy for the current block (e.g., Figure 41 The final value of BEST_K in the equation) and the offset unit used to determine the optimal base accuracy (e.g., Figure 41 At least one of the offsets a) added to K. When encoding the offset units, the encoding device may additionally encode information indicating which selectable K is used.

[0421] In this embodiment, when offset a is 2, the initial value of K as Val1 is -2, and the initial value of END_K as Val2 is 2. K can be selected by the encoding device in... Figure 41 The value becomes -2, 0, and 2. Here, the encoding device can encode information indicating which value among -2, 0, and 2 is used (e.g., index information).

[0422] In S4203, the encoding device can encode the optimal motion vector of the optimal K (e.g., Figure 40 The final BESTMV_K in the data.

[0423] The encoding device can encode the optimal motion vector for the current block based on the motion vectors of its neighboring blocks. Here, the motion vectors of the neighboring blocks can be scaled to match the base precision of the current block.

[0424] For example, when the base precision K of the current block is 0, the motion vectors of adjacent blocks can be scaled to match 1 / 20, and the scaled motion vectors can be used when encoding BESTMV_K. In an embodiment, the encoding device can encode the difference between the scaled motion vector and BESTMV_K.

[0425] Figure 43 This is a view that shows the best motion vector for decoding the current block.

[0426] In S4301, when decoding the current block via inter-frame prediction, the decoding device can decode information indicating whether motion vector improvements are used. Here, the information indicating whether motion vector improvements are used by reconstructing pixel regions can be decoded on a block-by-block basis or via the upper-layer header.

[0427] When it is determined that the motion vector can be improved by using reconstructed pixel regions, in S4302, the decoding device can decode information related to the basic precision of the current block.

[0428] Subsequently, in S4303, the decoding device can decode the optimal motion vector of the optimal K (e.g., Figure 41 The final BESTM_K in the code. When decoding the best motion vector for the current block, the motion vectors of the adjacent blocks are used as described above.

[0429] Figure 44 This is a view showing a flowchart of obtaining improved motion vectors in a decoding device.

[0430] S4401 represents the initial value of each parameter.

[0431] exist Figure 44 In the header, L and END_L can be initialized to Val3 and Val4 respectively. The initial values ​​of L and END_L can be decoded from the upper-layer header. BEST_L can be initialized to Val3.

[0432] BEST_K can represent the optimal K, and can be set as shown above. Figure 43 The value is decoded as shown in the flowchart.

[0433] MV_L and BESTMV_L can be initialized to (0, 0) respectively. In addition, COST can be initialized to 0, and BEST_COST_L can be initialized to the maximum value (MAX) that can be stored.

[0434] In S4402, the decoding device can set MV_L by performing motion estimation up to 1 / 2BEST_K+L unit and calculate the cost when using the set MV_L.

[0435] In S4403, COST and BEST_COST_L can be compared, and in S4404, when COST is not greater than best_COST_L, BEST_COST_L can be updated to COST, and BESTMV_L can be updated to MV_L.

[0436] When COST is greater than best_COST_L in S4403 or when the parameter update is completed in S4404, L can be updated in S4405 by adding an offset b to L.

[0437] In S4406, the updated L can be compared with END_L, and when L is not greater than END_L, a return to S4402 can be performed to estimate the motion vector based on BEST_K and L.

[0438] Once MV_L is determined through the steps described above, the encoding device can derive the final motion vector by scaling MV_K using BEST_L and BEST_K to match MV_L.

[0439] The improved intra-frame prediction method for the current block will then be described.

[0440] A coded block can be divided into at least two sub-blocks, and each sub-block can be further divided into at least two sub-blocks. When the coded block is not divided, a prediction block of the same size as the coded block can be generated, and when the coded block is divided into at least two sub-blocks, a prediction block matching the size of each sub-block can be generated. Here, a prediction block can represent a prediction sample of a block unit generated through inter-frame prediction or intra-frame prediction.

[0441] For ease of description, in the embodiments described below, a block prior to being divided into sub-blocks may be referred to as an upper-level block. In an embodiment, when a coding block is divided into at least two sub-blocks, the upper-level block of the sub-blocks may be the coding block itself. Alternatively, when a sub-block is divided into at least two sub-blocks, the upper-level block of the divided sub-blocks may be the sub-blocks themselves.

[0442] Figure 45 This is a view illustrating a flowchart of encoding intra-prediction information for each sub-block when the current block is divided into multiple sub-blocks. Here, the current block can refer to a coded block or a sub-block. Therefore, the current block means the current block to be encoded regardless of whether it is a coded block or a sub-block.

[0443] First, in S4501, the encoding device can encode information indicating whether the current block is divided into at least two sub-blocks. This information can be a 1-bit flag, but is not limited to this.

[0444] In S4502, when it is determined that the current block is divided into at least two sub-blocks, in S4503, the encoding device can encode information indicating whether the current block is divided in a horizontal or vertical direction. This information can be a 1-bit flag, but is not limited to this. In an embodiment, when the information is a 1-bit flag, when the flag value is true, it can indicate that the current block is divided into N sub-blocks in the horizontal (or vertical) direction (N is an integer equal to or greater than 2), and when the flag value is false, it can indicate that the current block is divided into N sub-blocks in the vertical (or horizontal) direction.

[0445] In S4505 and S4506, based on the current block partitioning method in S4504, the encoding device can generate N sub-blocks by performing at least one partitioning of the current block in the horizontal or vertical direction.

[0446] The number N of sub-blocks generated by dividing the current block can be set to a preset value used in the encoding and decoding devices, or it can be encoded in blocks or through the upper-layer header. N can be an integer represented by a power of 2, such as 1, 2, 4, 8, 16, 16, etc., or it can be encoded by converting to a logarithmic value (Log2N). For example, when N is 8, the encoding device can encode the value 3 (Log28) obtained by applying the logarithm to 8. Here, the decoding device can decode 3 and set N to 8 (2... 3 Here, when N is 1, it means that the current block is not divided into at least two sub-blocks. Therefore, when N is 1, the information indicating whether the current block is divided into sub-blocks can be omitted. When N is 1, a prediction block with the same size as the current block can be generated.

[0447] Alternatively, N can have integer values ​​that are not represented by the exponent 2.

[0448] In another embodiment, the encoding device can generate multiple sub-blocks of less than N by merging portions of multiple sub-blocks generated by dividing the current block. Here, the encoding device can generate a sub-block by merging at least two consecutively positioned sub-blocks. In an embodiment, when N is set to 4, the encoding device can generate four sub-blocks by dividing the current block three times, but blocks at any position among the four sub-blocks can be merged according to preset conditions. For example, the encoding device can merge the block located in the middle of the current block into one block. Here, although N is 4, three sub-blocks with a ratio of 1:2:1 can be generated by dividing the current block.

[0449] The same conditions can be used in both the encoding and decoding devices as the merging conditions for sub-blocks, or the encoding device can encode the merging conditions for sub-blocks and transmit them to the decoding device. In an embodiment, the encoding device can encode information representing the index of the sub-block that becomes the target of merging among multiple sub-blocks generated by dividing the current block, and transmit it to the decoding device. In other words, the encoding device can generate N-1 (or NM, where M is the number of merging times) sub-blocks by merging a portion of N sub-blocks generated by dividing the current block.

[0450] Subsequently, in S4507, the encoding device can repeat the above steps by using the first sub-block among the multiple sub-blocks included in the current block as the current block.

[0451] When the current block is not divided into at least two sub-blocks in S4502, the encoding device can perform intra-frame predictive coding on the current block in S4508.

[0452] Subsequently, in S4509, it can be determined whether the encoding of all sub-blocks has been completed. If not, in S4510, the above steps can be repeated by using the following sub-block as the current block.

[0453] Here, the encoding / decoding order between sub-blocks can be determined based on the encoding / decoding order of methods such as raster scanning, sawtooth scanning, and Z-scanning.

[0454] Figure 46 and 47 This is a view that divides the current block into multiple sub-blocks.

[0455] For ease of description, in this embodiment, it is assumed that the number of sub-blocks generated by dividing the current block is four (i.e., N is 4). Additionally, it is assumed that the information indicating whether the current block is divided into at least two sub-blocks is a 1-bit flag. In this embodiment, a flag of 1 indicates that the current block has been divided into multiple sub-blocks, and a flag of 0 indicates that the current block has not been further divided.

[0456] Additionally, assume that the information indicating the partitioning direction of the current block is also a 1-bit flag. In the embodiment, when the flag is 1, it indicates that the current block is partitioned in the vertical direction, and when the flag is 0, it indicates that the current block is partitioned in the horizontal direction.

[0457] Additionally, an example will be described that encodes only information related to block partitioning.

[0458] Figure 46This is a view of an example of dividing (a) into (c). Referring to (a) and (b), a block can be divided into multiple sub-blocks. Here, the division direction is horizontal, and the flag indicating whether the block is divided can be set to 1, and the flag indicating the division direction can be set to 0. Therefore, a block can include four sub-blocks. Sub-block A, one of the four sub-blocks included in the block, is further divided, and the division direction is horizontal. The flag indicating whether sub-block A is divided can be set to 1, and the flag indicating the division direction can be set to 0. Sub-blocks 1 to 4, generated by dividing sub-block A, are not further divided, so their flags can be set to 0 respectively.

[0459] Since sub-block B is not further divided, the flag indicating whether sub-block B has been divided can be set to 0.

[0460] Furthermore, sub-block C is divided horizontally, so the flag indicating whether sub-block C is divided can be set to 1, and the flag indicating the division direction can be set to 0. Sub-blocks 6 to 9, generated by dividing sub-block C, are not further divided, so their flags can be set to 0 respectively.

[0461] Sub-block D is not further divided, so the flag indicating whether sub-block D has been divided can be set to 0.

[0462] Finally, a block can contain ten sub-blocks.

[0463] Therefore, the information required to divide the block from form (a) to form (c) becomes 10 10 0000 0 10 0000 0.

[0464] Figure 47 This is a view of an example that combines a portion of the sub-blocks generated by dividing the blocks into a single sub-block.

[0465] refer to Figure 47 In (a) and (b), a block can be divided into multiple sub-blocks, where the division direction is horizontal. Therefore, the flag indicating whether a block has been divided can be set to 1, and the flag indicating the division direction can be set to 0.

[0466] When a block is divided into four sub-blocks, there are two sub-blocks in the middle of the block that do not touch the upper or lower boundaries of the block. Here, the encoding device can merge the two blocks located in the middle of the block into one sub-block.

[0467] Therefore, a block can include three sub-blocks. Sub-block A, one of the three sub-blocks included in the block, is not further divided, so the flag indicating whether sub-block A is divided can be set to 0.

[0468] Sub-block B is added, and the division direction is vertical. Therefore, the flag indicating whether sub-block B is divided can be set to 1, and the flag indicating the division direction can also be set to 1. The two middle sub-blocks among the four sub-blocks generated by dividing sub-block B can be merged into one sub-block. Therefore, three more sub-blocks can be generated by dividing sub-block B. The sub-blocks generated by dividing sub-block B are not further divided, so the flags indicating whether the sub-blocks included in sub-block B are divided can be set to 0 respectively.

[0469] Since sub-block C is not divided separately, the flag indicating whether sub-block C is divided can be set to 0.

[0470] Finally, a block can contain five sub-blocks.

[0471] Therefore, the information needed to divide block (a) into the form of block (c) is 10 0 11 000 0.

[0472] The division of sub-blocks can be restricted based on the maximum depth or minimum size of the sub-block. Here, the maximum depth or minimum size of the sub-block can be encoded on a block-by-block basis or through the upper-level header.

[0473] Each sub-block can have a different intra prediction mode. Therefore, the encoding device can encode the intra prediction information for each sub-block. Here, in addition to the intra prediction mode of the sub-block, the intra prediction information can also include information related to the weights that take into account the features of the previous sub-block. An example of encoding the intra prediction information of a sub-block will be described in detail below.

[0474] Figure 48 This is a diagram illustrating an example of determining the weights of sub-blocks. For ease of description, it is assumed that the number of intra-prediction modes that can be used by a block is 35, such as... Figure 5 As shown. Furthermore, based on the intra-prediction modes in the upper-left diagonal direction (number 18), the intra-prediction mode closer to the horizontal direction (mode 10) is called the horizontal mode, and the intra-prediction mode closer to the vertical direction (mode 26) is called the vertical mode. Additionally, it is assumed that the intra-prediction modes in the upper-left diagonal direction can be included in the horizontal modes, or can be included in the vertical modes. This embodiment can be applied when the number of intra-prediction modes usable by a block is greater than or less than 35.

[0475] Furthermore, it is assumed that weighted intra-prediction is performed within the upper-level block unit. In other words, when it is determined that weights for upper-level blocks will be used to perform intra-prediction, weighted intra-prediction can be performed on all the multiple sub-blocks generated by dividing the upper-level blocks.

[0476] Furthermore, assuming the upper-level block has a size of 8×8 and is divided into four sub-blocks horizontally, merging the centered sub-block generated from the upper-level block can produce three sub-blocks. Here, as... Figure 48 In the example shown, the dimensions of the three sub-blocks can be 8x2, 8x4, and 8x2 respectively. Figure 48 In this example, some sub-blocks are merged, but this embodiment can be applied to cases where sub-blocks are not merged.

[0477] When the orientation feature of any of the intra-prediction modes of a sub-block is the same as the orientation feature of the intra-prediction mode of a previous sub-block, the corresponding sub-block can be encoded by reflecting the change in pixel values ​​between rows or the change in pixel values ​​between rows in a previous sub-block.

[0478] In an embodiment, when the intra prediction mode for a sub-block 1 with an 8×2 size is a vertical orientation mode, and when the intra prediction mode to be used when encoding a sub-block 2 with an 8×4 size is the same as the vertical orientation mode for the previous sub-block (i.e., sub-block 1), the weights to be applied to sub-block 2 can be derived by using the changes in the average value of the pixels included in the first column of the sub-block and the changes in the average value of the pixels included in the last column of sub-block 1, and the derived weights can be applied to sub-block 2. Here, the pixel values ​​of sub-block 1 used to calculate the weights to be applied to sub-block 2 can be predicted pixels generated by performing intra prediction on sub-block 1, or reconstructed pixels reconstructed based on the predicted pixels.

[0479] For example, when the vertical orientation mode is applied to sub-block 2, the average pixel value included in the top column of sub-block 1 is 80, and the average pixel value included in the last column is 90. It can be determined that the average pixel value has increased by 10 for each line in sub-block 1. Therefore, the encoding device can generate a prediction block for sub-block 2 and apply the increase in the average pixel value Δ based on the position of each column. In an embodiment, the encoding device can gradually apply weights based on the position of each column in sub-block 2, for example, adding Δ to the first column of sub-block 2 (i.e., line 3), adding 2Δ to the second column (i.e., line 4), and so on. Figure 48 In the example shown, the predicted pixel refers to the predicted pixel generated by performing intra-frame prediction on sub-block 2.

[0480] Although not shown, when sub-block 3 also uses the vertical orientation pattern as sub-block 2, the variation in the average pixel value of the first column (i.e., region C) and the last column (i.e., region D) of sub-block 2 can be considered to determine the weights to be applied to sub-block 3. Here, the pixels included in the first and last columns of sub-block 2 used to calculate the weights of sub-block 3 can represent the predicted pixels or multiple predicted pixels generated by applying the weights to the predicted pixels.

[0481] When determining the weights to be applied to the currently encoded sub-block (i.e., the current block), pixel values ​​from previous sub-blocks can be used. Here, a previous sub-block can refer to a sub-block encoded before the current block. For example, when determining the weights of the current block, the upper sub-block adjacent to the top edge of the current block or the left sub-block adjacent to the left edge of the current block can be used. When both an upper and left sub-block exist for the current block, the encoding device can determine the weights to be applied to the current block by using N consecutive columns within the upper sub-block or M consecutive rows within the left sub-block. In an embodiment, the encoding device can compare the weights obtained by using N consecutive columns within the upper sub-block with the weights obtained by using M consecutive rows within the left sub-block to determine the optimal weights for generating the current block.

[0482] Additionally, in the above embodiment, the change in the pixel average value is calculated using the first column (or first row) and the last column (or last row) included in the previous sub-block. However, a different method than the above example can be used to calculate the change in the pixel average value. In the embodiment, the change in the pixel average value can be calculated using the last line and the line adjacent to the last line. For example, in Figure 48 In the example shown, lines 5 and 6 can be used to calculate the weight of sub-block 3. Alternatively, the change in the average pixel value can be calculated by using the average of the changes in each line.

[0483] In addition to sub-blocks, weighted intra-prediction can be applied between any blocks such as coding blocks, upper-layer blocks, etc.

[0484] Figure 49 This is a view showing a flowchart of the encoding of information related to the weights to be applied to each sub-block. First, in S4901, information indicating whether weights are applied in the upper-level block unit can be encoded.

[0485] Here, the information can be a 1-bit flag, but is not limited to this. Alternatively, the information can be encoded in a coding block unit, a higher-level block unit, or a sub-block unit. In an embodiment, the information can be encoded for the first sub-block among multiple sub-blocks generated by dividing a higher-level block.

[0486] When the sub-block to be encoded among multiple sub-blocks generated by dividing the upper-layer block is called the current block, in S4902, the encoding device can encode the intra-prediction mode of the current block. Subsequently, in S4903, it can be determined whether the encoding of the intra-prediction mode for all sub-blocks existing in the upper-layer block has been completed, and if the encoding of the intra-prediction mode for all sub-blocks has not been completed, in S4904, it can move to the subsequent sub-block and set the corresponding sub-block as the current block so that the intra-prediction mode of the current block can be encoded.

[0487] Figure 50 This is a view showing the intra-prediction mode encoding of the currently encoded sub-block. For ease of description, the currently encoded sub-block is referred to as the "current block".

[0488] In order to encode the intra prediction mode of the current block, the coding device can predict the intra prediction mode of the current block. Here, the prediction of the intra prediction mode can be performed by using the intra prediction modes of neighboring blocks that are adjacent to the current block or the upper-level block (or coding block).

[0489] In detail, the encoding device can configure candidate modes for predicting the intra-prediction mode of the current block by using the intra-prediction modes of neighboring blocks adjacent to the current block or the upper-layer block. N candidate modes can be encoded on a block-by-block basis or via the upper-layer header, or the same value can be set and used in both the encoding and decoding devices. In this embodiment, N is assumed to be 2, and candidate modes are determined by using the determined intra-prediction modes of neighboring blocks adjacent to the upper-layer block.

[0490] The encoding device can configure candidate modes by using the upper neighbor block that is adjacent to the upper part of the upper block and the left neighbor block that is adjacent to the left side of the upper block. In an embodiment, the encoding device can configure candidate modes by using the intra-prediction mode of the block at a specific position in the upper neighbor block of the upper block and the intra-prediction mode of the block at a specific position in the left neighbor block of the upper block.

[0491] Alternatively, the coding device can configure candidate modes by using the highest frequency mode among the intra-prediction modes of the upper adjacent block of the upper layer block and the highest frequency mode among the intra-prediction modes of the left adjacent block of the upper layer block.

[0492] Alternatively, the coding device can configure candidate modes by using a predetermined number of modes with the highest frequency in the intra-prediction modes of the upper adjacent block and the left adjacent block of the upper layer block.

[0493] In the embodiments, Figure 50 In the example shown, when the values ​​within a block represent the intra-prediction modes of adjacent blocks, the mode with the highest frequency among the intra-prediction modes of the upper adjacent block and the left adjacent block is mode number 1 (used four times), followed by mode number 0 (used three times). Therefore, the coding device can configure candidate modes by using mode number 1 and mode number 0.

[0494] When configuring candidate modes, the coding device can determine whether there exists a candidate mode that is the same as the intra-prediction mode of the current block. When it is determined that there is a matching mode, the coding device can encode information representing the candidate mode that is the same as the intra-prediction mode of the current block among multiple candidate modes.

[0495] Optionally, when there is no candidate mode that is the same as the intra-prediction mode of the current block, the residual intra-prediction mode other than the candidate mode among the intra-prediction modes that can be used by the current block is numbered, and the information specifying the intra-prediction mode of the current block in the residual intra-prediction mode with the number is encoded.

[0496] In an embodiment, Figure 51 This is a view of an example of the residual intra-prediction mode execution number.

[0497] When the residual intra-prediction mode is greater than the candidate mode, the coding device can allocate a number of residual intra-prediction modes with values ​​greater than the candidate modes, obtained by subtracting the number of candidate modes from the number of residual intra-prediction modes.

[0498] In an embodiment, when candidate modes include mode 0 and mode 1, for residual intra-prediction modes greater than mode 0 and mode 1, a number can be assigned by subtracting 2 from the residual intra-prediction mode. In an embodiment, when the intra-prediction mode of the current block is 5, the encoding device can encode 3 by subtracting 2 from 5.

[0499] In the above example, candidate modes are configured by using the intra-prediction modes of neighboring blocks adjacent to the current block or the upper-level block. However, when encoding blocks via intra-prediction, blocks that are not adjacent to the current block or the upper-level block can be used to configure candidate modes. In an embodiment, the candidate mode for the current block can be configured by using the intra-prediction modes of blocks that are not adjacent to the current block or the upper-level block but are adjacent to blocks near the current block or the upper-level block.

[0500] Figure 52 This is a view showing a flowchart of the encoding of the intra-prediction mode for the current block.

[0501] In S5201, the encoding device can configure the candidate modes of the current block, and in S5202, the encoding device encodes information indicating whether there is a candidate mode that is the same as the intra-prediction mode of the current block.

[0502] In S5203, when a candidate mode identical to the intra-prediction mode of the current block exists, in S5204, the encoding device may encode the index information representing the candidate mode identical to the intra-prediction mode of the current block. Meanwhile, in S5203, when no candidate mode identical to the intra-prediction mode of the current block exists, in S5205, the encoding device may encode the residual mode information of the available residual intra-prediction modes, excluding candidate modes, that specifies the intra-prediction mode of the current block.

[0503] In the above embodiments, within a sub-block unit, information regarding whether the intra-prediction mode of the sub-block is the same as a candidate mode, information specifying a candidate mode that is the same as the intra-prediction mode of the sub-block, or residual mode information can be encoded / decoded. In another embodiment, the encoding device can encode the difference between the intra-prediction mode and that of the previous block. Hereinafter, embodiments for encoding intra-prediction modes will be described in detail with reference to the following figures.

[0504] Figure 53 This is a diagram illustrating an example of determining the intra-frame prediction mode on a sub-block basis.

[0505] For ease of description, assume that the upper block is divided into four sub-blocks, and each sub-block can use 35 intra-prediction modes.

[0506] The encoding device can determine the intra prediction mode of the first sub-block (sub-block 1), and determine the intra prediction mode of the second sub-block by using the intra prediction mode used in the first sub-block and the offset 'a'. Specifically, the encoding device can determine that the intra prediction mode of the currently encoded sub-block is within the range of "the intra prediction mode of the previous sub-block ± 'a'".

[0507] In an embodiment, when the intra prediction mode of sub-block 1 is 26 and the offset a is 4, the encoding device can determine the intra prediction mode of sub-block 2 from one of the intra prediction modes from 22 to 30.

[0508] When the intra prediction mode of sub-block 2 is determined to be 25, the intra prediction mode of sub-block 3 can be determined to be one of the intra prediction modes from 21 to 29 that exist in the offset range based on the intra prediction mode of sub-block 2.

[0509] When the intra prediction mode of sub-block 3 is determined to be 27, the intra prediction mode of sub-block 4 can be determined to be one of the intra prediction modes from 23 to 31 that exist in the offset range based on the intra prediction mode of sub-block 4.

[0510] As described above, when determining the intra prediction mode of a sub-block within the offset range, the intra prediction modes of the sub-blocks can have similar orientations. Considering that the intra prediction modes of each sub-block have similar orientations, the difference between the intra prediction modes of the currently encoded sub-block and the previous sub-blocks can be encoded.

[0511] In the above embodiments, the intra-prediction mode of a sub-block is determined within the offset range based on the intra-prediction mode of the previous sub-block; however, the present invention is not limited thereto. The encoding device can determine the optimal intra-prediction mode for each sub-block and encode information regarding whether an intra-prediction mode for each sub-block exists within the offset range based on the intra-prediction mode of the previous sub-block. When an intra-prediction mode for each sub-block exists within the offset range based on the intra-prediction mode of the previous sub-block, the encoding device can encode the intra-prediction mode of the sub-block using the difference between the intra-prediction modes of the previous sub-block.

[0512] The encoding and decoding devices can use a predefined value as offset a, or they can encode offset a as a block unit or a higher-level header unit.

[0513] Figure 54 This is a view showing a flowchart of the encoding of intra-prediction modes for sub-blocks.

[0514] In S5401, when the currently encoded sub-block is the first sub-block, in S5402, the encoding device can encode the intra-prediction mode of the first sub-block. Here, for the intra-prediction mode of the first sub-block, the value of the intra-prediction mode can be encoded as is, or the value of the intra-prediction mode can be encoded using the aforementioned candidate mode. In the embodiment, the encoding device can encode information indicating whether there is a candidate mode identical to the intra-prediction mode of the first sub-block, and encode the residual mode information of the specified candidate mode based on whether there is a candidate mode identical to the intra-prediction mode of the first sub-block.

[0515] When the sub-block currently being encoded in S5401 is not the first sub-block, in S5403, the encoding device can encode the difference between the intra-prediction mode of the previous sub-block and the intra-prediction mode of the current sub-block.

[0516] In the embodiments, Figure 53 In the above, when the intra-prediction modes of sub-block 1, sub-block 2, sub-block 3 and sub-block 4 are 26, 25, 27 and 29 respectively, the second sub-block can be encoded as -1, the difference from the first sub-block; the third sub-block can be encoded as +2, the difference from the second sub-block; and the fourth sub-block can be encoded as +2, the difference from the third sub-block.

[0517] Although not shown, the encoding device can also encode information about whether there are residual sub-blocks other than the first sub-block within the offset range of the intra-prediction mode based on the previous sub-block. Here, this information can be a 1-bit flag, but is not limited to this. When there are residual sub-blocks other than the first sub-block within the offset range of the intra-prediction mode based on the previous sub-block, as in the example above, the difference with the previous sub-block can be encoded. At the same time, when the intra-prediction mode of each residual sub-block other than the first sub-block exceeds the offset range of the intra-prediction mode based on the previous sub-block, the encoding device can encode the intra-prediction mode of each sub-block as is, or encode the intra-prediction mode of each sub-block by using a candidate mode.

[0518] Alternatively, it is also possible to encode information about whether the notification uses an offset to encode the intra-prediction mode included in all sub-blocks of the upper-layer block. Information can be encoded for the first sub-block among multiple sub-blocks generated by dividing the upper-layer block.

[0519] When encoding intra-prediction modes for all sub-blocks included in the upper-layer block using offsets, the number of available intra-prediction modes for the remaining sub-blocks, excluding the first sub-block, can be reduced from 35 to ax²+1.

[0520] When it is determined that a sub-block included in an upper-layer block does not use an offset, the intra-prediction mode of the sub-block can be encoded without using an offset.

[0521] Figure 55 This is a diagram illustrating an example of encoding intra-prediction modes for each sub-block.

[0522] exist Figure 55 In the example shown, it is assumed that block ① is not divided, thus having one sub-block; block ② is divided into four sub-blocks s2 to s5; block ③ is divided into four sub-blocks s6 to s9; and block ④ is divided into four sub-blocks H, s11 to s13. In the case of block ④, for example, H is the first sub-block with upper-level sub-blocks, so the determined intra-prediction mode can be encoded by predicting it. Here, to predict the intra-prediction mode of H, candidate modes can be configured by using the intra-prediction modes of adjacent blocks. The encoding device can encode whether there is a candidate mode among the candidate modes that is the same as the intra-prediction mode of H, and when there is a candidate mode that is the same as the intra-prediction mode of H, the encoding device can encode information specifying the candidate mode that is the same as the intra-prediction mode of H and transmit it.

[0523] Subsequently, in the encoding device, the intra-prediction modes of s11 to s13 can be encoded using the difference from the previous sub-block. In an embodiment, the intra-prediction mode of s11 can be encoded as the difference from the intra-prediction mode of H, the intra-prediction mode of s12 can be encoded as the difference from the intra-prediction mode of s11, and the intra-prediction mode of s13 can be encoded as the difference from the intra-prediction mode of s12.

[0524] In the above embodiment, the intra-prediction mode of each residual sub-block other than the first sub-block is encoded as the difference from the previous sub-block. Unlike the example above, the intra-prediction mode of each residual sub-block other than the first sub-block can be encoded as the difference from the sub-block at a specific location. In the embodiment, the intra-prediction mode of the residual sub-block other than the first sub-block can be encoded as the difference from the first sub-block. Alternatively, the intra-prediction mode of the second sub-block can be encoded as the difference from the first sub-block. Meanwhile, the residual sub-blocks other than the first and second sub-blocks can be encoded by calculating the difference from the second sub-block.

[0525] Figure 56 This is a view showing a flowchart of the decoding process for intra-frame prediction information of sub-blocks in a decoding device.

[0526] First, in S5601, the decoding device can decode information indicating whether the current block has been divided into sub-blocks. In S5602, when it is determined that the current block has been divided into sub-blocks, in S5603, the decoding device can decode information indicating the division direction of the current block.

[0527] According to the information in S5604, in S5605 and S5606, the decoding device can divide the current block in the horizontal or vertical direction and generate multiple sub-blocks.

[0528] Here, when the number of times the current block is divided is greater than 2, the decoding device can merge multiple consecutive sub-blocks in the current block into one block by using a preset method.

[0529] Subsequently, in S5607, the decoding device can repeat the above steps by using the first sub-block included in the current block as the current block.

[0530] When the current block is not divided into at least two sub-blocks in S5602, the decoding device can perform intra-frame predictive decoding on the current block in S5608.

[0531] Subsequently, in S5609, it can be determined whether decoding of all sub-blocks has been completed, and if decoding of all sub-blocks has not been completed, the above steps can be repeated in S5610 by using the following sub-block as the current block.

[0532] Figure 57This is a view showing a flowchart of the decoding process related to weights.

[0533] First, in S5701, the decoding device can decode information about whether weights are applied in the upper-level block unit. Here, the information can be a 1-bit flag, but is not limited to this. Alternatively, the information can be decoded by dividing the upper-level block into the first sub-block, or by decoding the upper-level block (e.g., a coded block) instead of the sub-block.

[0534] Subsequently, in S5702, the decoding device can decode the intra-prediction mode of the sub-block to be decoded (hereinafter referred to as the "current block"). Then, in S5703, it can be determined whether to decode the intra-prediction modes of all sub-blocks included in the upper-layer block, and if intra-prediction decoding for all sub-blocks has not been completed, in S5704, a move to the subsequent sub-block can be performed to set the corresponding sub-block as the current block, and in S5704, the intra-prediction mode of the current block can be decoded.

[0535] When determining whether to apply weights to all sub-blocks present in the upper-layer block, the decoding device can determine the weights of the current block by considering whether the directional features of the prediction modes of the current block and the previous block are similar, and by considering the changes in the average pixel values ​​between columns or rows of the previous block. Subsequently, the decoding device can apply the weights to the obtained prediction samples using the intra-prediction mode of the current block.

[0536] Figure 58 This is a view showing the flowchart of the intra-prediction mode decoding of the currently decoded sub-block. For ease of description, the currently decoded sub-block is referred to as the "current block".

[0537] In the S5801, the decoding device can configure the candidate mode for the current block. (See reference...) Figure 50 An example of configuring candidate modes is described, so its detailed description will be omitted.

[0538] Subsequently, in S5802, the decoding device can decode information indicating whether there is a candidate mode among the candidate modes that is the same as the intra-prediction mode of the current block.

[0539] In S5803, when there is a candidate mode that is the same as the intra-prediction mode of the current block, in S5804, the decoding device can decode the index information representing the candidate mode that is the same as the intra-prediction mode of the current block.

[0540] Meanwhile, when there is no candidate mode in S5803 that is the same as the intra-prediction mode of the current block, in S5805, the decoding device can decode the residual mode information and obtain the intra-prediction mode of the current block by using the candidate mode and the decoded residual mode information.

[0541] Figure 59 This is a view illustrating another embodiment of the intra-prediction mode for a decoded sub-block.

[0542] In S5901, when the currently decoded sub-block is the first sub-block, in S5902, the decoding device can decode the intra-prediction mode of the first sub-block. Here, the decoding information may represent the intra-prediction mode value of the first sub-block, or include information related to candidate modes. The information related to candidate modes may include information indicating whether there is a candidate mode identical to the intra-prediction mode of the first sub-block, information specifying a candidate mode based on whether there is a candidate mode identical to the intra-prediction mode of the sub-block, or residual mode information.

[0543] When the sub-block being decoded in S5901 is not the first sub-block, in S5903, the decoding device can decode the difference between the intra-prediction mode of the previous sub-block and the intra-prediction mode of the current sub-block. Subsequently, the decoding device can obtain the intra-prediction mode of the current sub-block based on the difference between the previous sub-block and the current sub-block.

[0544] In an embodiment, when the intra-prediction mode of sub-block 1 is 26, and when the differences with sub-block 2, sub-block 3 and sub-block 4 are -1, +2 and +2 respectively, the intra-prediction mode of sub-block 2 can be determined to be 25 by applying the differences to the intra-prediction mode of sub-block 1, the intra-prediction mode of sub-block 3 can be determined to be 27 by applying the differences to the intra-prediction mode of sub-block 2, and the intra-prediction mode of sub-block 4 can be determined to be 29 by applying the differences to the intra-prediction mode of sub-block 3.

[0545] Although not shown, the decoding device can also decode information about whether the intra-prediction mode of each residual sub-block (excluding the first sub-block) exists within the offset range, based on the intra-prediction mode of the previous block. Here, the information can be a 1-bit flag, but is not limited to this. When the intra-prediction mode of each residual sub-block (excluding the first sub-block) exists within the offset range based on the intra-prediction mode of the previous sub-block, as in the example above, the difference with the previous sub-block can be decoded. Meanwhile, when the intra-prediction mode of each residual sub-block (excluding the first sub-block) exceeds the offset range based on the intra-prediction mode of the previous sub-block, the decoding device can decode the intra-prediction mode of each sub-block as is, or decode the intra-prediction mode of each sub-block using a candidate mode.

[0546] Alternatively, the notification can be used to decode information regarding whether intra-frame prediction using offsets is performed on all sub-blocks included in the upper-layer block. Here, this information can be decoded by dividing the upper-layer block into its first sub-block, or it can be encoded in units of arbitrary blocks.

[0547] When performing intra-prediction with offset for all sub-blocks included in the upper-layer block, the number of intra-prediction modes that can be used by the remaining sub-blocks other than the first sub-block can be reduced from 35 to a x2+1.

[0548] When it is determined that all sub-blocks existing in the upper-level sub-block do not use offsets, the intra-prediction mode of the sub-block can be decoded without using offsets.

[0549] The following section will describe an example of encoding / decoding sub-blocks using curve patterns.

[0550] A curve pattern means that the slope of the intra-prediction mode of a sub-block belonging to a higher-level block unit has a gradually increasing or decreasing form. In an embodiment, the sub-blocks grouped in the higher-level block unit can be determined using a curve pattern when the intra-prediction mode between sub-blocks gradually increases or decreases (e.g., with uniform difference or uniform ratio).

[0551] Figure 60 This is a view showing an example of determining whether to use curve mode.

[0552] For ease of description, let's assume the upper-level block is divided into four sub-blocks, such as... Figure 60 As shown.

[0553] First, the encoding device can encode information indicating whether the curve intra-prediction mode (hereinafter referred to as curve mode) is used for sub-block 1.

[0554] When it is determined that a curve mode is to be used, the intra-prediction mode for residual sub-blocks other than the first sub-block can be assigned a value obtained by adding the offset β to the intra-prediction mode of the previous sub-block.

[0555] In an embodiment, when the number of available intra-prediction modes is 35, the intra-prediction mode of sub-block 1 is number 10, the offset β is 2, number 12 can be assigned to sub-block 2, number 14 can be assigned to sub-block 3, and number 16 can be assigned to sub-block 4 as an intra-prediction mode.

[0556] Figure 61 This is a view showing a flowchart of encoding the intra-prediction mode of each sub-block using information from the curve pattern.

[0557] In S6101, when the sub-block to be encoded is the first sub-block in the upper-layer sub-block, in S6102, the encoding device can encode information indicating whether a curve mode is used. In S6103, when a curve mode is used, in S6104, the encoding device can encode information related to the offset β. Here, the offset-related information may include absolute value and sign information. Here, the offset and sign information may be encoded in the same layer or in different layers. In an embodiment, the absolute value of the offset-related information can be encoded through the upper-layer header. Meanwhile, signs can be encoded on a block-by-block basis (e.g., sub-block unit or prediction block unit). Additionally, in S6105, the encoding device can encode information about the intra-prediction mode of the first sub-block.

[0558] When the sub-block being encoded in S6101 is not a sub-block, in S6106, the encoding device can determine whether to use a curve mode in the first sub-block. When the curve mode is not used, in S6105, the encoding device can encode the intra-prediction mode of the current sub-block. Here, the intra-prediction mode of the current sub-block can be encoded by using a candidate mode or the difference from the aforementioned sub-block.

[0559] During this process, when it is determined that curve mode is to be used in the first sub-block, encoding of the intra-prediction mode for the current sub-block may not be performed.

[0560] In S6107, the method ends when the encoding of the intra-prediction mode for all sub-blocks is completed; otherwise, in S6108, the encoding of the subsequent sub-blocks begins.

[0561] Figure 62 This is a view showing a flowchart of decoding the intra-prediction mode of each sub-block using information from the curve pattern.

[0562] In S6201, when the currently decoded sub-block is the first sub-block in the upper-layer sub-block, in S6202, the decoding device can decode information indicating whether curve mode is used. In S6203, when curve mode is used, in S6204, the decoding device can decode offset-related information. Here, offset-related information may include absolute value and sign information. Here, offset and sign information can be decoded in the same layer or in different layers. In an embodiment, the absolute value of offset-related information can be decoded through the upper-layer header. Meanwhile, symbols can be decoded on a block-by-block basis (e.g., sub-block unit or prediction block unit). Subsequently, in S6205, the decoding device can decode the intra-prediction mode of the first sub-block.

[0563] If the sub-block being decoded in S6201 is not the first sub-block, in S6206, the decoding device can determine whether to use the curve mode in the first sub-block. If the curve mode is not used, in S6207, the decoding device can decode the intra-prediction mode of the current sub-block. Here, the intra-prediction mode of the current sub-block can be decoded by using a candidate mode or the difference from the previous sub-block.

[0564] During this process, when it is determined that the curve mode is to be used in the first sub-block, the intra-prediction mode of the current sub-block can be decoded by using the intra-prediction mode and offset value of the previous sub-block.

[0565] In S6207, the execution of this method ends when the decoding of the intra-prediction mode of all sub-blocks is completed; otherwise, in S6208, the decoding of the subsequent sub-blocks begins.

[0566] The following section will describe in detail how to perform intra-frame prediction when using curve mode.

[0567] When performing intra-prediction for each sub-block, the features of the reference samples used to perform intra-prediction for the sub-block can vary depending on whether the transformation is performed on a sub-block basis or on a higher-level block basis. In an embodiment, when performing a transformation within a sub-block unit, intra-prediction for the sub-block can be performed based on reconstructed samples included in adjacent sub-blocks adjacent to the sub-block and reconstructed samples included in adjacent blocks adjacent to the higher-level block that includes the sub-block. Meanwhile, when performing a transformation within a higher-level block unit, intra-prediction for the sub-block can be performed based on predicted samples included in adjacent sub-blocks adjacent to the sub-block and reconstructed samples included in adjacent blocks adjacent to the higher-level block that includes the sub-block.

[0568] The following text, with reference to the figure, will describe in detail a method for performing intra-frame prediction on sub-blocks using adjacent sub-blocks.

[0569] Figures 63 to 65 This is a view illustrating the method of performing intra-frame prediction on sub-blocks when a transformation is performed in an upper-level block unit.

[0570] exist Figures 63 to 65 In the example shown, P1 to P64 represent predicted pixels. In other words, each prediction block of sub-blocks 1 to 4 may include predicted pixels from P1 to P16, from P17 to P32, from P33 to P48, and from P49 to P64. R1 to R33 represent reconstructed pixels adjacent to the upper-level block.

[0571] exist Figure 63In the example shown, the upper block is divided into four sub-blocks. Here, when the curve mode is applied to the upper block, the intra-prediction mode of the first sub-block is number 27, and the offset β is 1, the intra-prediction modes of sub-blocks 1 to 4 can be set to numbers 27, 28, 29, and 30, respectively.

[0572] Intra-frame prediction of sub-block 1 can be performed using reconstructed pixels adjacent to sub-block 1. In an embodiment, intra-frame prediction of sub-block 1 can be performed using reference pixels R1 to R33.

[0573] When performing intra-prediction of sub-block 2, no reconstructed pixels exist in sub-block 1. Therefore, intra-prediction of sub-block 2 can be performed using the predicted pixels included in sub-block 1. In an embodiment, intra-prediction of sub-block 2 can be performed using the reconstructed pixels present on the left side of the sub-block and the predicted pixels present on the upper part of sub-block 2. In an embodiment, intra-prediction of sub-block 2 can be performed using R19 to R33 and P9 to P16.

[0574] When performing intra-prediction for sub-block 3, no reconstructed pixels exist in sub-block 2 adjacent to sub-block 3. Therefore, intra-prediction for sub-block 3 can be performed using the predicted pixels included in sub-block 2. In an embodiment, intra-prediction for sub-block 3 can be performed using the reconstructed pixels present on the left side of sub-block 3 and the predicted pixels present on the upper part of sub-block 3. In an embodiment, intra-prediction for sub-block 3 can be performed using R21 to R33 and P25 to P32.

[0575] Similarly, when performing intra-prediction for sub-block 4, there are no reconstructed pixels in sub-block 3 adjacent to sub-block 4. Therefore, intra-prediction for sub-block 4 can be performed using the predicted pixels included in sub-block 3. In an embodiment, intra-prediction for sub-block 4 can be performed using R23 to R33 and P41 to P48.

[0576] When performing intra-prediction for sub-blocks 2 through 4, unlike sub-block 1, the reconstructed pixels are not present in the upper right corner of the block. Therefore, when performing intra-prediction for sub-blocks 2 through 4, additional reference pixels can be generated by filling in the predicted pixels included in the adjacent sub-blocks adjacent to each sub-block.

[0577] exist Figure 64 In the example shown, in Figure 64 In this process, additional reference pixels are generated by copying the value of the rightmost pixel in the reconstructed sample included in the adjacent sub-blocks, but the method for generating additional reference pixels is not limited to this.

[0578] When the intra-prediction mode of a sub-block has a progressively increasing form, the intra-prediction performed when a transform is performed in the upper-level block can have the same characteristics as... Figure 65 The curves shown in the example are similar in form.

[0579] For example, the technology disclosed herein can also be configured as follows:

[0580] Technical Solution 1. A method for decoding video, the method comprising:

[0581] Determine whether the current block should be merged with its adjacent blocks;

[0582] Based on the determined results, obtain the motion information and weight prediction parameters of the current block;

[0583] The reference block for the current block is selected based on motion information; and

[0584] The prediction block for the current block is generated by applying the weighted prediction parameters to the reference block.

[0585] Technical Solution 2. The method as described in Technical Solution 1, wherein when it is determined that the current block is merged with the adjacent block, the weight prediction parameter of the current block is set to be the same as the weight prediction parameter of the adjacent block.

[0586] Technical Solution 3. The method as described in Technical Solution 1, wherein when it is determined that the current block will not be merged with the adjacent block, the weight prediction parameters of the current block are obtained from the information decoded from the bit stream.

[0587] Technical Solution 4. The method as described in Technical Solution 1, wherein the motion information includes a motion vector, and the precision of the motion vector is adjusted upward based on the reconstructed pixels adjacent to the current block.

[0588] Technical Solution 5. A method for decoding video, the method comprising:

[0589] Decode the intra-prediction mode information for the current block;

[0590] Intra-prediction is performed on the current block by using the intra-prediction mode of the current block;

[0591] Determine whether to correct the predicted samples generated as a result of performing intra-frame prediction; and

[0592] The predicted samples are corrected based on the determined results.

[0593] Technical Solution 6. The method as described in Technical Solution 5, wherein decoding the information of the intra-prediction mode of the current block includes:

[0594] Generate candidate patterns for the current block;

[0595] Determine if there exists a candidate mode that is the same as the intra-prediction mode of the current block; and

[0596] The intra-prediction mode for the current block is determined based on the determined result.

[0597] Technical Solution 7. The method as described in Technical Solution 6, wherein the candidate pattern is determined based on the usage frequency of at least one of the upper adjacent block that is adjacent to the upper part of the current block and the left adjacent block that is adjacent to the left side of the current block.

[0598] Technical Solution 8. The method as described in Technical Solution 5, wherein decoding the information of the intra-prediction mode of the current block includes:

[0599] Decode the difference between the intra-prediction modes of the current block and the previous block; and

[0600] The intra prediction mode of the current block is determined based on the intra prediction mode of the previous block and the difference.

[0601] Technical Solution 9. A method for encoding video, the method comprising:

[0602] Determine the motion information and weight prediction parameters of the current block; and

[0603] The encoding represents information about whether the motion information and weight prediction parameters of the current block should be merged with neighboring blocks adjacent to the current block.

[0604] The prediction block for the current block is generated by applying weighted prediction parameters to a reference block selected based on motion information.

[0605] Technical Solution 10. The method as described in Technical Solution 9, wherein when the current block is merged with the adjacent block, the weight prediction parameter of the current block is set to be the same as the weight prediction parameter of the adjacent block.

[0606] Technical Solution 11. The method of Technical Solution 9, wherein when the current block is not merged with the adjacent block, the method further includes encoding information related to the weight prediction parameters of the current block.

[0607] Technical Solution 12. The method of Technical Solution 9, wherein the motion information includes a motion vector, and the method further includes: encoding information representing whether the precision of the motion vector is adjusted upward based on reconstructed pixels adjacent to the current block.

[0608] Technical Solution 13. A method for encoding video, the method comprising:

[0609] Determine the intra-prediction mode for the current block;

[0610] Correcting prediction samples generated based on intra-frame prediction modes; and

[0611] The encoding represents information about whether the prediction sample is corrected based on the predicted sample and the corrected prediction sample.

[0612] Technical solution 14. The method described in technical solution 13 further includes:

[0613] Generate candidate patterns for the current block;

[0614] Determine if there exists a candidate mode that is the same as the intra-prediction mode of the current block; and

[0615] Based on this determination, the encoding represents information about whether there is a candidate mode that is the same as the intra-prediction mode of the current block.

[0616] Technical Solution 15. The method of Technical Solution 14, wherein the candidate pattern is determined based on the usage frequency of at least one of the upper adjacent block that is adjacent to the upper part of the current block and the left adjacent block that is adjacent to the left side of the current block.

[0617] Technical solution 16. The method described in technical solution 13 further includes: encoding the difference between the intra-prediction modes of the current block and the previous block.

[0618] Although the exemplary method of the present invention is described as a series of operations, this is not limiting for clarity. These steps may be performed simultaneously or in different orders as needed. To implement the method according to the invention, the exemplary method may also include additional steps, including remaining steps in addition to some steps, or may include additional steps in addition to some steps.

[0619] The various embodiments of the present invention are intended to illustrate representative aspects of the invention, rather than to list all possible combinations, and those described in the various embodiments can be applied independently or in combination of two or more.

[0620] Furthermore, the methods described herein can be implemented through various means depending on the application. For example, these methods can be implemented in hardware, firmware, software, or any combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, electronic devices, other electronic units designed to perform the functions described herein, or combinations thereof.

[0621] The scope of this invention includes software or machine-executable instructions (e.g., operating systems, applications, firmware, programs, etc.) that enable operation according to methods of various embodiments, as well as devices or non-transitory computer-readable media executable on a computer storing such software or instructions.

[0622] [Industrial Applicability]

[0623] This disclosure can be used when encoding / decoding video.

Claims

1. A method for decoding video, the method comprising: The prediction mode for the current block is determined as the inter-frame prediction mode; Decode information indicating whether the motion information and weight prediction information of the current block are merged with the neighboring blocks adjacent to the current block; Based on the prediction mode for the current block being an inter-frame prediction mode, it is determined whether the motion information and weight prediction information of the current block are merged with the adjacent blocks adjacent to the current block; Based on the determined results, obtain the motion information and weight prediction parameters of the current block; The reference block for the current block is selected based on motion information; and The prediction block for the current block is generated by applying the weighted prediction parameters to the reference block. The residual block of the current block is obtained by performing an inverse transform on the inverse quantized transform coefficients of the current block; and The current block is reconstructed based on the residual block and the prediction block; Specifically, when it is determined that the motion information of the current block is merged with that of the adjacent block, the weight prediction parameter of the current block is set to be the same as that of the weight prediction parameter of the adjacent block.

2. The method as described in claim 1, wherein, If it is determined that the motion information of the current block will not be merged with the adjacent block, the weight prediction parameters of the current block are obtained from the bit stream.

3. The method as described in claim 1, wherein, If it is determined that the motion information of the current block will not be merged with the adjacent block, weight prediction control information is obtained from the bitstream. This weight prediction control information indicates whether to use weight prediction parameters for the current block. The weight prediction parameters for the current block are obtained from the bitstream only when the weight prediction control information indicates that weight prediction parameters are to be used for the current block.

4. The method of claim 1, wherein, Upon determining that the motion information of the current block is merged with that of the adjacent block, identification information is obtained, which identifies the adjacent block. The weight prediction parameter of the current block is set to be equal to the weight prediction parameter of the neighboring block identified by the identification information.

5. The method of claim 1, wherein, The weight prediction parameter for the current block is an index indicating the weight for the current block in the weight prediction parameter set.

6. A method for encoding video, the method comprising: The prediction mode for the current block is determined as the inter-frame prediction mode; Based on the fact that the prediction mode for the current block is the inter-frame prediction mode, the motion information and weight prediction parameters of the current block are estimated; The information is encoded to indicate whether the motion information and weight prediction parameters of the current block should be merged with the adjacent blocks adjacent to the current block; The prediction block for the current block is generated by applying the weight prediction parameters to a reference block selected based on the motion information. The residual block of the current block is obtained by performing an inverse transform on the inverse quantized transform coefficients of the current block; and The current block is reconstructed based on the residual block and the prediction block; Specifically, when it is determined that the motion information of the current block is merged with that of the adjacent block, the weight prediction parameter of the current block is set to be the same as that of the weight prediction parameter of the adjacent block.

7. A method for transmitting a bitstream generated by an image encoding method, the image encoding method comprising: The prediction mode for the current block is determined as the inter-frame prediction mode; Based on the fact that the prediction mode for the current block is the inter-frame prediction mode, the motion information and weight prediction parameters of the current block are estimated; The information is encoded to indicate whether the motion information and weight prediction parameters of the current block should be merged with the adjacent blocks adjacent to the current block; The prediction block for the current block is generated by applying the weight prediction parameters to a reference block selected based on the motion information. The residual block of the current block is obtained by performing an inverse transform on the inverse quantized transform coefficients of the current block; and The current block is reconstructed based on the residual block and the prediction block; Specifically, when it is determined that the motion information of the current block is merged with that of the adjacent block, the weight prediction parameter of the current block is set to be the same as that of the weight prediction parameter of the adjacent block.

Citation Information

Patent Citations

  • Method for decoding and encoding video and method for transmitting bitstream

    CN114584763A

  • Method for decoding and encoding video and method for transmitting bitstream

    CN114584764A