Image encoding / decoding method and apparatus using intra prediction

By employing adaptive block segmentation and matrix-based intra-frame prediction methods, the problem of low image encoding/decoding efficiency in existing technologies is solved, resulting in more efficient image processing system performance.

CN121887982APending Publication Date: 2026-04-17GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2019-09-06
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing image encoding/decoding methods, the encoding/decoding efficiency needs to be improved, especially in image processing systems, where current technological research and development are insufficient to meet the performance and efficiency requirements.

Method used

An adaptive block segmentation and matrix-based intra-frame prediction method is adopted. By determining the intra-frame prediction mode, reference samples and matrix of the current block, downsampling and upsampling are performed to generate prediction blocks and perform interpolation.

Benefits of technology

By employing adaptive block segmentation and matrix-based intra-frame prediction, encoding/decoding efficiency is improved, thereby enhancing the performance of the image processing system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121887982A_ABST
    Figure CN121887982A_ABST
Patent Text Reader

Abstract

The present invention proposes an image encoding / decoding method and device using intra prediction, and a video signal processing method and device according to the present invention can determine an intra prediction mode of a current block, determine a reference sample for intra prediction of the current block, and decode an image on the basis of the intra prediction mode. And determining a predetermined matrix, and predicting the current block based on the reference sample and the matrix.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of Chinese patent application No. 201980056309.3, entitled "Image Coding / Decoding Method and Apparatus Using Intra-Frame Prediction", which entered the Chinese national phase of PCT international patent application PCT / KR2019 / 011554 filed on September 6, 2019. Technical Field

[0002] This invention relates to an image encoding / decoding method and apparatus. Background Technology

[0003] With the widespread adoption of the Internet and portable terminals, as well as the development of information and communication technologies, the use of multimedia data is increasing dramatically. Consequently, the need to improve the performance and efficiency of image processing systems in order to perform various services or tasks through image prediction in various systems is increasing significantly, but research and development results that can respond to this situation are insufficient.

[0004] Therefore, in existing image encoding / decoding methods and apparatuses, there is a need to improve image processing, especially the performance of image encoding or image decoding. Summary of the Invention

[0005] Technical issues This invention aims to improve encoding / decoding efficiency through adaptive block segmentation.

[0006] This invention aims to improve encoding / decoding efficiency through matrix-based intra-frame prediction.

[0007] The present invention provides a method and apparatus for determining reference samples and matrices for matrix-based intra-frame prediction.

[0008] This invention provides a method and apparatus for downsampling and upsampling for matrix-based intra-frame prediction.

[0009] Technical solution The video signal processing method and apparatus according to the present invention can determine the intra-prediction mode of the current block, determine the reference samples for intra-prediction of the current block, determine a predetermined matrix based on the intra-prediction mode, and predict the current block based on the reference samples and the matrix.

[0010] In the video signal processing method and apparatus according to the present invention, determining the reference sample may include: determining the adjacent regions of the current block and downsampling the determined adjacent regions.

[0011] In the video signal processing method and apparatus according to the present invention, the adjacent regions are divided into multiple sample groups, each sample group consisting of one or more samples, and the representative value of the sample group is determined as the reference sample. The representative value can be any one of the average value, minimum value, maximum value, mode, or median value.

[0012] In the video signal processing method and apparatus according to the present invention, the matrix is ​​determined by further considering the coding information of the current block, which may include the size, shape, angle or directionality of the intra-frame prediction mode of the current block.

[0013] In the video signal processing method and apparatus according to the present invention, predicting the current block may include: generating a prediction block by applying the matrix to the reference sample.

[0014] In the video signal processing method and apparatus according to the present invention, predicting the current block may further include: rearranging all or part of the prediction samples of the generated prediction block.

[0015] In the video signal processing method and apparatus according to the present invention, the prediction of the current block may further include: interpolating the current block based on the predicted block or at least one of the reconstructed samples adjacent to the current block.

[0016] Technical effect According to the present invention, encoding / decoding efficiency can be improved by segmenting tree-like structural blocks.

[0017] According to the present invention, encoding / decoding efficiency can be improved by matrix-based intra-frame prediction.

[0018] According to the present invention, encoding / decoding efficiency can be improved by downsampling or upsampling for matrix-based intra-frame prediction. Attached Figure Description

[0019] Figure 1 A schematic block diagram of an encoding device as an embodiment of the present invention is shown.

[0020] Figure 2 A schematic block diagram of a decoding apparatus as an embodiment of the present invention is shown.

[0021] Figure 3 A block segmentation type is shown as an embodiment of the present invention.

[0022] Figure 4 A tree-structure-based block segmentation method is shown as an embodiment of the present invention.

[0023] Figure 5The process of performing intra-frame prediction of the current block based on matrix is ​​shown as an embodiment of the present invention.

[0024] Figure 6 A method for determining a reference sample by downsampling adjacent regions is shown as an embodiment of the present invention.

[0025] Figure 7 A weighted average-based downsampling method is shown as an embodiment of the present invention.

[0026] Figure 8 The division of the first prediction sample and the interpolation method for the remaining regions are shown as an embodiment of the present invention.

[0027] Figure 9 The diagram illustrates the assignment of weight values ​​for distance in the interpolation step as an embodiment of the present invention.

[0028] Figure 10 The sequence of interpolation steps is shown as an embodiment of the present invention. Detailed Implementation

[0029] The video signal processing method and apparatus according to the present invention can determine the intra-prediction mode of the current block, determine the reference samples for intra-prediction of the current block, determine a predetermined matrix based on the intra-prediction mode, and predict the current block based on the reference samples and the matrix.

[0030] In the video signal processing method and apparatus according to the present invention, determining the reference sample may include: determining the adjacent regions of the current block; and downsampling the determined adjacent regions.

[0031] In the video signal processing method and apparatus according to the present invention, the adjacent regions are divided into multiple sample groups, each sample group consisting of one or more samples, and the representative value of the sample group is determined as the reference sample. The representative value can be any one of the average value, minimum value, maximum value, mode, or median value.

[0032] In the video signal processing method and apparatus according to the present invention, the matrix is ​​determined by further considering the coding information of the current block, which may include the size, shape, angle or directionality of the intra-frame prediction mode of the current block.

[0033] In the video signal processing method and apparatus according to the present invention, predicting the current block may include: generating a prediction block by applying the matrix to the reference sample.

[0034] In the video signal processing method and apparatus according to the present invention, predicting the current block may further include: rearranging all or part of the prediction samples of the generated prediction block.

[0035] In the video signal processing method and apparatus according to the present invention, the prediction of the current block may further include: interpolating the current block based on the predicted block or at least one of the reconstructed samples adjacent to the current block.

[0036] This invention can be modified in various ways and has multiple embodiments, with specific embodiments shown in the accompanying drawings and described in detail. However, it should be understood that these specific embodiments are not intended to limit the invention to the specific implementation, and include all modifications, equivalents, or substitutions within the scope of the invention's concept and technology. Similar reference numerals are used for similar constituent elements in the description of each drawing.

[0037] The terms "first," "second," etc., may be used to describe constituent elements, but the constituent elements should not be limited by these terms. These terms are used only to distinguish one constituent element from other constituent elements. For example, a first constituent element may be named a second constituent element without departing from the scope of the invention; similarly, a second constituent element may be named a first constituent element. The term "and / or" refers to a combination of the plurality of related items described or any one of the plurality of related items described.

[0038] When describing a component as "connected" or "linked" to another component, it should be understood that it can be directly connected or linked to the other component, or that there are other components between the component and the other component. Conversely, when describing a component as "directly connected" or "directly linked" to another component, it should be understood that there are no other components between the component and the other component.

[0039] The terminology used in this application is for illustrative purposes only and is not intended to limit the invention. Unless otherwise expressly indicated in the text, singular expressions include plural expressions. In this application, terms such as "comprising" or "having" should be understood as indicating the presence of features, numbers, steps, actions, constituent elements, parts, or combinations thereof described in the specification, and not as precluding the presence or additional possibility of one or more other features, numbers, steps, actions, constituent elements, parts, or combinations thereof.

[0040] Unless otherwise defined, all terms, including technical or scientific terms, shall have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. Terms as defined in commonly used dictionaries shall be interpreted as having the same meaning as in relevant technical literature, and their meanings, if not explicitly defined in this application, shall not be construed as ideal or overly formal.

[0041] Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the accompanying drawings. Hereinafter, the same reference numerals will be used for the same constituent elements in the drawings, and repeated descriptions of the same constituent elements will be omitted.

[0042] Figure 1 A schematic block diagram of an encoding device as an embodiment of the present invention is shown.

[0043] refer to Figure 1 The encoding device 100 may include: an image segmentation unit 110, a prediction unit 120, 125, a transformation unit 130, a quantization unit 135, a rearrangement unit 160, an entropy encoding unit 165, an inverse quantization unit 140, an inverse transformation unit 145, a filtering unit 150, and a memory 155.

[0044] Figure 1 The various components represented are shown separately to represent different feature functions in the image encoding apparatus, and this may indicate that each component is composed of separate hardware. However, for ease of description, each component is listed as a separate component and included therein, with at least two components in each component forming a single component, or a component being divided into multiple components to perform functions. Such comprehensive embodiments of the various components, as well as individual embodiments, are also included within the scope of the invention as long as they do not depart from the spirit of the invention.

