Video signal processing method and apparatus

By utilizing multiple reference lines and various intra-frame prediction mode sets in video signal processing, the coding efficiency and signaling efficiency of video signals are improved, and the problem of insufficient utilization of intra-frame prediction reference samples in existing technologies is solved.

CN116389733BActive Publication Date: 2026-07-03HUMAX CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUMAX CO LTD
Filing Date
2018-12-24
Publication Date
2026-07-03

Smart Images

  • Figure CN116389733B_ABST
    Figure CN116389733B_ABST
Patent Text Reader

Abstract

This invention relates to a video signal processing method and apparatus. More specifically, a video signal processing method and a video signal processing apparatus for performing the method are disclosed. The method includes: obtaining reference line information indicating a reference line for intra-frame prediction of a current block among a plurality of reference lines including neighboring samples of a current block; determining an intra-frame prediction mode for the current block among a plurality of intra-frame prediction modes constituting an intra-frame prediction mode set based on the reference line information; and decoding the current block based on a plurality of reference samples on the reference lines according to the reference line information and the determined intra-frame prediction mode, wherein the plurality of reference lines include: a first reference line including neighboring samples on a line adjacent to the boundary of the current block; and a second reference line including neighboring samples on a line separated from the boundary of the current block by a distance corresponding to a predetermined number of samples.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of patent application No. 201880083011.7 (PCT / KR2018 / 016604), filed with the China Patent Office on June 22, 2020, with an international application date of December 24, 2018, entitled "Video Signal Processing Method and Apparatus". Technical Field

[0002] The present invention relates to video signal processing methods and apparatus, and more specifically, to video signal processing methods and apparatus for encoding or decoding video signals. Background Technology

[0003] Compression encoding refers to a series of signal processing techniques used to transmit digitized information over communication lines or to store information in a form suitable for storage media. The objects of compression encoding include objects such as speech, video, and text, and in particular, techniques used to perform compression encoding on images are called video compression. Compression encoding of video signals is performed by removing excess information, taking into account spatial, temporal, and random correlations. However, with the recent development of various media and data transmission media, there is a need for more efficient video signal processing methods and devices. Summary of the Invention

[0004] Technical issues

[0005] The purpose of this invention is to improve the compilation efficiency of video signals. Additionally, the purpose of this invention is to improve signaling efficiency related to the prediction of the current block by using reference samples of the current block.

[0006] Technical solution

[0007] To address the aforementioned problems, the present invention provides the following video signal processing apparatus and video signal processing method.

[0008] First, according to an embodiment of the present invention, a method for processing a video signal includes: obtaining reference line information indicating a reference line for intra-frame prediction of the current block among a plurality of reference lines configured with neighboring samples of the current block; determining an intra-frame prediction mode for the current block among a plurality of intra-frame prediction modes configured with an intra-frame prediction mode set based on the reference line information; and decoding the current block based on a plurality of reference samples on the reference lines according to the reference line information and the determined intra-frame prediction mode, wherein the plurality of reference lines include: a first reference line configured with neighboring samples on a line adjacent to the boundary of the current block; and a second reference line configured with neighboring samples on a line separated by a specific number of samples based on the boundary of the current block.

[0009] Furthermore, according to an embodiment of the present invention, a video signal processing apparatus includes a processor, wherein the processor is configured to obtain reference line information indicating a reference line for intra-frame prediction of the current block among a plurality of reference lines configured with neighboring samples of the current block; determine an intra-frame prediction mode for the current block among a plurality of intra-frame prediction modes configured with an intra-frame prediction mode set based on the reference line information; and decode the current block based on a plurality of reference samples on the reference lines according to the reference line information and the determined intra-frame prediction mode, wherein the plurality of reference lines includes a first reference line configured with neighboring samples on a line adjacent to the boundary of the current block; and a second reference line configured with neighboring samples on a line separated by a specific number of samples based on the boundary of the current block.

[0010] When the reference line used for intra-prediction of the current block is a first reference line, the intra-prediction mode set can be a first intra-prediction mode set. When the reference line used for intra-prediction of the current block is not a first reference line, the intra-prediction mode set can be a second intra-prediction mode set, which is configured with a portion of the multiple intra-prediction modes configured in the first intra-prediction mode set.

[0011] The second intra-frame prediction mode set can be configured with multiple angle modes.

[0012] The second intra-prediction mode set can be configured with a preset number of angle modes, which are determined based on the intra-prediction mode corresponding to any one of the neighboring blocks of the current block.

[0013] The processor can receive intra-prediction mode information indicating any one of the preset number of angle modes included in the second intra-prediction mode set, and determine the intra-prediction mode of the current block based on the intra-prediction mode information.

[0014] The intra-frame prediction mode set can be determined based on the relative position of the current block in the higher-level regions of the current block.

[0015] The processor can configure the set of intra-prediction modes for the current block based on the relative position of the current block in a higher-level region.

[0016] When the current block is adjacent to the upper boundary of a higher-level region, the reference line information can be considered to indicate the first reference line, wherein the intra-prediction mode set used for the current block can be the first intra-prediction mode set.

[0017] The first intra-frame prediction mode set may include multiple angle modes, plane modes, and DC modes.

[0018] The boundary of the current block can be either the left boundary or the top boundary of the current block.

[0019] The specific number of samples can be less than or equal to the preset number of samples.

[0020] Beneficial effects

[0021] According to embodiments of the present invention, the compilation efficiency of video signals can be improved. Furthermore, according to embodiments of the present invention, the signaling efficiency related to intra-frame prediction of the current block can be improved. Attached Figure Description

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

[0023] Figure 2 This is a schematic block diagram of a video signal decoding apparatus according to an embodiment of the present invention.

[0024] Figure 3 An example is shown in which the compiler tree unit is divided into compiler units in the image.

[0025] Figure 4 An embodiment of a method for sending partitions of quadtrees and multi-type trees using signals is shown.

[0026] Figure 5 An example of a reference sample used for prediction of the current block in intra-frame prediction mode is shown.

[0027] Figure 6 An example of a prediction mode for intra-frame prediction is shown.

[0028] Figure 7 An embodiment of a method for sending an intra-frame prediction mode selected by the encoder to the decoder is shown.

[0029] Figure 8 A detailed embodiment of a method for transmitting intra-frame prediction modes using signals is shown.

[0030] Figure 9 This is a diagram illustrating the reference sample filling method when some reference samples used for intra-frame prediction of the current block are unavailable.

[0031] Figure 10 This is a diagram illustrating the reference sample filling method when all reference samples used for intra-frame prediction of the current block are unavailable.

[0032] Figure 11 This is a diagram illustrating the reference sample filling method when the prediction mode of neighboring blocks is a planar mode.

[0033] Figure 12 This is a diagram illustrating the reference sample filling method when the prediction mode of the neighboring blocks is the angular mode.

[0034] Figure 13 This is a diagram illustrating the reference sample filling method when the prediction mode of the neighboring blocks is the angular mode.

[0035] Figure 14 This is a diagram illustrating a reference sample filling method based on the position of a reference sample.

[0036] Figure 15 This is a diagram illustrating a method for performing reference sample filling based on neighboring samples.

[0037] Figure 16 This is a diagram illustrating the reference sample filling method when neighboring blocks are predicted inter-frame.

[0038] Figure 17 This is a diagram illustrating the reference sample filling method when neighboring blocks are predicted inter-frame.

[0039] Figure 18 This is a diagram illustrating the reference sample filling method when neighboring blocks are predicted inter-frame.

[0040] Figure 19 This is a diagram illustrating an embodiment where multiple reference lines are configured for neighboring samples of the current block.

[0041] Figure 20 This is a diagram illustrating a method of sending the intra-prediction mode of the current block using signals.

[0042] Figure 21 This is a diagram illustrating a method for transmitting intra-frame prediction mode information using signals based on the positions of padded reference samples.

[0043] Figure 22 This is a diagram illustrating the method for determining the intra-prediction mode based on the relative position of the current block.

[0044] Figure 23 This is a diagram illustrating an embodiment of a method for determining the intra-prediction mode of the current block based on reference samples.

[0045] Figure 24 This is a diagram illustrating an embodiment of a method for determining the intra-prediction mode of the current block based on reference samples.

[0046] Figure 25 This is a diagram illustrating an embodiment of a method for determining the intra-prediction mode of the current block based on reference samples.

[0047] Figure 26 This is a diagram illustrating an embodiment of a method in which vertical and horizontal blocks are divided.

[0048] Figure 27 This is a diagram illustrating an embodiment of a method for sending signals to divide a quadtree, binary tree, and ternary tree.

[0049] Figure 28 This is a diagram illustrating an embodiment of a method for sending signals to divide a ternary tree.

[0050] Figure 29 This is a diagram specifically illustrating the structure of a vertical block being divided according to an embodiment of the present invention.

[0051] Figure 30 This is a diagram specifically illustrating the structure of a horizontal block being divided according to an embodiment of the present invention.

[0052] Figure 31 This is a diagram illustrating an embodiment of a method for determining the block scan order. Detailed Implementation

[0053] Considering the functions of this invention, the terminology used in this specification may be currently widely used general terms, but may be changed according to the intent, customs, or emergence of new technologies of those skilled in the art. Furthermore, in some cases, terms may be arbitrarily chosen by the applicant, and in such cases, their meanings are described in the corresponding descriptive sections of the invention. Therefore, the terminology used in this specification should be interpreted based on the substantive meaning of the terms and content throughout the specification.

[0054] In this specification, some terms may be interpreted as follows. In some cases, compilation can be interpreted as encoding or decoding. In this specification, an apparatus that generates a video signal bitstream by performing encoding (compilation) of a video signal is called an encoding apparatus or encoder, and an apparatus that performs decoding (decoding) of a video signal bitstream to reconstruct a video signal is called a decoding apparatus or decoder. Additionally, in this specification, video signal processing apparatus is used as a term encompassing both the concepts of encoder and decoder. Information is a term that includes all values, parameters, coefficients, elements, etc. In some cases, the meaning is interpreted differently, therefore the invention is not limited thereto. "Unit" is used to refer to the basic unit of image processing or a specific location in an image, and refers to an image region including both luminance and chrominance components. Additionally, "block" refers to an image region including a specific component among the luminance and chrominance components (i.e., Cb and Cr). However, depending on the embodiment, terms such as "unit," "block," "partition," and "region" may be used interchangeably. Furthermore, in this specification, "unit" can be used as a concept encompassing all compilation units, prediction units, and transformation units. The image refers to a field or frame, and according to embodiments, these terms may be used interchangeably.

[0055] Figure 1 This is a schematic block diagram of a video signal encoding apparatus according to an embodiment of the present invention. (Reference) Figure 1The encoding device 100 of the present invention includes a transformation unit 110, a quantization unit 115, an inverse quantization unit 120, an inverse transformation unit 125, a filtering unit 130, a prediction unit 150, and an entropy compilation unit 160.

[0056] Transform unit 110 obtains the values ​​of transform coefficients by transforming the residual signal, which is the difference between the input video signal and the prediction signal generated by prediction unit 150. For example, discrete cosine transform (DCT), discrete sine transform (DST), or wavelet transform can be used. DCT and DST perform the transform by dividing the input image signal into multiple blocks. During the transform, the compilation efficiency can vary depending on the distribution and characteristics of the values ​​in the transform region. Quantization unit 115 quantizes the values ​​of the transform coefficients output from transform unit 110.

[0057] To improve compilation efficiency, instead of compiling the image signal as is, a method is used that predicts the image using the region already compiled by prediction unit 150, and obtains the reconstructed image by adding the residual value between the original image and the predicted image to the predicted image. To prevent mismatches in the encoder and decoder, information that can be used in the decoder should be used when performing prediction in the encoder. For this purpose, the encoder performs the processing of the current block of reconstruction encoding again. Inverse quantization unit 120 inverse quantizes the values ​​of the transform coefficients, and inverse transform unit 125 uses the inverse quantized transform coefficient values ​​to reconstruct the residual values. Simultaneously, filtering unit 130 performs filtering operations to improve the quality of the reconstructed image and improve compilation efficiency. For example, it may include a deblocking filter, sample adaptive offset (SAO), and adaptive loop filter. The filtered image is output or stored in decoded image buffer (DPB) 156 for use as a reference image.

[0058] Prediction unit 150 includes intra-frame prediction unit 152 and inter-frame prediction unit 154. Intra-frame prediction unit 152 performs intra-frame prediction in the current image, and inter-frame prediction unit 154 performs inter-frame prediction to predict the current image using a reference image stored in DPB 156. Intra-frame prediction unit 152 performs intra-frame prediction based on reconstructed samples in the current image and sends intra-frame encoding information to entropy encoding unit 160. Intra-frame encoding information may include at least one of intra-frame prediction mode, most probable mode (MPM) flag, and MPM index. Inter-frame prediction unit 154 may include motion estimation unit 154a and motion compensation unit 154b. Motion estimation unit 154a references a specific region of the reconstructed reference image to obtain motion vector values ​​for the current region. Motion estimation unit 154a sends motion information about the reference region (reference image index, motion vector information, etc.) to entropy encoding unit 160. Motion compensation unit 154b uses the motion vector values ​​sent from motion estimation unit 154a to perform motion compensation. Inter-frame prediction unit 154 sends inter-frame coding information, including motion information about the reference region, to entropy compilation unit 160.

[0059] When performing the image prediction described above, the transformation unit 110 transforms the residual values ​​between the original image and the predicted image to obtain transformation coefficient values. In this case, the transformation can be performed on a unit of specific blocks within the image, and the size of the specific blocks can be changed within a preset range. The quantization unit 115 quantizes the transformation coefficient values ​​generated in the transformation unit 110 and sends them to the entropy compilation unit 160.

[0060] Entropy compilation unit 160 performs entropy compilation on the quantized transform coefficients, intra-frame compilation information, and inter-frame compilation information to generate a video signal bitstream. In entropy compilation unit 160, variable-length compilation (VLC) methods, arithmetic compilation methods, etc., can be used. The VLC method transforms the input symbols into continuous codewords, and the length of the codewords can be variable. For example, frequently occurring symbols are represented as short codewords, while less frequently occurring symbols are represented as long codewords. As a VLC method, context-based adaptive variable-length compilation (CAVLC) can be used. Arithmetic compilation transforms continuous data symbols into single decimals, and arithmetic compilation can obtain the optimal number of decimal bits required to represent each symbol. As an arithmetic compilation method, context-based adaptive arithmetic compilation (CABAC) can be used.

