Video coding method and apparatus using derivation of intra prediction mode

By using the reconstructed neighboring reference sample values ​​to deduce the intra-frame prediction mode of the current block and generate prediction blocks, the problem of insufficient encoding and decoding efficiency for high-resolution and high-frame-rate video data is solved, and more efficient video encoding and decoding is achieved.

CN122270909APending Publication Date: 2026-06-23HYUNDAI MOTOR CO LTD +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HYUNDAI MOTOR CO LTD
Filing Date
2024-11-25
Publication Date
2026-06-23

Smart Images

  • Figure CN122270909A_ABST
    Figure CN122270909A_ABST
Patent Text Reader

Abstract

A video coding method using derivation of intra prediction mode is disclosed. The method comprises the steps of deriving an intra prediction mode for a current block using reconstructed neighboring reference sample values, and generating a prediction block for the current block based on the derived intra prediction mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to video encoding and decoding. More specifically, this invention relates to video encoding and decoding methods and apparatus that utilize intra-frame prediction mode derivation. Background Technology

[0002] The statements in this section are merely background information relating to the present invention and do not necessarily constitute prior art.

[0003] Assuming that video data is much larger in volume than audio or still image data, unprocessed or uncompressed video data requires significant hardware resources (including memory) to store or transmit in its raw form.

[0004] Accordingly, when storing or transmitting video data, an encoder is typically used to compress the video data for storage or transmission, and a decoder receives the compressed video data and performs decompression and reconstruction. Such video compression technologies include H.264 / AVC, High Efficiency Video Coding (HEVC), and Versatile Video Coding (VVC), which offers approximately 30% or more improvement in coding efficiency compared to HEVC.

[0005] However, as video size, resolution, and frame rate continue to increase, and the amount of data that needs to be encoded and decoded increases accordingly, there is a need for new compression techniques that are more efficient in encoding and decoding and more effective in improving video quality than existing compression techniques. Summary of the Invention

[0006] Technical issues This invention aims to provide a video encoding and decoding method and apparatus that uses reconstructed neighboring reference sample values ​​to derive the intra-frame prediction mode of the current block, and then generates a prediction block of the current block based on the derived prediction mode to solve these problems.

[0007] The problems that this invention aims to solve are not limited to those mentioned above, and other problems not mentioned will be clearly understood by those skilled in the art through the following description.

[0008] Technical solution At least one aspect of the present invention provides a video decoding method for generating a prediction block for a current block. The video decoding method includes determining the size of a sampling unit for gradient calculation based on the size or area of ​​the current block. The video decoding method further includes calculating the gradient of the determined-size sampling unit within a gradient calculation region containing reconstructed reference samples surrounding the current block, and generating a histogram of directional prediction patterns corresponding to the gradient. The video decoding method further includes deriving at least one or more dominant prediction patterns based on the histogram, and generating the prediction block for the current block by utilizing at least one or more dominant prediction patterns.

[0009] Another aspect of the invention provides a video coding method for generating a prediction block for a current block. The video coding method includes determining the size of sampling units for gradient calculation based on the size or area of ​​the current block. The video coding method further includes calculating the gradient of the determined-size sampling units within a gradient calculation region containing reconstructed reference samples surrounding the current block, and generating a histogram of directional prediction patterns corresponding to the gradients. The video coding method also includes deriving at least one or more dominant prediction patterns based on the histogram, and generating the prediction block for the current block by utilizing at least one or more dominant prediction patterns.

[0010] Another aspect of the present invention provides a method for storing or transmitting a bitstream generated by the video encoding method described above.

[0011] Another aspect of the present invention provides a computer-readable recording medium that stores a bitstream generated by the video encoding method described above.

[0012] Beneficial effects As described above, the present invention provides a video encoding / decoding method and apparatus that utilizes reconstructed neighboring reference sample values ​​to derive the intra-frame prediction mode of the current block, and then generates a prediction block for the current block based on the derived prediction mode. Therefore, the video encoding / decoding method and apparatus improve video encoding / decoding efficiency.

[0013] The effects that can be obtained by using the present invention are not limited to those described above, and other unmentioned effects will be clearly understood by those skilled in the art from the following description. Attached Figure Description

[0014] Figure 1 This is a block diagram of a video encoding device that can implement the technology of this invention.

[0015] Figure 2 This demonstrates a method for partitioning blocks using a quadtree plus binary tree ternary tree (QTBTTT) structure.

[0016] Figure 3a and Figure 3bMultiple intra-prediction modes, including the wide-angle intra-prediction mode, are shown.

[0017] Figure 4 Show the adjacent blocks of the current block.

[0018] Figure 5 This is a block diagram of a video decoding device that can implement the technology of this invention.

[0019] Figure 6 This is a block diagram showing in detail a portion of a video decoding apparatus according to at least one embodiment of the present invention.

[0020] Figure 7 This is a schematic diagram illustrating a gradient calculation region for calculating gradient values ​​according to at least one embodiment of the present invention.

[0021] Figures 8a to 8c This is a schematic diagram illustrating various implementations of a method for forming sampling units for applying gradient operators.

[0022] Figure 9 This is a schematic diagram showing the directional patterns corresponding to the gradients of some sampling units.

[0023] Figures 10a to 10c This is a schematic diagram illustrating various examples of dividing the gradient computation region into multiple regions.

[0024] Figure 11 This is a flowchart of an intra-frame prediction method derived using a prediction mode according to at least one embodiment of the present invention. Detailed Implementation

[0025] In the following description, some embodiments of the invention will be described in detail with reference to the accompanying illustrative drawings. In the description below, the same reference numerals denote the same elements, although the elements are shown in different drawings. Furthermore, in the following description of some embodiments, detailed descriptions of relevant known components and functions may be omitted for clarity and brevity when it is considered that such detailed descriptions obscure the subject matter of the invention.

[0026] Figure 1 This is a block diagram of a video encoding apparatus that can implement the technology of this invention. In the following text, reference is made to… Figure 1 The diagram illustrates the video encoding apparatus and its components.

[0027] The encoding device may include: an image segmenter 110, a predictor 120, a subtractor 130, a transformer 140, a quantizer 145, a rearrangement unit 150, an entropy encoder 155, an inverse quantizer 160, an inverse transformer 165, an adder 170, a loop filter unit 180, and a memory 190.

[0028] Each component of the encoding device can be implemented as hardware or software, or a combination of hardware and software. Furthermore, the function of each component can be implemented as software, and the microprocessor can be implemented to execute the software functions corresponding to each component.

[0029] A video consists of one or more sequences of images. Each image is segmented into multiple regions, and encoding is performed on each region. For example, an image is segmented into one or more tiles and / or slices. Here, one or more tiles can be defined as a tile group. Each tile and / or slice is segmented into one or more coding tree units (CTUs). Additionally, each CTU is segmented into one or more coding units (CUs) through a tree structure. Information applied to each coding unit (CU) is encoded as the syntax of the CU, and information commonly applied to CUs included in a CTU is encoded as the syntax of the CTU. Furthermore, information commonly applied to all blocks within a slice is encoded as the syntax of the slice header, while information applied to all blocks constituting one or more images is encoded as a Picture Parameter Set (PPS) or picture header. Moreover, information commonly referenced by multiple images is encoded as a Sequence Parameter Set (SPS). Additionally, information commonly referenced by one or more SPSs is encoded as a Video Parameter Set (VPS). Furthermore, information commonly applied to a tile or tile group can also be encoded as the syntax of the tile or tile group header. The syntax included in SPS, PPS, slice headers, and tile or tile group headers can be called high-level syntax.

[0030] Image splitter 110 determines the size of the coding tree unit (CTU). Information about the size of the CTU (CTU dimensions) is encoded into SPS or PPS syntax and transmitted to the video decoding device.

[0031] Image segmenter 110 segments each image constituting the video into multiple coding tree units (CTUs) of a predetermined size, and then recursively segments the CTUs using a tree structure. The leaf nodes in the tree structure become coding units (CUs), which are the basic units of coding.

[0032] A tree structure can be a quadtree (QT), where a higher node (or parent node) is split into four lower nodes (or child nodes) of the same size. A tree structure can also be a binary tree (BT), where a higher node is split into two lower nodes. A tree structure can also be a ternary tree (TT), where a higher node is split into three lower nodes in a 1:2:1 ratio. A tree structure can also be a combination of two or more of the following structures: QT, BT, and TT. For example, a quadtree plus binary tree (QTBT) structure can be used, or a quadtree plus binary tree ternary tree (QTBTTT) structure can be used. Here, a binary tree ternary tree (BTTT) is added to the tree structure to form a multiple-type tree (MTT).

[0033] Figure 2 This is a schematic diagram illustrating a method for segmenting blocks using a QTBTTT structure.

[0034] like Figure 2 As shown, the CTU can first be segmented into a QT structure. Quadtree segmentation can be recursive until the size of the segmented blocks reaches the minimum block size (MinQTSize) allowed for leaf nodes in the QT. The entropy encoder 155 encodes a first flag (QT_split_flag) indicating whether each node of the QT structure is segmented into the four nodes below it and signals this flag to the video decoding device. When the leaf node of the QT is not larger than the maximum block size (MaxBTSize) allowed for the root node in the BT, the leaf node can be further segmented using at least one of the BT or TT structures. Multiple segmentation directions can exist in the BT and / or TT structures. For example, two directions can exist: a horizontal direction for segmenting the blocks of the corresponding node and a vertical direction for segmenting the blocks of the corresponding node. Figure 2 As shown, when MTT splitting begins, the entropy encoder 155 encodes a second flag (mtt_split_flag) indicating whether a node has been split, as well as a flag indicating the splitting direction (vertical or horizontal) and / or the splitting type (binary or ternary) if the node has been split, and signals this to the video decoding device.

[0035] Alternatively, before encoding the first flag (QT_split_flag) indicating whether each node has been split into the four lower-level nodes, the CU split flag (split_cu_flag) indicating whether a node has been split can also be encoded. When the value of the CU split flag (split_cu_flag) indicates that each node has not been split, the block of the corresponding node becomes a leaf node in the split tree structure and becomes a CU, which is the basic unit of encoding. When the value of the CU split flag (split_cu_flag) indicates that each node has been split, the video encoding device begins encoding the first flag using the above scheme.