[0045] Furthermore, some constituent elements may be optional components used only to improve performance, rather than essential components for performing the basic functions in this invention. This invention may be implemented by including only constituent parts that are essential to realizing the essence of the invention, other than those used only to improve performance. Structures including only essential constituent parts, other than optional components used only to improve performance, are also included within the scope of this invention.

[0046] The image segmentation unit 110 can segment the input image into at least one block. At this time, the block can represent a coding unit (CU), a prediction unit (PU), or a transform unit (TU). The segmentation can be performed based on at least one of a quadtree, a binary tree, or a ternary tree. A quadtree is a method of dividing an upper-level block into lower-level blocks having half the width and height of the upper-level block. A binary tree is a method of dividing an upper-level block into lower-level blocks having at least half the width or height of the upper-level block. In binary tree segmentation, by segmenting based on the aforementioned binary tree with half the height of the upper-level block, the block can not only have a square shape but also a non-square shape.

[0047] In the following embodiments of the present invention, the encoding unit can be used as a unit that performs encoding or as a unit that performs decoding.

[0048] Prediction units 120 and 125 may include an inter-frame prediction unit 120 for performing inter-frame prediction and an intra-frame prediction unit 125 for performing intra-frame prediction. The prediction unit determines whether to use inter-frame or intra-frame prediction, and can determine specific information based on each prediction method (e.g., intra-frame prediction mode, motion vector, reference image, etc.). In this case, the processing unit for performing prediction may differ from the processing unit for determining the prediction method and specific content. For example, the prediction method and prediction mode may be determined by the prediction unit, or the prediction may be performed by the transform unit. The residual value (residual block) between the generated prediction block and the original block can be input to the transform unit 130. Furthermore, in the entropy coding unit 165, prediction mode information, motion vector information, etc., used for prediction can be encoded along with the residual value and transmitted to the decoding device. When using a certain coding mode, the original block can also be encoded as is and transmitted to the decoding unit without generating a prediction block through the prediction units 120 and 125.

[0049] The inter-frame prediction unit 120 can predict prediction units based on information from at least one image in the previous or next image of the current image. Depending on the situation, it can also predict prediction units based on information from some regions that have been encoded in the current image. The prediction unit 120 may include a reference image interpolation unit, a motion prediction unit, and a motion compensation unit.

[0050] In the reference image interpolation unit, reference image information is provided by memory 155, and pixel information in units smaller than integer pixels can be generated in the reference image. For luminance pixels, in order to generate pixel information in units smaller than integer pixels at 1 / 4 pixel units, an 8-tap DCT-based interpolation filter with different filter coefficients can be used. For chrominance signals, in order to generate pixel information in units smaller than integer pixels at 1 / 8 pixel units, a 4-tap DCT-based interpolation filter with different filter coefficients can be used.

[0051] The motion prediction unit can perform motion prediction based on a reference image interpolated by the reference image interpolation unit. Various methods, such as FBMA (Full Search-based Block Matching Algorithm), TSS (Three-Step Search), and NTS (New Three-Step Search Algorithm), can be used to calculate motion vectors. Based on the interpolated pixels, the motion vector can have a motion vector value of 1 / 2 or 1 / 4 pixel units. The motion prediction unit can predict the current prediction unit using different motion prediction methods. Various methods, such as Skip, Merge, and Advanced Motion Vector Prediction (AMVP), can be used for motion prediction.

[0052] The intra-prediction unit 125 can generate prediction units based on reference pixel information adjacent to the current block, wherein the reference pixel information adjacent to the current block is pixel information in the current image. Since the adjacent blocks of the current prediction unit are blocks that have undergone inter-frame prediction, when the reference pixel is a pixel that has undergone inter-frame prediction, the reference pixel information included in the block that has undergone inter-frame prediction can be replaced with the reference pixel information of the adjacent intra-prediction block. That is, when the reference pixel is unavailable, the unavailable reference pixel information can be replaced with at least one of the available reference pixels.

[0053] Intra-frame prediction can employ directional prediction modes that use reference pixel information based on the prediction direction, and non-directional modes that do not use directional information during prediction. The mode used to predict the luma component can differ from the mode used to predict the chromatic aberration component, and the chromatic aberration component can be predicted using either the intra-frame prediction mode used for predicting the luma component or by utilizing the predicted / reconstructed luma component.

[0054] Intra-prediction methods generate prediction blocks after applying an Adaptive Intra Smoothing (AIS) filter to a reference pixel based on the intra-prediction mode. The types of AIS filters applied to the reference pixel can be different. To perform intra-prediction, the intra-prediction mode of the current prediction unit can be predicted from the intra-prediction modes of neighboring prediction units. When using mode information predicted from neighboring prediction units to predict the prediction mode of the current prediction unit, if the intra-prediction modes of the current and neighboring prediction units are the same, predetermined flag information can be used to transmit information indicating that the intra-prediction modes of the current and neighboring prediction units are the same. If the intra-prediction modes of the current and neighboring prediction units are different, entropy coding can be performed to encode the intra-prediction mode information of the current block.

[0055] Furthermore, prediction units 120 and 125 can generate residual information, which includes the difference between the generated prediction unit and the original block. The generated residual block can be input into transformation unit 130.

[0056] The transform unit 130 can use transforms of types such as DCT and DST to transform residual blocks including residual data. At this time, the transform type can be determined based on the intra-prediction mode of the prediction unit used to generate the residual block.

[0057] The quantization unit 135 can quantize the values ​​transformed into frequency regions by the transformation unit 130. The quantization coefficients can vary according to the block or the importance of the image. The values ​​calculated from the quantization unit 135 can be provided to the inquantization unit 140 and the rearrangement unit 160.

[0058] The rearrangement unit 160 can rearrange the coefficient values ​​of the quantized residual block. The rearrangement unit 160 can change the coefficients of the two-dimensional block shape into a one-dimensional vector shape using a coefficient scanning method. For example, the rearrangement unit 160 can use a predetermined scan type to scan from the DC coefficients to the coefficients in the high-frequency region to change them into a one-dimensional vector shape.

[0059] The entropy coding unit 165 can perform entropy coding based on the value calculated by the rearrangement unit 160. Entropy coding can use various coding methods, such as Exponential Golomb coding, CAVLC (Context-Adaptive Variable Length Coding), and Context-Adaptive Binary Arithmetic Coding (CABAC).

[0060] The entropy coding unit 165 can encode various information from the rearrangement unit 160 and the prediction units 120 and 125, such as residual coefficient information and block type information of coding units, prediction mode information, segmentation unit information, prediction unit information and transmission unit information, motion vector information, reference image information, block interpolation information, filtering information, etc.

[0061] The entropy coding unit 165 can entropy code the coefficient values ​​of the coding units input to the rearrangement unit 160.

[0062] The inverse quantization unit 140 and the inverse transform unit 145 inverse quantize the value quantized in the quantization unit 135 and inverse transform the value transformed in the transform unit 130. The residual value generated by the inverse quantization unit 140 and the inverse transform unit 145 can be merged with the predicted prediction unit through the motion estimation unit, motion compensation unit and intra-frame prediction unit included in the prediction units 120 and 125 to generate a reconstructed block.

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

[0064] Deblocking filters remove block distortion caused by boundaries between blocks in a reconstructed image. To determine whether to deblock, the number of pixels in several columns or rows within the block is used to decide whether to apply a deblocking filter to the current block. When applying a deblocking filter to a block, a strong or weak filter can be applied depending on the desired deblocking intensity. Furthermore, when applying a deblocking filter, horizontal and vertical filtering can be processed in parallel.

[0065] The offset correction unit can correct the offset from the original image in pixels for a deblocked image. To perform offset correction for a specific image, a method can be used that divides the pixels in the image into a certain number of regions, determines the region to be offset, and applies the offset to that region, or a method can be used that considers the edge information of each pixel and applies an applicable offset.

[0066] Adaptive Loop Filtering (ALF) can be performed based on a comparison between the filtered reconstructed image and the original image. After dividing the pixels in the image into predetermined groups, a filter suitable for each group is determined, and filtering can be applied differently to each group. Each coding unit (CU) can transmit a luminance signal to indicate whether ALF is applicable, and the shape and coefficients of the applicable ALF filter can be varied for each block. Furthermore, ALF filters of the same shape (fixed shape) can be applied regardless of the characteristics of the target block.

[0067] The memory 155 can store the reconstructed blocks or images calculated by the filtering unit 150. When inter-frame prediction is performed, the stored reconstructed blocks or images can be provided to the prediction units 120 and 125.

[0068] Figure 2 A schematic block diagram of a decoding apparatus as an embodiment of the present invention is shown.

[0069] refer to Figure 2 The decoding device 200 may include an entropy decoding unit 210, a rearrangement unit 215, an inverse quantization unit 220, an inverse transform unit 225, a prediction unit 230, 235, a filtering unit 240, and a memory 245.

[0070] Figure 2 The various components shown are illustrated separately to represent different functional features in the decoding device, and this may indicate that each component is composed of separate hardware. However, for ease of description, each component is listed as a separate component and included therein, with at least two components in each component grouped into one component, or a component may be divided into multiple components to perform functions. Such comprehensive embodiments of the various components, as well as individual embodiments, are also included within the scope of the invention as long as they do not depart from the spirit of the invention.

[0071] The entropy decoding unit 210 can perform entropy decoding on the input bitstream. For example, various methods such as Exponential Golomb coding, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding) can be applied for entropy decoding.

[0072] The entropy decoding unit 210 can decode information about intra-frame prediction and inter-frame prediction performed by the encoding device.