[0061] The generated bitstream is encapsulated using Network Abstraction Layer (NAL) units as the basic unit. Each NAL unit comprises an integer number of compiled tree units. To decode the bitstream in the video decoder, the bitstream must first be separated into NAL units, and then each separated NAL unit must be decoded. Simultaneously, the information required for decoding the video signal bitstream can be sent via Raw Byte Sequence Payloads (RBSPs) of higher-level sets such as Picture Parameter Sets (PPS), Sequence Parameter Sets (SPS), Video Parameter Sets (VPS), etc.

[0062] at the same time, Figure 1 The block diagram illustrates an encoding device 100 according to an embodiment of the present invention, and the separately displayed blocks logically distinguish and illustrate the elements of the encoding device 100. Therefore, depending on the device design, the elements of the encoding device 100 can be mounted as one or more chips. According to an embodiment, the operation of each element of the encoding device 100 can be performed by a processor (not shown).

[0063] Figure 2 This is a schematic block diagram of a video signal decoding apparatus 200 according to an embodiment of the present invention. (See reference) Figure 2 The decoding device 200 of the present invention includes an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 225, a filtering unit 230, and a prediction unit 250.

[0064] Entropy decoding unit 210 performs entropy decoding on the video signal bitstream and extracts the transform coefficients, intra-frame coding information, and inter-frame coding information for each region. Inverse quantization unit 220 performs inverse quantization on the entropy-decoded transform coefficients, and inverse transform unit 225 uses the inverse-quantized transform coefficients to reconstruct the residual values. Video signal processing apparatus 200 reconstructs the original pixel values ​​by adding the residual values ​​obtained in inverse transform unit 225 to the predicted values ​​obtained in prediction unit 250.

[0065] Simultaneously, the filtering unit 230 performs filtering on the image to improve image quality. This may include a deblocking filter to reduce block distortion and / or an adaptive loop filter to remove distortion from the entire image. The filtered image is output or stored in the DPB 256 as a reference image for the next image.

[0066] Prediction unit 250 includes intra-frame prediction unit 252 and inter-frame prediction unit 254. Prediction unit 250 generates prediction images by using the coding type decoded by the entropy decoding unit 210 described above, the transform coefficients of each region, and intra-frame / inter-frame coding information. To reconstruct the current block in which decoding is performed, the current image or the decoded region of another image including the current block can be used. In reconstruction, only the current image, i.e., the image (or tile / slice) in which only intra-frame prediction is performed, is referred to as an intra-frame image or I-image (or tile / slice), and the image (or tile / slice) in which both intra-frame and inter-frame prediction can be performed is referred to as an inter-frame image (or tile / slice). To predict the sample values ​​of each block in the inter-frame image (or tile / slice), the image (or tile / slice) using at most one motion vector and reference image index is referred to as a prediction image or P-image (or tile / slice), and the image (or tile / slice) using at most two motion vectors and reference image index is referred to as a bidirectional prediction image or B-image (or tile / slice). In other words, a P-image (or tile / slice) uses at most one set of motion information to predict each block, and a B-image (or tile / slice) uses at most two sets of motion information to predict each block. Here, the set of motion information includes one or more motion vectors and a reference image index.

[0067] Intra-prediction unit 252 generates prediction blocks using intra-coding information and recovered samples from the current image. As described above, the intra-coding information may include at least one of intra-prediction mode, most probable mode (MPM) flag, and MPM index. Intra-prediction unit 252 predicts sample values ​​for the current block by using recovered samples located to the left and / or above the current block as reference samples. In this disclosure, the recovered samples, reference samples, and samples of the current block can represent pixels. Moreover, sample values ​​can represent pixel values.

[0068] According to an embodiment, the reference sample may be a sample included in the neighboring blocks of the current block. For example, the reference sample may be a sample adjacent to the left boundary of the current block and / or a sample adjacent to the top boundary. Moreover, the reference sample may be a sample among the samples of the neighboring blocks of the current block located on a line within a predetermined distance from the left boundary of the current block and / or a sample located on a line within a predetermined distance from the top boundary of the current block. In this case, the neighboring blocks of the current block may include the left (L) block, the top (A) block, the bottom left (BL) block, the top right (AR) block, or the top left (AL) block.

[0069] Inter-frame prediction unit 254 generates prediction blocks using reference images and inter-frame coding information stored in DPB 256. The inter-frame coding information may include motion information (reference image index, motion vector information, etc.) for the current block used as the reference block. Inter-frame prediction may include L0 prediction, L1 prediction, and bidirectional prediction. L0 prediction means making a prediction using a reference image included in the L0 image list, and L1 prediction means making a prediction using a reference image included in the L1 image list. For this purpose, a set of motion information (e.g., motion vectors and reference image index) may be required. In the bidirectional prediction method, up to two reference regions can be used, and the two reference regions may exist in the same reference image or in different images. That is, in the bidirectional prediction method, up to two sets of motion information (e.g., motion vectors and reference image index) can be used, and the two motion vectors may correspond to the same reference image index or different reference image indices. In this case, the reference image may be displayed (or output) before and after the current image in terms of time.

[0070] The inter-frame prediction unit 254 can obtain a reference block for the current block using motion vectors and a reference image index. The reference block is located in the reference image corresponding to the reference image index. Furthermore, the pixel value of the block specified by the motion vector, or its interpolated value, can be used as a predictor for the current block. For motion prediction with sub-pellet unit pixel precision, for example, an 8-tap interpolation filter for the luma signal and a 4-tap interpolation filter for the chroma signal can be used. However, the interpolation filter used for motion prediction at the sub-pellet level is not limited to this. In this way, the inter-frame prediction unit 254 performs motion compensation to predict the texture of the current unit based on a motion image reconstructed previously using motion information.

[0071] The reconstructed video image is generated by adding the predicted value output from the intra-frame prediction unit 252 or the inter-frame prediction unit 254 to the residual value output from the inverse transform unit 225. That is, the video signal decoding device 200 uses the predicted block generated by the prediction unit 250 and the residual obtained from the inverse transform unit 225 to reconstruct the current block.

[0072] at the same time, Figure 2 The block diagram illustrates a decoding device 200 according to an embodiment of the present invention, and the separately displayed blocks logically distinguish and illustrate the elements of the decoding device 200. Therefore, depending on the device design, the elements of the decoding device 200 can be mounted as one or more chips. According to an embodiment, the operation of each element of the decoding device 200 can be performed by a processor (not shown).

[0073] Figure 3The illustration shows an embodiment where a Compiler Tree Unit (CTU) in an image is segmented into Compiler Units (CUs). During the compilation of a video signal, an image can be segmented into a series of Compiler Tree Units (CTUs). A Compiler Tree Unit consists of N×N blocks of luminance samples and two blocks of corresponding chrominance samples. A Compiler Tree Unit can be segmented into multiple Compiler Units. A Compiler Tree Unit may not be segmented and may be a leaf node. In this case, the Compiler Tree Unit itself can be a Compiler Unit. A Compiler Unit refers to the basic unit used to process images during the aforementioned video signal processing, i.e., intra / inter-frame prediction, transform, quantization, and / or entropy compilation. The size and shape of a Compiler Unit in an image may not be constant. A Compiler Unit can have a square or rectangular shape. A rectangular Compiler Unit (or rectangular block) includes vertical Compiler Units (or vertical blocks) and horizontal Compiler Units (or horizontal blocks). In this specification, a vertical block is a block whose height is greater than its width, and a horizontal block is a block whose width is greater than its height. Furthermore, in this specification, a non-square block may refer to a rectangular block, but the invention is not limited thereto.

[0074] refer to Figure 3 First, the compiler tree unit is divided into a quadtree (QT) structure. That is, in a quadtree structure, a node of size 2×2N can be divided into four nodes of size N×N. In this specification, a quadtree can also be referred to as a quaternion tree. Quadtree partitioning can be performed recursively, and not all nodes need to be partitioned at the same depth.

[0075] Simultaneously, the leaf nodes of the aforementioned quadtree can be further divided into a multi-type tree (MTT) structure. According to embodiments of the present invention, in the MTT structure, a node can be divided into a horizontally or vertically partitioned binary or ternary tree structure. That is, in the MTT structure, there are four partitioning structures, such as vertical binary partitioning, horizontal binary partitioning, vertical ternary partitioning, and horizontal ternary partitioning. According to embodiments of the present invention, in each tree structure, the width and height of the node can both be powers of 2. For example, in a binary tree (BT) structure, a node of size 2×2N can be partitioned into two NX2N nodes through vertical binary partitioning, and further partitioned into two 2NXN nodes through horizontal binary partitioning. Additionally, in a ternary tree (TT) structure, a node of size 2×2N is partitioned into (N / 2)×2N, NX2N, and (N / 2)×2N nodes through vertical ternary partitioning, and further partitioned into 2NX(N / 2), 2NXN, and 2NX(N / 2) nodes through horizontal ternary partitioning. This multi-type tree split can be performed recursively.

[0076] Leaf nodes of multi-type trees can be compilation units. If the compilation unit is not too large for the maximum transformation length, it can be used as the unit for prediction and transformation without further partitioning. On the other hand, at least one of the following parameters in the quadtree and multi-type trees mentioned above can be predefined or sent through RBSPs of higher-level sets such as PPS, SPS, VPS, etc.: 1) CTU size: the size of the root node of the quadtree, 2) Minimum QT size MinQtSize: the minimum allowed QT leaf node size, 3) Maximum BT size MaxBtSize: the maximum allowed BT root node size, 4) Maximum TT size MaxTtSize: the maximum allowed TT root node size, 5) Maximum MTT depth MaxMttDepth: the maximum allowed depth of MTT derived from the leaf nodes of the QT, 6) Minimum BT size MinBtSize: the minimum allowed BT leaf node size, 7) Minimum TT size MinTtSize: the minimum allowed TT leaf node size, 8) Maximum QT depth (MaxQtDepth): the maximum allowed number of QT partitions.

[0077] Figure 4 An embodiment of a method for signaling the segmentation of quadtrees and multi-type trees is shown. Preset markers can be used to signal the segmentation of the aforementioned quadtrees and multi-type trees. Reference Figure 4 At least one of the following flags can be used: "qt_split_flag" indicating whether to split a quadtree node, "mtt_split_flag" indicating whether to split a multi-type tree node, "mtt_split_vertical_flag" indicating the split direction of a multi-type tree node, or "mtt_split_binary_flag" indicating the split type of a multi-type tree node.

[0078] According to an embodiment of the present invention, the compiler tree unit is the root node of the quadtree and can be first partitioned into a quadtree structure. In the quadtree structure, a "qt_split_flag" signal is sent for each node "QT_node". If the value of "qt_split_flag" is 1, the node is partitioned into 4 square nodes, and if the value of "qt_split_flag" is 0, the corresponding node becomes a leaf node "QT_leaf_node" of the quadtree.

[0079] Each quadtree leaf node "QT_leaf_node" can be further segmented into a multi-type tree structure. In the multi-type tree structure, "mtt_split_flag" is signaled for each node "MTT_node". When the value of "mtt_split_flag" is 1, the corresponding node is split into multiple rectangular nodes, and when the value of "mtt_split_flag" is 0, the corresponding node is a leaf node "MTT_leaf_node" in the multi-type tree. When the multi-type tree node "MTT_node" is split into multiple rectangular nodes (i.e., when the value of "mtt_split_flag" is 1), the "mtt_split_vertical_flag" and "mtt_split_binary_flag" of the node "MTT_node" can be additionally signaled. When the value of "mtt_split_vertical_flag" is 1, it indicates the vertical split of the node "MTT_node", and when the value of "mtt_split_vertical_flag" is 0, it indicates the horizontal split of the node "MTT_node". Additionally, when the value of "mtt_split_binary_flag" is 1, the node "MTT_node" is split into 2 rectangular nodes, and when the value of "mtt_split_binary_flag" is 0, the node "MTT_node" is split into 3 rectangular nodes.

[0080] Figure 5 and Figure 6 A more specific illustration is provided of an intra-frame prediction method according to an embodiment of the present invention. As described above, the intra-frame prediction unit predicts the sample values ​​of the current block by using recovered samples located to the left and / or above the current block as reference samples.

[0081] first, Figure 5 An embodiment of reference samples for prediction of the current block in intra-frame prediction mode is shown. According to the embodiment, the reference samples may be samples adjacent to the left boundary and / or the top boundary of the current block. Figure 5As shown, when the current block size is W×H and samples from a single reference line adjacent to the current block are used for intra-prediction, reference samples can be configured using a maximum of 2W+2H+1 neighboring samples located to the left and top of the current block. According to another embodiment of the invention, samples from multiple reference lines can be used for intra-prediction of the current block. The multiple reference lines can consist of n lines located within a predetermined distance from the boundary of the current block. In this case, separate reference line information indicating at least one reference line used for intra-prediction of the current block can be signaled. Specifically, the reference line information may include an index indicating any one of the multiple reference lines. Furthermore, if at least some of the samples to be used as reference samples have not yet been recovered, the intra-prediction unit can obtain reference samples by performing a reference sample padding process. Figures 9 to 18 The method for padding reference samples is described in detail. Additionally, the intra-prediction unit can perform reference sample filtering to reduce errors in intra-prediction. That is, reference samples can be obtained by filtering neighboring samples and / or samples obtained from the reference sample padding process. The intra-prediction unit uses the reference pixels obtained in this way to predict the pixels of the current block. In this disclosure, neighboring samples can include samples on at least one reference line. For example, neighboring samples can include adjacent samples on lines adjacent to the boundary of the current block. Next, Figure 6 An embodiment of a prediction mode for intra-frame prediction is illustrated. For intra-frame prediction, intra-frame prediction mode information indicating the direction of intra-frame prediction can be transmitted via signaling. The intra-frame prediction mode information indicates one of a plurality of intra-frame prediction modes included in a set of intra-frame prediction modes. When the current block is an intra-frame prediction block, the decoder receives the intra-frame prediction mode information of the current block from the bitstream. The decoder's intra-frame prediction unit performs intra-frame prediction on the current block based on the extracted intra-frame prediction mode information.