[0036] When QTBT is used as another example of a tree structure, two types can exist: one where the corresponding node's block is horizontally divided into two blocks of the same size (i.e., symmetrical horizontal division), and the other where the corresponding node's block is vertically divided into two blocks of the same size (i.e., symmetrical vertical division). The entropy encoder 155 encodes a split flag (split_flag) indicating whether each node of the BT structure is divided into blocks of the lower layer, and split type information indicating the split type, and transmits this information to the video decoding device. Alternatively, the type where the corresponding node's block is divided into two blocks that are asymmetrically divided can also exist. Asymmetrical forms can include the form where the corresponding node's block is divided into two rectangular blocks with a size ratio of 1:3, or it can also include the form where the corresponding node's block is divided diagonally.

[0037] The CU can have various sizes depending on the QTBT or QTBTTT segmentation from the CTU. In the following text, the block corresponding to the CU to be encoded or decoded (i.e., the leaf node of the QTBTTT) is called the "current block". When using QTBTTT segmentation, the current block can also be rectangular in shape in addition to a square shape.

[0038] Predictor 120 predicts the current block to generate a prediction block. Predictor 120 includes an intra-frame predictor 122 and an inter-frame predictor 124.

[0039] Typically, each block of the current image can be predicted and encoded. This prediction can usually be performed using either intra-frame prediction (which utilizes data from the image containing the current block) or inter-frame prediction (which utilizes data from an image encoded before the image containing the current block). Inter-frame prediction includes both one-way and two-way prediction.

[0040] Intra-predictor 122 predicts pixels in the current block by utilizing pixels (reference pixels) that are adjacent to the current block in the current image, including the current block. Depending on the prediction direction, multiple intra-prediction modes exist. For example, such as... Figure 3aAs shown, multiple intra-frame prediction modes can include two non-directional modes: Planar mode and DC mode, and can include 65 directional modes. The neighboring pixels and algorithm equations to be used are defined differently for each prediction mode.