[0073] The rearrangement unit 215 can rearrange the bitstream that has been entropily decoded by the entropy decoding unit 210. It can reconstruct coefficients from one-dimensional vector form to two-dimensional block form for rearrangement. The rearrangement unit 215 can receive information about the coefficient scan performed by the encoding device and can perform rearrangement by performing a reverse scan based on the scan order performed by the encoding device.

[0074] The dequantization unit 220 can perform dequantization based on the quantization parameters and the coefficient values ​​of the rearranged blocks.

[0075] The inverse transform unit 225 can perform an inverse transform on the inverse-quantized transform coefficients with a predetermined transform type. At this time, the transform type can be determined based on at least one of the following information: prediction mode (inter-frame / intra-frame prediction), block size / shape, intra-frame prediction mode, component type (luminance / chrominance component), segmentation type (QT, BT, TT, etc.).

[0076] Prediction units 230 and 235 can generate prediction blocks based on prediction blocks provided by entropy decoding unit 210 and previously decoded block or image information provided by memory 245.

[0077] Prediction units 230 and 235 may include a prediction unit discrimination unit, an inter-frame prediction unit, and an intra-frame prediction unit. The prediction unit discrimination unit can receive various information, such as prediction unit information input from the entropy decoding unit 210, intra-frame prediction mode information of the intra-frame prediction method, and motion prediction information of the inter-frame prediction method, etc., and distinguish prediction units within the current coding unit (CU) to determine whether the prediction unit performs inter-frame prediction or intra-frame prediction. The inter-frame prediction unit 230 can utilize the information required for inter-frame prediction of the current prediction unit provided by the coding device, and perform inter-frame prediction for the current prediction unit based on information included in at least one of the previous or next images of the current image including the current prediction unit. Alternatively, inter-frame prediction can be performed in the current image including the current prediction unit based on information from some reconstructed regions. For this purpose, the reconstructed regions can be added to a reference image list.

[0078] To perform inter-frame prediction, based on the coding unit, it is possible to determine which of the following methods the prediction units included in the coding unit use for motion prediction: Skip Mode, Merge Mode, AMVP Mode, or Current Image Reference Mode.

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

[0080] When the prediction mode of the current prediction unit is a prediction unit that performs intra-frame prediction based on the values ​​of pixels interpolated from reference pixels, the reference pixel interpolation unit can interpolate the reference pixels to generate reference pixels with pixel units smaller than integer values. When the prediction mode of the current prediction unit is a prediction mode that generates prediction blocks without interpolating reference pixels, interpolation of reference pixels is not required. When the prediction mode of the current block is DC mode, the DC filter can generate prediction blocks through filtering.

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

[0082] The decoding unit can receive information from the encoding device regarding whether a deblocking filter should be applied to the block or image, and if so, information regarding whether a stronger or weaker filter was applied. The decoding unit can receive deblocking filter-related information provided by the encoding device and can then perform deblocking filtering on the block.

[0083] The offset correction unit can perform offset correction on the reconstructed image based on the offset correction type applicable to the image and offset value information during encoding.

[0084] ALF can be applied to coding units based on ALF applicability information and ALF coefficient information provided by the encoder. This ALF information can be provided by including it in a specific parameter set.

[0085] The memory 245 can store the reconstructed image or block as a reference image or reference block, and can provide the reconstructed image to the output unit.

[0086] Figure 3 A block segmentation type is shown as an embodiment of the present invention.

[0087] refer to Figure 3 You can obtain blocks from a to s based on the segmentation settings and segmentation method, or you can obtain additional block shapes that are not shown.

[0088] As an example (1), asymmetric partitioning can be used for tree-based partitioning. For example, for a binary tree, it could be blocks such as b, c, or blocks such as b~g. When the flag allowing asymmetric partitioning is not explicitly or implicitly activated according to the encoding / decoding settings, the available candidate blocks can be b or c. When the flag allowing asymmetric partitioning is activated, the available candidate blocks can be b, d, e (horizontal partitioning in this example) or c, f, g (vertical partitioning in this example).

[0089] In the example described, it is assumed that the length ratio of the asymmetric division of left:right or top:bottom is 1:3 or 3:1, but it is not limited to this. Candidate groups with other ratios may also exist depending on the encoding settings (e.g., 1:2, 1:4, 2:3, 2:5, 3:5, etc.).

[0090] The following shows various examples of the segmentation information generated in binary tree splits (candidate groups of 1:1, 1:3, and 3:1 in this example).

[0091] For example, in addition to flags indicating whether a segmentation has occurred and flags indicating the segmentation direction, a flag indicating the segmentation type can also be generated. In this case, the segmentation type can represent symmetric or asymmetric segmentation. When asymmetric segmentation is determined as the segmentation type, a flag indicating the segmentation ratio can be generated, and an index can be assigned based on a preset candidate group. If a 1:3 or 3:1 segmentation ratio is supported as a candidate group, the segmentation ratio can be selected using a 1-bit flag.

[0092] Alternatively, in addition to flags indicating whether to segment and flags indicating the segmentation direction, flags indicating the segmentation ratio can also be generated. In this example, as a candidate group for the segmentation ratio, candidates with a 1:1 symmetrical ratio can be included.

[0093] In this invention, it is assumed that (when the flag that allows asymmetric partitioning is activated) the binary tree partitioning has the structure as in the previous example, unless otherwise stated, the binary tree represents a symmetric binary tree.

[0094] As an example (2), for tree-based splitting, additional tree splitting is allowed. For example, splitting can be performed on ternary trees, quad-type trees, octa trees, etc., from which n split blocks can be obtained (3, 4, 8, n are integers in this example). For ternary trees, the supported blocks (when split into multiple blocks in this example) can be h~m; for quad-type trees, the supported blocks can be n~p; and for octa trees, the supported blocks can be q. Whether the tree-based splitting is supported can be implicitly determined based on the encoding / decoding settings or the relevant information can be explicitly generated. In addition, it can be used alone or in combination with binary tree, quad-tree splitting, etc., depending on the encoding / decoding settings.

[0095] For example, for a binary tree, blocks such as b and c can be used. When using a mixture of binary and ternary trees (assuming in this example that the scope of binary and ternary tree usage partially overlaps), blocks such as b, c, i, and l can also be used. When a flag that allows additional splits beyond the current tree is explicitly or implicitly deactivated based on the encoding / decoding settings, the available candidate blocks can be b or c. When activated, the available candidate blocks can be b, i or b, h, i, j (horizontal splits in this example), or c, l or c, k, l, m (vertical splits in this example).

[0096] In the example described, although the length ratio of the left:middle:right or top:middle:bottom of the ternary tree segment is assumed to be 2:1:1 or 1:2:1 or 1:1:2, it is not limited to this and other ratios can be set according to the encoding.

[0097] The following shows an example of the segmentation information generated for a ternary tree split (a 1:2:1 candidate in this example).

[0098] For example, in addition to flags indicating whether a split has occurred and flags indicating the direction of the split, flags indicating the type of split can also be generated. In this case, the split type can represent a binary tree or a ternary tree split.

[0099] In this invention, appropriate encoding / decoding settings can be applied according to the segmentation method.

[0100] As an example, the segmentation method can be determined based on the type of block. For instance, coded blocks and transform blocks can be segmented using quadtrees, while prediction blocks can be segmented using quadtrees and binary trees (or ternary trees, etc.).

[0101] As an example, the partitioning method can be determined based on the size of the block. For instance, a quadtree partitioning method can be used in some ranges between the maximum and minimum values ​​of the block (e.g., a×b~c×d, where the latter is larger), while a binary tree (or ternary tree, etc.) partitioning can be used in some ranges (e.g., e×f~g×h). In this case, the range information based on the partitioning method can be explicitly generated or implicitly determined, and can also be used when the ranges overlap.

[0102] As an example, the partitioning method can be determined based on the shape of the block (or the block before partitioning). For instance, when the block is square, it can be partitioned into quadtrees and binary trees (or ternary trees, etc.). Alternatively, when the block is rectangular, it can be partitioned based on binary trees (or ternary trees, etc.).

[0103] As an example, the partitioning settings can be determined based on the type of block. For instance, in tree-based partitioning, the coded block and prediction block can be partitioned using a quadtree, while the transform block can be partitioned using a binary tree. Alternatively, the allowed partitioning depth for the coded block can be set to m, the allowed partitioning depth for the prediction block can be set to n, and the allowed partitioning depth for the transform block can be set to o, where m, n, and o can be the same or different.

[0104] As an example, the partitioning settings can be determined based on the size of the block. For instance, some ranges of the block (e.g., a×b~c×d) can be partitioned using a quadtree, some ranges (e.g., e×f~g×h; in this example, it is assumed that c×d is greater than g×h) can be partitioned using a binary tree, and some ranges (e.g., i×j~k×l; in this example, it is assumed that g×h is greater than or equal to k×l) can be partitioned using a ternary tree. In this case, the range can include all ranges between the maximum and minimum values ​​of the block, and the ranges can have non-overlapping or overlapping settings. For example, the minimum value of some ranges may be the same as the maximum value of some ranges, or the minimum value of some ranges may be less than the maximum value of some ranges. If there are overlapping ranges, the partitioning method with the larger maximum value can have a priority order or information on which partitioning method to use can be explicitly generated. That is, in partitioning methods with a priority order, it can be determined whether to perform a partitioning method with a lower priority based on the partitioning result, or it can be determined which partitioning method to use based on partitioning method selection information.