[0082] According to embodiments of the present invention, the intra-prediction mode set may include all intra-prediction modes used in intra-prediction (e.g., a total of 67 intra-prediction modes). More specifically, the intra-prediction mode set may include planar modes, DC modes, and multiple (e.g., 65) angle modes (i.e., orientation modes). In some embodiments, the intra-prediction mode set may consist of some of all intra-prediction modes. Each intra-prediction mode can be indicated by a preset index (i.e., an intra-prediction mode index). For example, as... Figure 6As shown, intra-prediction mode index 0 indicates a planar mode, and intra-prediction mode index 1 indicates a DC mode. Furthermore, intra-prediction mode indices 2 through 66 can each indicate different angle modes. Each angle mode indicates an angle that differs from the others within a preset angle range. For example, an angle mode can indicate an angle within a clockwise angle range of 45 degrees and -135 degrees (i.e., a first angle range). An angle mode can be defined based on the 12 o'clock direction. In this case, intra-prediction mode index 2 indicates a horizontal diagonal (HDIA) mode, intra-prediction mode index 18 indicates a horizontal (HOR) mode, intra-prediction mode index 34 indicates a diagonal (DIA) mode, intra-prediction mode index 50 indicates a vertical (VER) mode, and intra-prediction mode index 66 indicates a vertical diagonal (VDIA) mode.

[0083] Simultaneously, preset angle ranges can be set differently depending on the shape of the current block. For example, when the current block is a rectangular block, a wide-angle mode indicating an angle greater than 45 degrees or less than -135 degrees in the clockwise direction can be used. When the current block is a horizontal block, the angle mode can indicate an angle within the range of (45 + offset 1) degrees and (-135 + offset 1) degrees in the clockwise direction (i.e., the second angle range). In this case, angle modes 67 to 76, outside the first angle range, can be used. Furthermore, when the current block is a vertical block, the angle mode can indicate an angle within the range of (45 - offset 2) degrees and (-135 - offset 2) degrees in the clockwise direction (i.e., the third angle range). In this case, angle modes -10 to -1, outside the first angle range, can be used. According to embodiments of the present invention, the values ​​of offset1 and offset2 can be determined differently based on the ratio between the width and height of the rectangular block. Similarly, offset1 and offset2 can be positive numbers.

[0084] According to another embodiment of the present invention, the intra-frame prediction mode set may include a basic angle mode and an extended angle mode. In this case, the extended angle mode can be determined based on the basic angle mode.

[0085] According to an embodiment, the basic angle pattern is a pattern corresponding to an angle used in intra-frame prediction in the existing High Efficiency Video Coding (HEVC) standard, and the extended angle pattern can be a pattern corresponding to an angle newly added in intra-frame prediction in the next-generation video codec standard. More specifically, the basic angle pattern is an angle pattern corresponding to any one of the intra-frame prediction patterns {2,4,6,…,66}, while the extended angle pattern is an angle pattern corresponding to any one of the intra-frame prediction patterns {3,5,7,…,65}. That is, the extended angle pattern can be an angle pattern among the basic angle patterns within a first angle range. Therefore, the angle indicated by the extended angle pattern can be determined based on the angle indicated by the basic angle pattern.

[0086] According to another embodiment, the basic angle mode can be a mode corresponding to an angle within a preset first angle range, while the extended angle mode can be a wide-angle mode outside the first angle range. That is, the basic angle mode is an angle mode corresponding to any one of the intra-prediction modes {2, 3, 4, ..., 66}, and the extended angle mode is an angle mode corresponding to any one of the intra-prediction modes {-10, -9, ..., -1} and {67, 68, ..., 76}. The angle indicated by the extended angle mode can be determined as the opposite angle to the angle indicated by the corresponding basic angle mode. Therefore, the angle indicated by the extended angle mode can be determined based on the angle indicated by the basic angle mode. Meanwhile, the number of extended angle modes is not limited to this, and additional extended angles can be defined according to the size and / or shape of the current block. For example, the extended angle mode can be defined as an angle mode corresponding to any one of the intra-prediction modes {-14, -13, ..., -1} and {67, 68, ..., 80}. Meanwhile, the total number of intra-prediction modes included in the intra-prediction mode set can vary depending on the configuration of the basic angle mode and the extended angle mode mentioned above.

[0087] In the above embodiments, the interval between extended angle modes can be set based on the interval between corresponding basic angle modes. For example, the interval between extended angle modes {3, 5, 7, ..., 65} can be determined based on the interval between corresponding basic angle modes {2, 4, 6, ..., 66}. Similarly, the interval between extended angle modes {-10, -9, ..., -1} can be determined based on the interval between corresponding opposite-side basic angle modes {56, 57, ..., 65}, and the interval between extended angle modes {67, 68, ..., 76} can be determined based on the interval between corresponding opposite-side basic angle modes {3, 4, ..., 12}. The angular interval between extended angle modes can be configured to be the same as the angular interval between corresponding basic angle modes. Furthermore, the number of extended angle modes in the intra-frame prediction mode set can be configured to be less than or equal to the number of basic angle modes.

[0088] According to embodiments of the present invention, extended angle modes can be signaled based on a basic angle mode. For example, a wide-angle mode (i.e., an extended angle mode) can replace at least one angle mode (i.e., a basic angle mode) within a first angle range. The basic angle mode to be replaced can be an angle mode corresponding to the opposite side of the wide-angle mode. That is, the basic angle mode to be replaced is an angle mode corresponding to an angle in the opposite direction of the angle indicated by the wide-angle mode or an angle differing from the angle in the opposite direction by a preset offset index. According to embodiments of the present invention, the preset offset index is 1. The intra-frame prediction mode index corresponding to the replaced basic angle mode can be mapped back to the wide-angle mode to signal the wide-angle mode. For example, the wide-angle mode {-10, -9, ..., -1} can be signaled using the intra-frame prediction mode index {57, 58, ..., 66}, and the wide-angle mode {67, 68, ..., 76} can be signaled using the intra-frame prediction mode index {2, 3, ..., 11}. Thus, because the intra-prediction mode index used for the basic angle mode is signaled to the extended angle mode, even if the configuration of the angle mode used for intra-prediction in each block is different, the same set of intra-prediction mode indices can be used for signaling of the intra-prediction mode. Therefore, the signaling overhead caused by changes in the intra-prediction mode configuration can be minimized.

[0089] Simultaneously, the use of the extended angle mode can be determined based on at least one of the shape and size of the current block. According to an embodiment, when the size of the current block is greater than a preset size, the extended angle mode can be used for intra-frame prediction of the current block; otherwise, only the basic angle mode can be used for intra-frame prediction of the current block. According to another embodiment, when the current block is a block other than a square, the extended angle mode can be used for intra-frame prediction of the current block, and when the current block is a square block, only the basic angle mode can be used for intra-frame prediction of the current block.

[0090] The intra-prediction unit determines the reference samples and / or interpolated reference samples to be used for intra-prediction of the current block based on the intra-prediction mode information of the current block. When the intra-prediction mode index indicates a specific angle mode, the reference sample or interpolated reference sample corresponding to a specific angle from the current sample of the current block is used for the prediction of the current sample. Therefore, different sets of reference samples and / or interpolated reference samples can be used for intra-prediction according to the intra-prediction mode. After performing intra-prediction of the current block using the reference samples and intra-prediction mode information, the decoder reconstructs the sample values ​​of the current block by adding the residual signal of the current block obtained from the inverse transform unit to the intra-prediction values ​​of the current block.

[0091] Simultaneously, the encoder can signal the selected intra-prediction mode information to the decoder. The decoder can extract the intra-prediction mode information for the current block from the bitstream. For example, when the total number of intra-prediction modes comprising the intra-prediction mode set is T (e.g., 67), the signaling method of simply representing T modes in binary is inefficient because each mode does not take into account the possibility of selection or the context of the corresponding and neighboring blocks. Therefore, the intra-prediction mode set, consisting of some modes associated with the current block from all modes, can be managed separately. If the range of intra-prediction modes signaled is reduced, efficient signaling can be performed. For example, efficient signaling can be performed by separately managing a list of some modes from all modes that are most likely to be used in the current block.

[0092] Figure 7 An embodiment of a method for signaling intra-prediction modes selected by the encoder to the decoder is illustrated. According to an embodiment of the invention, for intra-prediction of the current block, a list of at least one prediction mode, consisting of some of the entire intra-prediction modes, can be managed. A first prediction mode list for intra-prediction is the most probable mode (MPM) list. Intra-prediction modes included in the MPM list are MPM modes, and intra-prediction modes not included in the MPM list can be referred to as non-MPM modes. The encoder signals an MPM flag to distinguish whether the intra-prediction mode used in the current block is an MPM mode or a non-MPM mode. The decoder can determine whether the intra-prediction mode used in the current block is an MPM mode or a non-MPM mode by receiving the MPM flag.

[0093] According to an embodiment, by using a separate encoding method for MPM modes, effective signaling can be performed with fewer bits. The number of non-MPM modes is Tm, where m is the number of MPM modes included in the MPM list. If the number of MPM modes m is less than the number of non-MPM modes Tm, then the MPM modes can be compiled with truncated unary binarization, and the non-MPM modes can be compiled with truncated binary binarization.

[0094] The MPM mode can be configured by considering various contexts in each of the following steps. First, the MPM list can include intra-prediction modes and plane / DC modes (context M0) used in neighboring blocks of the current block. If there are blocks encoded with intra-prediction modes among the reconstructed neighboring blocks, the current block may use the same intra-prediction mode as the corresponding block due to regional similarity of the images. Therefore, the MPM list can be configured to include the intra-prediction modes of neighboring blocks. According to an embodiment, the neighboring blocks of the current block can include at least one of the left (L) block, top (A) block, bottom-left (BL) block, top-right (AR) block, or top-left (AL) block. For example, the neighboring blocks of the current block can include the left (L) block and the top (A) block adjacent to the current block. The left (L) block is the bottommost block adjacent to the left boundary of the current block, while the top (A) block is the rightmost block adjacent to the top boundary of the current block. (See reference...) Figure 8 A detailed embodiment for configuring the neighboring blocks of the MPM list is described again. Intra-prediction mode, planar mode, and DC mode selected from the neighboring blocks of the current block can be added to the MPM list according to a preset order. For example, the MPM list can be configured in the order of {block L mode, block A mode, planar mode, DC mode, block BL mode, block AR mode, block AL mode}.

[0095] Second, if the above method fails to fill the m MPM list, additional context conditions (e.g., context M1, context M2, etc.) can be applied to populate the MPM list. When applying additional context conditions, intra-prediction modes already included in the MPM list may not be re-added.

[0096] Meanwhile, the remaining T - m non - MPM modes among the total of T intra - prediction modes that are not included in the MPM list can be coded by truncated binary binarization. When truncated binary binarization is used, if it is assumed that \(2^{k - 1}<T - m<2^{k}\), then \(k - 1\) bits (or bins) can be used to signal the initial \(2^{k}-(T - m)\) indices, and \(k\) bits (or bins) can be used to signal the remaining indices. Accordingly, an additional context condition (i.e., context N) is also applied to non - MPM modes to utilize the index consisting of \(k - 1\) bits to signal the mode that is more likely to be selected in the corresponding block, so that the signaling overhead can be minimized.

[0097] According to another embodiment of the present invention, a second prediction mode list composed of some non - MPM modes can be managed. More specifically, non - MPM modes can be further divided into selected modes and non - selected modes, and a second prediction mode list (i.e., selected mode list) composed of selected modes can be managed. The intra - prediction mode included in the selected mode list can be referred to as a selected mode, and the intra - prediction mode not included in the selected mode list can be referred to as a non - selected mode. The encoder can signal a selected mode flag to distinguish whether the intra - prediction mode used in the current block is a selected mode or a non - selected mode. The decoder can identify whether the intra - prediction mode used in the current block is a selected mode or a non - selected mode through the received selected mode flag.

[0098] As described above, when non - MPM modes are further classified, the selected modes can be coded in a fixed length. In this case, by applying an additional context condition (e.g., context S) to the selected modes, the modes that are highly likely to be selected in the corresponding block can be prioritized. In this case, \(s\) selected modes (where \(s\) is a power of 2) can be coded in a fixed length, while the remaining \(n_s\) non - selected modes can be coded by truncated binary binarization. Any \(l - 1\) bits (or bins) or \(l\) bits (or bins) can be used to signal the \(n_s\) non - selected modes. In this case, by applying an additional context condition (i.e., context NS) to the non - selected modes, an index containing \(l - 1\) bits can be used to signal the mode that is relatively more likely to be selected in the corresponding block, so that the signaling overhead can be minimized.

[0099] Detailed embodiments of the context conditions will be described later with reference to the accompanying drawings. The context conditions further defined in the following embodiments can be applied individually or repeatedly to various configurations to which the context conditions {M0, M1, M2, N, S, NS} have been applied. For example, a context condition for signaling a basic angle pattern that takes precedence over the extended angle pattern can be additionally used. Additionally, a context condition can be used to first add an angle pattern to the list of second prediction patterns by adding a predefined offset (e.g., -1, +1) to the angle patterns of neighboring blocks derived from the first context condition (e.g., context M0) of the MPM pattern. This context condition can be applied as a context condition for one or more of the MPM pattern, non-MPM pattern, selected pattern, or unselected pattern. Furthermore, in addition to the default position, blocks at other positions can also be included, such as the neighboring blocks of the current block being checked to generate a variable MPM list. Reference will be made to... Figure 8 Describe its specific implementation.

[0100] Figure 8 A detailed embodiment of a method for transmitting intra-frame prediction modes using signals is shown. Figure 8 (a) An example of a neighboring block being referenced to configure a list of prediction modes is shown. Figure 8 (b) An embodiment of the method for transmitting the above-described intra-frame prediction mode using a signal is shown. Additionally, Figure 8 (c) shows an embodiment of using truncated binary binarization to transmit a non-selected mode of signal.