[0041] To perform efficient orientation prediction for the current block with a rectangular shape, additional methods can be used. Figure 3b The directional modes indicated by the dashed arrows (intra-prediction modes #67 to #80, #-1 to #-14) can be referred to as "wide-angle intra-prediction modes." Figure 3b In the diagram, the arrow indicates the corresponding reference sample used for prediction, not the prediction direction. The prediction direction is opposite to the direction indicated by the arrow. When the current block has a rectangular shape, the wide-angle intra-frame prediction mode is a mode that performs prediction in the opposite direction to a specific directional mode without additional bit transmission. In this case, in the wide-angle intra-frame prediction mode, some wide-angle intra-frame prediction modes available for the current block can be determined by the ratio of the width to the height of the current block with a rectangular shape. For example, when the current block has a rectangular shape with a height less than its width, wide-angle intra-frame prediction modes with angles less than 45 degrees (intra-frame prediction modes #67 to #80) are available. When the current block has a rectangular shape with a width greater than its height, wide-angle intra-frame prediction modes with angles greater than -135 degrees (intra-frame prediction modes #-1 to #-14) are available.

[0042] Intra-predictor 122 can determine the intra-prediction to be used for encoding the current block. In some examples, intra-predictor 122 can encode the current block by utilizing multiple intra-prediction modes, and can also select the appropriate intra-prediction mode to use from test modes. For example, intra-predictor 122 can calculate rate-distortion values ​​by utilizing rate-distortion analysis of multiple test intra-prediction modes, and can also select the intra-prediction mode with the best rate-distortion characteristics from the test modes.

[0043] Intra-predictor 122 selects one intra-prediction mode from multiple intra-prediction modes and predicts the current block by utilizing neighboring pixels (reference pixels) determined according to the selected intra-prediction mode and an algorithmic equation. Entropy encoder 155 encodes the information about the selected intra-prediction mode and transmits it to the video decoding device.

[0044] Inter-frame predictor 124 generates a predicted block for the current block by utilizing motion compensation processing. Inter-frame predictor 124 searches for the most similar block to the current block in a reference image that was encoded and decoded earlier than the current image, and generates the predicted block for the current block using the searched block. Additionally, a motion vector (MV) is generated, corresponding to the displacement between the current block in the current image and the predicted block in the reference image. Typically, motion estimation is performed on the luma component, and the motion vector calculated based on the luma component is used for both the luma and chroma components. The motion information, including information from the reference image and information about the motion vector used to predict the current block, is encoded by entropy encoder 155 and transmitted to the video decoding device.

[0045] The inter-frame predictor 124 can also perform interpolation of a reference picture or reference block to increase prediction accuracy. In other words, subsamples are interpolated between two consecutive integer samples by applying filter coefficients to multiple consecutive integer samples comprising two integer samples. When performing the process of searching for the most similar block to the current block on the interpolated reference picture, the motion vector can be represented with fractional-unit precision instead of integer-sample-unit precision. For each target region to be encoded, such as a cell like a slice, tile, CTU, CU, etc., the precision or resolution of the motion vector can be set differently. When this adaptive motion vector resolution (AMVR) is applied, information about the motion vector resolution to be applied to each target region should be signaled for each target region. For example, when the target region is a CU, information about the motion vector resolution applied to each CU is signaled. The information about the motion vector resolution can be information representing the precision of the motion vector difference to be described below.

[0046] On the other hand, the inter-frame predictor 124 can perform inter-frame prediction by utilizing bidirectional prediction. In the case of bidirectional prediction, two reference images and two motion vectors representing the positions of the blocks most similar to the current block in each reference image are used. The inter-frame predictor 124 selects a first reference image and a second reference image from reference image list 0 (RefPicList0) and reference image list 1 (RefPicList1), respectively. The inter-frame predictor 124 also searches for the block most similar to the current block in the corresponding reference image to generate a first reference block and a second reference block. Furthermore, the predicted block for the current block is generated by averaging or weighted averaging the first reference block and the second reference block. In addition, motion information including information about the two reference images used to predict the current block and information about the two motion vectors is transmitted to the entropy encoder 155. Here, reference image list 0 may consist of images in the pre-reconstructed images that precede the current image in display order, and reference image list 1 may consist of images in the pre-reconstructed images that follow the current image in display order. However, although not particularly limited to this, pre-reconstructed images that follow the current image in display order may be additionally included in reference image list 0. Conversely, pre-reconstructed images preceding the current image can also be additionally included in the reference image list 1.

[0047] Various methods can be used to minimize the number of bits consumed in encoding motion information.

[0048] For example, when the reference image and motion vector of the current block are the same as those of the adjacent blocks, the information that can identify the adjacent blocks is encoded to transmit the motion information of the current block to the video decoding device. This method is called merge mode.

[0049] In merge mode, the inter-frame predictor 124 selects a predetermined number of merge candidate blocks (hereinafter referred to as "merge candidates") from the neighboring blocks of the current block.

[0050] As adjacent blocks used to derive merge candidates, all or some of the left block A0, lower left block A1, upper block B0, upper right block B1, and upper left block B2 adjacent to the current block in the current image can be used, such as Figure 4 As shown. In addition to the current image containing the current block, blocks located within a reference image (which may be the same as or different from the reference image used to predict the current block) can also be used as merge candidates. For example, a co-located block of the current block within the reference image, or a block adjacent to that co-located block, can be additionally used as a merge candidate. If the number of merge candidates selected using the above method is less than a preset number, a zero vector is added to the merge candidates.

[0051] The inter-frame predictor 124 configures a merge list including a predetermined number of merge candidates by utilizing neighboring blocks. It selects a merge candidate from the merge candidates included in the merge list to be used as motion information for the current block, and generates merge index information for identifying the selected candidate. The generated merge index information is encoded by the entropy encoder 155 and transmitted to the video decoding device.

[0052] The merge skip mode is a special case of the merge mode. After quantization, when all transform coefficients used for entropy coding are close to zero, only the adjacent block selection information is transmitted, and the residual signal is not transmitted. By utilizing the merge skip mode, relatively high coding efficiency can be achieved for images with slight motion, still images, and screen content images.

[0053] From then on, merge mode and merge skip mode were collectively referred to as merge / skip mode.

[0054] Another approach for encoding motion information is the Advanced Motion Vector Prediction (AMVP) model.

[0055] In AMVP mode, the inter-frame predictor 124 derives motion vector prediction candidates for the current block by utilizing neighboring blocks of the current block. As neighboring blocks used to derive motion vector prediction candidates, they can use... Figure 4 The current block in the current image shown includes all or some of the adjacent blocks: left block A0, lower left block A1, upper block B0, upper right block B1, and upper left block B2. Furthermore, blocks located in a reference image (which may be the same as or different from the reference image used to predict the current block) can also be used as neighboring blocks for deriving motion vector prediction candidates, in addition to the current image containing the current block. For example, a co-located block of the current block in the reference image or a block adjacent to that co-located block can be used. If the number of motion vector candidates selected by the above method is less than a preset number, a zero vector is added to the motion vector candidates.

[0056] The inter-frame predictor 124 derives motion vector prediction candidates by utilizing motion vectors from neighboring blocks, and determines the motion vector prediction for the current block by utilizing these candidates. Furthermore, the motion vector difference is calculated by subtracting the motion vector prediction from the motion vector prediction for the current block.

[0057] Motion vector predictions can be obtained by applying predefined functions (e.g., median and average calculations) to motion vector prediction candidates. In this case, the video decoding device is also aware of the predefined functions. Furthermore, since the neighboring blocks used to derive the motion vector prediction candidates are already encoded and decoded, the video decoding device may already know the motion vectors of the neighboring blocks. Therefore, the video encoding device does not need to encode the information used to identify the motion vector prediction candidates. Accordingly, in this case, information about the motion vector difference and information about the reference image used to predict the current block are encoded.

[0058] Alternatively, motion vector prediction can be determined by selecting any one of the motion vector prediction candidates. In this case, the information used to identify the selected motion vector prediction candidate is further encoded together with the information about the motion vector difference used to predict the current block and the information about the reference image.

[0059] Subtractor 130 generates a residual block by subtracting the predicted block generated by intra-predictor 122 or inter-predictor 124 from the current block.

[0060] Transformer 140 transforms the residual signal in the residual block, which has pixel values ​​in the spatial domain, into transform coefficients in the frequency domain. Transformer 140 can transform the residual signal in the residual block by using the entire size of the residual block as a transform unit, or it can divide the residual block into multiple sub-blocks and perform the transformation by using the sub-blocks as transform units. Alternatively, the residual block is divided into two sub-blocks, namely a transformed region and a non-transformed region, so that the residual signal is transformed by using only the transformed region sub-block as a transform unit. Here, the transformed region sub-block can be one of two rectangular blocks with a size ratio of 1:1 based on a horizontal axis (or a vertical axis). In this case, the entropy encoder 155 encodes a flag (cu_sbt_flag) indicating that only the transformed sub-block is used, as well as orientation (vertical / horizontal) information (cu_sbt_horizontal_flag) and / or position information (cu_sbt_pos_flag), and signals this information to the video decoding device. Additionally, the size of the transformed region sub-blocks can have a 1:3 size ratio based on the horizontal axis (or vertical axis). In this case, the entropy encoder 155 additionally encodes the flag (cu_sbt_quad_flag) for dividing the corresponding segment and signals it to the video decoding device.

[0061] On the other hand, the transformer 140 can perform the transformation of the residual block separately in the horizontal and vertical directions. Various types of transformation functions or transformation matrices can be used for this transformation. For example, the pair of transformation functions used for horizontal and vertical transformations can be defined as a multiple transform set (MTS). The transformer 140 can select the transform function pair with the highest transformation efficiency in the MTS and can transform the residual block in each of the horizontal and vertical directions. The entropy encoder 155 encodes the information (mts_idx) about the transform function pair in the MTS and signals it to the video decoding device.

[0062] Quantizer 145 quantizes the transform coefficients output from transformer 140 using quantization parameters and outputs the quantized transform coefficients to entropy encoder 155. Quantizer 145 can also quantize the relevant residual blocks immediately without transforming any block or frame. Quantizer 145 can also apply different quantization coefficients (scaling values) based on the position of the transform coefficients in the transform block. The quantization matrix applied to the quantized transform coefficients arranged in two dimensions can be encoded and signaled to the video decoding device.

[0063] The rearrangement unit 150 can rearrange the coefficient values ​​of the quantized residual values.

[0064] The rearrangement unit 150 can transform a 2D coefficient array into a 1D coefficient sequence by utilizing coefficient scanning. For example, the rearrangement unit 150 can use a zig-zag scan or a diagonal scan to scan the DC coefficients to the high-frequency region to output a 1D coefficient sequence. Depending on the size of the transform unit and the intra-frame prediction mode, a vertical scan scanning the 2D coefficient array in the column direction and a horizontal scan scanning the 2D block-type coefficients in the row direction can also be used instead of a zig-zag scan. In other words, the scanning method to be used can be determined from zig-zag scan, diagonal scan, vertical scan, and horizontal scan, depending on the size of the transform unit and the intra-frame prediction mode.

[0065] The entropy encoder 155 encodes the sequence of 1D quantized transform coefficients output from the rearrangement unit 150 by utilizing various encoding schemes, including Context-based Adaptive Binary Arithmetic Code (CABAC) and Exponential Golomb, to generate a bitstream.

[0066] Furthermore, the entropy encoder 155 encodes block-segmentation related information (e.g., CTU size, CTU segmentation flag, QT segmentation flag, MTT segmentation type, and MTT segmentation direction) so that the video decoding device can segment blocks equivalently to the video encoding device. Additionally, the entropy encoder 155 encodes information indicating whether the current block is intra-frame predictive coding or inter-frame predictive coding. The entropy encoder 155 encodes intra-frame prediction information (i.e., information about the intra-frame prediction mode) or inter-frame prediction information (the merge index in the case of merge mode, and information about the reference picture index and motion vector difference in the case of AMVP mode) according to the prediction type. Furthermore, the entropy encoder 155 encodes quantization-related information (i.e., information about quantization parameters and information about the quantization matrix).

[0067] Inverse quantizer 160 inverse quantizes the quantized transform coefficients output from quantizer 145 to generate transform coefficients. Inverse transformer 165 transforms the transform coefficients output from inverse quantizer 160 from the frequency domain to the spatial domain to reconstruct the residual block.

[0068] Adder 170 adds the reconstructed residual block to the prediction block generated by predictor 120 to reconstruct the current block. When performing intra-frame prediction for the next block, the pixels in the reconstructed current block are used as reference pixels.

[0069] The loop filtering unit 180 performs filtering on the reconstructed pixels to reduce blocking artifacts, ringing artifacts, blurring artifacts, etc., that occur due to block-based prediction and transform / quantization. The loop filtering unit 180, as an in-loop filter, may include all or some of the following: a deblocking filter 182, a sample adaptive offset (SAO) filter 184, and an adaptive loop filter (ALF) 186.

[0070] Deblocking filter 182 filters the boundaries between reconstructed blocks to remove blocking artifacts caused by block unit encoding / decoding, and SAO filter 184 and ALF 186 perform additional filtering on the deblocked video. SAO filter 184 and ALF 186 are filters used to compensate for the difference between reconstructed pixels and original pixels caused by lossy coding. SAO filter 184 applies an offset in CTU units to enhance subjective image quality and coding efficiency. On the other hand, ALF 186 performs block unit filtering and applies different filters to compensate for distortion by dividing the boundaries of the corresponding blocks and the degree of variation. Information about the filter coefficients to be used for ALF can be encoded and signaled to the video decoding device.

[0071] The reconstructed blocks filtered by deblocking filter 182, SAO filter 184, and ALF 186 are stored in memory 190. When all blocks in an image are reconstructed, the reconstructed image can be used as a reference image for inter-frame prediction of blocks in subsequent images to be encoded.

[0072] Figure 5 This is a functional block diagram of a video decoding device that can implement the technology of this invention. In the following text, reference is made to... Figure 5 It describes the video decoding device and its components.

[0073] The video decoding device may include an entropy decoder 510, a rearrangement unit 515, an inverse quantizer 520, an inverse transformer 530, a predictor 540, an adder 550, a loop filter unit 560, and a memory 570.

[0074] Similar to Figure 1 The video encoding device and the video decoding device each component can be implemented as hardware or software, or a combination of hardware and software. Furthermore, the function of each component can be implemented as software, and the microprocessor can also be implemented to execute the software functions corresponding to each component.

[0075] The entropy decoder 510 extracts information related to block segmentation by decoding the bitstream generated by the video encoding device to determine the current block to be decoded, and extracts the prediction information and information about the residual signal required to reconstruct the current block.

[0076] The entropy decoder 510 determines the size of the CTU by extracting information about the CTU size from the sequence parameter set (SPS) or the picture parameter set (PPS) and segments the image into CTUs of a defined size. Furthermore, the CTU is identified as the highest level (i.e., the root node) of the tree structure, and segmentation information of the CTU can be extracted to segment the CTU by utilizing the tree structure.

[0077] For example, when segmenting a CTU using a QTBTT structure, the first flag (QT_split_flag) related to the QT segmentation is first extracted to split each node into four lower-level nodes. Additionally, a second flag (mtt_split_flag), segmentation direction (vertical / horizontal), and / or segmentation type (binary / ternary) related to the MTT segmentation are extracted relative to the nodes corresponding to the leaf nodes of the QT to segment the corresponding leaf nodes using the MTT structure. As a result, each node below the leaf node of the QT is recursively segmented using either a BT or TT structure.

[0078] As another example, when splitting a CTU using a QTBTTT structure, a CU split flag (split_cu_flag) indicating whether a CU has been split is extracted. A first flag (QT_split_flag) can also be extracted when the corresponding block is split. During the splitting process, for each node, zero or more recursive MTT splits may occur after zero or more recursive QT splits. For example, for a CTU, MTT splits may occur immediately, or conversely, only multiple QT splits may occur.

[0079] As another example, when segmenting a CTU using a QTBT structure, the first flag (QT_split_flag) associated with the QT segmentation is extracted to split each node into four nodes at the lower level. Additionally, a split flag (split_flag) indicating whether the node corresponding to a leaf node of the QT will be further segmented using BT, as well as segmentation direction information, is extracted.

[0080] On the other hand, when the entropy decoder 510 determines the current block to be decoded by utilizing the segmentation of the tree structure, the entropy decoder 510 extracts information about the prediction type indicating whether the current block is predicted intra-frame or inter-frame. When the prediction type information indicates intra-frame prediction, the entropy decoder 510 extracts the syntax elements for the intra-frame prediction information (intra-frame prediction mode) for the current block. When the prediction type information indicates inter-frame prediction, the entropy decoder 510 extracts information representing the syntax elements of the inter-frame prediction information, namely, the motion vector and the reference picture of the motion vector reference.

[0081] In addition, the entropy decoder 510 extracts quantization-related information and extracts information about the quantization transform coefficients of the current block as information about the residual signal.

[0082] The rearrangement unit 515 can re-transform the sequence of 1D quantized transform coefficients entropy-decoded by the entropy decoder 510 into a 2D coefficient array (i.e., a block) in the reverse order of the coefficient scan order performed by the video encoding device.

[0083] The inverse quantizer 520 performs inverse quantization on the quantized transform coefficients, and performs inverse quantization on the quantized transform coefficients using quantization parameters. The inverse quantizer 520 can also apply different quantization coefficients (scaling values) to the quantized transform coefficients arranged in 2D. The inverse quantizer 520 can perform inverse quantization by applying a matrix of quantization coefficients (scaling values) from the video encoding device to a 2D array of quantized transform coefficients.

[0084] The inverse transformer 530 reconstructs the residual signal by inversely transforming the inverse-quantized transform coefficients from the frequency domain to the spatial domain to generate the residual block of the current block.

[0085] Furthermore, when the inverse transformer 530 performs an inverse transform on a portion (sub-block) of the transform block, it extracts a flag (cu_sbt_flag) indicating that only the sub-blocks of the transform block are transformed, the sub-block's orientation (vertical / horizontal) information (cu_sbt_horizontal_flag), and / or the sub-block's position information (cu_sbt_pos_flag). The inverse transformer 530 also inversely transforms the transform coefficients of the corresponding sub-blocks from the frequency domain to the spatial domain to reconstruct the residual signal, and fills the untransformed regions with values ​​"0" as the residual signal to generate the final residual block for the current block.

[0086] Furthermore, when applying MTS, the inverse transformer 530 determines the transform function or transform matrix to be applied in each of the horizontal and vertical directions by utilizing the MTS information (mts_idx) signaled from the video encoding device. The inverse transformer 530 also performs inverse transform on the transform coefficients in the transform block in both the horizontal and vertical directions using the determined transform function.

[0087] Predictor 540 may include intra-predictor 542 and inter-predictor 544. Intra-predictor 542 is activated when the prediction type of the current block is intra-prediction, and inter-predictor 544 is activated when the prediction type of the current block is inter-prediction.

[0088] Intra-predictor 542 determines the intra-prediction mode for the current block from among multiple intra-prediction modes based on the grammatical elements of the intra-prediction mode extracted from entropy decoder 510. Intra-predictor 542 also predicts the current block by utilizing neighboring reference pixels of the current block based on the intra-prediction mode.

[0089] The inter-frame predictor 544 determines the motion vector and the reference picture of the motion vector reference for the current block by utilizing the grammatical elements of the inter-frame prediction mode extracted from the entropy decoder 510, and predicts the current block by utilizing the motion vector and the reference picture.

[0090] Adder 550 reconstructs the current block by adding the residual block output from inverse transform 530 to the predicted block output from inter-frame predictor 544 or intra-frame predictor 542. Pixels within the reconstructed current block are used as reference pixels when performing intra-frame prediction for subsequent blocks to be decoded.

[0091] The loop filtering unit 560, acting as an in-loop filter, may include a deblocking filter 562, a SAO filter 564, and an ALF 566. The deblocking filter 562 performs deblocking filtering on the boundaries between reconstructed blocks to remove block artifacts caused by block unit decoding. The SAO filter 564 and ALF 566 perform additional filtering on the reconstructed blocks after deblocking to compensate for differences between reconstructed pixels and original pixels caused by lossy encoding. The filter coefficients of the ALF are determined by utilizing information about the filter coefficients decoded from the bitstream.

[0092] The reconstructed blocks filtered by deblocking filter 562, SAO filter 564, and ALF 566 are stored in memory 570. When all blocks in an image are reconstructed, the reconstructed image can be used as a reference image for inter-frame prediction of blocks in subsequent images to be encoded.

[0093] In some embodiments, the present invention relates to encoding and decoding video images as described above. More specifically, the present invention provides a video encoding and decoding method and apparatus that generates a prediction block for the current block by utilizing decoder-side intra-mode derivation (DIMD) technology, which derives the intra-prediction mode based on gradients calculated from adjacent reconstructed regions of the current block.

[0094] The following implementation scheme can be performed by the predictor 120 in the video encoding device. The following implementation scheme can also be performed by the predictor 540 in the video decoding device.

[0095] When encoding the current block, the video encoding apparatus can generate signaling information associated with this embodiment from the perspective of optimizing rate distortion. The video encoding apparatus can encode the signaling information using the entropy encoder 155 and send the encoded signaling information to the video decoding apparatus. The video decoding apparatus can decode the signaling information associated with the decoding of the current block from the bitstream using the entropy decoder 510.

[0096] In the following description, the term "target block" may be used interchangeably with the current block or coding unit (CU), or may refer to some region of a coding unit.

[0097] In the following description, the aspect ratio of a block is defined as the ratio of the block's horizontal length (W: width) to its vertical length (H: height), that is, the ratio between the horizontal length and the vertical length.

[0098] In addition, a flag value of true indicates that the flag is set to 1. Conversely, a flag value of false indicates that the flag is set to 0.

[0099] I. Device Configuration Figure 6 This is a block diagram showing in detail a portion of a video decoding apparatus according to at least one embodiment of the present invention.

[0100] The video decoding apparatus according to this embodiment can determine prediction and transform units, perform prediction on the current block equivalent to the determined units, and ultimately generate a reconstructed block of the current block by performing an inverse transform using the determined prediction technique and prediction mode. This can be performed in the video decoding apparatus via the inverse transformer 530, predictor 540, and adder 550. Figure 6 The operation is shown. Alternatively, it can be performed in a video encoding apparatus via inverse transformer 165, image segmenter 110, predictor 120, and adder 170. Figure 6 The operation shown is the same. In this case, the video decoding device utilizes the encoded information parsed from the bitstream, while the video encoding device can utilize the encoded information set at a higher level in terms of minimizing bit rate distortion. For convenience, this embodiment will be described below focusing on the video decoding device.

[0101] refer to Figure 6 The video decoding apparatus according to this embodiment includes all or part of a predictor 540, a transform coefficient entropy decoder 605, a transform coefficient inverse quantizer 606, an inverse transformer 530, and an adder 550. Here, as... Figure 5 As shown, according to the prediction technique, predictor 540 includes an intra-frame predictor 542 and an inter-frame predictor 544. For example... Figure 6 As shown, predictor 540 may include all or part of prediction unit determiner 601, prediction technique determiner 602, prediction mode determiner 603, and prediction executor 604. Additionally, inverse transformer 530 may include all or part of inverse transform unit determiner 607, inverse transform kernel determiner 608, and inverse transform executor 609.

[0102] Prediction unit determiner 601 determines prediction units (PUs). Here, a prediction unit can be the current block or a sub-block of a sub-block obtained by partitioning the current block. Prediction technique determiner 602 determines a prediction technique for each prediction unit determined by prediction unit determiner 601, such as inter-frame prediction (temporal prediction), intra-frame prediction (spatial prediction), intra-block copy (IBC), and palette. Prediction mode determiner 603 determines a detailed prediction mode for the prediction technique. Prediction executor 604 generates a prediction block for the current block based on the determined prediction mode.

[0103] Detailed prediction modes in inter-frame prediction techniques may include, for example, the following modes.

[0104] - Generate the predicted signal for the current block as a weighted sum of one or more predicted signals generated using the motion information and motion compensation of the current block. - After dividing the current block into one or more sub-regions through geometric partitioning, a pattern of predicted signals for the current block is generated by a weighted sum of one or more predicted signals generated via motion information and motion compensation for each sub-region.

[0105] Detailed prediction modes in intra-frame prediction techniques may include, for example, the following modes.

[0106] - A pattern for generating the predicted signal for the current block by utilizing directional prediction patterns, planar patterns (e.g., horizontal plane, vertical plane, or conventional plane), or DC patterns. - A pattern for generating the predicted signal for the current block by utilizing a predefined matrix. - A pattern for the predicted signal of the current block is generated by defining the adjacent reconstructed regions of the current block as templates and performing matching between the defined templates and the reconstructed regions. - By defining the adjacent reconstructed regions of the current block as templates, at least one directional prediction pattern is derived from the templates, and then the derived directional prediction patterns are used to generate the pattern of the predicted signal for the current block. On the other hand, predictor 540 can generate a prediction block for the current block by utilizing a hybrid mode that simultaneously utilizes prediction modes that can be included in inter-frame prediction techniques and prediction modes that can be included in intra-frame prediction techniques. For example, such a hybrid mode can include the following modes.

[0107] - A mode for generating the final predicted signal of the current block by weighted summing the predicted signals of the current block generated using the intra-frame prediction mode and the predicted signals of the current block generated using the inter-frame prediction mode. - The current block is divided into one or more sub-regions through geometric partitioning, and the predicted signals generated by utilizing the inter-frame prediction modes of some sub-regions and the predicted signals generated by utilizing the intra-frame prediction modes of the remaining sub-regions are weighted and summed to generate the final predicted signal for the current block. The transform coefficient entropy decoder 605 reconstructs the quantized transform coefficients from the bitstream. Here, if a quadratic transform is applied to the transform coefficients, the transform coefficient entropy decoder 605 can reconstruct the quantized quadratic transform coefficients. If no quadratic transform is applied, i.e., only the main transform is applied, the transform coefficient entropy decoder 605 can perform the reconstruction of the quantized main transform coefficients.

[0108] The transform coefficient inverse quantizer 606 parses information such as the method of quantization of the transform coefficients reconstructed by the transform coefficient entropy decoder 605 and quantization parameter information, and performs inverse quantization on the reconstructed transform coefficients.

[0109] Inverse transform unit determiner 607 determines the inverse transform unit for the transform coefficients. The inverse transform unit can be the same as the transform unit (TU), and can be set to the same size as a sub-block of the current block or a sub-block obtained by partitioning the current block. Inverse transform kernel determiner 608 determines separable vertical and horizontal main inverse transform kernels and / or non-separable secondary inverse transform kernels, or non-separable main inverse transform kernels, as the kernels for the inverse transform of the transform coefficients. Inverse transform executor 609 reconstructs the residual signal by performing an inverse transform on the inverse-quantized transform coefficients using the inverse transform kernel determined by inverse transform kernel determiner 608. On the other hand, whether to perform a non-separable main inverse transform and whether to perform a non-separable secondary inverse transform can be explicitly determined by parsing information communicated by signals, or implicitly determined based on factors such as the size of the current TU.

[0110] Adder 550 sums the residual signal reconstructed by inverse transformer 530 and the final predicted signal generated by predictor 540 to generate the final reconstructed signal for the current block. The final reconstructed signal for the current block (i.e., the reconstructed block) is stored in memory and can subsequently be used to predict other blocks.

[0111] As described above, the prediction technique for the current block can be determined by the prediction technique determiner 602. The prediction technique can be one of techniques such as inter-frame prediction, intra-frame prediction, IBC, or palette.

[0112] According to at least one embodiment of the prediction technique or prediction mode used to determine the current block, predictor 540 determines whether intra-frame prediction is applicable to the current block. If intra-frame prediction is not applicable to the current block, predictor 540 resolves a flag indicating whether the mode of the current block is a skip mode. If the flag indicates that the prediction mode of the current block corresponds to a skip mode, predictor 540 can determine whether the prediction mode of the current block is an inter-frame combining mode or an IBC combining mode. If the prediction mode of the current block corresponds to a skip mode, the video decoding apparatus can skip the inverse transform processing of the transform coefficients and can use the predicted block generated by predictor 540 for the reconstructed block.

[0113] According to another embodiment for determining the prediction technique or prediction mode of the current block, predictor 540 determines whether the prediction mode of the current block corresponds to a skip mode. If the prediction mode of the current block does not correspond to a skip mode, predictor 540 can parse the flag indicating the prediction technique of the current block and can use one of the following techniques to predict the current block: inter-frame prediction, intra-frame prediction, IBC, or palette.

[0114] According to another embodiment of the prediction technique or prediction mode used to determine the current block, if the prediction mode of the current block does not correspond to the skip mode, and inter-frame prediction or IBC technique is applicable to the current block, the predictor 540 can parse the flag indicating the merge or AMVP mode to determine whether the prediction of the current block is to be performed in merge mode or AMVP mode.

[0115] According to another embodiment of the prediction technique or prediction mode used to determine the current block, predictor 540 determines whether intra-frame prediction is applicable to the current block. If intra-frame prediction is applicable to the current block, predictor 540 can predict the current block based on the prediction mode indicated by information parsed from a flag and / or index indicating one of various prediction modes. The indicated prediction mode can be a prediction mode derivation technique or a mode referred to below as prediction mode derivation technique or decoder-side intra-mode derivation (DIMD) technique. The process of generating a predicted block or predicted signal of the current block by utilizing the prediction mode derivation technique according to the present invention is described in detail below with reference to the accompanying drawings.

[0116] II. Decoder-side Intra-frame Mode Derivation (DIMD) The DIMD technique generates the final predicted signal for the current block based on gradients computed over at least a portion of the adjacent reconstructed regions. Specifically, the DIMD technique computes at least one gradient over the left and top "L"-shaped regions within the adjacent reconstructed regions of the current block, which are of size W × H. The DIMD technique then uses at least one directional and / or non-directional prediction mode selected based on the computed gradients to generate the final predicted signal.

[0117] Typically, DIMD technology may require significant computation from the processor, thus its application may be limited by the size of the current block or the slice type. For example, DIMD technology can only be applied to the current block if the size (width × height) is greater than or equal to 128 and less than or equal to 1024, or only if the current slice type is an I slice.

[0118] The video decoding device can parse flags and / or indices from the bitstream indicating whether a prediction mode derivation technique is applied to the current block. Here, the flags and / or indices can be parsed after considering the aforementioned DIMD application conditions. The video decoding device can then determine whether the prediction mode indicated by the parsed flags and / or indices is a prediction mode derivation technique. If the prediction mode indicated by the parsed flags and / or indices is a prediction mode derivation technique, the video decoding device uses the prediction mode derivation technique to generate a prediction block for the current block. Conversely, if the prediction mode indicated by the parsed flags and / or indices is not a prediction mode derivation technique, the video decoding device generates a prediction block for the current block by using an indicated alternative prediction mode instead of a prediction mode derivation technique. Here, if the prediction mode indicated by the parsed flags and / or indices is a prediction mode derivation technique, the video decoding device can skip parsing flags and / or indices indicating whether other modes such as BDPCM, MIP, and MRL modes are applied.

[0119] The following describes in detail the process by which a video decoding device uses prediction mode derivation techniques to generate a prediction block for the current block, according to various implementation schemes.

[0120] 1. Gradient calculation region settings As described above, when the prediction mode indicated by the parsed flags and / or indexes is a prediction mode derivation technique, the video decoding apparatus uses the prediction mode derivation technique to generate a prediction block for the current block. For this purpose, the predictor 540 may set a gradient calculation region for performing gradient calculations from samples reconstructed from adjacent parts of the current block.

[0121] Figure 7 This is a schematic diagram illustrating a gradient calculation region for calculating gradient values ​​according to at least one embodiment of the present invention.

[0122] According to at least one implementation, a reconstructed reference sample or reference pixel (located in the top n rows and left m columns relative to the current block in the reconstructed region) can be included in the gradient calculation region. Here, n and m can be integers of 2 or greater. If some or all of the top n rows or left m columns are unavailable, only the available areas can be included in the gradient calculation region.

[0123] In some implementations, m and n can be determined based on the size or area of ​​the current block, that is, based on the total number of samples within the current block. For example, if the size or area of ​​the current block is smaller than a predefined size, or equal to a predefined small block size (e.g., 4 × 4, 8 × 4, 4 × 8, etc.), m and n can be set to a first value; otherwise, they can be set to a second value. Here, the second value can be greater than the first value. For example, the first value can be 2, and the second value can be 3.

[0124] In some other implementations, m and n can be determined differently based on the width (W) and height (H) of the current block, respectively. For example, m can be determined based on the width of the current block, and n can be determined based on the height of the current block.

[0125] For example, if the width of the current block is less than or equal to a predefined threshold, m can be set to a first value; otherwise, m can be set to a second value greater than the first value. Similarly, if the height of the current block is less than or equal to a predefined threshold, n can be set to a first value; otherwise, n can be set to a second value. For example, the predefined threshold could be 8, the first value could be 2, and the second value could be 3.

[0126] Given that the top n rows and left m columns are available, the length M of the top reference sample and the length N of the left reference sample can be determined based on the width (W) and height (H) of the current block. For example, assuming the top left pixel position of the current block is (0, 0) relative to the top left sample position (-m, -n) of the gradient calculation region, M can be set to the value W+m+b, and N can be determined to the value H+n+a. Here, n, m, M, and N can all be integers greater than or equal to 1, and "a" and "b" can be integer values ​​determined based on the availability of the reconstructed region. Specifically, based on Figure 7 If the m × a region (the lower left region of the current block) has been previously reconstructed and is available as a reference sample, then "a" can be an integer value greater than or equal to 1 and less than or equal to an integer multiple of H. Conversely, if the m × a region is not used as a reference sample, then "a" can be determined to have a value of 0. Similarly, based on Figure 7If the b × n region (the upper right region of the current block) has been previously reconstructed and is available as a reference sample, then "b" can be an integer with a value greater than or equal to 1 and less than or equal to an integer multiple of W. If the b × n region is not used as a reference sample, then "b" can be determined to have a value of 0.

[0127] According to another implementation, the gradient calculation region can be determined by parsing a flag or index from the bitstream indicating the region to be included in the gradient calculation region, so as to include at least a portion of the region to the left and top of the current block.

[0128] In another implementation, the gradient calculation region can be implicitly determined based on the protocol between the video encoding device and the video decoding device. In this case, the gradient calculation region determination operation described above can be omitted.

[0129] 2. Gradient Calculation According to the above implementation scheme, once the gradient calculation region is determined, the predictor 540 can calculate the gradient of at least some regions within the gradient calculation region. In other words, the gradient can be calculated on a unit basis of at least some regions. Here, at least some regions can be set as p × q block units, and in the following text, at least one region of a p × q block unit is called a sampling unit. The width p and height q of the sampling unit can be adaptively determined based on the size of the current block, the resolution of the video, the aspect ratio of the current block, etc.

[0130] According to at least one implementation, the sizes p and q of the sampling unit can be determined based on the size or area of ​​the current block. For example, if the size or area of ​​the current block is less than or equal to a predefined size (e.g., 4 × 4, 8 × 4, 4 × 8, etc.), p and q can be set to a first value; otherwise, they can be set to a second value. Here, the second value is greater than the first value. For example, the first value could be 2, and the second value could be 3.

[0131] According to another implementation, p and q can be determined differently based on the width (W) and height (H) of the current block. For example, p can be determined based on the width of the current block, and q can be determined based on the height of the current block.

[0132] For example, if the width of the current block is less than or equal to a predefined threshold, p can be set to a first value; otherwise, p can be set to a second value greater than the first value. Similarly, if the height of the current block is less than or equal to a predefined threshold, q can be set to a first value; otherwise, q can be set to a second value. For example, the predefined threshold could be 8, the first value could be 2, and the second value could be 3.

[0133] For ease of explanation, an example with 3 × 3 sampling units will be described below.

[0134] Before gradient calculation, if the value of m is less than p or the value of n is less than q, the predictor 540 can fill the outermost part of the gradient calculation region such that the values ​​of m or n less than p or q become greater than or equal to p or q. That is, the predictor 540 can fill the outermost part of the gradient calculation region so that the sampling unit does not extend beyond the gradient calculation region. For example, if m and n have values ​​of 2, the predictor 540 can copy the sample values ​​corresponding to positions (-m, -n) to (-m, H+a-1) to positions (-m-1, -n) to (-m-1, H+a-1). Then, the sample values ​​corresponding to positions (-m, -n) to (W+b-1, -n) can be copied to positions (-m, -n-1) to (W+b-1, -n-1). This filling can ultimately set m and n to 3. In other words, the gradient calculation region can be extended by filling to the size that accommodates the sampling unit.

[0135] Subsequently, predictor 540 can perform gradient computation on the gradient computation region along with preprocessing. Specifically, predictor 540 can determine whether to perform preprocessing based on flags and / or indices indicating whether a filter has been applied to the gradient computation region, and then the gradient can be computed. The filter can be applied to each sampling unit, to each region within the gradient computation region defined separately from the sampling unit, or to the entire gradient computation region at once.

[0136] If a flag and / or index indicating whether a filter has been applied to the gradient computation region indicates that a filter has been applied, the predictor 540 can apply the filter to the gradient computation region and then compute the gradient by applying the gradient operator to each sampling unit included in the filtered gradient computation region. Here, the filter applied to the gradient computation region can be a smoothing filter represented as a box filter or an averaging filter, or a sharpening filter represented as a Laplacian filter or an anti-sharpening mask filter. Furthermore, the present invention can use edge detection filters such as Sobel filters or Prewitt filters for the gradient operator.

[0137] Conversely, if a flag and / or index indicating whether a filter has been applied to the gradient computation region indicates that no filter is applied, the predictor 540 may not apply a filter to the gradient computation region and may compute the gradient by applying a gradient operator to each sampling unit included in the gradient computation region. Here, the gradient operator may be an edge detection filter, such as a Sobel filter or a Prewitt filter as described above.

[0138] On the other hand, the formation of sampling units for applying gradient operators can be performed in various ways.

[0139] Figures 8a to 8c This is a schematic diagram illustrating various implementations of a method for forming sampling units for applying gradient operators.

[0140] Figure 8a This is a schematic diagram illustrating at least one embodiment of a method for forming sampling units for applying gradient operators.

[0141] refer to Figure 8a According to at least one embodiment, the predictor 540 organizes sampling units into a continuous and overlapping form spanning the entire gradient computation region, and computes the gradient by applying gradient operators to the formed sampling units. Specifically, the center of each sampling unit may be arranged adjacent to the center of neighboring sampling units. (See reference...) Figure 8a The sampling unit can be formed with a center at (-2, -2) to (-2, H-1) and (-2, -2) to (W-1, -2) relative to the current block.

[0142] The gradient operator can be applied in a continuous and overlapping manner across the entire gradient computation region, such as... Figure 8a As shown, it can also be performed on a portion of the gradient computation region, or it can be performed in a discontinuous and / or non-overlapping manner.

[0143] Figure 8b This is a schematic diagram illustrating another embodiment of a method for forming sampling units for applying gradient operators.

[0144] Referring to Figure 8B, according to another embodiment, the predictor 540 forms sampling units that constitute a portion of the gradient calculation region, and calculates the gradient by applying a gradient operator to the formed sampling units. Specifically, the center of each sampling unit can be arranged to have a distance of 2 pixels from the center of the neighboring sampling unit. Figure 8b The sampling unit can be centered relative to the current block at (-2, H-2), (-2, H-4), (-2, H-6)... and (W-2, -2), (W-4, -2), (W-6, -2). Furthermore, the centers of every two sampling units can be centered not only at a distance of 2 pixels but also at a distance of x pixels, where x can be adaptively determined based on the size of the current block, the size of the sampling unit, etc.

[0145] On the other hand, sampling units can also be formed based on the partition information of adjacent reconstructed blocks of the current block.

[0146] Figure 8cThis is a schematic diagram illustrating another embodiment of a method for forming sampling units for applying gradient operators.

[0147] Figure 8c The dashed lines corresponding to the boundaries of the current block's adjacent blocks are shown. (Reference) Figure 8c According to another embodiment, predictor 540 forms sampling units based on partitioning information of adjacent reconstructed blocks of the current block, and computes gradients by applying gradient operators to the formed sampling units. Specifically, predictor 540 may compute gradients only for regions not adjacent to block partition boundaries, thereby omitting gradient computation based on certain pixel regions where block partitioning has been performed. (See reference...) Figure 8c The sampling unit can be configured to center on samples at least 2 pixels away from the boundary of neighboring blocks of the current block, thereby excluding samples adjacent to the boundary of neighboring blocks of the current block. Figure 8c In contrast, the sampling unit can also be centered on a sample that is at least x pixels away from the boundary of the neighboring block, where x can be adaptively determined based on the size of the current block, the size of the sampling unit, etc.

[0148] 3. Derivation of Available Patterns Predictor 540 can calculate the gradient of each sampling unit based on the method described above, and can derive at least one available mode for predicting the current block based on the calculated gradient. To derive at least one available mode, predictor 540 can calculate the gradient of each sampling unit and can use information terms based on the calculated gradient to derive the available mode. The information terms based on the calculated gradient can be formed to include a directional pattern corresponding to or mapped to the calculated gradient and information about the intensity of the gradient. Here, the calculated gradient can be based on its direction corresponding to at least one intra-frame directional pattern. According to the embodiment, at least one additional factor can be considered among the aspect ratio of the current block, the range of the gradient calculation region, or the position of the sampling unit. Furthermore, the intensity of the gradient can be determined as, for example, the absolute value of the x-direction gradient (i.e., the horizontal gradient), the absolute value of the y-direction gradient (i.e., the vertical gradient), or the sum of the absolute values ​​of the x-direction gradient and the y-direction gradient. Alternatively, the intensity of the gradient can be based on the sum of the squares of the x-direction gradient and the y-direction gradient.

[0149] According to at least one embodiment that associates gradients with directional patterns, the calculated gradient can be associated with one of the intra-frame directional patterns based on its direction. Alternatively, the directional patterns that can be associated with the gradient can be restricted based on the aspect ratio of the current block. Specifically, if the gradient calculated for a particular sampling unit corresponds to a restricted directional pattern, the pattern corresponding to the calculated gradient can be replaced with another unrestricted directional pattern.

[0150] Table 1 is a table showing examples of directional patterns that are restricted based on the aspect ratio of the current block.

[0151] [Table 1] The directional patterns listed in Table 1 correspond to Figure 3b The directional patterns shown are illustrated in Table 1. Referring to Table 1, as an example of at least one implementation for mapping the calculated gradient to the directional patterns, a method considering the aspect ratio of the current block is described below.

[0152] When the aspect ratio of the current block is 16:1, intra-prediction modes 2 to 15 are restricted. Therefore, the gradient calculated for each sampling unit can correspond to one of the intra-prediction modes 16 to 80. For example, if the aspect ratio of the current block is 16:1, even if the gradient calculated for a particular sampling unit corresponds to intra-prediction mode 15, the mode corresponding to the gradient of that sampling unit can be mapped to intra-prediction mode 80. Furthermore, if the aspect ratio of the current block is 1 / 1, the gradient calculated for each sampling unit can be mapped to one of the intra-prediction modes 2 to 66. Similarly, when the aspect ratio is 8 / 1, the mode corresponding to the gradient can be mapped to one of the intra-prediction modes numbered 14 to 78; when the aspect ratio is 4 / 1, it is mapped to one of the intra-prediction modes 12 to 76; when the aspect ratio is 2 / 1, it is mapped to one of the intra-prediction modes 8 to 72; when the aspect ratio is 1 / 2, it is mapped to one of the intra-prediction modes -6 to -1 and 2 to 60; when the aspect ratio is 1 / 4, it is mapped to one of the intra-prediction modes -10 to -1 and 2 to 56; when the aspect ratio is 1 / 8, it is mapped to one of the intra-prediction modes -12 to -1 and 2 to 54; and when the aspect ratio is 1 / 16, it is mapped to one of the intra-prediction modes -14 to -1 and 2 to 52.

[0153] If the directional pattern A calculated via gradient corresponds to one of the restricted patterns shown in Table 1, then directional pattern A can be replaced with another pattern. For example, directional pattern A can be mapped to another pattern oriented in the opposite direction using the following relationship.

[0154] (1) When the aspect ratio (W / H) is greater than 1, replace the directional pattern A with the directional pattern (A+65).

[0155] (2) When the aspect ratio (W / H) is less than 1, replace the directional pattern A with the directional pattern (A-67).

[0156] According to another embodiment for mapping gradients to directional modes, the computed gradient can be mapped to an intra-frame directional mode based on its orientation. Additionally, the directional modes to which gradients can be mapped can be restricted based on the extent of the gradient computation region. According to such an embodiment, if the gradient computed for a particular sampling unit corresponds to a restricted directional mode, then the gradient computed for that sampling unit may correspond to another unrestricted mode, or may be excluded during the derivation process of the available modes.

[0157] Refer again Figure 7 As another implementation for associating the calculated gradient with a directional pattern, an example method considering the size of the gradient computation region is as follows.

[0158] The available intra-prediction modes can be determined differently based on the length *b* of the gradient computation region located at the top right corner of the current block. For example, when *b* is *W* or greater, modes 67 through 80 can be determined as available modes. In other words, the use of modes 2 through 15 is restricted. When the intra-prediction mode corresponding to the gradient direction falls within the range of modes 2 through 15, that mode is replaced with one of modes 67 through 80 according to the above relationship. If *b* is greater than 0 and less than *W*, the available modes among modes 67 through 80 can be determined proportionally based on the modes available when *b*=0 and the modes available when *b*=W. As another example, the available modes can be pre-specified by the encoder / decoder protocol based on the value of *b*.

[0159] Similarly, the available intra-prediction modes can be determined differently based on the length 'a' of the gradient computation region located at the lower left corner of the current block. For example, when a is H or greater, modes -1 to -14 can be determined as available modes. In other words, the use of modes 53 to 66 is restricted. When the intra-prediction mode corresponding to the gradient direction falls within the range of modes 53 to 66, that mode is replaced with one of modes -1 to -14 according to the above relationship. Conversely, if a is greater than 0 and less than H, the available modes among modes -1 to -14 can be determined proportionally based on the modes available when a=0 and the modes available when a=H. As yet another example, the available modes can be pre-specified by the encoder / decoder protocol based on the value of a.

[0160] According to another implementation for mapping gradients to directional modes, the calculated gradient can be mapped to an intra-frame directional mode based on its orientation. Furthermore, the directional modes that can be mapped to the gradient can be restricted by considering both the aspect ratio of the current block and the range of the gradient computation region. For example, if the aspect ratio of the current block is 16 / 1 and a equals W / 2, then modes other than intra-frame prediction modes 16 to 72 can be restricted. Here, the restricted modes can be replaced with another unrestricted mode according to the above relationship, or excluded during the derivation process of the available modes.

[0161] According to another embodiment for mapping gradients to directional patterns, the directional patterns that can be mapped to the sampling units can be pre-specified based on the location of the sampling units through a protocol between the encoding and decoding devices.

[0162] Figure 9 This is a schematic diagram showing the directional patterns corresponding to the gradients of some sampling units.

[0163] According to some implementation schemes, when the gradients of some sampling units correspond to a specific directional pattern, the gradients of those sampling units can be excluded from the derivation process of the available patterns. For example, Figure 9 As shown, if the gradient of the sampling unit located in the gradient calculation region on the left corresponds to the vertical prediction mode, specifically, as... Figure 3b If the intra-prediction mode 50 in the current block is used, then the sampling unit can be ignored during the prediction processing of the current block. In other words, if the intra-prediction mode derived from the sampling unit located in the gradient calculation region on the left is a vertical prediction mode, then the vertical prediction mode can be ignored. Similarly, as... Figure 9 As shown, if the gradient of the sampling unit located in the upper gradient calculation region corresponds to the horizontal prediction mode, that is, as Figure 3b In intra-frame prediction mode 18, the sampling unit can be disregarded during the prediction processing of the current block.

[0164] 4. Selection of Representative Models Predictor 540 can perform processing for selecting at least one representative mode to apply to the current block simultaneously with or after the processing of deriving the available modes at the sampling unit. For example, the selection of at least one representative mode can be performed based on a histogram calculated by aggregating the available modes determined at each sampling unit. Specifically, the selection of at least one representative mode can be performed by constructing a table or histogram (hereinafter, the terms "table" and "histogram" are used interchangeably) by aggregating information about the available modes derived at each sampling unit and / or the gradient strength information of each sampling unit, thereby deriving at least one dominant mode from the constructed table and then selecting at least one dominant mode as at least one representative mode. Here, when deriving the dominant mode by utilizing the gradient strength information of each sampling unit, the histogram can be calculated by recording the occurrence count of the available modes derived from each sampling unit and applying weights to the occurrence count. Specifically, for each mode derived at each sampling unit, a table can be constructed by applying weights based on the gradient strength instead of simply recording the occurrence count. For example, a histogram can be generated by accumulating the patterns derived from each sampling unit according to the gradient intensity.

[0165] According to at least one implementation, during the histogram construction process, a table or histogram can be constructed by aggregating information about the available patterns derived from each sampling unit and / or gradient intensity information for each sampling unit across all gradient computation regions.

[0166] Alternatively, the histogram construction process can be performed only until the total cumulative intensity value of the gradients on the histogram reaches a predefined threshold. That is, if the cumulative intensity value of the gradients is greater than or equal to the predefined threshold, the table or histogram construction process for the current block can be terminated early. To this end, pattern information and intensity information can be constructed for each sampling unit in the table or histogram of the current block, and the intensity information can be managed cumulatively for each sampling unit. According to the implementation scheme, this process can be performed on the upper and left regions of the current block separately in the gradient calculation region.

[0167] In some implementations, the cumulative intensity value of the gradient can vary based on the size of the current block, which can instruct the execution of a table or histogram to terminate the process early.

[0168] In another implementation, the size or area of ​​the current block can indicate whether to perform early termination. For example, the early termination process can be performed only if the area of ​​the current block is greater than or equal to a predefined threshold. The predefined threshold could be 128.

[0169] On the other hand, in order to aggregate available patterns, the gradient computation region can be defined as being divided into multiple regions, depending on the implementation scheme.

[0170] Figures 10a to 10c This is a schematic diagram illustrating various examples of dividing the gradient computation region into multiple regions.

[0171] Figure 10a This is a schematic diagram illustrating an example of dividing the gradient calculation region into multiple regions.

[0172] Based on the example of dividing the gradient computation region into multiple regions, when Figure 7 When "a" and "b" have values ​​of 0, the gradient calculation region can be divided into a total of three regions. Each region can be defined as the left-hand region, the top-hand region, and the top-left-hand region relative to the current block. Figure 10a In the diagram, region B corresponds to the left region, region C corresponds to the top region, and region A corresponds to the top left region.

[0173] Figure 10b This is a schematic diagram illustrating another example of dividing the gradient calculation region into multiple regions.

[0174] Based on another example of dividing the gradient computation region into multiple regions, when... Figure 7 When "a" and "b" have values ​​of 0, the gradient calculation region can be defined as divided into a total of three regions, similar to the partitioning example above. However, unlike the example above, as... Figure 10b As shown, three regions can be defined relative to the extension of the line that bisects the height and width of the current block.

[0175] Figure 10c This is a schematic diagram illustrating yet another example of dividing the gradient calculation region into multiple regions.

[0176] In yet another example of dividing the gradient computation region into multiple regions, when Figure 7 When "a" and / or "b" have non-zero values, additional regions can be defined corresponding to regions different from those in the above partitioning examples. For example, as Figure 10c As shown, when Figure 7 When both "a" and "b" in the gradient calculation region have non-zero values, the regions not adjacent to the current block (i.e., the gradient regions on the lower left and upper right sides of the current block) can be separately defined as the X region and the Y region. Furthermore, if Figure 7If only one of "a" and "b" in the gradient calculation region has a non-zero value, then the region not adjacent to the current block within the gradient calculation region can be further defined as region X or region Y. When the gradient calculation region has regions adjacent to the current block, the present invention can use a method similar to or the same as the example partitioning described above for defining regions, thereby defining the entire adjacent region as a single region, or the present invention can use other methods that are not similar to the example partitioning described above.

[0177] The method of dividing the gradient computation region into multiple regions is not limited to the examples above. For example, in Figure 10a or Figure 10b In the example shown, region A and region B or C can be defined as a single region, or the gradient computation region can be divided into multiple regions relative to the boundaries of adjacent reconstructed blocks of the current block. Therefore, some neighboring regions from the multiple regions divided from the gradient computation region can be defined as a single region.

[0178] In some implementations, during the processing of aggregating available patterns, predictor 540 may aggregate only selected directional patterns instead of all directional patterns. Here, for each of the multiple regions divided from the gradient computation region, the selection of some directional patterns may be performed differently. In other words, the gradient computation region may be divided into multiple regions, and for each region, predictor 540 aggregates available patterns to derive the dominant directional pattern. The available patterns that can be aggregated may be limited based on their position relative to each region of the current block.

[0179] Based on the example of aggregating only some directional patterns, when multiple regions are divided into, for example... Figure 10a As shown, for region A, only the directional patterns corresponding to the angular range of 90° to 180° can be recorded; for region B, only the directional patterns corresponding to the angular range of 135° to 225° can be recorded; and for region C, only the directional patterns corresponding to the angular range of 45° to 135° can be recorded. In such an example, if the X and / or Y regions are additionally divided, i.e., when using... Figure 10a The example division and Figure 10c When the example division shown is used to divide multiple regions in a combined manner, for region X, only the directional patterns corresponding to the angular range of 225° to 270° are recorded, and for region Y, only the directional patterns corresponding to the angular range of 0° to 45° are recorded. Here, the example angle can correspond to... Figure 3b The intra-frame prediction mode is shown. Specifically, the example angle can be related to... Figure 3b The angle shown corresponds to the counterclockwise direction formed by the line that vertically connects the center of the rectangle to the right side of the rectangle (this line indicates the intra-frame prediction mode).

[0180] Based on another example of aggregating only some directional patterns, when multiple regions are divided into such... Figure 10b As shown, for region A, only directional patterns corresponding to the angular range of 45° to 225° are recorded; for region B, only directional patterns corresponding to the angular range of 135° to 225° are recorded; and for region C, only directional patterns corresponding to the angular range of 45° to 135° are recorded. In such an example, if X and / or Y regions are additionally divided, i.e., when using... Figure 10b The example division and Figure 10c When the example division shown is used to divide multiple regions in a combined manner, for region X, only the directional patterns corresponding to the angular range of 180° to 270° are recorded, and for region Y, only the directional patterns corresponding to the angular range of 0° to 90° are recorded. Here, the example angle can correspond to... Figure 3b The intra-frame prediction mode shown is as described above.

[0181] Methods for aggregating only some directional patterns are not limited to the examples above. For example, the selection of certain directional patterns for aggregation can be adaptively performed based on at least one of the aspect ratio of the current block, the size or extent of the gradient calculation region, and the position or size of each of the multiple regions divided from the gradient calculation region. Alternatively, the selection of certain directional patterns for aggregation can be performed based on information provided by the video coding device, such as flags or indexes.

[0182] According to some implementations, during the processing of aggregating available patterns, when the horizontal gradient of some sampling units is zero or below a certain threshold, i.e., when the vertical gradient dominates, the predictor 540 can additionally aggregate directional patterns with a vertical orientation. Similarly, during the processing of aggregating available patterns, if the vertical gradient of some sampling units is zero or below a certain threshold, i.e., when the horizontal gradient dominates, the predictor 540 can additionally aggregate directional patterns with a horizontal orientation. Furthermore, if the horizontal directional gradient of a sampling unit located to the left of the current block is zero or below a certain threshold, the possible directional pattern corresponding to that sampling unit is likely to be a vertical directional pattern. Therefore, it may not be aggregated into the available pattern determined by that sampling unit. Similarly, if the vertical gradient of a sampling unit located above the current block is zero or below a certain threshold, it may not be aggregated into the available pattern determined by that sampling unit. Here, the specific threshold can be set to a fixed value or the average or median brightness value of the gradient calculation area.

[0183] According to some implementation schemes, predictor 540 can aggregate directional patterns individually for each of the multiple regions divided from the gradient calculation region, perform normalization on each aggregation, sum the normalized data, and select at least one representative pattern based on the summed data.

[0184] Alternatively, representative patterns can be selected from the corresponding tables (histograms) of multiple regions. Specifically, one or more of the most dominant patterns can be selected as representative patterns from the tables of each region.

[0185] As another example, predictor 540 can aggregate directional patterns across the entire gradient computation region at once and select at least one representative pattern accordingly.

[0186] 5. Generate the final predicted signal If at least one representative mode is selected, the predictor 540 can use the selected representative mode to generate a signal for the final prediction of the current block.

[0187] According to at least one embodiment for generating a final prediction signal for the current block by utilizing representative patterns, predictor 540 can use a table constructed according to the above processing as the basis for selecting n dominant directional patterns (where n is an integer, the same below) as representative patterns. Predictor 540 then uses each representative pattern to generate individual prediction signals for the current block, and these predicted signals can then be weighted and summed to generate a final prediction signal for the current block. Here, the number n or the maximum value of n can be set to a fixed value, or the number n can be adaptively determined based on the generated table. Alternatively, only patterns in the table whose aggregation is above a certain threshold can be selected as representative patterns. Alternatively, the value of n can be determined differently based on the size or area of ​​the current block. For example, when the area of ​​the current block is greater than or equal to a predefined threshold (e.g., 128), the value of n can be set to a value greater than that when this is not the case. For example, if the area of ​​the current block is greater than or equal to the predefined threshold, n can be set to a first value. Conversely, if the area of ​​the current block is less than the predefined threshold, n can be set to a second value less than the first value.

[0188] According to another implementation of generating the final prediction signal for the current block by utilizing representative patterns, predictor 540 can select n dominant directional patterns as representative patterns. Predictor 540 then generates the final prediction signal for the current block by performing a weighted sum of the prediction signals generated using each representative pattern and the prediction signals generated using a planar pattern.

[0189] According to another embodiment of the signal used to generate the final prediction of the current block by utilizing representative patterns, if the vertical directional pattern is the most dominant among the n representative patterns according to the generated table, then predictor 540 can generate the final prediction signal of the current block by weighted summing of the signals generated by utilizing each representative pattern and the signals generated by utilizing the vertical plane pattern. Alternatively, in this case, predictor 540 can also generate the final prediction signal of the current block by weighted summing of the signals generated by utilizing each representative pattern and the signals generated by utilizing the plane pattern and the vertical plane pattern.

[0190] According to another embodiment of the signal used to generate the final prediction of the current block by utilizing representative patterns, if the horizontal directional pattern is the most dominant among the n representative patterns according to the generated table, then predictor 540 can generate the final prediction signal of the current block by weighted summing the signals generated by utilizing each representative pattern and the signals generated by utilizing the horizontal plane pattern. Alternatively, in this case, predictor 540 can also generate the final prediction signal of the current block by weighted summing the signals generated by utilizing each representative pattern and the signals generated by utilizing the plane pattern and the horizontal plane pattern.

[0191] The vertical plane pattern predicts the target sample by weighted summing of the values ​​of its upper and lower adjacent samples, which are in the same column as the target sample within the current block and are adjacent to the current block. The horizontal plane pattern predicts the target sample by weighted summing of the values ​​of its left and right adjacent samples, which are in the same row as the target sample within the current block and are adjacent to the current block. The planar pattern predicts the target sample by performing a weighted average using two adjacent samples used in the vertical plane pattern and two adjacent samples used in the horizontal plane pattern.

[0192] Here, the right-hand adjacent sample and the bottom-hand adjacent sample of the current block can be samples that have not yet been reconstructed. In this case, the right-hand adjacent sample can be replaced by the adjacent sample located at the top right corner of the current block, and the bottom-hand adjacent sample can be replaced by the adjacent sample located at the bottom left corner of the current block.

[0193] According to at least one implementation of weighted summation of several predicted signals, the weights can be set to fixed values ​​that are the same for all patterns.

[0194] According to another implementation, the weight of each representative pattern can be determined based on the histogram size (cumulative strength value of the gradient) of the representative pattern. For example, larger weights can be assigned to patterns with larger histogram sizes. That is, larger weights can be assigned to prediction blocks predicted by patterns with larger histogram sizes.

[0195] As an alternative or additional implementation, the weights to be applied to samples within a prediction block predicted by the representative pattern can also be determined differently based on the sample location. For example, predictor 540 examines the histogram size of a specific representative pattern from the histograms of each of multiple regions and compares those sizes. Predictor 540 then assigns larger weights to samples within a prediction block that are closer to the region with the larger histogram size, where the prediction block is predicted by the representative pattern.

[0196] For example, if the histogram size of the representative pattern in the upper gradient region is a certain ratio or greater than the histogram size of the representative pattern in the left gradient region, then in the predicted samples within the prediction block predicted by that representative pattern, samples closer to the upper boundary of the prediction block are assigned greater weights. Conversely, in the opposite case, when the predicted samples are closer to the left boundary, greater weights are assigned to the predicted samples within the prediction block predicted by the representative pattern.

[0197] According to another implementation of weighted summation of several predicted signals, the weights can be implicitly and adaptively set by utilizing at least one of the following: the height and width of the current block, the table, the position of the sampling unit of the derivation of the representative pattern, and information about the calculated gradient.

[0198] According to another implementation of weighted summation of several predicted signals, the weights can be set to fixed values ​​that have the same weight for some modes, and for the remaining modes, the weights can be implicitly and adaptively set by utilizing at least one of the following: the height and width of the current block, the table, the position of the sampling unit determined by the relevant mode, and information about the calculated gradient.

[0199] On the other hand, the weights of signals applied to several individual predictions can be integerized based on a look-up table (LUT).

[0200] Figure 11 This is a flowchart of an intra-frame prediction method derived using a prediction mode according to at least one embodiment of the present invention.

[0201] The following is for reference Figure 11A method for predicting the current block by utilizing a prediction mode, performed by a video decoding apparatus or a video encoding apparatus according to the present invention, is described. Although the operation of the video decoding apparatus is described below, it will be apparent that the video encoding apparatus can perform the same operation.

[0202] The video decoding device calculates the gradient of each sampling unit within the gradient calculation region, which consists of the adjacent reconstructed reference samples of the current block (S1110). Here, the extent of the gradient calculation region and / or the size of the sampling unit can be determined based on the size or area of ​​the current block.

[0203] Subsequently, the video decoding device derives a directional prediction mode based on the gradient of each sampling unit and generates a histogram for the directional prediction mode (S1120). The directional prediction mode can be derived based on at least one of the position of the sampling unit, the aspect ratio of the current block, and the range of the gradient calculation region, and based on the gradient corresponding to the sampling unit.

[0204] The video decoding device derives at least one dominant prediction mode based on a histogram (S1130) and generates a prediction block by utilizing the at least one dominant prediction mode (S1140). When multiple dominant prediction modes are used, a prediction block is generated by utilizing each prediction mode (S1142), and the prediction blocks are weighted and summed to generate the final prediction block of the current block (S1144).

[0205] The apparatus or method according to the invention may have corresponding components arranged as hardware or software, or a combination of hardware and software. Furthermore, each component can be functionally implemented by software, and in implementation, a microprocessor can execute the function of each component via software.

[0206] Various exemplary implementations of the systems and methods described herein can be implemented using digital electronic circuits, integrated circuits, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include those implemented in one or more computer programs executable on a programmable system. The programmable system includes at least one programmable processor, which is configured to receive data and instructions from a storage system, at least one input device, and at least one output device, and to send data and instructions to the storage system, at least one input device, and at least one output device, wherein the programmable processor may be a dedicated processor or a general-purpose processor. The computer program (also referred to as a program, software, software application, or code) contains instructions for the programmable processor and is stored in a computer-readable recording medium.

[0207] Computer-readable recording media include any type of recording device on which data that can be recorded can be read by a computer system. Examples of computer-readable recording media include non-volatile or non-transitory media, such as ROM, CD-ROM, magnetic tape, floppy disk, memory card, hard disk, optical disk / magnetic disk, storage device, etc. Computer-readable recording media may further include transient media such as data transmission media. Furthermore, computer-readable recording media can be distributed across computer systems connected via a network, where computer-readable code can be stored and executed in a distributed manner.

[0208] Although the steps in the various flowcharts are described in sequence, these steps merely exemplify the technical ideas of some embodiments of the invention. Therefore, those skilled in the art to which this invention pertains can perform the steps by changing the order described in the various figures or by performing two or more steps in parallel. Thus, the steps in the various flowcharts are not limited to the chronological order shown.

[0209] Although exemplary embodiments of the invention have been described for illustrative purposes, those skilled in the art will understand that various modifications, additions, and substitutions can be made without departing from the spirit and scope of the invention. Therefore, embodiments of the invention have been described for the sake of brevity and clarity. The scope of the technical concept of the embodiments of the invention is not limited to the examples. Accordingly, those skilled in the art will understand that the scope of the invention should not be limited by the embodiments explicitly described above, but rather by the claims and their equivalents.

[0210] Cross-reference to related applications This application claims priority and benefit to Korean Patent Application No. 10-2023-0169361, filed on November 29, 2023, and Korean Patent Application No. 10-2024-0168696, filed on November 22, 2024, the entire contents of each of which are incorporated herein by reference.

Claims

1. A video decoding method for generating a prediction block for a current block, the video decoding method comprising: The size of the sampling unit used for gradient calculation is determined based on the size or area of ​​the current block; Within the gradient computation region containing the reconstructed reference samples around the current block, the gradient of a sampling cell of a defined size is computed, and a histogram of the directional prediction pattern corresponding to the gradient is generated. Based on the histogram, derive at least one or more dominant prediction patterns; as well as The predicted block for the current block is generated by utilizing at least one or more dominant prediction patterns.

2. The video decoding method according to claim 1, wherein, Each sampling unit is defined as having a center that is m pixels away from the center of other neighboring sampling units within the gradient calculation region, where m is an integer of 2 or greater.

3. The video decoding method according to claim 2, wherein, The distance of m pixels is determined based on at least one of the current block size, video resolution, and aspect ratio of the current block.

4. The video decoding method according to claim 1, further comprising: The sampling unit is defined based on the partition information of the neighboring blocks adjacent to the current block.

5. The video decoding method according to claim 1, wherein, Generating a histogram includes: Filter the samples within the target sampling unit; and The gradient of the target sampling unit is calculated by using the filtered samples within the target sampling unit.

6. The video decoding method according to claim 1, wherein, Generating a histogram includes: The directional prediction pattern is derived based on at least one of the following: the location of the sampling unit, the aspect ratio of the current block, or the extent of the gradient calculation region, and based on the gradient. Histograms are generated based on directional prediction patterns.

7. The video decoding method according to claim 6, wherein, Generating a histogram includes: From multiple directional prediction modes, determine a first directional prediction mode corresponding to the directionality of the gradient derived from the target sampling unit; and Based on at least one of the aspect ratio or gradient calculation region of the current block, the first directional prediction mode is replaced with a second directional prediction mode, or the first directional prediction mode is set to an unusable mode.

8. The video decoding method according to claim 6, wherein, Generating a histogram includes: From multiple directional prediction modes, determine the first directional prediction mode that corresponds to the directionality of the gradient derived from the target sampling unit; The availability of the first directional prediction mode is determined based on the position of the target sampling unit within the gradient calculation region; and When the first directional prediction pattern is determined to be usable, the first directional prediction pattern is used to generate a histogram.

9. The video decoding method according to claim 1, wherein, Generating a histogram includes: Early termination of the process, The early termination process includes: The cumulative intensity values ​​of the gradients of the sampling units are generated and updated by calculating gradients in a predetermined order; and The generation of histograms is terminated by comparing the cumulative intensity value with a predefined threshold.

10. The video decoding method according to claim 1, further comprising: Decode the flags used to indicate the gradient calculation region from the bitstream; as well as Based on the flag, the gradient calculation region is determined to be one or more of the left or upper regions of the current block.

11. The video decoding method according to claim 1, wherein, When the size of the current block is less than or equal to a predefined threshold, the size of the sampling unit is determined to be the first value. Alternatively, the size of the sampling unit can be determined to be a second value that is greater than the first value.

12. A video coding method for generating a prediction block for a current block, the video coding method comprising: The size of the sampling unit used for gradient calculation is determined based on the size or area of ​​the current block; Within the gradient computation region containing the reconstructed reference samples around the current block, the gradient of a sampling cell of a defined size is computed, and a histogram of the directional prediction pattern corresponding to the gradient is generated. Based on the histogram, derive at least one or more dominant prediction patterns; as well as The predicted block for the current block is generated by utilizing at least one or more dominant prediction patterns.

13. A method for providing a bitstream containing video data to a video decoding apparatus, the method comprising: Based on the prediction of the current block, the video data is encoded into a bitstream; as well as Send the bitstream to the video decoding device. The encoded video data includes: The size of the sampling unit used for gradient calculation is determined based on the size or area of ​​the current block; Within the gradient computation region containing the reconstructed reference samples around the current block, the gradient of a sampling cell of a defined size is computed, and a histogram of the directional prediction pattern corresponding to the gradient is generated. Based on the histogram, derive at least one or more dominant prediction patterns; and The predicted block for the current block is generated by utilizing at least one or more dominant prediction patterns.