[0105] As an example, the partitioning settings can be determined based on the shape of the block. For instance, a quadtree can be used to partition a square block. Alternatively, a binary or ternary tree can be used to partition a rectangular block.

[0106] As an example, the segmentation settings can be determined based on encoding / decoding information (e.g., slice type, color components, encoding mode, etc.). For instance, when the slice type is I, quadtree (or binary tree, ternary tree) segmentation can be used within a range (e.g., a×b~c×d); when the slice type is P, it can be used within a range (e.g., e×f~g×h); and when the slice type is B, it can be used within a range (e.g., i×j~k×l). Furthermore, when the slice type is I, the allowed segmentation depth for quadtree (or binary tree, ternary tree) segmentation can be set to m; when the slice type is P, the allowed segmentation depth can be set to n; and when the slice type is B, the allowed segmentation depth can be set to o. m, n, and o can be the same or different. Some slice types can have the same settings as other slices (e.g., P and B slices).

[0107] As another example, when the color component is a luminance component, the allowed depth of the quadtree (or binary tree, ternary tree) partition can be set to m, and when the color component is a chrominance component, it can be set to n. m and n can be the same or different. Furthermore, the range of the quadtree (or binary tree, ternary tree) partition when the color component is a luminance component (e.g., a×b~c×d) can be the same or different from the range of the quadtree (or binary tree, ternary tree) partition when the color component is a chrominance component (e.g., e×f~g×h).

[0108] As another example, when the encoding mode is Intra, the allowed depth of quadtree (or binary tree, ternary tree) partitioning can be m, and when the encoding mode is Inter, it can be n (assuming n is greater than m in this example). m and n can be the same or different. In addition, the range of quadtree (or binary tree, ternary tree) partitioning when the encoding mode is Intra can be the same or different from the range of quadtree (or binary tree, ternary tree) partitioning when the encoding mode is Inter.

[0109] For the example described, information regarding whether to support an adaptive segmentation candidate group structure based on encoded / decoded information can be generated explicitly or determined implicitly.

[0110] The example illustrates a scenario where the segmentation method and settings are determined based on encoding / decoding settings. The example represents some cases based on various factors, and variations are possible. Furthermore, the segmentation method and settings can also be determined based on a combination of multiple factors. For example, the segmentation method and settings can be determined by block type, size, shape, encoding / decoding information, etc.

[0111] Additionally, factors related to the segmentation method, settings, etc., in the examples can be implicitly determined or information can be explicitly generated to determine whether adaptive situations, such as those in the examples above, are allowed.

[0112] The segmentation depth in the segmentation settings represents the number of times the space is segmented based on the initial block (the segmentation depth of the initial block in this example is 0). A larger segmentation depth allows for smaller segments. This depth-related setting can be configured differently depending on the segmentation method. For example, in tree-based segmentation, the segmentation depth for binary trees can share the same depth as that for ternary trees, while the segmentation depth for quadtrees can be different from that for binary trees. The appropriate depth can be used depending on the type of tree.

[0113] When using individual split depths based on the tree type in the example, the split depth at the starting position of the tree split (the block before splitting in this example) can be set to 0. The split depth can be calculated centered on the starting split position, rather than based on the split range of each tree (the maximum value in this example).

[0114] Figure 4 A tree-structure-based block segmentation method is shown as an embodiment of the present invention.

[0115] In the diagram, thick solid lines represent basic coding blocks, thick dashed lines represent quadtree partition boundaries, double solid lines represent symmetric binary tree partition boundaries, solid lines represent ternary tree partition boundaries, and thin solid lines represent asymmetric binary tree partition boundaries. Except for the thick solid lines, all other lines represent boundaries defined according to the respective partitioning method. The partitioning settings described below (e.g., partition type, partition information, partition information configuration order, etc.) are not limited to the case in this example and various variations are also possible.

[0116] For ease of description, we assume that the top-left, top-right, bottom-left, and bottom-right blocks (N×N; 64×64) based on the basic coding block (2N×2N; 128×128) have their own block partitioning settings. First, we assume that four sub-blocks have been obtained due to a partitioning operation in the initial block (partition depth 0->1; that is, the partition depth increases by 1), and that for the quadtree partitioning settings, the maximum coding block is 128×128, the minimum coding block is 8×8, and the maximum partitioning depth is 4. This is the common setting applicable to all blocks.

[0117] (1st; top left block; A1~A6) This example illustrates a single-tree partitioning approach (a quadtree in this example). A block partitioning setting, such as maximum block size, minimum block size, and partition depth, determines the size and shape of the obtainable blocks. This example assumes a partitioning operation that yields only one block (two partitions horizontally and two vertically). The partitioning information required for a single operation (based on a 4M×4N block before partitioning, with the partitioning depth increased by 1) serves as a flag indicating whether to partition (0 in this example means no partitioning; 1 means partitioning). The possible candidates are 4M×4N and 2M×2N.

[0118] (2nd block; top right; A7~A11) This example demonstrates a scenario supporting multiple tree partitioning methods (quadtree and binary tree in this example). The size and shape of the obtainable blocks can be determined through multiple block partitioning settings. In this example, it is assumed that the maximum coded block for a binary tree is 64×64, and the minimum coded block is a block with a length of 4 and a maximum partitioning depth of 4.

[0119] This example assumes that there are more than two blocks obtainable from the split (2 or 4 in this example). The splitting information required for one splitting operation (increasing the quadtree splitting depth by 1) is a flag indicating whether to split, a flag indicating the splitting type, a flag indicating the splitting direction, and a flag indicating the splitting direction. The obtainable candidates can be 4M×4N, 4M×2N, 2M×4N, 4M×N / 4M×3N, 4M×3N / 4M×N, M×4N / 3M×4N, and 3M×4N / M×4N.

[0120] If the quadtree and binary tree segmentation ranges overlap (i.e., the ranges within which quadtree and binary tree segmentation can be performed in the current step), and the current block (the state before segmentation) is a block obtained by quadtree segmentation (a block obtained by quadtree segmentation within the parent block <when ​​the segmentation depth is 1 less than the current one>), the segmentation information can be distinguished and configured according to the following conditions. That is, when blocks supported according to various segmentation settings can be obtained by multiple segmentation methods, they can be classified in the following way to generate segmentation information.

[0121] (1) Cases where quadtree partitioning and binary tree partitioning overlap. Table 1

[0122] In the table, 'a' is a flag indicating whether a quadtree split is performed, with 1 indicating a quadtree split (QT). If the flag is 0, then 'b', which indicates whether a binary tree split is performed, is confirmed. If 'b' is 0, then no split is performed on this block (No Split); if 'b' is 1, then a binary tree split is performed.

[0123] `c` indicates the direction of the split. If `c` is 0, it indicates a horizontal split (`hor`); if `c` is 1, it indicates a vertical split (`ver`). `d` indicates the type of split. If `d` is 0, it indicates a symmetrical split (Symmetric Binary Tree, SBT); if `d` is 1, it indicates an asymmetrical split (Asymmetric Binary Tree, ABT). Only when `d` is 1 is the detailed split ratio information (1 / 4 or 3 / 4) for asymmetrical splits confirmed. When `d` is 0, the left / right block and the top block have a 1 / 4 ratio, and the right / bottom block has a 3 / 4 ratio. If `d` is 1, the opposite is true.

[0124] (2) Cases where only binary tree partitioning is possible In the table, segmentation information can be represented by the symbols b through e, excluding a.

[0125] against Figure 4 In block A7, since quadtree splitting can be performed in the pre-splitting blocks (A7~A11) (i.e., although quadtree splitting can be performed, binary tree splitting is performed instead of quadtree splitting), it belongs to the case of generating splitting information in (1).

[0126] Conversely, for A8 to A11, since binary tree partitioning instead of quadtree partitioning has already been performed in the blocks before partitioning (i.e., in this block...)<A8~A11> If the quadtree cannot be further divided, then it belongs to the case of generating the split information in (2).

[0127] (3rd; bottom left block; A12~A15) This example demonstrates a scenario supporting multiple tree partitioning methods (quadtree, binary tree, and ternary tree in this example). The size and shape of the achievable blocks can be determined through multiple block partitioning settings. In this example, it is assumed that the maximum coded block size for a binary / ternary tree is 64×64, and the minimum coded block size is a block with a length of 4 and a maximum partitioning depth of 4.

[0128] This example assumes that there are more than two blocks that can be obtained from the split (2, 3, or 4 blocks in this example). The splitting information required in one splitting operation is a flag indicating whether to split, a flag indicating the splitting type, and a flag indicating the splitting direction. The possible candidates are 4M×4N, 4M×2N, 2M×4N, 4M×N / 4M×2N / 4M×N, and M×4N / 2M×4N / M×4N.

[0129] If the partitioning ranges of a quadtree overlap with those of a binary / ternary tree, and the current block is a block obtained by partitioning a quadtree, the partitioning information can be distinguished and configured according to the following cases.

[0130] (1) Cases where quadtree partitioning overlaps with binary / ternary tree partitioning Table 2

[0131] In the table, 'a' is a flag indicating whether to perform a quadtree partition; a value of 1 indicates that a quadtree partition is performed. If the flag is 0, then 'b', which indicates whether to perform a binary or ternary tree partition, is confirmed. If 'b' is 0, no further partitioning is performed on that block; if 'b' is 1, a binary or ternary tree partition is performed.

[0132] c is used as a marker to indicate the direction of the split. If c is 0, it indicates a horizontal split; if c is 1, it indicates a vertical split. d is used as a marker to indicate the type of split. If d is 0, it indicates a binary tree split (BT); if d is 1, it indicates a ternary tree split (TT).