[0101] first, Figure 8 (a) An embodiment illustrating the relative positions of neighboring blocks referenced in configuring the MPM list. Reference Figure 8 (a) Neighboring blocks are referenced in the order of left (L), top (A), bottom left (BL), top right (AR), or top left (AL) adjacent to the current block. In this case, intra-prediction mode, planar mode, and DC mode selected from neighboring blocks can be added to the MPM list according to a preset order. However, in embodiments of the present invention, the neighboring blocks referenced to configure the MPM list are not limited to this. For example, the neighboring blocks of the current block may include the left (L) block and the top (A) block adjacent to the current block. The left (L) block is the bottommost block adjacent to the left boundary of the current block, while the top (A) block is the rightmost block adjacent to the top boundary of the current block.

[0102] According to embodiments of the present invention, the order in which the MPM list is configured can vary depending on the shape of the current block. For example, when the current block is a non-square block, the reference order of neighboring blocks can be determined differently depending on whether the current block is a vertical block or a horizontal block. For example, when the current block is a vertical block, the left block can be included in the MPM list with priority over the top block. When the current block is a horizontal block, the top block can be included in the MPM list with priority over the left block. According to another embodiment of the present invention, the order in which the MPM list is configured can be determined by comparing the shape of the current block with the shapes of neighboring blocks. For example, if the current block is a vertical block, the intra-prediction modes for vertical blocks among the preset neighboring blocks can be included in the MPM list with priority.

[0103] According to another embodiment of the invention, the order in which the MPM list is configured can be determined by considering the correlation between the shape of the current block and the angle modes used in neighboring blocks. For example, if the current block is a vertical block, angle modes among the preset angle modes used in neighboring blocks that are within a preset range starting from the vertical (VER) mode 50 or between the diagonal (DIA) mode 34 and the vertical diagonal (VDIA) mode 66 can preferably be included in the MPM list. According to yet another embodiment, intra-prediction modes included in the MPM list of neighboring blocks can be included in the MPM list of the current block. In this case, when the MPM list of the current block is not full with intra-prediction modes for neighboring blocks, intra-prediction modes included in the MPM list of neighboring blocks can be added to the MPM list of the current block.

[0104] According to another embodiment of the invention, depending on the size of the current block and the size of each neighboring block, an intra-prediction mode of the block at the additional position can be used. For example, when the neighboring blocks of the current block are smaller than the size of the current block, multiple left blocks with different intra-prediction modes can exist to the left of the current block. Specifically, in Figure 8 In (a), the left block refers to the block located at the bottom of the block adjacent to the left boundary of the current block, but may include another block adjacent to the left boundary of the current block. In this case, the MPM mode list can be configured based on the intra-prediction mode corresponding to the other block.

[0105] According to another embodiment of the invention, the MPM mode list of the current block can be configured based on the MPM mode list of the current block's neighboring blocks. For example, in addition to the methods used for... Figure 8 In addition to the intra-prediction mode of the left block in (a), the MPM mode list of the current block can be configured based on additional intra-prediction modes included in the MPM mode list of the left block.

[0106] Figure 8(b) An embodiment of the method for signaling the above-described intra-prediction modes is shown. In T intra-prediction modes, m modes are divided into MPM modes and signaled using truncated unary binarization. According to the embodiment, T can be 67 and m can be 6. In truncated unary binarization, since the number of bits (or bins) used increases with the signaling index, signaling efficiency can be increased by matching modes more likely to be selected in the corresponding block with lower value indices. For this purpose, the encoder and decoder configure the MPM list with the same context conditions and can rearrange the derived mode values ​​based on the context conditions and signal them. For example, CABAC-based encoding can be performed by classifying the selected modes in the order of non-angular modes such as DC / plane mode, vertical mode, and planar angular mode. Next, s selected modes determined by any context conditions are signaled using bits of a fixed length, and the remaining ns unselected modes are signaled using truncated unary binarization. According to the embodiment, n can be 16 and ns can be 45.

[0107] Figure 8 (c) illustrates an embodiment of signaling a non-selected pattern using truncated binary binarization. According to the above embodiment, the number of non-selected patterns, ns, is 45. When using truncated binary binarization, since 2^5 < 45 < 2^6, 5 bits (or bins) can be used to signal the initial 2^6 - 45 = 19 indices, and 6 bits (or bins) can be used to signal the remaining 26 indices. Therefore, since a preset context condition is also applied to the non-selected patterns, the pattern more likely to be selected in the corresponding block can be matched with the low-value index signaled via 5 bits (or bins). Specific embodiments of the preset context condition will be described with reference to the following figures.

[0108] Furthermore, depending on the scan order, block partitioning, and the location of the current block, at least some of the reference samples used for intra-frame prediction may be unavailable. This is because, depending on the recovery order of the blocks in the image, there may be one or more unrecovered reference samples at the time point for predicting the current block. Alternatively, if it is necessary to reference the outside of the image boundary due to the location of the current block, at least some reference samples may not exist.

[0109] In this disclosure, the unavailability of reference samples includes situations where the reference samples have not yet been recovered and situations where the reference samples do not exist. If at least some reference samples are unavailable, reference sample filling can be performed. In the following, reference... Figures 9 to 18 A filling method according to an embodiment of the present invention is described.

[0110] Figure 9This is a diagram illustrating the reference sample padding method when some reference samples used for intra-frame prediction of the current block are unavailable. (See reference...) Figure 5 As described above, when at least some reference samples are unavailable, the decoder can replace the unavailable reference sample values ​​with available reference sample values ​​by performing a reference sample filling process according to preset rules. According to an embodiment, unavailable reference sample values ​​can be generated based on the reference sample among the available reference samples that is closest to the unavailable reference sample. For example, the unavailable reference sample value can be replaced with the reference sample value that is closest to the unavailable reference sample.

[0111] Figure 10 This diagram illustrates a reference sample filling method when all reference samples for intra-frame prediction of the current block are unavailable. For example, if the current block is adjacent to the top-left boundary of the image, there may be no reference samples available for the current block. In this case, reference sample filling can be performed based on a representative value. In this case, all filled reference samples may have the same value. According to an embodiment, the representative value can be set based on the bit depth of the sequence including the current block. For example, the representative value can be an intermediate value within a range that can be expressed based on the bit depth.

[0112] According to another embodiment, a representative value can be set differently for each image or sequence. For example, the representative value can be set based on sample values ​​from the current image including the current block or from pre-recovered images or sequences recovered before the current sequence. For example, the representative value can be any one of the mean, mode, or median of the sample values ​​from the pre-recovered images or sequences. Moreover, the representative value can be set based on sample values ​​included in the current image or current sequence. Specifically, when sample values ​​recovered before the current block exist in the current sequence or current image, the representative value can be any one of the mean, mode, or median of the previously recovered sample values.

[0113] Simultaneously, the reference sample can be segmented into a left reference sample of the left boundary neighbor and an upper reference sample of the upper boundary neighbor, based on the boundary of the current block. According to another embodiment of the invention, different reference sample filling methods can be applied to the left reference sample and the upper reference sample. For example, a first reference sample filling method can be applied to one side of the left reference sample and the upper reference sample, and a second reference sample filling method can be applied to the other side. For example, the first reference sample filling method can be achieved by... Figure 9 The described reference sample filling method, and the second reference sample filling method can be through... Figure 10 The described reference sample filling method. For example, if a reference sample exists that can only be used on one of the left and top reference samples, it can be performed on the side where no reference sample is available. Figure 10 The description is filled with reference samples.

[0114] According to embodiments of the present invention, reference sample padding can be performed in different ways depending on the method for predicting neighboring blocks. This is because neighboring blocks of the current block can be predicted in a manner similar to predicting other neighboring blocks of the current block. According to an embodiment, when predicting neighboring blocks based on one of a plurality of intra-frame prediction modes, reference sample padding can be performed based on the intra-frame prediction mode of the neighboring blocks. For example, unrecovered reference sample values ​​can be determined based on available reference samples at the locations determined by the intra-frame prediction mode based on neighboring blocks. According to another embodiment, when performing inter-frame prediction for neighboring blocks, reference sample padding can be performed based on information related to inter-frame prediction. (Referring to...) Figures 16 to 18 This is described in more detail. Because the reference sample values ​​determined based on the neighboring block prediction method can improve the prediction performance of the current block.

[0115] In the following text, reference will be made to Figures 11 to 15 Describes a method for performing reference sample filling for the current block based on the intra-prediction mode of neighboring blocks. Figure 11 This diagram illustrates the reference sample filling method when the prediction pattern of neighboring blocks is a planar pattern. (Reference) Figure 11 Reference sample filling can be performed based on available reference samples. Alternatively, it can be performed using reference samples that were filled before the reference sample to be filled, depending on the positional filling order of the reference samples. The planar mode can be an intra-prediction mode, which is advantageous for representing blocks where sample values ​​gradually change. Therefore, when using a planar mode to predict at least one of the neighboring blocks of the current block, reference sample filling can be performed based on available reference samples located at a preset distance relative to the reference sample to be filled. In this case, the reference sample filling method may be similar to... Figure 9 The methods described in the text are different.

[0116] For example, the encoder and / or decoder can perform reference sample padding using reference samples located at a predetermined distance relative to the reference sample to be padded. The predetermined distance can be a sample unit distance. Specifically, the unavailable reference sample values ​​can be determined based on a first reference sample and a second reference sample. For example, the first reference sample can be the reference sample closest to the unavailable reference sample among the available reference samples in the first row to which the unavailable reference sample belongs. Furthermore, the second reference sample can be a reference sample located at a distance equal to the number of available reference samples in the first row from the unavailable reference sample.

[0117] As in Figure 11 In this context, when the unavailable reference sample is the upper reference sample, the first reference sample can be the sample adjacent to the unavailable reference sample on its left. In this case, the second reference sample can be a sample M samples away from the unavailable reference sample on its left. For example, in... Figure 11In this context, when the unavailable reference sample is the upper reference sample, the first reference sample can be the sample to the left of the unavailable reference sample. In this case, the second reference sample can be a sample that is a certain number of samples above the unavailable reference sample.

[0118] As in Figure 11 In this context, M consecutive reference samples among the upper reference samples of the current block can be available. Additionally, the block including at least some of the M reference samples can be a neighboring block predicted intra-frame using a planar mode. When the indices indicating the positions of the M available reference samples are 0 to M-1, the k-th reference sample may be unavailable. In this case, k can be an integer greater than or equal to M. In this case, the k-th reference sample value (p[k]) can be determined based on the first reference sample value (p[k-1]) closest to the left of the k-th reference sample and the second reference sample value (p[kM]) M distance to the left of the k-th reference sample. Alternatively, the k-th reference sample value can be determined based on the change between the first and second reference sample values ​​(p[k-1] - p[kM]). In this case, the k-th reference sample value p[k] can be expressed as the following equation.

[0119] [Equation 1]

[0120] p[k]=p[k-1]+(p[k-1]-p[kM]) / (M-1)

[0121] or

[0122] p[k]=p[k-1]+(p[k-1]-p[kM]) / M

[0123] According to another embodiment, unusable reference sample values ​​can be determined based on the values ​​of samples located at both ends of a series of available reference samples. Figure 14 In this context, the k-th reference sample value can be determined based on the leftmost third reference sample value (p[0]) and the rightmost fourth reference sample value (p[M-1]) among the available continuous reference samples. Alternatively, the k-th reference sample value can be filled based on the amount of change between the third and fourth reference sample values. In this case, the k-th sample value can be expressed by the following equation.

[0124] [Equation 2]

[0125] p[k]=p[M-1]+(k-M+1)*(p[M-1]–p[0]) / (M-1)

[0126] or

[0127] p[k]=p[M-1]+(k-M+1)*(p[M-1]–p[0]) / M

[0128] Equation 2 illustrates a method for determining the k-th reference sample value based on the fourth reference sample value and the amount of change. In Equation 2, (k-M+1) / M or (k-M+1) / (M-1) can be weights used to adjust the degree of responsiveness of the amount of change according to the location of unavailable reference samples.

[0129] Figure 12 This diagram illustrates a reference sample filling method when the prediction mode of neighboring blocks is an angle mode. According to embodiments of this disclosure, unavailable reference sample values ​​can be determined based on the angle mode of neighboring blocks. For example, unavailable reference sample values ​​can be determined using reference samples determined according to the angle mode of neighboring blocks from among the available reference samples. In this case, the values ​​of unavailable reference samples included in the first group can be determined based on the available reference samples included in the second group. For example, the first group can be configured with the upper reference samples of the current block, and the second group can be configured with the left reference samples of the current block.

[0130] Specifically, when the first group includes at least one unavailable reference sample, and the prediction pattern of the neighboring blocks overlapping with the first group is a first angle pattern, reference samples for filling the first group of reference samples can be determined based on the first angle pattern. The reference samples for filling the first group of reference samples can be determined based on the prediction direction indicated by the first angle pattern or the opposite direction. In this case, the reference samples for filling the first group of reference samples are included in the second group and can be available reference samples.

[0131] refer to Figure 12 Unavailable reference sample 1201 can be a sample from the first group. The intra-prediction mode of the neighboring block of the first available reference sample 1202 in the first group can be a vertical diagonal mode. In this case, the value of unavailable reference sample 1201 can be determined based on the second available reference sample 1203 included in the second group. Reference sample padding can be performed based on reference samples positioned in the prediction direction or in the direction opposite to the vertical diagonal mode within the second available reference sample 1203. Unavailable reference samples located on the horizontal diagonal relative to the upper reference sample can be any of the left reference samples.

[0132] Figure 13 This diagram illustrates the reference sample filling method when the prediction pattern of neighboring blocks is an angular pattern. For example... Figure 12 As shown, when unavailable reference sample values ​​are determined based on the angle pattern, the distance between the position of the reference sample to be filled and the position of the reference sample used for filling may be greater than or equal to a preset value. As the distance between sample positions increases, the correlation between sample values ​​may decrease.

[0133] Therefore, according to embodiments of the present invention, when the intra-prediction mode of a neighboring block is an angle mode, the unavailable reference sample value can be determined based on the sample closest to the unavailable reference sample among the samples recovered at the angle indicated by the intra-prediction mode of the neighboring block. In this case, the nearest sample may not be limited to the neighboring samples of the current block. Figure 13 Unavailable reference sample values ​​can be determined based on a first angle corresponding to the intra-prediction mode of neighboring blocks. The unavailable reference sample values ​​can also be determined based on the location of the unavailable reference sample, specifically the nearest sample among the recovered samples located at the first angle.

[0134] Figure 14 This is a diagram illustrating a reference sample filling method based on the position of a reference sample. As described above, the reference sample can be segmented into a left reference sample and an upper reference sample. According to embodiments of the present invention, the left reference sample and the upper reference sample can be mapped to each other based on their respective positions. For example, an upper reference sample corresponding to each left reference sample can be determined.

[0135] According to an embodiment of the present invention, when either the first left reference sample or the first upper reference sample that corresponds to each other is unavailable, the value of the unavailable reference sample can be determined based on the other available value.

[0136] Specifically, in Figure 14 In the index, the index indicating the relative position of each upper reference sample can be 0, ..., N-1, N, ..., 2N-1, starting from the left. Similarly, the index indicating the relative position of each left reference sample can be 0, ..., N-1, N, ..., 2N-1, starting from the top. Upper and left reference samples with the same index can be corresponding reference samples. For example, when the index of the first left reference sample is 2N-1, the index of the first upper reference sample corresponding to the first left reference sample can also be 2N-1.

[0137] Figure 15 This is a diagram illustrating a method for performing reference sample filling based on neighboring samples. Reference Figure 15A sample located at a specific angle based on the position of an unavailable reference sample can be a sample outside the range of reference samples determined based on the size of the current block. For example, if the size of the current block is W×H, the range of reference samples can be the sample at the top left of the current block, 2W samples on the line adjacent to the top of the current block, and 2H samples on the line adjacent to the left of the current block. Furthermore, the range of reference samples can be the sample at the top left of the current block, W+H samples on the line adjacent to the top of the current block, and W+H samples on the line adjacent to the left of the current block. This is because, as mentioned above, a compiler tree unit can have a rectangular shape. In this case, recovered samples outside the range of reference samples can be used to determine the unavailable reference sample values. In this case, the recovered samples can be samples located on lines adjacent to the top or left of the current block.

[0138] In the following text, reference will be made to Figures 16 to 18 This describes a method for filling the current block with reference samples based on inter-frame prediction of neighboring blocks. According to embodiments of the invention, the decoder can generate reference samples for the current block based on samples from another image.

[0139] Figure 16 This diagram illustrates a reference sample filling method when neighboring blocks are predicted inter-frame. According to embodiments of the invention, when inter-frame prediction is performed on neighboring blocks of the current block, reference sample filling can be performed based on samples from a reference image used for inter-frame prediction of neighboring blocks. Reference sample filling of the current block can be performed based on neighboring samples of a juxtaposed block corresponding to the same position in the reference image as the current block. In this disclosure, a juxtaposed block can represent a block determined based on an index from the reference image used for inter-frame prediction of neighboring blocks. In this case, the positional relationship between the neighboring samples of the juxtaposed block and the juxtaposed block can be the same as the positional relationship between an unavailable reference sample and the current block.

[0140] refer to Figure 16 When at least some reference samples adjacent to the upper boundary of the current block are unavailable, reference sample padding can be performed based on neighboring samples adjacent to the upper boundary of the juxtaposed block. According to another embodiment, reference sample padding can be performed based on a method (e.g., intra-frame prediction mode or inter-frame prediction) in which neighboring blocks of the juxtaposed block included in the reference image are predicted. In this case, the above-described method can be applied in the same or corresponding manner, wherein unavailable reference sample values ​​are determined based on the intra-frame prediction mode of neighboring blocks.

[0141] Figure 17This diagram illustrates a reference sample filling method when neighboring blocks are predicted inter-frame. According to an embodiment of the invention, when inter-frame prediction is performed on neighboring blocks of the current block, reference sample filling can be performed based on the reference image index and motion vector used for inter-frame prediction of neighboring blocks. For example, indirect reference blocks of the current block can be determined based on the reference image and motion vector used for inter-frame prediction of neighboring blocks. Next, reference sample filling can be performed based on neighboring samples of the indirect reference blocks present in the reference image.

[0142] Specifically, the value of an unusable first reference sample can be determined based on a specific sample among the neighboring samples of an indirect reference block. The positional relationship between the specific sample and the indirect reference block can be the same as the positional relationship between the current block and the first reference sample. Figure 17 When at least some of the reference samples adjacent to the upper boundary of the current block are unavailable, reference sample filling can be performed based on neighboring samples adjacent to the upper boundary of the indirect reference block.

[0143] Figure 18 This diagram illustrates a reference sample padding method when neighboring blocks are predicted inter-frame. According to embodiments of the invention, reference sample padding can be performed based on a method in which neighboring blocks of an indirect reference block are predicted. For example, when neighboring blocks of an indirect reference block are predicted based on any of a plurality of intra-frame prediction modes, reference sample padding can be performed based on the intra-frame prediction mode of the neighboring blocks of the indirect reference block. Reference Figure 18 When the prediction mode of a neighboring block of an indirect reference block is the first intra-frame prediction mode, the values ​​of unavailable reference samples for the current block can be determined based on the first intra-frame prediction mode. In this case, the same or corresponding methods can be applied... Figures 11 to 15 The method described.

[0144] In the above embodiments, the reference sample padding description includes reference samples in reference lines adjacent to the current block, but this disclosure is not limited thereto. As described above, the encoder and decoder according to embodiments of the present invention can use samples on n reference lines within a predetermined distance from the boundary of the current block as reference samples for intra-frame prediction of the current block. For example, the encoder can transmit reference line information by signaling at least one of the n reference lines for prediction of the current block. The decoder can obtain the reference line information from the bitstream.

[0145] In the following description, according to an embodiment of the present invention, when multiple reference lines are available for intra-frame prediction of the current block, the reference lines will be... Figure 19 Describe the configuration of neighboring samples for each reference line. Figure 19 This is a diagram illustrating an embodiment where multiple reference lines are configured for neighboring samples of the current block. Here, the neighboring samples of the current block can be samples located within a predetermined distance from the boundary line of the current block.

[0146] For reference Figure 5 As described above, samples from one or more of the multiple reference lines can be used for intra-frame prediction of the current block. For example, the multiple reference lines may include lines located at a distance of n samples from the boundary of the specific block to be predicted. In this case, n can be an integer of 0 or greater.

[0147] refer to Figure 19 The first reference line (line 1), second reference line (line 2), and third reference line (line 3) can be configured based on the boundary of the current block. Specifically, the first reference line can be configured with adjacent samples positioned on a line adjacent to the boundary of the current block. The second reference line can be configured with samples positioned on a line separated by one sample from the boundary of the current block. The third reference line can be configured with samples positioned on a line separated by two samples from the boundary of the current block. Although in Figure 19 The example described uses a reference line adjacent to the upper boundary of the current block, but this disclosure is not limited thereto. For example, multiple reference lines can exist based on the left boundary of the current block.

[0148] In intra-frame prediction mode, the reference sample used for prediction of the current block can be a neighboring sample of the current block. For example, neighboring samples can include samples on lines adjacent to the boundary of the current block. Neighboring samples can be samples adjacent to the top boundary and the left boundary of the current block. In addition, neighboring samples can include samples located on the upper left side of the current block.

[0149] Furthermore, neighboring samples can include samples that are not adjacent to the boundary of the current block. Specifically, neighboring samples can include samples on a line separated to the left by a specific number of samples from the leftmost sample in the current block. Additionally, neighboring samples can include samples on a line separated from the topmost sample in the current block by a specific number of samples. Here, the specific number of samples can be less than or equal to a preset number of samples. For example, when the preset number of samples is 2, the specific number of samples can be any number from 0 to 2. Furthermore, the number of samples can represent the number of integer pixels.

[0150] Simultaneously, the intra-prediction mode of the current block can be determined based on other information related to the intra-prediction of the current block. According to embodiments of the present invention, the intra-prediction mode of the current block can be determined based on reference samples used for intra-prediction of the current block. This is because the intra-prediction method is a prediction method based on the regional similarity between the current block and neighboring blocks.

[0151] For example, the encoder and decoder can determine the intra-prediction mode of the current block based on reference samples of the current block. According to embodiments of the invention, the encoder can implicitly use the reference samples to signal intra-prediction mode information, or it can signal intra-prediction mode information with a smaller number of bits by generating a set of intra-prediction modes configured with some of all modes. In this way, signaling for intra-prediction mode information can be executed efficiently.

[0152] According to embodiments of the present invention, the intra-prediction mode set of the current block can be configured based on the characteristics of the reference samples of the current block. The encoder and decoder can configure the intra-prediction mode set according to predetermined rules depending on the characteristics of the reference samples of the current block. In this case, the intra-prediction mode sets configured by the encoder and decoder can be identical to each other. Moreover, the decoder can determine the intra-prediction mode of the current block based on the configured intra-prediction mode set and the intra-prediction mode information transmitted by the signal. The intra-prediction mode information can be a sub-index indicating any one of the multiple modes configured in the intra-prediction mode set. In this case, the sub-index can be a value distinct from the aforementioned intra-prediction mode index. For example, the sub-index can be a value mapped to any one of the modes included in the intra-prediction mode set according to a preset mapping rule.

[0153] The intra-prediction mode set can be configured with some of all modes. For example, the intra-prediction mode set can be configured in a predetermined way based on information related to reference sample padding. The intra-prediction mode set can also be configured in a predetermined way based on the position of the reference sample. Specifically, the position of the reference sample can be a reference line.

[0154] In the following text, reference will be made to Figure 20 A method for determining the intra-prediction mode of the current block based on information relating to a reference sample of the current block, according to an embodiment of the present invention, is described. Figure 20 This is a diagram illustrating a method of sending the intra-prediction mode of the current block using signals.

[0155] refer to Figure 20 In operation S2002, multiple reference samples can be determined for intra-frame prediction of the current block. The decoder can prepare the reference samples for the current block based on neighboring samples of the current block. For example, if at least some of the reference samples are unavailable, the decoder can perform reference sample padding. Furthermore, the decoder can determine reference lines. For example, the encoder can send reference line information via a signal, indicating the reference lines used for prediction of the current block. The decoder can receive the reference line information from the bitstream. The decoder can determine at least one reference line for predicting the current block based on the reference line information.

[0156] Next, an intra-prediction mode set can be determined based on reference samples. According to embodiments of the present invention, the intra-prediction mode of the current block can be determined based on the presence of padded reference samples within the reference samples. Reference operation S2004 allows for the determination of the intra-prediction mode based on the presence of padded reference samples. For example, different intra-prediction mode sets can be used depending on whether reference samples are padded. Here, the configuration of the intra-prediction modes included in each different intra-prediction mode set can be different. For example, a first intra-prediction mode set can be configured with at least a portion of the intra-prediction modes configuring a second intra-prediction mode set. The first intra-prediction mode set includes the intra-prediction modes configuring the second intra-prediction mode set, and may further include other intra-prediction modes.

[0157] When reference sample padding is not performed (operation S2004), the intra-prediction mode of the current block can be determined based on the first intra-prediction mode set (operation S2006). In this case, the first intra-prediction mode set can be a set configured with all intra-prediction modes. The decoder can determine the intra-prediction mode of the current block based on the first intra-prediction mode set. The encoder can send intra-prediction mode information using signals, which indicates any of the modes configured in the first intra-prediction mode set. The decoder can determine one intra-prediction mode from the first intra-prediction mode set based on the intra-prediction mode information received from the bitstream. Furthermore, the decoder can perform intra-prediction on the current block based on the determined intra-prediction mode.

[0158] When at least one padding reference sample is present (operation S2004), the intra-prediction mode of the current block can be determined based on the second intra-prediction mode set (operation S2008). In this case, the second intra-prediction mode set can be a set configured with some of all intra-prediction modes. If padding samples are present, the intra-prediction mode set can be used, where reference samples used for padding are excluded from predicting the angle mode of the current block. This is because the probability of predicting the current block based on padding reference samples may be lower than the probability of predicting the current block based on recovered reference samples. The decoder can determine the intra-prediction mode of the current block based on the second intra-prediction mode set. The encoder can send intra-prediction mode information with a signal, which indicates any of the modes configured in the second intra-prediction mode set. The decoder can determine one intra-prediction mode in the second intra-prediction mode set based on the intra-prediction mode information received from the bitstream. In addition, the decoder can perform intra-prediction on the current block based on the determined intra-prediction mode.

[0159] According to another embodiment of the present invention, the intra-prediction mode of the current block can be determined based on the position of the filled reference sample. For example, different sets of intra-prediction modes can be used depending on the position of the filled reference sample. In the above embodiments, although one of the first intra-prediction mode and the second intra-prediction mode is selected as an example, the present disclosure is not limited thereto. For example, multiple sets of intra-prediction modes can be configured according to the characteristics of the reference sample. In addition, the intra-prediction mode of the current block can be determined based on any one of the multiple sets of intra-prediction modes.

[0160] According to embodiments of the present invention, a set of intra-prediction modes for predicting the current block can be configured based on the position of a reference sample. The position of the reference sample can be a reference line. As described above, the encoder and decoder can use any one of a plurality of reference lines configured with neighboring samples of the current block to predict the current block. According to embodiments, the intra-prediction mode of the current block can be determined based on a reference line including the reference sample of the current block.

[0161] For example, the set of intra-prediction modes for the current block can be configured based on reference line information. Reference line information can be information indicating which of a plurality of reference lines is used to predict the current block. The plurality of reference lines for the current block may include a first reference line configured with neighboring samples on lines adjacent to the boundary of the current block. The plurality of reference lines for the current block may include one or more second reference lines not adjacent to the boundary of the block. Furthermore, each of the one or more second reference lines may be configured with neighboring samples on lines separated by a specific number of samples, relative to the boundary of the corresponding block. In this case, the specific number of samples separated from the boundary of the current block may be different for each reference line.

[0162] According to an embodiment, when the reference line used for intra-prediction of the current block is a first reference line, the intra-prediction mode of the current block can be determined based on a first intra-prediction mode set. The first intra-prediction mode set may include all intra-prediction modes. Alternatively, when the reference line used for intra-prediction of the current block is not the first reference line, the intra-prediction mode of the current block can be determined based on a second intra-prediction mode set. According to an embodiment, multiple reference lines can be used for intra-prediction of the current block. When the multiple reference lines used for intra-prediction of the current block include a second reference line, the intra-prediction mode of the current block can be determined based on a second intra-prediction mode set. The second intra-prediction mode set may be configured with a portion of the modes configuring the first intra-prediction mode.