[0133] (2) Cases where only binary / ternary tree partitioning is possible In the table, segmentation information can be represented by the symbols b to d, excluding a.

[0134] against Figure 4 Blocks A12 and A15 in the middle belong to the case of generating split information in (1) because quadtree splitting can be performed in the blocks (A12~A15) before splitting.

[0135] Conversely, A13 and A14, as the case where the ternary tree segmentation has been performed in the pre-segmentation blocks (A13, A14) instead of the quadtree segmentation, belong to the case of generating segmentation information in (2).

[0136] (4th; bottom left block; A16~A20) This example demonstrates a scenario supporting multiple tree partitioning methods (quadtree, binary tree, and ternary tree in this example). The size and shape of the achievable blocks can be determined through multiple block partitioning settings. In this example, it is assumed that the maximum coded block size for a binary / ternary tree is 64×64, and the minimum coded block size is a block with a length of 4 and a maximum partitioning depth of 4.

[0137] This example assumes that there are more than two blocks that can be obtained from the segmentation (2, 3, or 4 blocks in this example). The segmentation information required for one segmentation operation is a flag indicating whether to perform segmentation, a flag indicating the segmentation category, a flag indicating the segmentation type, and a flag indicating the segmentation direction. The possible candidates are 4M×4N, 4M×2N, 2M×4N, 4M×N / 4M×3N, 4M×3N / 4M×N, M×4N / 3M×4N, 3M×4N / M×4N, 4M×N / 4M×2N / 4M×N, and M×4N / 2M×4N / M×4N.

[0138] If the partitioning ranges of a quadtree overlap with those of a binary / ternary tree, and the current block is a block obtained by partitioning a quadtree, the partitioning information can be distinguished and configured according to the following cases.

[0139] (1) Cases where quadtree partitioning overlaps with binary / ternary tree partitioning Table 3

[0140] In the table, 'a' is a flag indicating whether a quadtree split is performed; a value of 1 indicates that a quadtree split is performed. If the flag is 0, then 'b', which is used as a flag to indicate whether a binary tree split is performed, is confirmed. If 'b' is 0, then no further splitting is performed on this block; if 'b' is 1, then a binary or ternary tree split is performed.

[0141] `c` serves as a marker indicating the direction of the segmentation. If `c` is 0, it indicates a horizontal segmentation; if `c` is 1, it indicates a vertical segmentation. `d` serves as a marker indicating the segmentation category. If `d` is 0, it indicates a ternary tree segmentation; if `d` is 1, it indicates a binary tree segmentation. When `d` is 1, `e`, which serves as a marker for the segmentation type, is confirmed. A symmetrical segmentation is performed when `e` is 0, and an asymmetrical segmentation is performed when `e` is 1. When `e` is 1, detailed information about the segmentation ratio in asymmetrical segmentation is confirmed, which is the same as in the previous example.

[0142] (2) Cases where only binary / ternary tree partitioning is possible In the table, segmentation information can be represented by labels b through f, excluding a.

[0143] because Figure 4 If block A20 in the previous block (A16~A19) can be split into a quadtree, then it belongs to the case of generating split information in (1).

[0144] Conversely, for A16 to A19, which are the cases where binary tree segmentation has been performed instead of quadtree segmentation in the pre-segmentation blocks (A16~A19), they belong to the case of generating segmentation information in (2).

[0145] Figure 5The process of performing intra-frame prediction of the current block based on matrix is ​​shown as an embodiment of the present invention.

[0146] refer to Figure 5 The intra prediction mode (S500) for intra prediction of the current block can be determined.

[0147] When performing intra-frame prediction for the current block, the encoding / decoding device can determine the intra-frame prediction mode. The current block can be a coded block (CU), a prediction block (PU), a transform block (TU), or any of these word blocks.

[0148] (Example 1) The intra-prediction mode can be determined based on information from the transmitted signal. This information can specify any one of N predefined intra-prediction modes in the encoding / decoding device. The predefined intra-prediction modes represent all intra-prediction modes that can be used for the current block, and N can be a natural number less than or equal to 67 and greater than or equal to 11 (e.g., 67, 35, 11). Alternatively, the value of N can be determined based on the size of the current block. For example, if the current block is less than 8×8, N is determined to be 35; otherwise, N can be determined to be any one of 19 or 11.

[0149] (Example 2) The intra-frame prediction mode can also be determined by a pre-defined default mode or index in the encoding / decoding device. The default mode can be at least one of the following: Planar mode (index 0), DC mode (index 1), horizontal mode (index 18), vertical mode (index 50), and diagonal mode (index 2, 34, 66). The index corresponds to the case where there are 67 predefined intra-frame prediction modes, and different indices can be assigned to each mode based on the value of N.

[0150] (Example 3) The intra-frame prediction mode can be variably determined based on the encoding information. The encoding information can include not only information encoded and transmitted in the encoding device, but also information derived from the information transmitted in the decoding device. The encoding information may be information about at least one of the current block or neighboring blocks. Neighboring blocks include spatial and / or temporal neighboring blocks of the current block, where a spatially neighboring block can represent a block adjacent to at least one of the following layers: left-hand side, top-hand side, top-left side, bottom-left side, or top-right side of the current block.

[0151] The encoded information may include: block size / shape, block availability, segmentation type, number of segmentations, component type, prediction mode, information about intra-frame prediction modes, inter-frame modes, motion information, transform type, transform skip mode, information about non-zero residual coefficients, scan order, color format, loop filter information, etc. The block size can be represented by either width or height, the minimum / maximum value of width and height, the sum of width and height, the number of samples belonging to the block, etc. Block availability can be determined by considering block location, the range of parallel processing areas, decoding order, etc. The prediction mode can represent information indicating intra-frame or inter-frame modes. Information about the intra-frame prediction mode may include: whether the intra-frame prediction mode is non-directional, whether it is vertical / horizontal, the directionality of the intra-frame prediction mode, the number of predefined intra-frame prediction modes in the encoding / decoding device, etc. The inter-frame mode can represent information indicating merge / skip mode, AMVP mode, or current image reference mode. The current image reference mode represents the method of predicting the current block using the reconstructed region of the current image. The current image can be the image to which the current block belongs. The current image can be added to a list of reference images for inter-frame prediction, and can be arranged after a short-term or long-term reference image in the list. The motion information may include: prediction direction markers, motion vectors, reference image indexes, etc.

[0152] (Example 4) The intra-frame prediction mode can also be derived based on the MPM list and MPM index. The MPM list includes multiple MPMs, and the MPMs can be determined based on the intra-frame prediction modes of the spatial / temporal adjacent blocks of the current block. The number of MPMs is x, where x can be 3, 4, 5, 6, or a larger integer.

[0153] For example, the MPM list may include at least one of the intra-prediction modes of adjacent blocks: mode A, (mode An), (mode A+n), or the default mode. The value of n can be an integer of 1, 2, 3, 4, or greater. The adjacent blocks may represent the blocks adjacent to the left and / or upper layer of the current block. The default mode may be at least one of the Planar mode, DC mode, or a predetermined directional mode. The predetermined directional mode may include at least one of the following: horizontal mode (mode V), vertical mode (mode H), (mode Vk), (mode V+k), (mode Hk), or (mode H+k).

[0154] The MPM index can specify an MPM in the MPM list that has the same intra-prediction mode as the current block. In other words, the MPM specified by the MPM index can be set to the intra-prediction mode of the current block.

[0155] The intra-prediction mode of the current block can be selectively determined using any one of the aforementioned embodiments 1 to 4, and the intra-prediction mode of the current block can be determined based on at least two combinations of embodiments 1 to 4. A predetermined flag can be used for the selection, in which case the flag can be encoded by the encoding device and transmitted as a signal.

[0156] refer to Figure 5 Reference samples for intra-frame prediction of the current block can be determined (S510).

[0157] The reference sample can be derived from the adjacent regions of the current block. The adjacent regions of the current block can include at least one of the following: the left side, right side, top layer, bottom left layer, top left layer, bottom right layer, or top right layer of the current block.

[0158] The adjacent region may include one or more sample lines. Specifically, the number of sample lines belonging to the adjacent region is k, where k can be 1, 2, 3, 4, or a natural number greater than these. The value of k can be a fixed value predetermined in the encoding / decoding device, or it can be variably determined based on the aforementioned encoding information. For example, when the current block is of a first size (e.g., 4×4, 4×8, 8×4), the adjacent region can be configured with one sample line; when the current block is of a second size (e.g., 8×8, 16×16, etc.), the adjacent region can be configured with two sample lines. The sample lines can be determined in a vertical or horizontal direction based on the position of the adjacent region. Furthermore, the sample lines can be in contact with the current block, or they can be located at a predetermined distance away in the vertical and / or horizontal directions relative to the current block.

[0159] The plurality of sample lines exist continuously in the vertical and / or horizontal directions with the current block as a reference, or they may be separated by a predetermined distance. As an example, when there are two sample lines on the upper layer of the current block, the sample line from the bottommost layer upwards is named the first and second sample lines, respectively. In this case, the first and second sample lines may be in contact with each other or separated by a predetermined distance. The predetermined distance can be represented by i line lengths (i.e., width or height), where i can be 0, 1, 2, 3, or a larger natural number. As an example, when there are three sample lines on the upper layer of the current block, the sample lines from the bottommost layer upwards are named the first, second, and third sample lines, respectively. In this case, the first sample line may be in contact with the second sample line, and the second sample line may be in contact with the third sample line. Alternatively, the first and third sample lines may be separated by the aforementioned predetermined distance. In this case, the interval (d1) between the first and second sample lines may be the same as the interval (d2) between the second and third sample lines. Alternatively, d1 can be set to be greater than d2, or vice versa. As an example, when there are more than four sample lines above the current block, the four sample lines can be determined using the same method as in the case of three sample lines. Furthermore, this embodiment is applicable not only to sample lines located above the block but also to sample lines located on the left side; detailed descriptions are omitted here.