[0163] Specifically, the second intra-frame prediction mode set can be configured with n angle modes. Additionally, the first intra-frame prediction mode set can include m angle modes, a plane mode, and a DC mode. In this case, m can be greater than n. According to one embodiment, m can be the total number of angle modes used for intra-frame prediction. Furthermore, the second intra-frame prediction mode set can be configured with some modes from the first intra-frame prediction mode set. The angle modes can include those referenced above. Figure 6 The basic angle mode and extended angle mode are described. According to an embodiment, a second set of intra-prediction modes can be configured based on the intra-prediction modes of neighboring blocks of the current block.

[0164] The second intra-prediction mode set may include intra-prediction modes of blocks within neighboring blocks that are intra-predicted. According to an embodiment, when the intra-prediction mode of a neighboring block is an angle mode, the angle mode may be included in the second intra-prediction mode set. Additionally, the second intra-prediction mode set may be configured with a preset number of angle modes. For example, the second intra-prediction mode set may include angle modes in which a preset offset (e.g., -1, +1) is added to the angle modes of neighboring blocks. In the case of multiple blocks predicted based on intra-prediction modes within the neighboring blocks of the current block, the context of the neighboring blocks can be considered when configuring the second intra-prediction mode set. For example, the second intra-prediction mode set may be configured in accordance with the above references. Figure 7 The MPM list configuration method described is the same as or corresponds to the configuration method. The second frame intra-prediction mode set can be an MPM list.

[0165] If no angle-mode-based intra-prediction block exists among the neighboring blocks of the current block, a second intra-prediction mode set can be configured based on a preset angle mode. For example, the preset angle mode may include at least one of a horizontal diagonal mode, a horizontal mode, a diagonal mode, a vertical mode, and a vertical diagonal mode. Furthermore, the second intra-prediction mode set may include angle modes in which a preset offset (e.g., -1, +1) is added to the preset angle mode.

[0166] According to an embodiment, the encoder can send reference line information using signals, which indicates the reference line among multiple reference lines for predicting the current block. The decoder can obtain the reference line information from the bitstream. Furthermore, the encoder and decoder can configure an intra-prediction mode set based on the reference line information according to predefined rules. In this case, the intra-prediction mode sets configured by the encoder and decoder can be identical. The decoder can determine the intra-prediction mode for the current block based on the configured intra-prediction mode set.

[0167] For example, the encoder can signal intra-prediction mode information indicating any one of the configured intra-prediction mode sets. The decoder can obtain the intra-prediction mode information by parsing the bitstream. The decoder can determine the intra-prediction mode index of the current block based on the intra-prediction mode set and the intra-prediction mode information. The decoder can perform intra-prediction of the current block based on the determined intra-prediction mode index. Alternatively, the decoder can perform intra-prediction of the current block based on multiple reference samples on a reference line according to reference line information and the intra-prediction mode index. The decoder can determine the reference line used for predicting the current block based on the reference line information. When at least some of the multiple samples on the reference line used for intra-prediction of the current block are unavailable, the decoder can perform the above reference line prediction. Figures 9 to 18 The reference sample described is used to prepare the reference sample for the current block.

[0168] Therefore, a method can be used to implicitly configure an intra-prediction mode set containing some of the modes from the total number of modes via signal transmission using reference line information. Based on the reference line, an intra-prediction mode set including intra-prediction modes with high probabilities of being used for prediction of the current block can be configured. This is because the intra-prediction modes whose prediction performance is improved according to the reference line may differ. Additionally, intra-prediction mode information indicating one of the intra-prediction mode sets containing fewer modes than the total number of modes can be transmitted via signal transmission. Therefore, effective signaling for the intra-prediction mode information can be executed.

[0169] In operation S2010, prediction for the current block can be performed based on the determined intra-prediction mode. The decoder can generate a prediction block by performing intra-prediction on the current block based on the determined intra-prediction mode.

[0170] Figure 21 This is a diagram illustrating a method for transmitting intra-frame prediction mode information using a signal based on the position of a padded reference sample. According to an additional embodiment of the invention, an intra-frame prediction mode corresponding to an additional angle can be transmitted using a signal based on the position of the padded reference sample. For example, in Figure 21 The intra-prediction mode set for the current block can be configured with modes between indices 34 and 66. In this case, additional angles between the angles corresponding to indices 34 to 66 can be used to signal intra-prediction modes corresponding to indices less than 34 using bits allocated for signaling. Alternatively, intra-prediction mode information can be signaled with fewer bits using an intra-prediction mode set configured with some of all modes.

[0171] refer to Figure 21The neighboring samples adjacent to the upper boundary of the current block can include the recovered samples. Alternatively, the neighboring samples adjacent to the left boundary of the current block can be configured using all the padded neighboring samples. In this case, the intra-prediction mode of the current block can be determined such that the upper neighboring samples are used for intra-prediction. For example, the intra-prediction mode set can be configured with intra-prediction modes corresponding to indices 34 to 66. This is because the probability of prediction using previously recovered reference samples may be higher than the probability of prediction using padded reference samples.

[0172] Figure 22 This diagram illustrates a method for determining an intra-prediction mode based on the relative position of the current block. According to embodiments of the invention, the intra-prediction mode of the current block can be determined based on its relative position within a higher-level region of the current block. Here, the higher-level region of the current block can be a slice or tile that includes the current block. Alternatively, the higher-level region of the current block can be an image that includes the current block. Furthermore, the higher-level region of the current block can be a CTU or Compiler Tree Block (CTB) that includes the current block.

[0173] According to an embodiment, the intra-prediction mode set for the current block can be configured differently based on its relative position in a higher-level region. This is because, depending on the position of the current block, neighboring samples of the current block may not be available for prediction of the current block. For example, different intra-prediction mode sets can be configured based on the relative position of the current block in an image, slice, tile, CTU, or CTB. The decoder can determine the intra-prediction mode for the current block using the configured intra-prediction mode set based on its relative position.

[0174] The encoder and decoder can configure an intra-prediction mode set according to predefined rules based on the relative position of the current block in a higher-level region. In this case, the intra-prediction mode sets configured by the encoder and decoder can be the same. Furthermore, the decoder can use the configured intra-prediction mode set to determine the intra-prediction mode for the current block. Additionally, the decoder can perform prediction for the current block based on the determined intra-prediction mode.

[0175] According to an embodiment of the present invention, when the position of the current block is a preset position, the intra-prediction mode of the current block can be determined using a preset intra-prediction mode set. In this case, the position of the current block can indicate the position in a higher-level region of the upper-left corner sample of the current block among the samples included in the current block. Specifically, the preset position can be the position where the boundary of the current block is adjacent to the boundary of the higher-level region. The preset position can be a position set based on at least one of the scanning order or the encoding / decoding order. For example, the preset position can be the position of the block that is processed first in a region that can be processed in parallel. The preset position can be the position adjacent to the upper boundary of the image (or tile / slice / CTU / CTB). In addition, the preset position can be the position adjacent to the left boundary of the image (or tile / slice / CTU / CTB). This is because if the current block is adjacent to the boundary of the image (or tile / slice / CTU / CTB), the previously recovered block may not exist around the current block. The preset intra-prediction mode set can be configured with all intra-prediction modes.

[0176] Additionally, if the upper boundary of the current block overlaps with the upper boundary of a higher-level region, the available upper neighbor blocks may be limited. In this case, reference lines among the aforementioned reference lines that are not adjacent to the boundary of the current block may not be permitted. When the current block is adjacent to the upper boundary of a higher-level region, the encoder and decoder can predefine the use of adjacent reference lines in the current block. Therefore, when the current block is adjacent to the upper boundary of a higher-level region, the decoder can predict the current block based on the reference lines adjacent to it. Furthermore, the decoder can configure the intra-prediction mode set for the current block based on the reference lines adjacent to it and determine the intra-prediction mode. Moreover, the decoder can perform prediction on the current block based on the determined intra-prediction mode.

[0177] According to an embodiment of the present invention, if the current block position is not the predetermined position described above, it can be referenced as described above. Figures 19 to 21 The method described above configures the intra-prediction mode set. If the current block position is not the preset position mentioned above, the encoder and decoder can configure an intra-prediction mode set that includes some of the configured modes. Additionally, the decoder can perform intra-prediction on the current block based on the configured intra-prediction modes.

[0178] According to another embodiment of the present invention, when the position of the current block is a preset position, a preset intra-prediction mode can be used to perform prediction on the current block. In this case, the preset intra-prediction mode may include at least one of a planar mode or a DC mode. Additionally, when the position of the current block is a preset position, the encoder and decoder can use an intra-prediction mode set configured with intra-prediction modes other than some angle modes to perform intra-prediction on the current block. In this case, some angle modes can be determined based on the position of unavailable reference samples in the reference samples of the current block. For example, it may be an angle mode corresponding to the prediction direction predicted from the unavailable reference samples. Specifically, when the reference sample located on the left side of the current block is unavailable, the encoder and decoder can configure an intra-prediction mode set configured with all intra-prediction modes except for at least intra-prediction mode indices 2 to 18. This is because when reference sample padding is performed based on the position of the current block, the probability of using some angle modes for intra-prediction of the current block may be reduced.

[0179] According to another embodiment of the invention, the intra-prediction mode of the current block can be determined based on the similarity between reference samples of the current block. In this case, the intra-prediction mode of the current block can be implicitly signaled. The encoder and decoder can use predetermined rules to select the intra-prediction mode of the current block without additional signaling. This intra-prediction mode information signaling scheme can be referred to as implicit signaling. Hereinafter, reference will be made to... Figures 23 to 25 This paper describes in detail a method for determining the intra-prediction mode of the current block based on the similarity between neighboring samples of the current block.

[0180] Figure 23 This diagram illustrates an embodiment of a method for determining the intra-prediction mode of the current block based on the similarity between neighboring samples. According to embodiments of this disclosure, the intra-prediction mode of the current block can be determined using multiple subsets of reference samples configured with multiple neighboring samples. For example, the intra-prediction mode of the current block can be determined based on the similarity between a first subset of reference samples and a second subset of reference samples. Here, the neighboring sample configurations included in each of the first and second subsets of reference samples can be different.

[0181] In the following description, for ease of description, a method for determining an intra-prediction mode based on a first subset of reference samples and a second subset of reference samples will be described, but this disclosure is not limited thereto. For example, two or more subsets of reference samples may be configured, and based on this, the intra-prediction mode of the current block may be determined.

[0182] refer to Figure 23In operation S2302, the decoder can determine a first reference sample subset and a second reference sample subset similar to the first reference sample subset. The first and second reference sample subsets can be configured with neighboring samples located at different positions. For example, the first reference sample subset can be a subset configured with neighboring samples located above the current block. Furthermore, the second reference sample subset can be a subset configured with neighboring samples located to the left of the current block. The first and second reference sample subsets can also be subsets configured with samples on different reference lines.

[0183] A second reference sample subset can be determined based on its similarity to a first reference sample subset. For example, the second reference sample subset could be a subset that has a higher than predetermined similarity to the first reference sample subset. For example, similarity could be the correlation between the first and second reference sample subsets. Similarity can also be calculated based on the values ​​of neighboring samples included in the reference sample subset.

[0184] Specifically, similarity can be calculated by comparing the value of a first neighbor sample from a subset of neighbor samples of the first reference sample with the value of a second neighbor sample from a subset of neighbor samples of the second reference sample. Alternatively, similarity can be calculated by comparing the values ​​of multiple samples at each location. The encoder and decoder can compare the values ​​of multiple reference samples from the first subset of the configuration reference sample with the values ​​of multiple reference samples from the second subset of the configuration reference sample.

[0185] According to embodiments, similarity can be calculated based on at least one of gradient, orientation change, or difference in sample values ​​between multiple neighboring samples in each of the first and second reference sample subsets. For example, the encoder and decoder can calculate similarity by comparing the gradient values ​​of samples in the first subset of the configured reference samples with the gradient values ​​of samples in the second subset of the configured reference samples. The encoder and decoder can also calculate similarity by comparing the difference in sample values ​​between samples in the first subset of the configured reference samples with the difference in sample values ​​between samples in the second subset of the configured reference samples.

[0186] Furthermore, multiple subsets including edges can be obtained based on at least one of the gradient, orientation change, or difference in sample values ​​of multiple neighboring samples of a subset of configuration reference samples. When the first reference sample subset and the second reference sample subset include edges, the intra-frame prediction mode of the current block can be determined based on the positional relationship between the first reference sample subset and the second reference sample subset.

[0187] According to another embodiment of the invention, the first and second reference sample subsets can be configured by excluding unavailable reference samples. The reference sample subset may not include reference samples at the location where padding is performed. This is because the sample values ​​of the padded reference samples are generated based on the values ​​of neighboring samples. Furthermore, errors may occur when calculating similarity using unrecovered reference samples.

[0188] According to another embodiment of the invention, additional subpixels can be used to determine a second subset of reference samples. For example, subpixels from each of a plurality of subsets of reference samples can be used to calculate the similarity between the plurality of subsets of reference samples. In this case, the subpixel can be a pixel located at a subpel unit between adjacent integer samples. The subpixel can be a value obtained by interpolating the integer samples. At least one of a linear filter or a DCT filter used for intra-frame prediction can be used to obtain the subpixel. When using subpixels, more angular patterns may be implicitly transmitted with the signal.

[0189] In operation S2304, the intra-prediction mode of the current block can be determined. For example, the intra-prediction mode of the current block can be determined based on the positional relationship between a first reference sample subset and a second reference sample subset. In this regard, the reference... Figure 24 and Figure 25 The following description is provided. In operation S2305, intra-prediction for the current block can be performed based on the determined intra-prediction mode. Furthermore, in this embodiment, the samples used to calculate similarity and the reference samples referenced in the intra-prediction process can be different samples. For example, in... Figures 23 to 25 In one embodiment, the reference sample subset may be configured with neighboring samples of the current block, independent of those referenced in intra-frame prediction.

[0190] According to another embodiment of the present invention, the intra-frame prediction mode of the current block can be determined based on multiple subsets of reference samples configured with neighboring samples. For example, multiple candidate subsets can be configured based on the positions of neighboring samples. Alternatively, a pair of subsets with the highest similarity can be determined by calculating the similarity between multiple candidate subsets.