[0160] The reference sample can be derived by utilizing all or part of the samples belonging to the adjacent region.

[0161] (Example 1) Some samples in the adjacent region can be samples at pre-defined positions in the encoding / decoding device. The pre-defined positions can include at least one of the leftmost, rightmost, or middle samples of the upper sample line. Alternatively, the pre-defined positions can include at least one of the topmost, bottommost, or middle samples of the left sample line. Or, the pre-defined positions can include at least one of the odd-numbered samples of the upper and / or left sample lines. Alternatively, the pre-defined positions can also include samples with x-coordinates that are multiples of j in the samples of the upper sample line, or samples with y-coordinates that are multiples of j in the samples of the left sample line. Here, j can be 2, 3, 4, or a larger natural number.

[0162] (Example 2) Some samples in the adjacent regions can also be variably determined based on the encoding information. The encoding information is as described above, and a detailed description is omitted here.

[0163] Either embodiment 1 or 2 can be selectively used, or some samples can be specified based on a combination of embodiments 1 and 2. In this case, as mentioned above, the intervals between some samples can be set in the same way, but it is not limited to this, and the intervals between some samples can also be set differently.

[0164] The number of samples can be one, two, three, four, or more predefined in the encoding / decoding device. Furthermore, the number of samples can be defined differently for the left-side adjacent region and the upper-side adjacent region of the current block. For example, when the width of the current block is greater than its height, the number of samples belonging to the upper-side adjacent region (numSamA) can be greater than the number of samples belonging to the left-side adjacent region (numSamL). Conversely, when the width of the current block is less than its height, numSamA can be less than numSamL. Alternatively, the number of samples can be variably determined based on the aforementioned encoding information.

[0165] The samples in the adjacent regions can be either predicted samples or reconstructed samples. The predicted samples can be obtained through intra-frame prediction or inter-frame prediction. The reconstructed samples can be reconstructed samples before or after applying the loop filter.

[0166] On the other hand, the reference sample can be directly derived from samples in adjacent regions (CASE 1), or it can be derived by downsampling samples in adjacent regions (CASE 2). Either CASE 1 or CASE 2 can be selectively used. This selection can be based on the aforementioned encoding information. For example, if the size of the current block is less than a predetermined threshold, the reference sample can be derived based on CASE 1; otherwise, it can be derived based on CASE 2. The size can be represented by any one of the following: the width, height, the maximum / minimum value of the width and height, the ratio of width to height, or the product of width and height of the current block. As an example, if the current block is less than 8×8, the reference sample can be derived from samples in adjacent regions; otherwise, it can be derived by downsampling samples in adjacent regions. Regarding the downsampling method, the reference... Figure 6 and Figure 7 To learn more.

[0167] refer to Figure 5 The matrix used for matrix-based intra-frame prediction can be determined (S520).

[0168] The matrix can be determined based on at least one of the intra-prediction mode determined in step S500 or the size of the current block. Alternatively, the matrix can be determined by considering only the intra-prediction mode of the current block, or by considering only the size of the current block. The size can be represented by either width or height, a minimum / maximum value of width and height, the sum of width and height, the number of samples belonging to the current block, etc. However, it is not limited to this; the matrix can be further determined by considering encoding information about the current block. The encoding information is as described above, and a detailed description is omitted here.

[0169] Specifically, the pre-defined matrix in the encoding / decoding device can be divided into multiple matrix groups. These multiple matrix groups can be configured as a first matrix group, a second matrix group, ..., an m-th matrix group. Here, m can be a natural number of 2, 3, 4, 5, or larger. Based on the size of the current block, the current block can selectively utilize any one of the multiple matrix groups. For example, the first matrix group can be used when the current block size is 4×4, the second matrix group can be used when the current block size is 8×4, 4×8, or 8×8, and a third matrix group can be used in other cases. The matrix group selected based on the size of the current block can include one or more matrix candidates. Any one of the multiple matrix candidates can be determined by the matrix of the current block. This determination can be based on the coding information of the current block (e.g., intra-frame prediction mode).

[0170] The number of pre-agreed matrices can be the same as the number of predefined intra-prediction modes. Alternatively, the number of pre-agreed matrices can be less than the number of predefined intra-prediction modes. In this case, one matrix can match multiple intra-prediction modes. For example, one matrix can match two intra-prediction modes. In this case, the number of pre-agreed matrices can be half the number of predefined intra-prediction modes. However, this is not a limitation; the number of intra-prediction modes matching one matrix can be three, four, five, six, or more.

[0171] As an example, the matching can be determined by taking into account the directionality and / or symmetry of the intra-frame prediction mode.

[0172] Predefined intra-frame prediction modes can include directional modes with predetermined angles. These directional modes can be divided into a first group of modes with horizontal orientation and a second group of modes with vertical orientation. Assuming there are 65 directional modes, the first group can be configured to include modes between indices 2 and 34, and the second group can be configured to include modes between indices 34 and 66.

[0173] The encoding / decoding device defines a matrix only for the first mode group, and the second mode group can also utilize the matrix defined for the first mode group. Conversely, the encoding / decoding device defines a matrix only for the second mode group, and the first mode group can also utilize the matrix defined for the second mode group. In this case, the number of pre-defined matrices can be half the number of predefined intra-prediction modes. As an example, when there are x symmetric mode groups, the number of pre-defined matrices can be 1 / x the number of predefined intra-prediction modes. Here, x can be 3, 4, or more.

[0174] The symmetry can be based on an intra-prediction mode with a -45° angle, including the symmetry of prediction angles between vertically oriented modes and horizontally oriented modes. The oriented intra-prediction modes have prediction angles (PredAngle) according to each orientation. The vertically oriented modes can be based on the intra-prediction mode with the -45° angle, including modes with an angle of -45° < (PredAngle) ≤ 45° from that mode and modes along the x-axis from that mode. The horizontally oriented modes can be based on the intra-prediction mode with the -45° angle, including modes other than that mode with an angle of -45° < (PredAngle) ≤ 45° from that mode along the y-axis.

[0175] refer to Figure 5 The current block can be predicted based on reference samples and matrices (S530).

[0176] When a reference sample is determined in step S510 and a matrix is ​​determined in step S520, the encoding / decoding device can predict the current block based on the reference sample and the matrix.

[0177] The step of predicting the current block may include: applying the matrix to the reference sample to obtain a predicted sample of the DS block (hereinafter referred to as the first predicted sample). The DS block may represent the current block or a downsampled current block. That is, the DS block may have the same size as the current block, and the size of the current block may be 1 / 2, 1 / 4, 1 / 8, or 1 / 16 of its width or height. For example, when the current block is a 4×4, 4×8, or 8×4 block, the DS block may be a 4×4 block. Or, when the current block is an 8×8, 8×16, or 16×8 block, the DS block may be a 4×4 or 8×8 block. Or, when the current block is greater than or equal to 16×16, the DS block may be an 8×8 or 16×16 block. However, the DS block is not limited to a square block and may also be a non-square block. Alternatively, the DS block may be limited to a square block. The application of the matrix may include multiplying the reference sample by a weighted value obtained from the matrix.

[0178] The step of obtaining the first predicted sample may include at least one of the steps of adding an offset value or filtering.

[0179] The step of obtaining the first predicted sample may further include: rearranging the first predicted sample. This rearrangement may be limited to cases where multiple intra-frame prediction modes are matched within a single matrix.

[0180] Alternatively, the reordering can be performed when the intra-prediction mode of the current block belongs to a first mode group with horizontal orientation. For example, when the intra-prediction mode of the current block belongs to a first mode group with horizontal orientation, the first prediction samples for the DS block are reordered; when the intra-prediction mode of the current block belongs to a second mode group with vertical orientation, the first prediction samples for the DS block may not be reordered.

[0181] Conversely, the reordering can be performed when the intra-prediction mode of the current block belongs to the first mode group with vertical orientation. For example, when the intra-prediction mode of the current block belongs to the first mode group with horizontal orientation, the reordering of the first prediction samples for the DS block is not performed; when the intra-prediction mode of the current block belongs to the second mode group with vertical orientation, the reordering of the first prediction samples for the DS block can be performed.

[0182] The rearrangement can be performed as shown in Formula 1 below. Here, x can represent the x-axis coordinate value, and y can represent the y-axis coordinate value. In other words, the rearrangement can represent the process of assigning the first predicted sample with (x, y) coordinates to (y, x) coordinates.

[0183] [Formula 1] First predicted sample [x][y] = First predicted sample [y][x] Alternatively, the rearrangement according to the present invention can also represent the process of rotating the DS block composed of the first predicted sample at a predetermined angle. The predetermined angle can represent 90 degrees or 180 degrees clockwise, or 90 degrees or 180 degrees counterclockwise.

[0184] The step of predicting the current block may further include: upsampling the current block based on at least one of adjacent reconstructed samples or the first predicted sample to obtain a second predicted sample.

[0185] During the upsampling process, it can be determined whether to perform upsampling or at least one of the upsampling methods based on the encoding information of the current block. For example, it can be determined whether to perform upsampling or at least one of the upsampling methods based on the size of the DS block composed of the first predicted samples and the size of the current block. The block size can be represented by either width or height, the minimum / maximum value of width and height, the sum of width and height, the number of samples belonging to the block, etc.

[0186] The upsampling can be determined only if the size of the DS block composed of the first predicted samples is smaller than the size of the current block.

[0187] The upsampling method may include: allocating the first predicted sample to a predetermined position within the current block using the ratio of the size of the DS block formed by the first predicted sample to the size of the current block; and interpolating the remaining region within the current block. The remaining region may represent the region within the current block other than the region partitioned by the first predicted sample. (Refer to...) Figures 8 to 10 The partitioning of the first predicted sample and the interpolation method for the remaining regions are described in detail.

[0188] Figure 6 A method for determining a reference sample by downsampling adjacent regions is shown as an embodiment of the present invention.

[0189] refer to Figure 6 , Figure 6 (a) illustrates the case where the adjacent regions used for intra-frame prediction are located to the left and above the current block. Additionally, as an example, the sample line located to the left of the current block contacts the current block and consists of one sample line in the vertical direction. The sample line located above the current block contacts the current block and consists of one sample line in the horizontal direction.

[0190] The reference sample may include a downsampled region formed by downsampling the adjacent regions of the current block.

[0191] The downsampled region can be derived from the average, maximum, minimum, mode, or filtered values ​​of all or some samples belonging to the adjacent region.

[0192] When derived from the average value, the downsampling region can be formed by distributing the average values ​​of N different samples to the samples in the downsampling region.

[0193] The N different samples can be arranged consecutively or spaced apart by a certain interval. The interval is one or more times the size of a sample. When there are multiple intervals, they can be uniform or non-uniform. (Where N is greater than 2 and less than the total number of samples belonging to the adjacent regions.) Furthermore, the combination of the N different samples is called a sample group. In this case, the first sample group may overlap with the second sample group or may not overlap.

[0194] As an example, Figure 6 The diagram shows N = 2, with two non-overlapping sample groups. The average of the two samples belonging to each sample group is then distributed to one sample in the downsampling region for downsampling.

[0195] Alternatively, three consecutive samples (S1, S2, S3) can form a first sample group, and the average of the three samples belonging to the first sample group can be distributed among the samples in the downsampling region (DS1). Three consecutive samples (S2, S3, S4) can form a second sample group, and the average of the three samples belonging to the second sample group can be distributed among the samples in the downsampling region (DS2).

[0196] Alternatively, after determining the minimum or maximum value among the two samples (S1, S2) belonging to the first sample group, it can be assigned to the samples in the downsampling region (DS1). Similarly, after determining the minimum or maximum value among the two samples (S3, S4) belonging to the second sample group, it can be assigned to the samples in the downsampling region (DS2). The same method can be used when the first / second sample group consists of three samples.

[0197] Alternatively, in the upper adjacent region, samples at predefined positions belonging to the first sample group can be assigned to samples in the downsampling region (DS1), and samples at predefined positions belonging to the second sample group can be assigned to samples in the downsampling region (DS2). The predefined positions can represent fixed positions predetermined in the encoding / decoding device; for example, they can be any one of the leftmost, rightmost, or middle positions. In the left adjacent region, samples at predefined positions belonging to each sample group can also be assigned to samples in the downsampling region. In this case, the predefined positions can be any one of the topmost, bottommost, or middle positions.

[0198] Figure 7 A weighted average-based downsampling method is shown as an embodiment of the present invention.

[0199] In this embodiment, the average value can be calculated using the following formula (hereinafter referred to as the first average expression): The number of samples belonging to the sample group; Alternatively, it can be calculated using the following formula (hereinafter referred to as the second average expression): Sum (weighted value × number of samples belonging to the sample group) / number of samples.

[0200] Figure 7 (a) illustrates the case where the aforementioned sample group consists of 3 samples. In this case, the weighting applied to the 3 samples can be determined as a ratio of 1:2:1. Figure 7 As shown in (b), when the sample group consists of 5 samples, the weighting can be determined as a ratio of 1:1:4:1:1. Figure 7 As shown in (c), when the sample group consists of 6 samples, the weighting value can be determined as a ratio of 1:2:1:2:2:1 or 1:2:2:1:2:1 in the Z direction, starting from the upper left layer. Additionally, the... Figure 7 While (a) and (c) show the weighting values ​​applicable to the upper adjacent regions, this can also be applied to the left adjacent regions.

[0201] The average value may also include a result derived from applying a predetermined operation to multiple average values ​​calculated using the first average expression or the second average expression. The predetermined operation can be either the first average expression or the second average expression mentioned above. For example, if three samples (i.e., the first to the third samples) belong to a sample group, the average value between the first and second samples (first value) and the average value between the second and third samples (second value) can be calculated separately. The average value can be derived from the average value between the calculated first value and the second value.

[0202] The aforementioned downsampling method can be applied only to the upper adjacent region, or conversely, only to the left adjacent region. Alternatively, according to... Figure 6 The downsampling method (hereinafter referred to as the first method) can be applied to any one of the upper or left adjacent regions, according to Figure 7 The downsampling method (hereinafter referred to as the second method) can be applied to another region in the upper or left adjacent area.

[0203] Additionally, considering the size / shape of the current block, at least one of the first or second methods can be selectively used. For example, if the width of the current block is greater than a predetermined threshold, the first method can be applied to the upper adjacent region of the current block; otherwise, the second method can be applied. The height of the current block can also be downsampled in the same way. Alternatively, when the current block is not square, the first method can be applied to either the upper or left adjacent region, and the second method can be applied to the other region. In this case, if the width of the current block is greater than its height, the first method can be applied to the upper adjacent region, and the second method can be applied to the left adjacent region. Conversely, if the width of the current block is less than its height, the second method can be applied to the upper adjacent region, and the first method can be applied to the left adjacent region. When the current block is square, the same downsampling method can be used in the upper and left adjacent regions, where the downsampling method can also be limited to the first method.

[0204] Figure 8 The division of the first prediction sample and the interpolation method for the remaining regions are shown as an embodiment of the present invention.

[0205] refer to Figure 8 In (a), the predicted samples of the DS block can be assigned to the predicted samples at predetermined positions within the current block. These predetermined positions can be determined by considering the size ratio between the current block and the DS block. For example, the correspondence between the predicted samples of the DS block and the current block can be defined as shown in Equation 2 below.

[0206] [Formula 2] The first predicted sample curBLK[(x+1)×r-1][(y+1)×r-1] = the first predicted sample dsBLK[x][y] Where r represents the size ratio between the current block and the DS block, and x and y are the x-axis and y-axis coordinates of the first predicted sample within each DS block, respectively. The first predicted sample curBLK can represent the position of the first predicted sample within the current block, and the first predicted sample dsBLK can represent the position of the first predicted sample within the DS block.

[0207] The interpolation, reference Figure 8(b) can be used to derive samples (hereinafter referred to as interpolation object samples) that are not divided in the current block by the first predicted sample, which is partitioned to the current block, or reconstructed samples adjacent to the current block (hereinafter referred to as interpolation reference samples). Additionally, the interpolation reference samples may also include predicted samples generated by interpolation prior to the current interpolation object sample (i.e., the previous interpolation object sample).

[0208] The location and extent of the reconstructed samples adjacent to the current block are the same as those of the aforementioned reference samples, so their detailed description is omitted here.

[0209] Depending on the location of the interpolation object sample, the interpolation reference sample may consist of multiple first predicted samples, or it may consist of at least one first predicted sample and at least one reconstructed neighboring sample. The reconstructed neighboring samples may selectively utilize any one of samples having the same x-coordinate or y-coordinate as the interpolation object sample, or may utilize multiple samples whose x-coordinate or y-coordinate is at least the same as the interpolation object sample. This selection may be based on the location of the interpolation object sample. For example, if the interpolation object sample has the same x-coordinate as the first predicted sample, the reconstructed neighboring samples may only include samples with the same x-coordinate as the interpolation object sample. Conversely, if the interpolation object sample has the same y-coordinate as the first predicted sample, the reconstructed neighboring samples may only include samples with the same y-coordinate as the interpolation object sample. Alternatively, the reconstructed neighboring samples may also include multiple samples located on the same horizontal and vertical lines as the interpolation object sample.

[0210] The interpolation object sample can be derived from representative values ​​of multiple interpolation reference samples, wherein the representative value can include any one of the average, minimum, maximum, mode, or median value.

[0211] The average value can be calculated using the following formula (hereinafter referred to as the first average expression): Total difference reference samples / Number of difference reference samples; Alternatively, it can be calculated using the following formula (hereinafter referred to as the second average expression): Sum(weighted value × difference reference sample) / number of difference reference samples.

[0212] The weighted value, based on the second average expression, can be determined according to the relative / absolute distance between the interpolation object sample and the interpolation reference sample. Figure 9 Detailed description.

[0213] Figure 9 The diagram illustrates the assignment of weight values ​​for distance in the interpolation step as an embodiment of the present invention.