[0191] Furthermore, according to an additional embodiment of the invention, the amount of change between neighboring samples of the current block can be determined first. This amount of change can be calculated based on the gradient, slope, or sample value difference between neighboring samples of the current block. Depending on the amount of change between neighboring samples of the current block, it can be determined whether to transmit the intra-prediction mode using the method described above. For example, if it is less than a preset amount of change, the intra-prediction mode of the current block may not be transmitted using the method described above. Alternatively, if it is greater than or equal to a preset amount, the intra-prediction mode can be transmitted using the method described above. Alternatively, the intra-prediction mode can be transmitted using the method described above even if it is less than a preset amount of change. This is because in planar mode or DC mode, the amount of change between neighboring samples may be small.

[0192] Figure 24 This is a diagram illustrating an embodiment of a method for determining the intra-prediction mode of the current block based on neighboring samples. (Reference) Figure 24 The shaded area can indicate regions similar to the first and second reference sample subsets. For example, the sample value of each sample included in the shaded area of ​​the original or restored image can be a value within a preset range. Prediction performance can be improved by directing the prediction direction closer to the shape of the shaded area.

[0193] exist Figure 24 In this configuration, a first reference sample subset can be configured with multiple neighboring samples located above the current block. Additionally, a second reference sample subset can be configured with multiple neighboring samples located to the left of the current block. Among the neighboring samples of the first subset of reference samples, the values ​​of neighboring samples included in the shaded portion can be changed to be similar to the values ​​of neighboring samples included in the shaded portion of the second reference sample subset. In this case, the intra-frame prediction mode of the current block can be determined based on the direction in which highly similar samples are connected.

[0194] According to another embodiment of the present invention, multiple intra-frame prediction modes can be determined based on a first reference sample subset and a second reference sample subset determined in operation S2302. For example, two angle modes corresponding to angles determined based on the positions of the first and second reference sample subsets are possible. Each of the two angle modes can be a first angle mode and a second angle mode opposite in direction to the first angle mode. Intra-frame prediction mode information indicating one of the multiple angle modes needs to be signaled. In addition, when one of the first and second angle modes determined based on the positions of the first and second reference sample subsets corresponds to the aforementioned wide-angle mode, the current block can be predicted based on the angle mode instead of the wide-angle mode.

[0195] According to an embodiment, the intra-prediction mode of the current block can be determined based on the indices of multiple angle modes. For example, the angle mode with the smallest index among the multiple angle modes can be used as the intra-prediction mode of the current block. Alternatively, the angle mode with the largest index among the multiple angle modes can be used as the intra-prediction mode of the current block.

[0196] According to another embodiment, the intra-prediction mode for the current block can be determined based on the residual signal of the current block. For example, the intra-prediction mode for the current block can be determined using the residual signal for each region in the current block. Specifically, the sum of the first residual signals of the samples on the topmost line of the current block can be obtained. The sum of the second residual signals of the samples on the leftmost line of the current block can be obtained. When the sum of the second residual signals is greater than the sum of the first residual signals, the intra-prediction mode corresponding to the prediction angle from top to left can be used for the prediction of the current block. Conversely, when the sum of the first residual signals is greater than the sum of the second residual signals, the intra-prediction mode corresponding to the prediction angle from left to top can be used for the prediction of the current block. This is because, in the case of intra-prediction, as the predicted samples are closer to the reference samples used for intra-prediction, the residual signals may be fewer.

[0197] According to another embodiment, the intra-prediction mode for the current block can be determined based on the number of padded reference samples included in the subset of reference samples. For example, the intra-prediction mode in the direction referenced from a subset of reference samples with a smaller number of padded reference samples can be used for the prediction of the current block. This is because padded reference samples may exhibit fewer original signal characteristics than recovered reference samples. Additionally, it may be because the probability of prediction based on recovered reference samples may be higher than the probability of prediction based on padded reference samples.

[0198] Figure 25 This is a diagram illustrating an embodiment of a method for determining the intra-prediction mode of the current block based on neighboring samples. (Reference) Figure 25 The intra-frame prediction mode of the current block can be determined based on the positions of the first reference sample subset and the second reference sample subset. As mentioned above, the first reference sample subset and the second reference sample subset can be a pair of subsets with a similarity higher than a predetermined value.

[0199] exist Figure 25 In this context, the first subset of reference samples may include the nth sample to the right of its neighboring sample located at the top left of the current block. Furthermore, the first subset of reference samples may include a predetermined number of consecutive samples to the right of the first sample. The second subset of reference samples may include the mth sample downwards from its neighboring sample located at the top left of the current block. Additionally, the second subset of reference samples may include a predetermined number of consecutive samples downwards from the second sample.

[0200] In this case, the intra-prediction mode of the current block can be determined based on n and m. Specifically, in Figure 25 In the block, the angle θ between the line connecting the first and second samples and the line adjacent to the left boundary of the current block can be arctan(n / m). The intra-frame prediction mode of the current block can be a prediction mode corresponding to either the first angle θ or the second angle (θ-a*π). In this case, a is an integer, and π can be the perimeter.

[0201] Meanwhile, among the multiple angle patterns included in the intra-frame prediction mode set, the angle pattern that corresponds to the line connecting the first and second samples may not exist. For example, the first angle θ may not be mapped to a line connecting the first and second samples. Figure 6 The angles corresponding to the preset angle patterns shown. In this case, the angle pattern corresponding to the angle closest to the first angle θ among the angles corresponding to the angle patterns can be used as the intra-prediction mode for the current block.

[0202] As described above, the intra-prediction mode of the current block can be determined based on the similarity between neighboring samples of the current block. Therefore, the encoder and decoder can reduce the signaling overhead for determining the intra-prediction mode of the current block. According to another embodiment of the invention, such signaling may be necessary when combining a method for determining the intra-prediction mode of the current block based on reference samples with existing methods for signaling intra-prediction mode information.

[0203] According to embodiments, a method for explicitly determining an intra-prediction mode can be determined by signaling. For example, an intra-prediction mode determination method can be determined by signaling for each block. Alternatively, multiple methods can be used to determine whether they are applicable to each first region, and a method for determining an intra-prediction mode for each second region can be determined by signaling. For example, the first region may be a higher-level region comprising multiple second regions. The first region may be a picture (or tile / slice), and the second regions may be compilation units or blocks segmented for compilation.

[0204] According to another embodiment, a method for determining the intra-frame prediction mode can be implicitly transmitted using signals. For example, the encoder and decoder can select the method for determining the intra-frame prediction mode based on a preset method. Specifically, when the amount of change between neighboring samples of the current block is greater than or equal to a preset value, a method based on the aforementioned reference samples can be used; and if it is less than the preset value, an existing method is used.

[0205] Hereinafter, a method for dividing a compiler tree unit into compiler units according to another embodiment of the present invention is described. Figure 26This diagram illustrates an embodiment of a method for dividing vertical and horizontal blocks. Binary blocks, divided from the leaf nodes of a quadtree by binary partitioning, can be divided into vertical and horizontal blocks. Blocks whose vertical side is longer than their horizontal side, such as N×2N blocks, can be called vertical blocks. Vertical blocks can be generated by performing vertical binary partitioning from the leaf nodes of the quadtree.

[0206] If the vertical block is a leaf node, it need not be further divided. Alternatively, the vertical block can be further divided based on specific conditions. These conditions may include the parameters described above for multiple tree types. A vertical block can be divided into two (N / 2) × 2N nodes via a vertical binary partition. Alternatively, it can be divided into two N × N nodes via a horizontal binary partition. Alternatively, it can be divided into four (N / 2) × N nodes via a binary quadtree (BQ) partition. Alternatively, a vertical block can be divided into two N × (N / 2) nodes and one N × N node via a horizontal ternary partition. Alternatively, it can be divided into two (N / 4) × 2N nodes and one (N / 2) × 2N node via a vertical ternary partition.

[0207] Furthermore, blocks whose horizontal length is longer than their vertical length, such as 2NxN blocks, can be referred to as horizontal blocks. Horizontal blocks can be generated by horizontal binary partitioning from the leaf nodes of a quadtree. When a horizontal block is a leaf node, it may not be further partitioned. Alternatively, horizontal blocks can be further partitioned based on specific conditions. These conditions may include the parameters described above regarding multi-type trees. A horizontal block can be partitioned into two NxN nodes by vertical binary partitioning. Alternatively, a vertical block can be partitioned into two 2Nx(N / 2) nodes by horizontal binary partitioning. Alternatively, a vertical block can be partitioned into four Nx(N / 2) nodes by binary quadtree (BQ) partitioning. Alternatively, a horizontal block can be partitioned into two (N / 2)xN nodes and one NxN node by vertical ternary partitioning. Alternatively, a horizontal block can be partitioned into two 2Nx(N / 4) nodes and one 2Nx(N / 2) node by vertical ternary partitioning.

[0208] According to embodiments of the present invention, binary quadtree segmentation can be performed based on preset conditions. For example, it can be determined whether a binary block can be segmented by BQ on a per-image, slice, tile, CTU, or CU basis. The encoder can signal whether BQ segmentation of the binary block is permitted on a per-image, slice, tile, CTU, or CU basis. When binary quadtree segmentation is permitted, a BQ segmentation signaling field for the current block can be signaled. According to another embodiment, when a binary block is BQ segmented, the corresponding segmentation can be a final segmentation without further segmentation. Furthermore, the segmented block can indicate the unit to be encoded. Additionally, the segmented block can represent a transformed unit. That is, the execution of prediction, etc., is performed holistically in the block before BQ block segmentation, and in the block segmented by BQ, it can be a unit for which transformation is performed on each block. BQ segmentation of a binary block can be limited to the case where the size of one side of the binary block is MinBtSize. Only when the size of the shorter side of the binary block is MinBtSize can a signaling field for BQ block segmentation be signaled separately. Furthermore, the ternary segmentation of a binary block can be determined based on a separate parameter related to the ternary segmentation. For example, the separate parameter could be MaxTtSize, as mentioned above.

[0209] Figure 27 This is a diagram illustrating an embodiment of a method for sending signals to divide a quadtree, binary tree, and ternary tree. Figure 27 (a) illustrates an embodiment of a method in which quadtree segmentation is signaled. When a QT segmentation instruction is given, the corresponding node can be segmented into a quadtree node; if no segmentation instruction is given, the corresponding node can be a leaf node. In this case, when the quadtree is signaled as a leaf node, binary tree segmentation information can also be signaled.

[0210] Figure 27 (b) illustrates an embodiment of a method in which the partitioning of a binary tree is signaled. If a partition is not indicated by BT, the corresponding node becomes a leaf node, and when a partition is indicated, signaling indicating a vertical or horizontal partition can be added.

[0211] Figure 27 (c) This diagram illustrates a method for segmenting a binary tree according to another embodiment of the present invention. When the BT adaptive segmentation is 1, a node can be segmented by either a vertical binary segmentation or a horizontal binary segmentation. If the BT adaptive segmentation is 0, the node can be a leaf node, or it can be segmented by either a vertical binary segmentation or a horizontal binary segmentation. Signaling indicating whether it is a leaf node or a binary segmentation can be added. The encoder can preferably signal binary segments in one direction of the binary segmentation. In this way, signaling overhead can be reduced when selecting a large number of segments from the entire image, slice, tile, or CTU unit.

[0212] Figure 27 The adaptive signaling method in (c) can be adaptively used or transmitted via signals in the following ways. For example, when the maximum BT depth MaxBTDepth, indicating the maximum number of allowed BT splits, is greater than a preset value, the adaptive signaling method can be used. This is because when MaxBTDepth is large, signaling for binary tree splitting is generated frequently, making the effect of adaptive signaling possible. On the other hand, this is because when MaxBTDepth is small, the number of signaling for binary tree splitting is small, making it difficult to obtain the effect of adaptive signaling. Accordingly, when MaxBTDepth is less than the preset value, the adaptive signaling method can be used... Figure 27 (b) Signaling method.

[0213] Furthermore, the encoder can use signals to transmit information related to the adaptive signaling method based on the image (or tile / slice). Specifically, the encoder can use signals to transmit the segmentation direction that is preferentially signaled by BT adaptive segmentation in both vertical and horizontal binary segmentation. Additionally, the segmentation direction preferentially signaled by BT adaptive segmentation can be changed based on the context within the image (or tile / slice) unit. For example, the preferential segmentation direction can be determined based on the frequency of vertical and horizontal binary segmentation up to the current block.

[0214] Furthermore, in the case of an I-slice where all blocks are encoded in intra-prediction mode, adaptive signaling for chroma block segmentation can be performed based on the segmentation structure of the luma blocks corresponding to the chroma blocks. The luma blocks corresponding to the chroma blocks can be selected based on the block corresponding to the position of the pixel in the center of the chroma block. Alternatively, luma blocks corresponding to pixels in various parts of the chroma block, such as the upper left, upper right, center, lower left, or lower right, can be selected. Using a segmentation structure of one or more luma blocks corresponding to the chroma blocks, the method of signaling the segmentation of the chroma blocks can be changed. For example, when the luma blocks are vertical blocks, a signaling method that prioritizes signaling vertical binary segmentation for the segmentation of the chroma blocks can be selected.

[0215] Figure 27 (d) illustrates an embodiment of a method for transmitting a QTBT combined block segmentation structure using signals. If the QTBT segmentation is 1, the corresponding node can be segmented by a quadtree; if the QTBT segmentation is 0, the node can be a leaf node or can be segmented by a binary tree. Additionally, signaling indicating whether it is a leaf node or segmented by a binary tree can be added. Furthermore, when indicating segmentation by a binary tree, signaling indicating whether it is a vertical binary segmentation or a horizontal binary segmentation can be added.

[0216] Figure 27(e) illustrates an embodiment of a method in which the partition of a binary tree is signaled when BQ partitioning is permitted. Figure 27 As shown in (c), one of the horizontal binary partition and the vertical binary partition can be signaled first. The other of the horizontal binary partition and the vertical binary partition can then be signaled, and it can be signaled whether it is a leaf node or a BQ partition.

[0217] Figure 27 (f) illustrates another embodiment of the method, wherein the binary tree segmentation is signaled when BQ segmentation is permitted. The binary tree segmentation can be signaled using a fixed-length compiled method. Signaling indicating leaf nodes, horizontal binary segmentations, vertical binary segmentations, and BQ segmentations can be executed separately. Valid signaling can be executed when the probability of occurrence of each of the leaf nodes, horizontal binary segmentations, vertical binary segmentations, and BQ segmentations is similar.

[0218] Figure 27 (g) illustrates an embodiment of a method in which QTBT combined block segmentation is signaled when BQ segmentation is permitted. Figure 27 In (g), the current tree structure can be sent using a signal, regardless of whether it is a quadtree or a binary tree.

[0219] Figure 28 This is a diagram illustrating an embodiment of a method for sending signals to partition a ternary tree. (See reference) Figure 28 (a) When the BTTT partition is 0, the corresponding node can be a leaf node. Conversely, when the BTTT partition is 1, the corresponding node can be a binary tree partition or a ternary tree partition. Bits indicating whether it is a binary tree partition or a ternary tree partition, and bits indicating whether it is a horizontal partition or a vertical partition in each case, can be sent by signaling.

[0220] refer to Figure 28 (b) The segmentation direction can be signaled prior to the segmentation shape. Rather than whether it is a binary tree or a ternary tree, the signal can prioritize signaling whether it is a horizontal or vertical segmentation. If the BTTT segmentation is 0, the node becomes a leaf node; if it is 1, the node can be segmented by either a horizontal or vertical segmentation. In this case, bits indicating the horizontal or vertical segmentation and bits indicating the binary or ternary tree can be signaled separately.

[0221] Simultaneously, the permission for ternary tree segmentation can be determined at the unit level of images, slices, tiles, or CTUs. For example, when preset conditions are established at the unit level of images, slices, tiles, or CTUs, ternary tree segmentation may be allowed. Alternatively, the encoder can signal whether ternary tree segmentation at the unit level of images, slices, tiles, or CTUs is allowed. When ternary tree segmentation is not allowed, [the signal is transmitted]... Figure 28Compared with the signaling method in (a), Figure 28 (b) signaling method can reduce signaling overhead by 1 bit. When ternary tree partitioning is not allowed, Figure 28 (b) Signaling method can use up to 2 bits to send binary tree partitions.

[0222] refer to Figure 28 (c) The corresponding node can be a leaf node, or it can be divided into multiple nodes according to the binary tree structure through vertical binary partitioning, horizontal binary partitioning, vertical ternary partitioning, or horizontal ternary partitioning. According to an embodiment, the encoder can preferably send the vertical binary partitioning or horizontal binary partitioning with a signal, and then send the remaining partitioning structure with a signal. Even in this case, it can be applied in the same or corresponding manner via... Figure 27 (c) describes the adaptive signaling method.

[0223] Figure 29 This is a diagram specifically illustrating the structure of a vertically segmented block according to an embodiment of the present invention. (Reference) Figure 29 (a) A 2Nx2N block can be divided into a first left vertical block (LVB) and a first right vertical block (RVB) of size Nx2N by vertical binary partitioning. In this case, the partitioning structure of the first right vertical block can be restricted based on the partitioning structure of the first left vertical block. For example, when the first left vertical block is horizontally binary partitioned, the first right vertical block may not be allowed to be horizontally binary partitioned. This is because when the first left and first right vertical blocks are partitioned by horizontal binary partitioning, it is the same as when the 2Nx2N block is partitioned into a quadtree structure. Furthermore, this is because it is possible to signal the quadtree partitioning within the 2Nx2N block. Therefore, when signaling the horizontal binary partitioning of the first left vertical block, the partitioning of the first right vertical block, other than the horizontal binary partitioning, can be signaled.

[0224] refer to Figure 29 (b) A vertical block of size Nx2N can be divided into a second left vertical block and a second right vertical block of size (N / 2)×2N by vertical binary partitioning. In this case, the partitioning structure of the second right vertical block can be restricted based on the partitioning structure of the second left vertical block. For example, when the second left vertical block is partitioned horizontally, the second right vertical block may not be allowed to be partitioned horizontally. This is because partitioning the second left and second right vertical blocks by horizontal binary partitioning is the same as partitioning an Nx2N block by binary quadtree partitioning. Additionally, this is because it is possible to signal the partitioning from the Nx2N node using BQ partitioning. Therefore, when signaling the horizontal binary partitioning of the second left vertical block, the partitioning of the second right vertical block, other than the horizontal binary partitioning, can be signaled.

[0225] Figure 30 This is a diagram specifically illustrating the structure of a horizontally divided block according to an embodiment of the present invention. (See reference) Figure 30 (a) A 2Nx2N block can be divided into a first upper horizontal block UHB and a first lower horizontal block LHB, both of size 2NxN, using horizontal binary partitioning. In this case, the partitioning structure of the first lower horizontal block can be restricted based on the partitioning structure of the first upper horizontal block. For example, if the first upper horizontal block is partitioned vertically, the first lower horizontal block may not be allowed to be partitioned horizontally. This is because partitioning the first upper and lower horizontal blocks by vertical binary partitioning is the same as partitioning the 2Nx2N block into a quadtree structure. Furthermore, this is because it is possible to signal the quadtree partitioning within the 2Nx2N block. Therefore, when signaling the vertical binary partitioning of the first upper horizontal block, the partitioning of the first lower horizontal block, other than the vertical binary partitioning, can be signaled.

[0226] refer to Figure 30 (b) A 2NxN horizontal block can be divided into a second upper horizontal block and a second lower horizontal block of size 2N×(N / 2) by horizontal binary partitioning. In this case, the partitioning structure of the second lower horizontal block can be restricted based on the partitioning structure of the second upper horizontal block. For example, when the second upper horizontal block is partitioned vertically, the second lower horizontal block may not be allowed to be partitioned vertically. This is because partitioning the second upper and lower horizontal blocks by horizontal binary partitioning is the same as partitioning a 2NxN block by binary quad partitioning. Additionally, this is because it is possible to signal from the 2NxN node using BQ partitioning. Therefore, when signaling a vertical binary partition of the second upper horizontal block, the partitioning of the second lower horizontal block other than the vertical binary partitioning can be signaled.

[0227] As referenced above Figure 29 and 30 As described, according to embodiments of the present invention, the type of segmentation signaling for the current block can be limited based on the segmentation information of neighboring blocks. In this way, segmentation information of compilation tree units or compilation units can be efficiently transmitted via signals.

[0228] Figure 31 This is a diagram illustrating an embodiment of a method for determining the block scan order. Figure 31 (a) illustrates an embodiment of the scanning order of multiple nodes segmented from a 2Nx2N node. Here, a 2Nx2N node may include a CTU. The encoder and decoder may use the same scanning order for each other according to predefined rules. For example, when the corresponding node is segmented into four nodes by quadtree segmentation ((a)(1)), the encoding and decoding of the four blocks can be performed according to the Z-scan order, as follows. Figure 31 As shown in (a).

[0229] A node can be divided into multiple blocks using binary or ternary partitioning. For example... Figure 31 As shown in (a), when the corresponding nodes are segmented in the vertical direction ((a)(2), (4)), multiple blocks can be encoded and decoded sequentially from left to right (horizontal direction). Furthermore, when the corresponding nodes are segmented in the horizontal direction ((a)(3), (5)), multiple nodes can be encoded and decoded sequentially from top to bottom (vertical direction).

[0230] Figure 31 (b) illustrates an embodiment of the order for scanning multiple blocks segmented from a vertical block. For example... Figure 31 As shown in (3) of (b), when a vertical block is segmented by BQ segmentation, the encoding and decoding of four blocks can be performed according to the Z-scan order. When a vertical block is segmented in the vertical direction ((b)(1)), multiple blocks can be encoded and decoded sequentially from left to right (horizontal direction). Furthermore, when a vertical block is segmented in the horizontal direction ((b)(2), (4)), multiple nodes can be encoded and decoded sequentially from top to bottom (vertical direction).

[0231] Figure 31 (c) illustrates an embodiment of the order for scanning multiple blocks segmented from a horizontal block. For example... Figure 31 As shown in (3) of (c), when a vertical block is segmented by BQ segmentation, the encoding and decoding of four blocks can be performed according to the Z-scan order. When a horizontal block is segmented in the vertical direction ((c)(1), (4)), multiple blocks can be encoded and decoded sequentially from left to right (horizontal direction). Furthermore, when a horizontal block is segmented in the horizontal direction ((c)(2)), multiple nodes can be encoded and decoded sequentially from top to bottom (vertical direction).

[0232] Figure 31 (d) is a diagram illustrating an embodiment of a scanning sequence used to scan blocks segmented in various ways. Reference Figure 31 (d) of (1) divides a 2Nx2N block into two vertical blocks, and each vertical block can be divided by horizontal binary partitioning and horizontal ternary partitioning. According to the embodiment, the encoder and decoder scan the vertical blocks in a left-to-right order, but within each vertical block, a top-to-bottom scanning order can be used. Therefore, the encoder and decoder can scan in the order of the top node of the left vertical block, the bottom node of the left vertical block, the top node of the right vertical block, the middle node of the right vertical block, and the bottom node of the right vertical block.

[0233] According to another embodiment, a method that maintains the Z-scan order can be used. For example, the encoder and decoder can perform a Z-scan from the top-left block of the image, but only scan a specific block if the left-hand neighboring block of that specific block has been recovered. Specifically, Figure 31 (d) shows the scan sequence based on Z-scan. (2) to (4)

[0234] The above embodiments of the present invention can be implemented by various means. For example, the embodiments of the present invention can be implemented by hardware, firmware, software, or a combination thereof.

[0235] In the case of hardware implementation, the method according to the embodiments of the present invention can be implemented by one or more of the following: application-specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), field-programmable gate array (FPGA), processor, controller, microcontroller, microprocessor, etc.

[0236] When implemented via firmware or software, the method according to embodiments of the invention can be implemented in the form of modules, processes, or functions that perform the above-described functions or operations. Software code can be stored in memory and driven by a processor. The memory can be located inside or outside the processor and can exchange data with the processor in various known ways.

[0237] The above description of the present invention is for illustrative purposes only, and it will be understood that those skilled in the art to which this invention pertains can make changes to the invention without altering its technical concept or essential characteristics, and that the invention can be readily modified in other specific forms. Therefore, the above embodiments are illustrative and not limiting in any way. For example, each component described as a single entity can be distributed and implemented, and similarly, components described as distributed can also be implemented in an associated manner.

[0238] The scope of this invention is defined by the appended claims rather than the foregoing detailed description, and all changes or modifications derived from the meaning and scope of the appended claims and their equivalents shall be construed as being included within the scope of this invention.

Claims

1. A non-transitory computer-readable medium for storing a bitstream, said bitstream being decoded by a decoding method. in, The decoding method includes: Obtain a first reference sample subset, which includes multiple samples located at a first distance from the current block; Obtain a second reference sample subset, which includes multiple samples located at a second distance from the current block, the second distance being different from the first distance; Based on at least one of gradient, direction change, or sample value difference between samples in the first reference sample subset and samples in the second reference sample subset, calculate the correlation value between the first reference sample subset and the second reference sample subset. The intra-prediction mode for the current block is determined as an angle mode based on the correlation value, wherein the correlation value indicates the directional similarity between the first reference sample subset and the second reference sample subset; and The current block is reconstructed based on the intra-frame prediction mode. The intra-frame prediction mode is a prediction mode within the set of intra-frame prediction modes. Wherein, the intra-prediction modes in the intra-prediction mode set are some or all of the intra-prediction modes, and The intra-frame prediction mode set includes multiple angle modes.

2. An apparatus for decoding video signals, the apparatus comprising a processor, in, The processor is configured to: Obtain a first reference sample subset, which includes multiple samples located at a first distance from the current block; Obtain a second reference sample subset, which includes multiple samples located at a second distance from the current block, the second distance being different from the first distance; Based on at least one of gradient, direction change, or sample value difference between samples in the first reference sample subset and samples in the second reference sample subset, calculate the correlation value between the first reference sample subset and the second reference sample subset. Based on the correlation value, the intra-frame prediction mode for the current block is determined to be an angle mode, wherein the correlation value indicates the directional similarity between the first reference sample subset and the second reference sample subset; and The current block is reconstructed based on the intra-frame prediction mode. The intra-frame prediction mode is a prediction mode within the set of intra-frame prediction modes. Wherein, the intra-prediction modes in the intra-prediction mode set are some or all of the intra-prediction modes, and The intra-frame prediction mode set includes multiple angle modes.

3. An apparatus for encoding video signals, the apparatus comprising: processor, in, The processor is configured to: Obtain the bitstream that the decoder will use to decode it using the decoding method. The decoding method includes: Obtain a first reference sample subset, which includes multiple samples located at a first distance from the current block; Obtain a second reference sample subset, which includes multiple samples located at a second distance from the current block, the second distance being different from the first distance; Based on at least one of gradient, direction change, or sample value difference between samples in the first reference sample subset and samples in the second reference sample subset, calculate the correlation value between the first reference sample subset and the second reference sample subset. The intra-prediction mode for the current block is determined as an angle mode based on the correlation value, wherein the correlation value indicates the directional similarity between the first reference sample subset and the second reference sample subset; and The current block is reconstructed based on the intra-frame prediction mode. The intra-frame prediction mode is a prediction mode within the set of intra-frame prediction modes. Wherein, the intra-prediction modes in the intra-prediction mode set are some or all of the intra-prediction modes, and The intra-frame prediction mode set includes multiple angle modes.

4. A video signal processing method, the method comprising: Obtain a first reference sample subset, which includes multiple samples located at a first distance from the current block; Obtain a second reference sample subset, which includes multiple samples located at a second distance from the current block, the second distance being different from the first distance; Based on at least one of gradient, direction change, or sample value difference between samples in the first reference sample subset and samples in the second reference sample subset, calculate the correlation value between the first reference sample subset and the second reference sample subset. The intra-frame prediction mode for the current block is determined as an angle mode based on the correlation value, wherein the correlation value indicates the directional similarity between the first reference sample subset and the second reference sample subset; as well as The current block is reconstructed based on the intra-frame prediction mode. The intra-frame prediction mode is a prediction mode within the set of intra-frame prediction modes. Wherein, the intra-prediction modes in the intra-prediction mode set are some or all of the intra-prediction modes, and The intra-frame prediction mode set includes multiple angle modes.