[0214] The weighting values ​​according to the present invention may include weighting values ​​determined based on the distance from the interpolation object sample to the interpolation reference sample. As an example, the reference... Figure 9 If interpolation is performed on the first interpolation object sample 910, since the distance ratio from the first interpolation object sample 910 to the first interpolation reference sample 911 and the second interpolation reference sample 912 is 3:1, the weighting ratio applicable to the first interpolation reference sample 911 and the second interpolation reference sample can be 1:3. If interpolation is performed on the second interpolation object sample 920, since the distance ratio from the second interpolation object sample 920 to each of the first interpolation reference samples 921 and the second interpolation reference samples 922 is 1:1, the weighting ratio applicable to the first interpolation reference samples and the second interpolation reference samples 921 and 922 can be 1:1.

[0215] Furthermore, the interpolation filter according to the present invention can be directional. The directionality may include vertical, horizontal, z-shaped, diagonal, and other directions.

[0216] The interpolation can be performed based on a predetermined priority order. This priority order can be either a first order (interpolation in the vertical direction followed by interpolation in the horizontal direction) or a second order (interpolation in the horizontal direction followed by interpolation in the vertical direction). Alternatively, interpolation can be performed simultaneously in both the vertical and horizontal directions (third order).

[0217] Interpolation of the current block can be performed using any one of the aforementioned first to third orders, or it can be performed using at least two combinations of the first to third orders. For details on the interpolation order, please refer to [link / reference needed]. Figure 10 Learn more.

[0218] Figure 10 The sequence of interpolation steps is shown as an embodiment of the present invention.

[0219] Figure 10 (a) is about Figure 9 The first order in the process is as follows: Specifically, the vertical line to which the first predicted sample belongs can be interpolated first, and then the horizontal line can be interpolated based on the interpolated line and the interpolated reference sample to the left of the current block.

[0220] Figure 10 (b) is about Figure 9 The second order in the process is as follows: Specifically, the horizontal line to which the first predicted sample belongs can be interpolated first, and then the vertical line can be interpolated based on the interpolated line and the interpolated reference sample above the current block.

[0221] Figure 10 (c) is about Figure 9The third step is to interpolate the vertical and horizontal lines to which the first predicted sample belongs. Then, interpolation is performed on the remaining samples that were not interpolated. This can be done on either the vertical or horizontal lines, or both simultaneously. If both vertical and horizontal lines are interpolated simultaneously, an interpolated sample can have both a first interpolated value on the vertical line and a second interpolated value on the horizontal line. In this case, a representative value between the first and second interpolated values ​​can be assigned to the interpolated sample. This representative value can be derived from the average, minimum, maximum, mode, or median.

[0222] The interpolation order can be a pre-agreed order in the encoding / decoding device, or it can be selectively determined based on the encoding information of the current block. The encoding information is as described above, therefore its detailed description is omitted.

[0223] The order can be determined based on the block size. The block size can be represented by either width or height, the minimum / maximum value of width and height, the sum of width and height, the number of samples belonging to the block, etc.

[0224] For example, if the size of the current block is greater than a predetermined threshold, the first interpolation can be performed; otherwise, the second interpolation can be performed. Conversely, if the size of the current block is less than the predetermined threshold, the second interpolation can be performed; otherwise, the first interpolation can be performed. The threshold can be 8, 16, 32, or a larger natural number.

Claims

1. A method of video decoding, the method comprising: include: Determine the reference sample line for the current block; Determine whether there exists a candidate intra-prediction mode that is the same as the intra-prediction mode of the current block; Based on the determined results, the intra-prediction mode of the current block is obtained; as well as Intra-frame prediction is performed on the current block based on the reference sample line and the intra-frame prediction mode; At least one of the candidate intra-prediction modes is: adding or subtracting the offset from the maximum value of the intra-prediction modes of the upper adjacent block and the intra-prediction modes of the left adjacent block of the current block. Determine whether to divide the current block into multiple sub-blocks. When the current block is divided into multiple sub-blocks, the multiple sub-blocks share an intra-prediction mode; The horizontal transformation type of the sub-block is determined based on the width of the sub-block of the current block, and the vertical transformation type of the sub-block is determined based on the height of the sub-block of the current block.

2. The video decoding method according to claim 1, characterized in that, When the difference between the intra-prediction mode of the upper adjacent block and the intra-prediction mode of the left adjacent block is 64, at least one of the candidate intra-prediction modes is: adding or subtracting 2 from the maximum value.

3. The video decoding method according to claim 1, characterized in that, The number of candidate intra-frame prediction modes varies depending on the index of the reference sample line.

4. The video decoding method according to claim 1, characterized in that, For some of the sub-blocks, skip the inverse transformation.

5. The video decoding method according to claim 1, characterized in that, The horizontal and vertical transformation types of the sub-blocks are determined based on their shapes.

6. A video encoding method, characterized in that, include: Determine the reference sample line for the current block; Determine whether there exists a candidate intra-prediction mode that is the same as the intra-prediction mode of the current block; Based on the determined results, the intra-prediction mode of the current block is obtained; as well as Intra-prediction is performed on the current block based on the reference sample line and the intra-prediction mode. At least one of the candidate intra-prediction modes is: adding or subtracting the offset from the maximum value of the intra-prediction modes of the upper adjacent block and the intra-prediction modes of the left adjacent block of the current block. Determine whether to divide the current block into multiple sub-blocks. When the current block is divided into multiple sub-blocks, the multiple sub-blocks share an intra-prediction mode; The horizontal transformation type of the sub-block is determined based on the width of the sub-block of the current block, and the vertical transformation type of the sub-block is determined based on the height of the sub-block of the current block.

7. The video encoding method according to claim 6, characterized in that, When the difference between the intra-prediction mode of the upper adjacent block and the intra-prediction mode of the left adjacent block is 64, at least one of the candidate intra-prediction modes is: adding or subtracting 2 from the maximum value.

8. The video encoding method according to claim 6, characterized in that, The number of candidate intra-frame prediction modes varies depending on the index of the reference sample line.

9. The video encoding method according to claim 6, characterized in that, For some of the sub-blocks among the plurality of sub-blocks, the transformation is skipped.

10. The video encoding method according to claim 6, characterized in that, The horizontal and vertical transformation types of the sub-blocks are determined based on their shapes.

11. A video decoding device, characterized in that, include: A device for determining the reference sample line of the current block; A means for determining whether there exists a candidate intra-prediction mode that is the same as the intra-prediction mode of the current block; An apparatus for obtaining the intra-prediction mode of the current block based on the determined result; as well as A means for performing intra-frame prediction of the current block based on the reference sample line and the intra-frame prediction mode; Wherein, at least one of the candidate intra-prediction modes is: adding or subtracting the offset from the maximum value of the intra-prediction modes of the upper adjacent block and the intra-prediction modes of the left adjacent block of the current block. A means for determining whether to divide the current block into multiple sub-blocks. When the current block is divided into multiple sub-blocks, the multiple sub-blocks share an intra-prediction mode; The horizontal transformation type of the sub-block is determined based on its width, and the vertical transformation type of the sub-block is determined based on its height.

12. The video decoding apparatus according to claim 11, characterized in that, When the difference between the intra-prediction mode of the upper adjacent block and the intra-prediction mode of the left adjacent block is 64, at least one of the candidate intra-prediction modes is: adding or subtracting 2 from the maximum value.

13. The video decoding apparatus according to claim 11, characterized in that, The number of candidate intra-frame prediction modes varies depending on the index of the reference sample line.

14. The video decoding apparatus according to claim 11, characterized in that, For some of the sub-blocks, skip the inverse transformation.

15. The video decoding apparatus according to claim 11, characterized in that, The horizontal and vertical transformation types of the sub-blocks are determined based on their shapes.

16. A video encoding apparatus, characterized in that, include: A device for determining the reference sample line of the current block; A means for determining whether there exists a candidate intra-prediction mode that is the same as the intra-prediction mode of the current block; An apparatus for obtaining the intra-prediction mode of the current block based on the determined result; as well as An apparatus for performing intra-frame prediction of the current block based on the reference sample line and the intra-frame prediction mode. At least one of the candidate intra-prediction modes is: adding or subtracting the offset from the maximum value of the intra-prediction modes of the upper adjacent block and the intra-prediction modes of the left adjacent block of the current block. A means for determining whether to divide the current block into multiple sub-blocks. When the current block is divided into multiple sub-blocks, the multiple sub-blocks share an intra-prediction mode; The horizontal transformation type of the sub-block is determined based on its width, and the vertical transformation type of the sub-block is determined based on its height.

17. The video encoding apparatus according to claim 16, characterized in that, When the difference between the intra-prediction mode of the upper adjacent block and the intra-prediction mode of the left adjacent block is 64, at least one of the candidate intra-prediction modes is: adding or subtracting 2 from the maximum value.

18. The video encoding apparatus according to claim 16, characterized in that, The number of candidate intra-frame prediction modes varies depending on the index of the reference sample line.

19. The video encoding apparatus according to claim 16, characterized in that, For some of the sub-blocks among the plurality of sub-blocks, the transformation is skipped.

20. The video encoding apparatus according to claim 16, characterized in that, The horizontal and vertical transformation types of the sub-blocks are determined based on their shapes.

21. A computer-readable recording medium includes program instructions that, when executed by a computer component, perform the video decoding method according to any one of claims 1-5.

22. A computer-readable recording medium includes program instructions that, when executed by a computer component, perform the video encoding method according to any one of claims 6-10.

23. A method for transmitting a code stream, characterized in that, The video encoding method according to any one of claims 6-10 is used to generate a bitstream; and the bitstream is transmitted.

24. A method for receiving a code stream, characterized in that, Receive the bitstream and perform the video decoding method according to any one of claims 1-5 to decode the bitstream to generate a video or image.