Method for deriving intra prediction mode on basis of prediction mode of reconstructed block
The method addresses the inefficiencies in existing video compression by deriving intra prediction modes from neighboring blocks, enhancing encoding efficiency and quality through histogram-based selection.
Patent Information
- Application Number
- PCT/KR2025/008925
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-28
- Filing Date
- 2025-06-25
- Publication Date
- 2026-03-05
AI Technical Summary
Existing video compression technologies struggle to efficiently handle increasing image sizes, resolutions, and frame rates, requiring improved encoding efficiency and image quality.
A method for deriving an intra prediction mode of a current block using prediction modes of restored adjacent and non-adjacent blocks, constructing a histogram of occurrence, and selecting an intra prediction mode based on block size to generate prediction blocks.
Improves video encoding efficiency and enhances video quality by utilizing neighboring block information for intra prediction.
Smart Images

Figure KR2025008925_05032026_PF_FP_ABST
Abstract
Description
A method for deriving an intra prediction mode based on the prediction mode of a restoration block
[0001] The present disclosure relates to a video encoding / decoding method, device, and recording medium for storing a bitstream, and relates to a method for deriving an intra prediction mode based on a prediction mode of a restored block.
[0002] The content described below merely provides background information related to the present invention and does not constitute prior art.
[0003] Since video data has a large amount of data compared to voice data or still image data, it requires a lot of hardware resources, including memory, to store or transmit it without processing for compression.
[0004] Therefore, when storing or transmitting video data, the encoder compresses the video data and stores or transmits it, and the decoder receives the compressed video data, decompresses it, and plays it back. These video compression technologies include H.264 / AVC, HEVC (High Efficiency Video Coding), and VVC (Versatile Video Coding), which improves encoding efficiency by about 30% compared to HEVC.
[0005] However, as the size, resolution, and frame rate of images are gradually increasing, and the amount of data that needs to be encoded is also increasing, a new compression technology that has better encoding efficiency and better image quality improvement than existing compression technologies is required.
[0006] The present disclosure aims to provide a video encoding / decoding method and device for deriving an intra prediction mode of a current block using prediction modes of restored blocks around the current block, and a recording medium for storing a bitstream generated by the video encoding method / device.
[0007] According to an embodiment of the present disclosure, a method for restoring a current block, performed by an image decoding device, is provided, comprising: obtaining candidate intra prediction modes based on prediction information of neighboring blocks of the current block, wherein the neighboring blocks include pre-restored adjacent blocks and pre-restored non-adjacent blocks; constructing a histogram of occurrence of each candidate intra prediction mode based on a size of each neighboring block; selecting at least one intra prediction mode of the current block based on the occurrence histogram and the size of the current block; and generating at least one prediction block of the current block according to the at least one intra prediction mode.
[0008] According to another embodiment of the present disclosure, a method for encoding a current block, performed by a video encoding apparatus, is provided, comprising: obtaining candidate intra prediction modes based on prediction information of neighboring blocks of the current block, wherein the neighboring blocks include pre-restored adjacent blocks and pre-restored non-adjacent blocks; constructing a histogram of occurrence of each candidate intra prediction mode based on a size of each neighboring block; selecting at least one intra prediction mode of the current block based on the occurrence histogram and the size of the current block; and generating at least one prediction block of the current block according to the at least one intra prediction mode.
[0009] According to another embodiment of the present disclosure, a method for providing video data to a video decoding device is provided, comprising: encoding the video data into a bitstream; and transmitting the bitstream to the video decoding device, wherein the encoding the video data comprises: obtaining candidate intra prediction modes based on prediction information of neighboring blocks of a current block, wherein the neighboring blocks include pre-restored adjacent blocks and pre-restored non-adjacent blocks; constructing a histogram of occurrence of each candidate intra prediction mode based on a size of each neighboring block; selecting at least one intra prediction mode of the current block based on the occurrence histogram and the size of the current block; and generating at least one prediction block of the current block according to the at least one intra prediction mode.
[0010] As described above, by providing a video encoding / decoding method and device according to the present embodiment and a recording medium for storing a bitstream generated by the video encoding method / device, it is possible to improve video encoding efficiency and enhance video quality.
[0011] FIG. 1 is an exemplary block diagram of an image encoding device capable of implementing the techniques of the present disclosure.
[0012] Figure 2 is a drawing for explaining a method of dividing a block using the QTBTTT (QuadTree plus BinaryTree TernaryTree) structure.
[0013] FIGS. 3A and 3B are diagrams illustrating multiple intra prediction modes, including wide-angle intra prediction modes.
[0014] Figure 4 is an example diagram of the surrounding blocks of the current block.
[0015] FIG. 5 is an exemplary block diagram of an image decoding device capable of implementing the techniques of the present disclosure.
[0016] FIG. 6 is a block diagram illustrating in detail a portion of an image decoding device according to one embodiment of the present disclosure.
[0017] FIG. 7 is an exemplary diagram showing a restored area surrounding a current block according to one embodiment of the present disclosure.
[0018] FIG. 8 is an exemplary diagram showing a reference line of a peripheral restored area according to one embodiment of the present disclosure.
[0019] FIG. 9 is an exemplary diagram illustrating restored adjacent blocks according to one embodiment of the present disclosure.
[0020] FIG. 10 is an exemplary diagram showing restored adjacent blocks according to another embodiment of the present disclosure.
[0021] FIG. 11 is an exemplary diagram illustrating restored non-adjacent blocks according to another embodiment of the present disclosure.
[0022] FIG. 12 is an exemplary diagram showing a chain search of reference blocks according to one embodiment of the present disclosure.
[0023] FIG. 13 is an exemplary diagram showing the positional relationship between a current block and surrounding blocks according to one embodiment of the present disclosure.
[0024] Figures 14a and 14b are flowcharts showing a method for determining an inverse transform kernel.
[0025] FIG. 15 is a flowchart illustrating a method for an image encoding device to encode a current block according to one embodiment of the present disclosure.
[0026] FIG. 16 is a flowchart illustrating a method for an image decoding device to restore a current block according to one embodiment of the present disclosure.
[0027] Hereinafter, embodiments of the present invention will be described in detail with reference to exemplary drawings. When designating components in each drawing, it should be noted that, where possible, identical components are given the same reference numerals, even if they appear in different drawings. Furthermore, in describing the present embodiments, detailed descriptions of related known structures or functions will be omitted if they are deemed to obscure the gist of the present embodiments.
[0028] FIG. 1 is an exemplary block diagram of an image encoding device capable of implementing the techniques of the present disclosure. Hereinafter, the image encoding device and its subcomponents will be described with reference to the illustration in FIG. 1.
[0029] The video encoding device may be configured to include a picture segmentation unit (110), a prediction unit (120), a subtractor (130), a transformation unit (140), a quantization unit (145), a reordering unit (150), an entropy encoding unit (155), an inverse quantization unit (160), an inverse transformation unit (165), an adder (170), a loop filter unit (180), and a memory (190).
[0030] Each component of the video encoding device may be implemented in hardware, software, or a combination of hardware and software. Furthermore, the functions of each component may be implemented in software, with a microprocessor executing the software functions corresponding to each component.
[0031] A single image (video) is composed of one or more sequences containing multiple pictures. Each picture is divided into multiple regions, and encoding is performed for each region. For example, a single picture is divided into one or more tiles and / or slices. Here, one or more tiles can be defined as a tile group. Each tile or slice is divided into one or more Coding Tree Units (CTUs). Each CTU is then divided into one or more Coding Units (CUs) by a tree structure. Information applied to each 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. In addition, information commonly applied to all blocks within a single slice is encoded as the syntax of the slice header, and information applied to all blocks constituting one or more pictures is encoded in the Picture Parameter Set (PPS) or the picture header. Furthermore, information commonly referenced by multiple pictures is encoded in a Sequence Parameter Set (SPS). And, information commonly referenced by one or more SPS is encoded in a Video Parameter Set (VPS). In addition, information commonly applied to one tile or tile group may be encoded as syntax of a tile or tile group header. Syntaxes included in an SPS, PPS, slice header, tile or tile group header may be referred to as high level syntax.
[0032] The picture segmentation unit (110) determines the size of the CTU. Information about the size of the CTU (CTU size) is encoded as the syntax of SPS or PPS and transmitted to the image decoding device.
[0033] The picture segmentation unit (110) divides each picture constituting an image into a plurality of CTUs having a predetermined size, and then recursively divides the CTUs using a tree structure. A leaf node in the tree structure becomes a CU, which is a basic unit of encoding.
[0034] The tree structure may be a QuadTree (QT) in which an upper node (or parent node) is divided into four lower nodes (or child nodes) of the same size, a BinaryTree (BT) in which an upper node is divided into two lower nodes, or a TernaryTree (TT) in which an upper node is divided into three lower nodes in a 1:2:1 ratio, or a structure that mixes two or more of the QT structures, BT structures, and TT structures. For example, a QTBT (QuadTree plus BinaryTree) structure may be used, or a QTBTTT (QuadTree plus BinaryTree TernaryTree) structure may be used. Here, BTTT may be combined and referred to as a MTT (Multiple-Type Tree).
[0035] Figure 2 is a drawing for explaining a method of dividing a block using the QTBTTT structure.
[0036] As illustrated in FIG. 2, a CTU may first be split into a QT structure. The quadtree splitting may be repeated until the size of the splitting block reaches the minimum block size (MinQTSize) of the leaf node allowed in the QT. A first flag (QT_split_flag) indicating whether each node of the QT structure is split into four nodes of the lower layer is encoded by the entropy encoding unit (155) and signaled to the image decoding device. If the leaf node of the QT is not larger than the maximum block size (MaxBTSize) of the root node allowed in the BT, it may be further split into one or more of the BT structure or the TT structure. In the BT structure and / or the TT structure, multiple splitting directions may exist. For example, there may be two directions in which the block of the corresponding node is split horizontally and two directions in which the block is split vertically. As illustrated in FIG. 2, when MTT splitting begins, a second flag (mtt_split_flag) indicating whether nodes have been split, and if splitting has occurred, a flag indicating the splitting direction (vertical or horizontal) and / or a flag indicating the splitting type (Binary or Ternary) are encoded by the entropy encoding unit (155) and signaled to the image decoding device.
[0037] Alternatively, before encoding the first flag (QT_split_flag) indicating whether each node is split into four nodes of a lower layer, a CU split flag (split_cu_flag) indicating whether the node is split may be encoded. If the CU split flag (split_cu_flag) value indicates that the node is not split, the block of the corresponding node becomes a leaf node in the split tree structure and becomes a CU (coding unit), which is a basic unit of encoding. If the CU split flag (split_cu_flag) value indicates that the node is split, the video encoding device starts encoding from the first flag in the above-described manner.
[0038] As another example of a tree structure, when QTBT is used, there may be two types: a type that horizontally splits the block of the corresponding node into two blocks of the same size (i.e., symmetric horizontal splitting) and a type that vertically splits it (i.e., symmetric vertical splitting). A split flag (split_flag) indicating whether each node of the BT structure is split into blocks of a lower layer and split type information indicating the type of split are encoded by the entropy encoding unit (155) and transmitted to the image decoding device. Meanwhile, there may additionally be a type that splits the block of the corresponding node into two blocks of an asymmetrical shape. The asymmetric shape may include a shape that splits the block of the corresponding node into two rectangular blocks with a size ratio of 1:3, or a shape that splits the block of the corresponding node in a diagonal direction.
[0039] A CU can have various sizes depending on the QTBT or QTBTTT partitioning from the CTU. Hereinafter, the block corresponding to the CU to be encoded or decoded (i.e., the leaf node of the QTBTTT) is referred to as the "current block." Depending on the QTBTTT partitioning employed, the current block may be rectangular as well as square.
[0040] The prediction unit (120) predicts the current block and generates a prediction block. The prediction unit (120) includes an intra prediction unit (122) and an inter prediction unit (124).
[0041] In general, each current block within a picture can be predictively coded. Prediction of the current block can typically be performed using either intra-prediction (using data from the picture containing the current block) or inter-prediction (using data from a picture coded before the picture containing the current block). Inter-prediction encompasses both unidirectional and bidirectional prediction.
[0042] The intra prediction unit (122) predicts pixels within the current block using pixels (reference pixels) located around the current block within the current picture including the current block. There are multiple intra prediction modes depending on the prediction direction. For example, as shown in Fig. 3a, the multiple intra prediction modes may include two non-directional modes including the Planar mode and the DC mode, and 65 directional modes. The surrounding pixels to be used and the calculation formula are defined differently depending on each prediction mode.
[0043] For efficient directional prediction for a rectangular current block, directional modes (intra prediction modes 67 to 80 and -1 to -14) indicated by dotted arrows in Fig. 3b may be additionally used. These may be referred to as "wide-angle intra-prediction modes." In Fig. 3b, the arrows point to corresponding reference samples used for prediction, and do not indicate the prediction direction. The prediction direction is opposite to the direction indicated by the arrows. Wide-angle intra-prediction modes are modes that perform prediction in the opposite direction of a specific directional mode without additional bit transmission when the current block is rectangular. At this time, among the wide-angle intra-prediction modes, some wide-angle intra-prediction modes available for the current block may be determined based on the ratio of the width and height of the rectangular current block. For example, wide-angle intra prediction modes (intra prediction modes 67 to 80) having an angle less than 45 degrees are available when the current block is a rectangular shape whose height is smaller than its width, and wide-angle intra prediction modes (intra prediction modes -1 to -14) having an angle greater than -135 degrees are available when the current block is a rectangular shape whose width is larger than its height.
[0044] The intra prediction unit (122) can determine an intra prediction mode to be used to encode the current block. In some examples, the intra prediction unit (122) can encode the current block using multiple intra prediction modes and select an appropriate intra prediction mode to be used from the tested modes. For example, the intra prediction unit (122) can calculate bit-rate distortion values using rate-distortion analysis for multiple tested intra prediction modes and select an intra prediction mode with the best bit-rate distortion characteristics among the tested modes.
[0045] The intra prediction unit (122) selects one intra prediction mode from among multiple intra prediction modes and predicts the current block using surrounding pixels (reference pixels) and an operation formula determined according to the selected intra prediction mode. Information about the selected intra prediction mode is encoded by the entropy encoding unit (155) and transmitted to the image decoding device.
[0046] The inter prediction unit (124) generates a prediction block for the current block using a motion compensation process. The inter prediction unit (124) searches for a block most similar to the current block within reference pictures that were encoded and decoded before the current picture, and generates a prediction block for the current block using the searched block. Then, a motion vector (MV) corresponding to the displacement between the current block within the current picture and the prediction block within the reference picture is generated. Generally, motion estimation is performed on the luma component, and the motion vector calculated based on the luma component is used for both the luma component and the chroma component. The motion information including information on the reference picture used to predict the current block and information on the motion vector is encoded by the entropy encoding unit (155) and transmitted to the image decoding device.
[0047] The inter prediction unit (124) may perform interpolation on a reference picture or a reference block to improve prediction accuracy. That is, subsamples between two consecutive integer samples are interpolated by applying filter coefficients to a plurality of consecutive integer samples including the two integer samples. When a process of searching for a block most similar to the current block is performed on the interpolated reference picture, the motion vector can be expressed up to a precision in decimal units rather than a precision in integer sample units. The precision or resolution of the motion vector can be set differently for each target region to be encoded, such as a slice, tile, CTU, CU, etc. When such adaptive motion vector resolution (AMVR) is applied, information on the motion vector resolution to be applied to each target region must be signaled for each target region. For example, when the target region is a CU, information on the motion vector resolution applied to each CU is signaled. Information on the motion vector resolution may be information indicating the precision of a differential motion vector, which will be described later.
[0048] Meanwhile, the inter prediction unit (124) can perform inter prediction using bi-prediction. In the case of bi-prediction, two reference pictures and two motion vectors indicating the block position most similar to the current block within each reference picture are used. The inter prediction unit (124) selects a first reference picture and a second reference picture from reference picture list 0 (RefPicList0) and reference picture list 1 (RefPicList1), respectively, and searches for a block similar to the current block within each reference picture to generate a first reference block and a second reference block. Then, the first reference block and the second reference block are averaged or weighted averaged to generate a prediction block for the current block. Then, motion information including information on two reference pictures used to predict the current block and information on two motion vectors is transmitted to the entropy encoding unit (155). Here, reference picture list 0 may be composed of pictures that are before the current picture in display order among the restored pictures, and reference picture list 1 may be composed of pictures that are after the current picture in display order among the restored pictures. However, this is not necessarily limited to this, and restored pictures that are after the current picture in display order may be additionally included in reference picture list 0, and conversely, restored pictures that are before the current picture may be additionally included in reference picture list 1.
[0049] Various methods can be used to minimize the number of bits required to encode motion information.
[0050] For example, if the reference picture and motion vector of the current block are identical to those of a neighboring block, the motion information of the current block can be transmitted to the image decoding device by encoding information that can identify the neighboring block. This method is called 'merge mode'.
[0051] In merge mode, the inter prediction unit (124) selects a predetermined number of merge candidate blocks (hereinafter referred to as 'merge candidates') from the surrounding blocks of the current block.
[0052] As the surrounding blocks for deriving merge candidates, all or part of the left block (A0), the lower left block (A1), the upper block (B0), the upper right block (B1), and the upper left block (B2) adjacent to the current block within the current picture may be used, as illustrated in FIG. 4. In addition, a block located within a reference picture (which may or may not be the same as the reference picture used to predict the current block) other than the current picture in which the current block is located may be used as a merge candidate. For example, a block co-located with the current block within the reference picture or blocks adjacent to the block at the co-located block may be additionally used as a merge candidate. If the number of merge candidates selected by the method described above is less than a preset number, a 0 vector is added to the merge candidates.
[0053] The inter prediction unit (124) uses these surrounding blocks to construct a merge list containing a predetermined number of merge candidates. Among the merge candidates included in the merge list, the merge candidate to be used as motion information of the current block is selected and merge index information for identifying the selected candidate is generated. The generated merge index information is encoded by the entropy encoding unit (155) and transmitted to the video decoding device.
[0054] Merge Skip mode is a special case of merge mode. After quantization, when all transform coefficients for entropy encoding are close to zero, only neighboring block selection information is transmitted without transmitting residual signals. By utilizing merge skip mode, relatively high encoding efficiency can be achieved for low-motion images, still images, and screen content images.
[0055] Hereinafter, merge mode and merge skip mode are collectively referred to as merge / skip mode.
[0056] Another method for encoding motion information is Advanced Motion Vector Prediction (AMVP) mode.
[0057] In AMVP mode, the inter prediction unit (124) derives predicted motion vector candidates for the motion vector of the current block using neighboring blocks of the current block. As neighboring blocks used to derive predicted motion vector candidates, all or some of the left block (A0), the lower left block (A1), the upper block (B0), the upper right block (B1), and the upper left block (B2) adjacent to the current block in the current picture as shown in FIG. 4 may be used. In addition, a block located in a reference picture (which may or may not be the same as the reference picture used to predict the current block) other than the current picture in which the current block is located may be used as the neighboring block used to derive predicted motion vector candidates. For example, a block co-located with the current block in the reference picture or blocks adjacent to the block in the co-located block may be used. If the number of motion vector candidates is less than a preset number by the method described above, a 0 vector is added to the motion vector candidates.
[0058] The inter prediction unit (124) derives predicted motion vector candidates using the motion vectors of these surrounding blocks, and determines a predicted motion vector for the motion vector of the current block using the predicted motion vector candidates. Then, the predicted motion vector is subtracted from the motion vector of the current block to produce a differential motion vector.
[0059] The predicted motion vector can be obtained by applying a predefined function (e.g., median, mean, etc.) to the predicted motion vector candidates. In this case, the image decoding device also knows the predefined function. In addition, since the surrounding blocks used to derive the predicted motion vector candidates are blocks that have already been encoded and decoded, the image decoding device also already knows the motion vectors of the surrounding blocks. Therefore, the image encoding device does not need to encode information to identify the predicted motion vector candidates. Therefore, in this case, information about the differential motion vector and information about the reference picture used to predict the current block are encoded.
[0060] Alternatively, the predicted motion vector can be determined by selecting one of the predicted motion vector candidates. In this case, information for identifying the selected predicted motion vector candidate is additionally encoded, along with information about the differential motion vector and the reference picture used to predict the current block.
[0061] The subtractor (130) subtracts the prediction block generated by the intra prediction unit (122) or inter prediction unit (124) from the current block to generate a residual block.
[0062] The transformation unit (140) transforms residual signals in a residual block having pixel values in a spatial domain into transform coefficients in a frequency domain. The transformation unit (140) may transform the residual signals in the residual block using the entire size of the residual block as a transformation unit, or may divide the residual block into a plurality of sub-blocks and use the sub-blocks as transformation units to perform the transformation. Alternatively, the residual signals may be transformed using only the transformation domain sub-block as a transformation unit by dividing the sub-blocks into two sub-blocks, that is, a transformation domain and a non-transform domain. Here, the transformation domain sub-block may be one of two rectangular blocks having a size ratio of 1:1 with respect to the horizontal axis (or vertical axis). In this case, a flag (cu_sbt_flag) indicating that only a sub-block has been converted, directionality (vertical / horizontal) information (cu_sbt_horizontal_flag), and / or position information (cu_sbt_pos_flag) are encoded by the entropy encoding unit (155) and signaled to the image decoding device. In addition, the size of the conversion area sub-block may have a size ratio of 1:3 with respect to the horizontal axis (or vertical axis), and in this case, a flag (cu_sbt_quad_flag) distinguishing the corresponding division is additionally encoded by the entropy encoding unit (155) and signaled to the image decoding device.
[0063] Meanwhile, the transformation unit (140) can individually perform transformations on the residual block in the horizontal and vertical directions. For the transformation, various types of transformation functions or transformation matrices can be used. For example, a pair of transformation functions for horizontal transformation and vertical transformation can be defined as a Multiple Transform Set (MTS). The transformation unit (140) can select one transformation function pair with the best transformation efficiency among the MTS and transform the residual block in the horizontal and vertical directions, respectively. Information (mts_idx) on the transformation function pair selected among the MTS is encoded by the entropy encoding unit (155) and signaled to the image decoding device.
[0064] The quantization unit (145) quantizes the transform coefficients output from the transform unit (140) using quantization parameters and outputs the quantized transform coefficients to the entropy encoding unit (155). The quantization unit (145) may directly quantize a related residual block without transformation for a certain block or frame. The quantization unit (145) may also apply different quantization coefficients (scaling values) according to the positions of the transform coefficients within the transform block. The quantization matrix applied to the quantized transform coefficients arranged in two dimensions may be encoded and signaled to an image decoding device.
[0065] The rearrangement unit (150) can perform rearrangement of coefficient values for quantized residual values.
[0066] The reordering unit (150) can change a two-dimensional coefficient array into a one-dimensional coefficient sequence by using coefficient scanning. For example, the reordering unit (150) can output a one-dimensional coefficient sequence by scanning from the DC coefficient to the coefficients of the high-frequency region by using a zig-zag scan or a diagonal scan. Depending on the size of the transformation unit and the intra prediction mode, a vertical scan that scans the two-dimensional coefficient array in the column direction or a horizontal scan that scans the two-dimensional block-shaped coefficients in the row direction may be used instead of the zig-zag scan. That is, depending on the size of the transformation unit and the intra prediction mode, the scanning method to be used may be determined among the zig-zag scan, the diagonal scan, the vertical scan, and the horizontal scan.
[0067] The entropy encoding unit (155) generates a bitstream by encoding a sequence of one-dimensional quantized transform coefficients output from the rearrangement unit (150) using various encoding methods such as CABAC (Context-based Adaptive Binary Arithmetic Code) and Exponential Golomb.
[0068] In addition, the entropy encoding unit (155) encodes information related to block division, such as CTU size, CU division flag, QT division flag, MTT division type, and MTT division direction, so that the image decoding device can divide the block in the same manner as the image encoding device. In addition, the entropy encoding unit (155) encodes information about a prediction type indicating whether the current block is encoded by intra prediction or inter prediction, and encodes intra prediction information (i.e., information about an intra prediction mode) or inter prediction information (information about an encoding mode of motion information (merge mode or AMVP mode), a merge index in the case of a merge mode, and a reference picture index and a differential motion vector in the case of an AMVP mode) according to the prediction type. In addition, the entropy encoding unit (155) encodes information related to quantization, that is, information about a quantization parameter and information about a quantization matrix.
[0069] The inverse quantization unit (160) inversely quantizes the quantized transform coefficients output from the quantization unit (145) to generate transform coefficients. The inverse transform unit (165) transforms the transform coefficients output from the inverse quantization unit (160) from the frequency domain to the spatial domain to restore the residual block.
[0070] An adder (170) adds the restored residual block and the predicted block generated by the prediction unit (120) to restore the current block. The pixels within the restored current block are used as reference pixels when intra-predicting the next block.
[0071] The loop filter unit (180) performs filtering on restored pixels to reduce blocking artifacts, ringing artifacts, blurring artifacts, etc. that occur due to block-based prediction and transformation / quantization. The loop filter unit (180) may include all or part of a deblocking filter (182), a sample adaptive offset (SAO) filter (184), and an adaptive loop filter (ALF, 186) as an in-loop filter.
[0072] The deblocking filter (182) filters the boundaries between restored blocks to remove blocking artifacts caused by block-based encoding / decoding, and the SAO filter (184) and the ALF (186) perform additional filtering on the deblocking-filtered image. The SAO filter (184) and the ALF (186) are filters used to compensate for the differences between restored pixels and original pixels caused by lossy coding. The SAO filter (184) improves not only subjective image quality but also encoding efficiency by applying an offset in units of CTUs. In contrast, the ALF (186) performs block-based filtering, and compensates for distortion by applying different filters by distinguishing the edges and degrees of variation of the corresponding block. Information on filter coefficients to be used in the ALF can be encoded and signaled to an image decoding device.
[0073] The restored blocks filtered through the deblocking filter (182), SAO filter (184), and ALF (186) are stored in the memory (190). When all blocks within a picture are restored, the restored picture can be used as a reference picture for inter-predicting blocks within a picture to be encoded later.
[0074] The video encoding device can store the bitstream of encoded video data on a non-transitory storage medium or transmit it to the video decoding device using a communication network.
[0075] FIG. 5 is an exemplary block diagram of an image decoding device capable of implementing the techniques of the present disclosure. Hereinafter, the image decoding device and its subcomponents will be described with reference to FIG. 5.
[0076] The video decoding device may be configured to include an entropy decoding unit (510), a rearrangement unit (515), an inverse quantization unit (520), an inverse transformation unit (530), a prediction unit (540), an adder (550), a loop filter unit (560), and a memory (570).
[0077] Similar to the video encoding device of FIG. 1, each component of the video decoding device may be implemented in hardware, software, or a combination of hardware and software. Furthermore, the functions of each component may be implemented in software, with a microprocessor executing the software functions corresponding to each component.
[0078] The entropy decoding unit (510) decodes the bitstream generated by the image encoding device to extract information related to block division, thereby determining the current block to be decoded, and extracts prediction information, information on residual signals, etc. required to restore the current block.
[0079] The entropy decoding unit (510) extracts information about the CTU size from the Sequence Parameter Set (SPS) or the Picture Parameter Set (PPS), determines the size of the CTU, and divides the picture into CTUs of the determined size. Then, the CTU is determined as the top layer of the tree structure, i.e., the root node, and the CTU is divided using the tree structure by extracting division information about the CTU.
[0080] For example, when splitting a CTU using the QTBTTT structure, first, the first flag (QT_split_flag) related to the splitting of QT is extracted, and each node is split into four nodes of the lower layer. Then, for the nodes corresponding to the leaf nodes of QT, the second flag (mtt_split_flag) related to the splitting of MTT and the split direction (vertical / horizontal) and / or split type (binary / ternary) information are extracted, and the corresponding leaf nodes are split into the MTT structure. Accordingly, each node below the leaf nodes of QT are split recursively into the BT or TT structure.
[0081] As another example, when splitting a CTU using the QTBTTT structure, the CU split flag (split_cu_flag) indicating whether the CU is split is first extracted, and if the block is split, the first flag (QT_split_flag) may be extracted. During the splitting process, each node may undergo zero or more repeated QT splits followed by zero or more repeated MTT splits. For example, a CTU may undergo an MTT split right away, or conversely, may undergo only multiple QT splits.
[0082] As another example, when splitting a CTU using the QTBT structure, the first flag (QT_split_flag) related to the splitting of QT is extracted, and each node is split into four nodes of the lower layer. Furthermore, for nodes corresponding to leaf nodes of QT, a split flag (split_flag) indicating whether to further split into BTs and splitting direction information are extracted.
[0083] Meanwhile, when the entropy decoding unit (510) determines the current block to be decoded by using the division of the tree structure, it extracts information on the prediction type indicating whether the current block is intra-predicted or inter-predicted. If the prediction type information indicates intra-prediction, the entropy decoding unit (510) extracts syntax elements for intra-prediction information (intra-prediction mode) of the current block. If the prediction type information indicates inter-prediction, the entropy decoding unit (510) extracts syntax elements for inter-prediction information, i.e., information indicating a motion vector and a reference picture referenced by the motion vector.
[0084] Additionally, the entropy decoding unit (510) extracts information about the quantized transform coefficients of the current block as information related to quantization and information about residual signals.
[0085] The rearrangement unit (515) can change the sequence of one-dimensional quantized transform coefficients entropy-decoded in the entropy decoding unit (510) back into a two-dimensional coefficient array (i.e., block) in the reverse order of the coefficient scanning performed by the image encoding device.
[0086] The inverse quantization unit (520) inversely quantizes the quantized transform coefficients and inversely quantizes the quantized transform coefficients using the quantization parameters. The inverse quantization unit (520) may also apply different quantization coefficients (scaling values) to the quantized transform coefficients arranged in two dimensions. The inverse quantization unit (520) may perform inverse quantization by applying a matrix of quantized coefficients (scaling values) from an image encoding device to a two-dimensional array of quantized transform coefficients.
[0087] The inverse transform unit (530) inversely transforms the inverse quantized transform coefficients from the frequency domain to the spatial domain to restore residual signals, thereby generating a residual block for the current block.
[0088] In addition, when the inverse transform unit (530) inversely transforms only a portion of a transform block (sub-block), it extracts a flag (cu_sbt_flag) indicating that only a sub-block of the transform block has been transformed, directionality (vertical / horizontal) information (cu_sbt_horizontal_flag) of the sub-block, and / or position information (cu_sbt_pos_flag) of the sub-block, and inversely transforms the transform coefficients of the corresponding sub-block from the frequency domain to the spatial domain to restore residual signals, and fills “0” values with residual signals for areas that have not been inversely transformed, thereby generating a final residual block for the current block.
[0089] In addition, when MTS is applied, the inverse transform unit (530) determines a transform function or a transform matrix to be applied in the horizontal and vertical directions using MTS information (mts_idx) signaled from the image encoding device, and performs inverse transform on the transform coefficients within the transform block in the horizontal and vertical directions using the determined transform function.
[0090] The prediction unit (540) may include an intra prediction unit (542) and an inter prediction unit (544). The intra prediction unit (542) is activated when the prediction type of the current block is intra prediction, and the inter prediction unit (544) is activated when the prediction type of the current block is inter prediction.
[0091] The intra prediction unit (542) determines the intra prediction mode of the current block among a plurality of intra prediction modes from the syntax elements for the intra prediction mode extracted from the entropy decoding unit (510), and predicts the current block using reference pixels around the current block according to the intra prediction mode.
[0092] The inter prediction unit (544) uses the syntax elements for the inter prediction mode extracted from the entropy decoding unit (510) to determine the motion vector of the current block and the reference picture referenced by the motion vector, and predicts the current block using the motion vector and the reference picture.
[0093] An adder (550) adds the residual block output from the inverse transform unit (530) and the predicted block output from the inter prediction unit (544) or the intra prediction unit (542) to restore the current block. The pixels within the restored current block are used as reference pixels when intra-predicting a block to be decoded later.
[0094] The loop filter unit (560) may include a deblocking filter (562), an SAO filter (564), and an ALF (566) as in-loop filters. The deblocking filter (562) deblocks the boundaries between restored blocks to remove blocking artifacts caused by block-by-block decoding. The SAO filter (564) and the ALF (566) perform additional filtering on restored blocks after deblocking filtering to compensate for differences between restored pixels and original pixels caused by lossy coding. The filter coefficients of the ALF are determined using information about filter coefficients decoded from the non-stream.
[0095] The restored blocks filtered through the deblocking filter (562), SAO filter (564), and ALF (566) are stored in the memory (570). When all blocks within a picture are restored, the restored picture is used as a reference picture for inter-predicting blocks within a picture to be encoded later.
[0096] The present embodiment relates to encoding and decoding of images (video) as described above. More specifically, it provides an image encoding / decoding method and device for deriving an intra prediction mode of a current block using the prediction modes of previously restored blocks located around the current block, and a recording medium for storing a bitstream generated by the image encoding method / device.
[0097] The following embodiments may be performed by a prediction unit (120), a transformation unit (140), and an inverse transformation unit (165) within a video encoding apparatus. In addition, the following embodiments may be performed by a prediction unit (540) and an inverse transformation unit (530) within a video decoding apparatus.
[0098] The video encoding device can generate signaling information related to the present embodiment in terms of rate distortion optimization in encoding the current block. The video encoding device can encode the signaling information using the entropy encoding unit (155) and then transmit it to the video decoding device. The video decoding device can decode the signaling information related to the decoding of the current block from the bitstream using the entropy decoding unit (510).
[0099] In the following description, the term "target block" may be used interchangeably with the current block or coding unit (CU). Alternatively, the term "target block" may also refer to a portion of a coding unit.
[0100] Also, a value of a flag being true indicates that the flag is set to 1. Also, a value of a flag being false indicates that the flag is set to 0.
[0101] The decoder side includes all or part of the inverse quantization unit (160), the inverse transform unit (165), the prediction unit (120), the adder (170), the loop filter unit (180), and the memory (190) in the video encoding device illustrated in FIG. 1. Alternatively, the decoder side includes all or part of the inverse quantization unit (520), the inverse transform unit (530), the prediction unit (540), the adder (550), the loop filter unit (560), and the memory (570) in the video decoding device illustrated in FIG. 5. With respect to a series of decoding processes, the decoder side of the video encoding device and the decoder side of the video decoding device perform the same operation. The video encoding device determines information related to the operation of the decoder side and signals the determined information to the video decoding device. The video decoding device can decode the signaled information and operate the decoder side based on the decoded information.
[0102] I. Intra Prediction - OBIC (Occurrence-based Intra Coding) Mode
[0103] OBIC mode derives multiple intra prediction directions based on prediction information of spatially adjacent blocks and non-adjacent blocks in the restoration area around the current block, generates corresponding prediction blocks using one or more derived intra prediction directions, and weights and adds the prediction blocks to generate the final prediction block of the current block.
[0104] In OBIC mode, a candidate list of intra prediction modes is constructed based on prediction information of adjacent and non-adjacent blocks to derive an intra prediction mode. To construct the candidate list, neighboring blocks can be searched in the order of adjacent and non-adjacent blocks. Each candidate in the candidate list can be rearranged based on distance-based rearrangement. During the rearrangement process, the distance between the upper-left coordinate of the current block and the upper-left coordinates of adjacent and non-adjacent blocks included in the candidate list is used. The prediction mode of a candidate with a smaller distance can be arranged first in the list. In other words, the rearrangement can be performed so that the prediction mode associated with a candidate with a smaller distance is given a higher priority.
[0105] Among the rearranged candidate lists, only some candidate modes can be selected as the multiple intra prediction modes to be used for prediction. To select multiple intra prediction modes, the OBIC mode constructs a histogram of occurrences (HoC). The histogram is constructed using the sizes of the adjacent / non-adjacent blocks in which the candidate mode occurs as amplitudes. Specifically, the method of adding candidate modes to the histogram may vary based on the prediction modes of the adjacent / non-adjacent blocks in which each candidate mode occurs. The prediction modes can be distinguished as Template-based Intra Mode Derivation (TIMD), Decoder-side Intra Mode Derivation (DIMD), OBIC, Spatial Geometric Partitioning Mode (SGPM), Template-based Multiple Reference Line (TMRL), Extrapolation Intra Prediction (EIP), Intra Template Matching Prediction (IntraTMP), Matrix-based Intra Prediction (MIP), and other intra prediction modes.
[0106] 1) If the block is predicted according to TIMD and 2 or 3 prediction modes are weighted, all modes (2 or 3) used in the weighted sum are added to the histogram using the block size as the amplitude.
[0107] 2) If the block is predicted according to DIMD, all modes (up to 5) used in the weighted sum are added to the histogram using the block size as the amplitude.
[0108] 3) If the block is predicted according to OBIC, all modes (up to 5) used in the weighted sum are added to the histogram using the block size as the amplitude.
[0109] 4) If the block is predicted according to SGPM, two modes are added to the histogram using the block size as amplitude.
[0110] 5) If the block is predicted according to TMRL, the primary intra prediction mode is added to the histogram using the block size as the amplitude.
[0111] 6) If the current slice is not an I-slice but a block predicted by EIP, the directionality of the block is derived, and the size of the block is used as the amplitude, and the derived directionality is added to the histogram.
[0112] 7) If the current slice is not an I-slice but a block predicted by IntraTMP, the directionality of the block is derived, and the size of the block is used as the amplitude, and the derived directionality is added to the histogram.
[0113] 8) If the current slice is not an I-slice but a block predicted by MIP, the directionality of the block is derived, and the size of the block is used as the amplitude, and the derived directionality is added to the histogram.
[0114] 9) In the case of a block predicted according to other intra prediction modes, the intra prediction mode of the block is added to the histogram using the block size as the amplitude.
[0115] 10) Among the histogram information constructed from the aforementioned process, the histogram is updated by reducing the amplitude corresponding to the top N modes derived by applying DIMD to the current block by a certain ratio, for example, by half. Here, N can be an integer greater than or equal to 1, for example, 2.
[0116] As described above, after constructing the HoC in the order of 1) to 9), the prediction mode is derived by applying DIMD to the current block. That is, the prediction mode is derived using the directionality of the restored L-shaped region around the current block, and the derived prediction mode is compared with the prediction mode in the histogram. If one or more prediction modes with a large gradient size among the DIMD-derived prediction modes exist in the HoC, the amplitude of the corresponding mode is halved in the histogram. The OBIC mode selects up to five modes with large amplitude values in the histogram and derives weights to be used in the weighted sum.
[0117] For the final weighted sum, the OBIC mode uses one to five intra prediction modes derived from HoC, and signals predicted in a non-directional mode. Planar and block vector (BV)-based prediction are used as non-directional modes. Using the reconstructed L-shaped region surrounding the current block, the template matching costs associated with the planar-based and BV-based prediction signals are calculated. The mode with the lower cost is used as the non-directional mode.
[0118] If there is only one mode induced by HoC, a weighted sum of the prediction block and the non-directional prediction block according to the induced mode is performed, and the weight for the non-directional prediction block is determined as 21 out of the total weight of 64. If there is more than one mode induced by HoC, the weight for the non-directional prediction block is determined as 16 out of the total weight of 64.
[0119] The weights of the modes derived from HoC are determined for each prediction mode based on the amplitude size of HoC so that their sum is 43 or 48. The OBIC mode can generate the final prediction block by performing a weighted sum using the determined weights.
[0120] The following embodiments are described with a focus on a video decoding device, but can be implemented in the same or similar manner in a video encoding device. Alternatively, the following embodiments are described with a focus on the decoder side of a video decoding device, but can also be implemented in the same or similar manner in the decoder side of a video encoding device.
[0121] II. Embodiments according to the present disclosure
[0122] FIG. 6 is a block diagram illustrating in detail a portion of an image decoding device according to one embodiment of the present disclosure.
[0123] Hereinafter, “current block”, “current coding block”, “current prediction block”, and “current prediction unit block” have the same meaning and can be used interchangeably.
[0124] The video decoding device according to the present embodiment determines prediction and transformation units, and performs prediction and inverse transformation on the current block corresponding to the determined unit using the determined prediction technique and prediction mode, thereby finally generating a restoration block of the current block. The example illustrated in FIG. 6 may be performed by the inverse transformation unit (530), the prediction unit (540), and the adder (550) of the video decoding device. Meanwhile, the same operations as the example illustrated in FIG. 6 may be performed by the inverse transformation unit (165), the picture division unit (110), the prediction unit (120), and the adder (170) of the video encoding device. At this time, the video decoding device uses encoding information parsed from the bitstream, but the video encoding device may use encoding information set from a higher level in terms of minimizing rate distortion. Hereinafter, for convenience, the present embodiment will be described with reference to the video decoding device.
[0125] As shown in the example of FIG. 5, the prediction unit (540) includes an intra prediction unit (542) and an inter prediction unit (544) depending on the prediction technology, but as shown in FIG. 6, the prediction unit (540) may include all or part of the prediction unit determination unit (602), the prediction technology determination unit (604), the prediction mode determination unit (606), and the prediction execution unit (608).
[0126] The prediction unit determination unit (602) determines a prediction unit (PU). The prediction technique determination unit (604) determines a prediction technique (e.g., intra prediction, inter prediction, IBC (Intra Block Copy) mode, palette mode, a technique that mixes intra and inter prediction, etc.) for the prediction unit. The prediction mode determination unit (606) determines a detailed prediction mode for the prediction technique. The prediction execution unit (608) generates a prediction block of the current block according to the determined prediction mode.
[0127] The inverse transform unit (530) includes all or part of the inverse transform unit determination unit (610), the inverse transform kernel determination unit (612), and the inverse transform execution unit (614). The inverse transform unit determination unit (610) determines a transformation unit for the inverse quantization signals (i.e., inverse quantization transform coefficients) of the current block, and can correct the prediction signal of the transformation unit before performing inverse transform for the determined transformation unit. The inverse transform kernel determination unit (612) determines an inverse transform kernel, and the inverse transform execution unit (614) generates residual samples by inversely transforming the transformation unit expressed by the inverse quantization transform coefficients.
[0128] Hereinafter, the transform unit (TU) on the encoding side can be used interchangeably with the transform block. The inverse transform unit and inverse transform block on the decoding side correspond to the TU and transform block, respectively. Therefore, the inverse transform unit and inverse transform block can be used interchangeably with the TU and transform block.
[0129] A transform unit is a unit that determines whether to perform an inverse transform with respect to transform coefficients and represents a unit in which information about the inverse transform is transmitted. An image decoding device determines a kernel to be applied to a transform unit and performs an inverse transform of transform coefficients based on the determined kernel. At least one kernel may be determined for one transform unit. According to an embodiment, an inverse transform of N orders may be applied, and the sizes of the transform unit and the inverse transform kernel in each order may not be the same. For example, when an inverse transform of N orders is applied to a current transform unit block (hereinafter, transform block or current transform block), the sizes of the kernels used for the inverse transform of each order may not be the same. That is, the image decoding device may apply an inverse transform to some of the input transform coefficients.
[0130] An adder (550) adds a prediction block and residual samples to generate a restoration block. The restoration block is stored in memory and can be used to predict other blocks.
[0131] If the color format of the input video is a YUV format (such as YUV420, YUV411, YUV422, YUV444), the video decoding device can perform prediction and restoration of the chroma component after performing prediction and restoration of the luma component. That is, the luma component and the chroma component can be sequentially restored by the components illustrated in Fig. 6. Meanwhile, if the color format of the input video is RGB, the video encoding device can perform color format conversion from RGB to YUV and then encode the converted video. Here, in the case of the YUV format, the color format represents the correspondence between the pixels of the luma component and the pixels of the chroma component.
[0132] The prediction unit determination unit (602) determines the size and shape of the prediction target block, and may utilize all direct or indirect information transmitted from the video encoding device. The prediction unit determination unit (602) may utilize direct information related to the size and shape of the current block, and may utilize information that may influence the determination of the size and shape of the current block, such as the number of divisions, depth, shape of division, direction of division, size information related to the minimum division block, and division information / prediction mode of the decoded neighboring blocks.
[0133] The prediction unit determined by the prediction unit determination unit (602) may be a current block, one of the sub-blocks into which the current block is divided, a set of pixels, or a single pixel. The prediction unit may include size information and shape information for performing prediction of chroma components and luma components.
[0134] The prediction unit can be determined dependently or independently for the chroma component and the luma component. Dependent determination means that the prediction unit of the luma component or chroma components is not determined for each component, but rather, when the prediction unit of one component is determined, the units of the other components or components are determined with a corresponding size and shape. In this case, one component may correspond to one or more of the luma component and the chroma component. That is, the luma component may be determined based on information of the chroma components. For example, the prediction unit of the chroma component may have a size corresponding to the prediction unit of the luma component depending on the color format. In the case of dependent determination, information about the prediction unit of the other component corresponding to one component, i.e., the dependently determined component, may be omitted. Independent determination means that the prediction units of the luma component and the chroma component are determined separately. In the case of independent determination, information about the prediction unit of each component may be signaled separately.
[0135] The prediction technique determination unit (604) determines a prediction technique for each prediction unit. As described above, the prediction technique may be one of inter prediction, intra prediction, IBC mode, palette mode, or a technique combining intra and inter prediction. In this case, the prediction technique for the chroma component may be determined in the same manner as the prediction technique for the corresponding luma component, without separate signaling or parsing of information. In some embodiments, a technique combining intra and inter prediction may be included in inter prediction.
[0136] For example, if the prediction technology of the current block is not intra prediction, the video decoding device parses 1-bit flag information. For example, if the parsed flag indicates a skip mode, the video decoding device determines the prediction mode of the current block to be a merge mode of inter prediction or an IBC merge mode. In the case of a skip mode, the video decoding device can use the prediction signals as restoration signals without performing an inverse transformation process (i.e., without parsing the residual signals). Here, skip may mean a method of not transmitting motion information (for example, a motion vector, a reference picture, a reference picture list, etc.) or transmitting motion information using only at least one piece of syntax information, and may also mean that the residual signal of the current block is not transmitted.
[0137] On the other hand, if the parsed flag does not indicate a Skip mode for the current block, the prediction technique determination unit (604) can parse a series of 1-bit flags to determine the prediction technique of the current block as one of techniques such as inter prediction, intra prediction, IBC mode, palette mode, etc.
[0138] For example, if Skip is not applied to the current block and the prediction technique is determined to be Inter-Prediction or IBC mode, the video decoding device parses a 1-bit flag. Depending on the parsed flag, the prediction mode of the current block can be determined as either General Merge mode or Advanced Motion Vector Prediction (AMVP) mode.
[0139] The prediction mode determination unit (606) determines the detailed prediction mode of the current prediction unit block in relation to the prediction technology.
[0140] If the prediction technique of the current block is intra prediction, the prediction mode of the current block may be a mode for generating a prediction block of the current block based on at least one of a directional prediction mode, a planar mode (Horizontal Planar, Vertical Planar, or Regular Planar), a DC mode, an EIP (Extrapolation intra prediction) prediction mode, a matrix-based prediction mode (for example, MIP), or a prediction mode based on correlation between components (e.g., CCLM (Cross component linear model), MMLM (Multi model CCLM), CCCM (Convolutional cross component model), LBCCP (Local boosting cross component prediction), BVG-CCCM (Block vector guided CCCM), CCLM with slope adjustment, Multi model CCCM, GLCCCM (Gradient and location based CCCM), CCP-merge, GLM (Gradient linear model), DDCCP (Decoder derived cross component prediction), etc.).
[0141] As an example, if the prediction technology of the current block is intra prediction, the prediction mode of the current block may be a matrix-based intra prediction mode (for example, MIP (Matrix-based intra prediction)). The MIP mode may signal / parse and / or derive an index of a matrix based on a predefined matrix according to an agreement between an image encoding device and an image decoding device, or may signal / parse and / or derive a matrix and generate a prediction block of the current block based on the matrix.
[0142] As another example, if the prediction technique of the current block is intra prediction, directional intra prediction, and a specific directional prediction mode is applied depending on the block size, the prediction mode of the current block may be a mode based on matrix multiplication. In this case, a prediction signal of the current block may be generated using a matrix multiplication operation between the directional matrix and the previously restored reference samples surrounding the current block. The matrix may be defined in advance according to an agreement between the image encoding device and the image decoding device.
[0143] As another example, if the prediction technique for the current block is intra prediction, the prediction mode for the current block may be intra-template matching prediction (IntraTMP). IntraTMP mode defines a restored area surrounding the current block as a template, and performs template matching on the restored area surrounding the current block to generate a predicted block. The template may also include areas not adjacent to the current block.
[0144] As another example, if the prediction technique of the current block is intra prediction, the prediction mode of the current block may be a spatial geometric partitioning-based prediction mode. The spatial geometric partitioning-based prediction mode may divide the current block into one or more sub-regions according to geometric partitioning, generate a prediction block of each region using intra prediction modes including different directional prediction modes, Planar mode, DC mode, etc., and generate a prediction block of the current block by weighting and combining each prediction block. According to an embodiment, if the prediction technique is intra prediction and the geometric partitioning-based prediction mode is determined, all sub-blocks within the current block may be predicted according to intra prediction.
[0145] As another example, if the prediction technique of the current block is intra prediction, the prediction mode of the current block may be DIMD (Decoder-side intra mode derivation) mode. DIMD mode implicitly derives a prediction mode based on reconstructed samples within a previously reconstructed region around the current block, performs prediction of the current block using at least one derived mode, and generates a final prediction block of the current block using a weighted sum of the prediction blocks. As an example, the directionality of the reconstructed samples within the previously reconstructed region may be considered in the process of deriving the prediction mode.
[0146] As another example, if the prediction technique of the current block is intra prediction, the prediction mode of the current block may be OBIC (Occurrence-based intra coding) mode. OBIC mode implicitly derives a prediction mode based on the prediction modes of blocks within the previously restored region surrounding the current block, performs prediction of the current block according to at least one derived mode, and generates a final prediction block of the current block using a weighted sum of the prediction blocks. For example, in the process of deriving the prediction mode, both the directionality of the restored samples within the previously restored region and the occurrence frequency of the prediction mode of the blocks within the previously restored region may be considered.
[0147] As another example, if the current block is a chroma block and the prediction technique of the current block is intra prediction, the current block can be predicted according to DM (Direct Mode). DM mode can perform prediction of the current chroma block based on a prediction method applied to a luma block corresponding to the current chroma block, or a prediction method predefined between a video encoding device and a video decoding device.
[0148] As another example, the relationship between the surrounding restored chroma samples of the current chroma component and the surrounding restored luma samples of the luma region at the location corresponding to the current chroma block may be calculated using a linear and / or nonlinear model, and a prediction block of the current chroma block may be generated based on one or more of the calculated models.
[0149] As another example, there may be various methods for deriving the intra prediction mode of the current block. Among the multiple methods, one or more may be used based on the signaling / parsing of flags and / or indices.
[0150] Meanwhile, if the prediction technology of the current block is IBC prediction, a prediction block can be obtained from a previously restored area within a frame including the current block using one or more block vectors, and a final prediction block can be generated based on the prediction block. The video encoding device can signal information of the block vector, and the video decoding device can parse information of the block vector. For example, the video decoding device can construct a block vector candidate list according to a position and search order defined according to an agreement between the video encoding device and the video decoding device, and parse information such as an index. The video decoding device can obtain final block vector information by correcting the initial block vector information obtained based on the parsed information using a method such as template matching.
[0151] For example, if the prediction technique of the current block is IBC prediction, the prediction mode of the current block may be an IBC geometric partitioning-based prediction mode (hereinafter, IBC geometric partitioning mode). The IBC geometric partitioning mode may divide the current block into one or more sub-regions according to the geometric partitioning, generate a prediction block for each region using a different block vector, and weight and combine the prediction blocks to generate a final prediction block of the current block. According to an embodiment, if the current block is IBC prediction and the geometric partitioning mode is determined, at least one of all sub-blocks within the current block may be predicted according to the IBC prediction.
[0152] As another example, if the current block is a chroma block and the prediction technology of the current block is IBC prediction, and the corresponding luma block is restored during the process of constructing a block vector candidate list or obtaining a block vector, the block vector information of the luma block at the corresponding position can be used. For example, if the block division structures of the luma component and the chroma component are the same, the block vector information of the corresponding luma block can be scaled according to a color format to generate information, and the scaled information can be used as the block vector and / or block vector candidate of the current chroma block. On the other hand, if the block division structures of the luma component and the chroma component are different, one or more block vectors can be acquired according to a predefined position and order within the corresponding luma region. The acquired block vector can be scaled according to a color format to generate information, and the scaled information can be used as the block vector and / or block vector candidate of the current chroma block.
[0153] Meanwhile, if the prediction technology of the current block is a mixed technology of intra and inter prediction, the surrounding restoration area of the current block may be defined as a template, and an intra prediction mode may be derived using information of some or all pixels of the template, or an intra prediction block may be generated based on template matching. The prediction block of the current block may be derived according to the derived intra prediction mode, or the prediction block may be generated based on block vector information signaled from a video encoding device. The final prediction block may be generated by mixing the prediction block / intra prediction block, or inter prediction block generated based on template matching and / or block vector, according to a method such as weighted summation.
[0154] A template may include both adjacent and non-adjacent regions to the current block. The non-adjacent region may be an region within a certain distance of pixel lines from the current block. When a non-adjacent region is used as a template, information on whether it is used and / or the distance may be transmitted from the video encoding device to the video decoding device. For example, the distance information may be defined according to an agreement between the video encoding device and the video decoding device, and the transmission of the information may be omitted. If defined according to an agreement, the value may be fixed to a specific constant or may be variably determined based on the horizontal and vertical pixel lengths of the prediction unit, the block width, the aspect ratio, etc. Thereafter, the final prediction block of the current block may be generated using the derived intra prediction mode.
[0155] The prediction execution unit (608) generates a final prediction block of the current decryption block (hereinafter, used interchangeably with the current block) according to the determined prediction technology and prediction mode.
[0156] As an example, the prediction performing unit (608) performs prediction according to the prediction mode determined as described above to generate a prediction block of the current block, and the adder (550) adds the prediction block of the current block and residual samples (i.e., residual block) to generate a restoration block.
[0157] As an example, after prediction and restoration of a luma component block, prediction and restoration of a corresponding chroma component block can be performed. Here, a block may be a coding unit (CU), a coding tree unit (CTU), a set of one or more CUs, and / or a set of one or more CTUs.
[0158] For example, if the current block is predicted using an intra prediction mode, the video decoding device may store the intra prediction mode in units of N×M regions. Here, N and M may be positive integers of the same value. For example, the video decoding device may only store prediction modes of N×M regions related to the directional intra prediction mode.
[0159] For example, when prediction is performed to derive a prediction mode of a current block using information of a surrounding pre-restored region and to generate a prediction block of the current block using at least one derived prediction mode, the image decoding device may parse two flags, determine a prediction mode for the current block based on the two parsed flags, and generate a prediction block. Here, the two flags may be dimdFlag and obicFlag. dimdFlag indicates whether the intra prediction mode of the current block is derived according to the directionality of the surrounding pre-restored region, and obicFlag indicates whether the intra prediction mode of the current block is derived according to the occurrence frequency of the intra prediction mode in the surrounding pre-restored region.
[0160] Based on the values of the two flags, one of the following two methods can be optionally performed:
[0161] (1) A method of generating a final prediction block by deriving a prediction mode based on the directionality of a restored area around a current block and weighting prediction blocks generated according to at least one derived prediction mode.
[0162] (2) A method of generating a final prediction block by deriving a prediction mode based on the directionality of a previously restored region surrounding a current block, deriving a prediction mode based on the occurrence frequency of an intra-prediction mode of the previously restored region surrounding a current block, and weighting and combining prediction blocks generated according to at least one derived prediction mode. Here, the prediction modes derived based on the directionality of the previously restored region surrounding a current block can be used to update an occurrence histogram related to the occurrence frequency, as described above. For example, if the top N modes among the prediction modes derived based on the directionality are included in the occurrence histogram, the amplitudes of the top N modes in the occurrence histogram can be updated by half. At least one prediction mode for the current block can be derived based on the updated histogram.
[0163] As an example, when dimdFlag is 1 and obicFlag is 0, the image decoding device can perform directionality-based prediction mode derivation as in method (1).
[0164] As another example, when obicFlag is 1, the image decoding device can perform directionality-based prediction mode derivation and occurrence frequency-based prediction mode derivation as in method (2).
[0165] FIG. 7 is an exemplary diagram showing a restored area surrounding a current block according to one embodiment of the present disclosure.
[0166] As an example, in relation to directionality-based prediction mode derivation, an image decoding device may derive directionality of a restored region surrounding a current block having a size of W×H (width W, height H), and derive a prediction mode of the current block using at least one derived directionality. In the example of Fig. 7, a and b are integers greater than or equal to 1, a may be W, and b may be H. m and n are integers greater than or equal to 1, and may be integers of the same value. For example, the shape of the restored region may be determined by signaling / parsing, or may be implicitly determined based on an aspect ratio of the current block.
[0167] For example, if the restored area around the current block is defined as described above, the image decoding device can derive an intra prediction mode using the directionality of the restored area around the current block. In FIG. 7, when m and n are 3 or more, the image decoding device can calculate the slope of the block in all areas in the restored area around the current block in units of p×q blocks, and derive the intra prediction mode corresponding to the most dominant slope values by adding up the calculated slope information. At this time, p and q can be integers 2 or more. For example, if the number of intra prediction modes to be derived is 4, 4 intra prediction modes corresponding to the top 4 dominant slopes can be derived from the added information. As an example, in FIG. 7, when m is less than p or n is less than q, the image decoding device can copy the outermost pixel value in the restored area around the current block to make m and n into p and q, and then perform the above-described process. Additionally, if the left area of the current block is partially or completely unusable or the upper area is partially or completely unusable in the entire restored area around the current block, the image decoding device may perform the aforementioned process using only the restored area around the top or only the restored area around the left.
[0168] For example, when deriving an intra prediction mode by obtaining a block-level gradient, there may be various methods for obtaining the gradient. For example, the gradient may be calculated by applying a 3×3 Sobel filter, a 2×2 Roberts cross filter, etc. Alternatively, the gradient (i.e., direction) may be calculated using the horizontal and vertical gradients for each pixel in the restored surrounding area.
[0169] As an example, an image decoding device may calculate a gradient in a defined restored region. The image decoding device may perform filtering on the restored region and then calculate the gradient in the filtered region. Alternatively, the image decoding device may calculate the gradient in a portion of the restored region. For example, a smoothing filter or a Gaussian filter with coefficients of [1 / 4, 2 / 4, 1 / 4] may be applied for filtering.
[0170] Meanwhile, the derivation of a prediction mode based on occurrence frequency can be performed as follows.
[0171] The video decoding device induces a non-directional prediction mode. For example, a prediction block generated according to the derived non-directional prediction mode may be one of the weighted elements in the process of generating the final prediction block.
[0172] The non-directional prediction mode can be at least one of prediction modes such as Planar, BV-based prediction, etc. If there is more than one candidate non-directional prediction mode, the image decoding device can implicitly derive one non-directional prediction mode. For example, it can be derived using the restored region around the current block. Assume that the restored region around the current block is determined as in Fig. 7 (a). As shown in Fig. 8, the image decoding device generates prediction samples of the restored region according to each candidate non-directional prediction mode using reference lines of the restored region around the current block, and calculates the cost between the prediction samples of the restored region and the restoration values of the restored region. The image decoding device can derive a non-directional mode with a lower or higher cost as the non-directional prediction mode of the current block. At this time, at least one of cost functions such as SAD (Sum of absolute difference), MSE (Mean squared error), SATD (Sum of absolute transformed difference), etc. can be used to calculate the cost. If BV-based prediction is included in the candidates of the non-directional mode, the image decoding device can construct a BV candidate list based on prediction information of blocks within the surrounding restored area of the current block, and use at least one BV in the list in the non-directional prediction mode candidate derivation process.
[0173] Hereinafter, compared to the non-directional prediction mode, the intra prediction mode (IPM) represents a directional intra prediction mode as illustrated in Fig. 3a, and can be used interchangeably with the directional intra prediction mode.
[0174] The video decoding device constructs a candidate list of intra prediction modes based on prediction information of adjacent and non-adjacent blocks.
[0175] As an example, a video decoding device sequentially searches for blocks A to B, C to D, and E, each having a size of N×M, in adjacent restored areas around a current block, as shown in FIG. 9. If a search target block is predicted using a (directional) intra prediction mode during the prediction process, the video decoding device may add the corresponding intra prediction mode to a candidate list. At this time, overlapping modes may not be added to the list. The video decoding device may add intra prediction modes at all positions to the list, or may add intra prediction modes at only some positions to the list.
[0176] As another example, the video decoding device sequentially searches for L, T, and 3-12 position blocks each having a size of N×M in an adjacent pre-restored area around the current block, as shown in FIG. 10. If the search target block is predicted with a (directional) intra prediction mode during the prediction process, the video decoding device can add the intra prediction mode to the candidate list. At this time, N and M in FIG. 9 and N and M in FIG. 10 may be different values. In the example of FIG. 10, if the L block is predicted with the intra prediction mode, the block at position 3 can be searched. Similarly, if the block at position 3 is predicted with the intra prediction mode, the block at position 5 can be searched. This can be similarly applied to the upper position blocks. That is, the search can be performed in the order of T -> 4 -> 6.
[0177] As another example, if the L block is predicted using the intra prediction mode, the block at position 7 can be searched. Similarly, if the block at position 3 is predicted using the intra prediction mode, the block at position 9 can be searched, and if the block at position 5 is predicted using the intra prediction mode, the block at position 11 can be searched. This can be similarly applied to the upper position blocks. That is, searches can be performed for T -> 8, 4 -> 10, and 6 -> 12.
[0178] As another example, following the two embodiments described above, the search can be performed in the order of the blocks at each numerical position in the example of FIG. 10. For example, the order is 3 -> 4 -> 5 -> 6 -> 7 -> 8 -> 9 -> 10 -> 11 -> 12, i.e., the blocks at the left and top positions can be searched alternately.
[0179] As another example, the video decoding device may search for blocks at positions 13 to 30 in ascending order in the example of FIG. 11. If the search target block is predicted using an intra prediction mode during the prediction process, the video decoding device may add the intra prediction mode to the candidate list.
[0180] For example, in the examples of FIGS. 9 to 11, if a restored block around the current block is predicted using an intra prediction mode but not a directional prediction mode, the image decoding device may derive a directionality from the block or a restored CU including the block. Thereafter, a directional prediction mode according to the derived directionality may be added to the candidate list.
[0181] As an example, in the examples of FIGS. 9 to 11, if a block whose position around the current block is restored is predicted based on a plurality of intra prediction modes, the image decoding device can add at least one mode among the modes used for prediction to the candidate list.
[0182] As an example, in the examples of FIGS. 9 to 11, a case is described where a block whose position around the current block is restored is predicted according to the inter prediction mode or the IBC mode.
[0183] FIG. 12 is an exemplary diagram showing a chain search of reference blocks according to one embodiment of the present disclosure.
[0184] As shown in the example of Fig. 12, the video decoding device sequentially searches for reference blocks within the current frame and / or the reference frame using motion vector (MV) information and / or block vector information of the corresponding block. Thereafter, the prediction mode of the intra prediction block searched during the search process can be added to a candidate list. In the example of Fig. 12, the sequential search process can be performed N times. N is an integer greater than or equal to 1, and can be implicitly determined based on at least one of conditions such as the size of the block, the size of the current frame, etc. N can be explicitly determined from syntax such as a sequence parameter set (SPS), a picture parameter set (PPS), a slice header, etc.
[0185] Meanwhile, the example of FIG. 12 can be used in various embodiments, including a process of deriving an intra prediction mode from prediction information of restored blocks surrounding the current block.
[0186] A video decoding device can rearrange candidates included in a candidate list. The rearrangement method can vary. For example, candidates can be rearranged based on the distance between the current block and the adjacent and non-adjacent blocks illustrated in FIGS. 9 to 11 . The distance can be calculated based on the upper-left coordinates of the current block and the blocks at each location.
[0187] As another example, as shown in FIG. 13, the distance can be calculated based on the positional relationship (upper left, top, upper right, left, lower left) between the current block and the surrounding blocks. For example, 1) in the case of blocks located at the upper position of the current block, the distance between the upper left coordinate of the current block and the lower left coordinate of the upper position blocks can be calculated, 2) in the case of blocks located at the left position of the current block, the distance between the upper left coordinate of the current block and the upper right coordinate of the left position blocks can be calculated, 3) in the case of blocks located at the upper left position of the current block, the distance between the upper left coordinate of the current block and the lower right coordinate of the upper left position blocks can be calculated, 4) in the case of blocks located at the upper right position of the current block, the distance between the upper right coordinate of the current block and the lower left coordinate of the upper right position blocks can be calculated, and 5) in the case of blocks located at the lower left position of the current block, the distance between the lower left coordinate of the current block and the upper right coordinate of the lower left position blocks can be calculated.
[0188] As an example, when an intra prediction mode is added to the list according to the example of FIG. 12, the video decoding device can rearrange the candidates based on the distance between the block at the position where the motion vector and / or block vector is first used (the block at the upper position of the current block in the example of FIG. 12) and the current block.
[0189] As an example, a video decoding device can rearrange a candidate list based on distance, with the candidate modes rearranged in descending order of distance values. The video decoding device can then derive the intra prediction mode for the current block using only a portion of the candidates from the rearranged list.
[0190] The video decoding device can construct a generation histogram. For example, the histogram can be constructed with respect to each mode in the candidate list for which rearrangement has been performed. The video decoding device can construct the histogram using the size of each adjacent / non-adjacent pre-restored block as the intensity value of each candidate mode, with respect to each adjacent / non-adjacent pre-restored block whose distance has been calculated during the rearrangement process. For example, if the horizontal directional prediction mode of the pre-restored 16×16 block surrounding the current block is included in the candidate list, the histogram can be constructed using 256 as the intensity value of the horizontal directional prediction mode.
[0191] An image decoding device can determine an intra prediction mode of a current block based on a configured histogram. For example, the top N prediction modes having the highest intensity values can be selected as the intra prediction modes of the current block. N may be a fixed value according to an agreement between the image encoding device and the image decoding device, or may be implicitly determined based on the size of the current block. For example, a plurality of intra prediction modes of the current block may be selected based on the intensity value of the prediction mode having the highest intensity in the histogram and N. For example, with respect to the prediction mode having the highest intensity, prediction modes having an intensity value less than half of the intensity value of the corresponding prediction mode may not be selected as the intra prediction modes of the current block.
[0192] An image decoding device can calculate weights and generate a final prediction block of the current block using the calculated weights. Each prediction block according to one or more selected intra prediction modes and a prediction block according to a non-directional prediction mode can be weighted based on the weights.
[0193] For example, the weights of each prediction block can be calculated based on the intensity values of the histogram. For non-directional modes, fixed weights can be applied.
[0194] For example, if the number of intra prediction modes of the selected current block is 1, the weight of the non-directional mode and the weight of the intra prediction mode can have a ratio of 1:3. 1:3 is an example, and an example such as 21:43 can be determined by the weight of the non-directional mode and the weight of the intra prediction mode.
[0195] For example, when the number of intra prediction modes of the selected current block is 1 or more, the weight of the non-directional mode and the weights of the selected intra prediction modes may have a 1:4 ratio. Each weight of the selected multiple intra prediction modes may be determined based on histogram information. As an example, the intensity value of the histogram may be used. For example, when three intra prediction modes Q, W, and E are selected from the histogram, and the intensity of each mode is q, w, and e, the weight of the Q mode may be determined as q / (q+w+e), the weight of the W mode may be determined as w / (q+w+e), and the weight of the E mode may be determined as e / (q+w+e). That is, the weighted sum coefficient of each mode may be derived as the ratio of the histogram intensities.
[0196] As an example, if the final prediction block of the current block is a weighted sum of each prediction block generated according to six modes, the image decoding device performs a weighted sum using the prediction blocks (M0, M1, M2, M3, M4, M5) generated according to each mode and the weights (w0, w1, w2, w3, w4, w5) of each prediction block, as in Equation 1, thereby obtaining the final prediction block (Pred) of the current block. curr ) can be created.
[0197]
[0198] In mathematical expression 1, the total sum of the weights is 2 k , and k can be an integer greater than or equal to 1.
[0199] Below, the operations related to inverse transformation and restoration are described.
[0200] In relation to the inverse transformation, the entropy decoding unit (510) decodes the transform coefficients. If a secondary transformation is applied, the entropy decoding unit (510) decodes the quantized secondary transform coefficients. If a secondary transformation is not applied, the entropy decoding unit (510) decodes the quantized primary transform coefficients. The entropy decoding unit (510) parses information such as the quantization method and quantization parameter information.
[0201] The inverse quantization unit (520) inversely quantizes the decoded quantized transform coefficients based on information such as the quantization method and quantization parameter information to generate inverse quantized transform coefficients.
[0202] The inverse transform unit (530) generates residual samples by inversely transforming the TU expressed as inverse quantization transform coefficients. As shown in Fig. 6, the inverse transform unit (530) may include an inverse transform unit determination unit (610), an inverse transform kernel determination unit (612), and an inverse transform execution unit (614).
[0203] The inverse transformation unit determination unit (610) can determine a single TU or a sub-block obtained by dividing a single TU into multiple sub-blocks as the target of transformation. For example, the TU may be the entire current block, which is the target of prediction, or a portion of the current block.
[0204] The inverse transform kernel determination unit (612) can determine a separable vertical and horizontal first-order inverse transform kernel, and / or a non-separable second-order inverse transform kernel, or can determine a non-separable first-order inverse transform kernel.
[0205] The inverse transform performing unit (614) can inversely transform the inverse quantized transform coefficients using the inverse transform kernel determined by the inverse transform kernel determining unit (612). The inverse transform performing unit (614) can perform non-separable first-order inverse transform, non-separable second-order inverse transform, first-order inverse transform, etc.
[0206] As an example, whether to perform a non-separable first-order inverse transformation and whether to perform a non-separable second-order inverse transformation can be determined using signaling / parsing, and can be implicitly determined based on the size of the current transformation block, etc. Hereinafter, "current block", "current transformation block", and "current transformation unit block" have the same meaning and can be used interchangeably.
[0207] Figures 14a and 14b are flowcharts showing a method for determining an inverse transform kernel.
[0208] When nst_idx is 0, the video decoding device can determine the inverse transform kernel as shown in Fig. 14b. Here, nst_idx represents a non-separable transform index, and in the next-generation VVC, the Enhanced Compression Model (ECM), it may correspond to lfnst_idx, i.e., a low-frequency non-separable transform index.
[0209] If ISP (Intra sub-partition) is applied in the prediction process of the current transform block, or MIP (Matrix-based intra prediction) is not used in the prediction process of the current transform block and the transform kernel is implicitly determined (ImplicitMTS), the image decoding device determines the vertical and horizontal primary transform kernels as one of {DCT2 / DCT2, DCT2 / DST7, DST7 / DCT2, DST7 / DST7} according to the size of the current TU.
[0210] If all of the above information is not satisfied and transformation is performed only on some sub-regions within the transformation block (SBT, Subblock Transform), the image decoding device determines the vertical and horizontal primary transformation kernels as one of {DCT2 / DCT2, DCT8 / DST7, DST7 / DCT8, DST7 / DST7} based on the size of the current TU and the location of the region where transformation is performed within the current TU.
[0211] If none of the above information is satisfied, it can be checked whether the transform kernel is explicitly determined (ExplicitMTS). If the transform kernel is not explicitly determined, the image decoding device determines both the vertical and horizontal primary transform kernels as DCT2. On the other hand, if the transform kernel is explicitly determined, mts_idx may be parsed, and the primary transform kernel may be determined based on the parsed index value. At this time, the range of the index, i.e., the size of the kernel set, may be determined as one of 1, 4, and 6 based on a comparison between the sum of the absolute values of the transform coefficients in the transform block and a preset threshold value.
[0212] When explicitly determining the transformation kernel, the transformation kernel can be determined differently depending on the prediction technology of the current transformation block as follows. When the intra prediction technology is used, the video decoding device determines the kernel set according to the size of the current TU and the prediction mode index, and parses the index indicating one transformation kernel (i.e., a transformation kernel pair) among the kernel sets. The video decoding device obtains information on the vertical and horizontal primary transformation kernels indicated by the index from the LUT (Look-up Table) defined according to the agreement between the video encoding device and the video decoding device, and uses the obtained information as the primary transformation kernel of the current TU. At this time, if the height and width of the current TU are both less than or equal to 16 and mts_idx is 3, the vertical and horizontal primary transformation kernels are determined as IDTR (Identity Transform) according to specific conditions. Meanwhile, the prediction mode index indicates a directional prediction mode. When the intra prediction mode is a non-directional mode, the image decoding device can derive the directionality of the prediction signals and use a directional prediction mode mapped to the derived directionality. Furthermore, when prediction is performed using MIP, the image decoding device can map the prediction mode to a planar mode.
[0213] When inter prediction technology is used, the video decoding device determines the vertical and horizontal primary transform kernels among DCT8 and DST7 according to mts_idx. At this time, if the height and width of the current TU are both less than 16, the vertical and horizontal transform kernels may be changed to KLT (Kahunen-Loeve Transform) defined according to an agreement between the video encoding device and the video decoding device.
[0214] If nst_idx is not 0, the video decoding device can determine the inverse transform kernel as shown in Fig. 14a. Based on the size of the current TU, it is implicitly determined whether to perform a non-separable first inverse transform or a non-separable second inverse transform and a first inverse transform. For example, for blocks smaller than 16×16 (4×4, 4×8, 8×4, 8×8, 8×16, 16×8), a non-separable first inverse transform can be performed.
[0215] If the prediction technology of the current TU is directional prediction, i.e., intra prediction technology and directional prediction mode, the image decoding device determines a non-separable first-order transform kernel set or a non-separable second-order transform kernel set based on the nst_idx value. The image decoding device determines a non-separable first-order transform kernel or a non-separable second-order transform kernel based on the directionality of the mode used for prediction of the current transform block.
[0216] If the prediction technology of the current transform block is not directional prediction, the image decoding device determines a non-separable first-order transform kernel set or a non-separable second-order transform kernel set based on the nst_idx value. The image decoding device derives the directionality of the prediction samples of the current transform block and determines a non-separable first-order transform kernel or a non-separable second-order transform kernel based on the derived directionality.
[0217] When a non-separable second-order inverse transform is performed, the image decoding device determines a non-separable second-order transform kernel and performs a non-separable second-order inverse transform. Subsequently, a first-order inverse transform is performed. At this time, a fixed kernel, such as a DCT2 kernel, may be implicitly used as the vertical and horizontal first-order transform kernels.
[0218] Below, a method for predicting the current block based on the occurrence frequency is described using the cities of FIGS. 15 and 16.
[0219] FIG. 15 is a flowchart illustrating a method for an image encoding device to encode a current block according to one embodiment of the present disclosure.
[0220] The video encoding device determines a flag, dimdFlag, that indicates the derivation of a direction-based intra prediction mode. For example, the video encoding device may determine dimdFlag for rate-distortion optimization. Alternatively, the video encoding device may obtain dimdFlag from a higher level.
[0221] The video encoding device can encode dimdFlag.
[0222] If dimdFlag does not indicate derivation of a direction-based intra prediction mode, the video encoding device may generate a prediction block of the current block using an intra prediction technique other than derivation of a direction-based intra prediction mode and derivation of an occurrence frequency-based intra prediction mode.
[0223] On the other hand, if dimdFlag indicates the derivation of a directionality-based intra prediction mode, the video encoding device determines a flag, i.e., obicFlag, indicating the derivation of a frequency-based intra prediction mode (S1500). For example, the video encoding device may determine obicFlag in terms of rate distortion optimization. Alternatively, the video encoding device may obtain obicFlag from a higher level.
[0224] The video encoding device can encode obicFlag.
[0225] The video encoding device checks obicFlag (S1502).
[0226] If obicFlag does not indicate derivation of an intra prediction mode based on occurrence frequency (No in S1502), the video encoding device can derive intra prediction modes of the current block based on directionality-based derivation of an intra prediction mode, i.e., dimd mode. The video encoding device can generate prediction blocks of the current block based on the derived intra prediction modes, and weight and combine the prediction blocks to generate a final prediction block.
[0227] On the other hand, if obicFlag indicates derivation of an intra prediction mode based on occurrence frequency (Yes in S1502), the video encoding device may perform the following steps.
[0228] The video encoding device constructs a candidate list of intra prediction modes based on prediction information of neighboring blocks of the current block (S1504). Here, the neighboring blocks include restored neighboring blocks and restored non-adjacent blocks, and the candidate intra prediction modes are directional intra prediction modes. The video encoding device can search a preset number of neighboring blocks in a preset order.
[0229] As an example, if a surrounding block is predicted in an intra prediction mode, the image encoding device can add the intra prediction mode to the candidate list.
[0230] As another example, the video encoding device can sequentially search for a target block having a size of N×M (where M and N are positive integers) in an adjacent reconstructed area around the current block. If the target block is intra-predicted, the video encoding device can add the intra-prediction mode of the target block to a candidate list.
[0231] As another example, if a surrounding block is intra-predicted but not predicted according to a directional prediction mode, the video encoding device can derive an intra-prediction mode of the surrounding block and add the derived intra-prediction mode to the candidate list.
[0232] As another example, if a neighboring block is inter-predicted or predicted according to the IBC mode, the video encoding device can search for an intra-predicted block by sequentially searching for reference blocks within the current picture or reference picture using motion vector information or block vector information of the neighboring blocks. The video encoding device can add the intra-prediction mode of the searched block to a candidate list.
[0233] The video encoding device rearranges the candidate list (S1506).
[0234] The video encoding device can rearrange the candidate list based on the distance between the current block and surrounding blocks. Here, the distance can be calculated based on the positional relationship between the current block and each surrounding block.
[0235] An image encoding device can rearrange the candidate intra prediction modes associated with each candidate block by rearranging the surrounding blocks included in the candidate list, i.e., the candidate blocks. In other words, the image encoding device can increase the priority of the prediction mode associated with a candidate block with a small distance by utilizing the rearrangement of the candidate list.
[0236] The video encoding device constructs an occurrence histogram of candidate intra prediction modes within the candidate list based on the size of each surrounding block (S1508).
[0237] The video encoding device can use the size of each surrounding block as the strength of the candidate intra prediction mode corresponding to each surrounding block.
[0238] The video encoding device selects at least one intra prediction mode of the current block based on the occurrence histogram and the size of the current block (S1510).
[0239] The video encoding device may select a predetermined number of candidate intra prediction modes having the largest intensity of the occurrence histogram as at least one intra prediction mode. Here, the predetermined number may be determined based on the size of the current block.
[0240] The video encoding device generates at least one prediction block of the current block according to at least one intra prediction mode (S1512).
[0241] The video encoding device calculates at least one weight corresponding to at least one prediction block (S1514).
[0242] An image encoding device can induce a non-directional prediction mode, generate a second prediction block of a current block according to the non-directional prediction mode, and generate a second weight corresponding to the second prediction block. One of planar and block vector-based prediction can be used as the non-directional mode.
[0243] The video encoding device can calculate the weight of each prediction block based on the intensity value of the occurrence histogram. For non-directional modes, fixed weights can be applied.
[0244] The video encoding device can generate a final prediction block of the current block by weighting at least one prediction block and a second prediction block using at least one weight and a second weight.
[0245] Thereafter, the video encoding device can generate a residual block by subtracting the prediction block (or the final prediction block) from the current block. The video encoding device can apply transformation / quantization to the residual block to generate transformation coefficients and encode the generated transformation coefficients.
[0246] FIG. 16 is a flowchart illustrating a method for an image decoding device to restore a current block according to one embodiment of the present disclosure.
[0247] The video decoding device obtains a flag, i.e., dimdFlag, that indicates the derivation of a direction-based intra prediction mode. For example, the video decoding device can decode dimdFlag from a bitstream.
[0248] If dimdFlag does not indicate derivation of a direction-based intra prediction mode, the video decoding device may generate a prediction block of the current block using an intra prediction technique other than derivation of a direction-based intra prediction mode and derivation of an occurrence frequency-based intra prediction mode.
[0249] On the other hand, if dimdFlag indicates the derivation of a direction-based intra prediction mode, the video decoding device obtains a flag, i.e., obicFlag, indicating the derivation of a frequency-based intra prediction mode (S1600). For example, the video decoding device can decode obicFlag from a bitstream.
[0250] The video decoding device checks obicFlag (S1602).
[0251] If obicFlag does not indicate derivation of an intra prediction mode based on occurrence frequency (No in S1602), the video decoding device may derive intra prediction modes of the current block based on directionality-based derivation of an intra prediction mode, i.e., dimd mode. The video decoding device may generate prediction blocks of the current block based on the derived intra prediction modes, and weight and combine the prediction blocks to generate a final prediction block.
[0252] On the other hand, if obicFlag indicates derivation of an intra prediction mode based on occurrence frequency (Yes in S1602), the video decoding device may perform the following steps.
[0253] The video decoding device constructs a candidate list of intra prediction modes based on prediction information of neighboring blocks of the current block (S1604). Here, the neighboring blocks include pre-restored adjacent blocks and pre-restored non-adjacent blocks, and the candidate intra prediction modes are directional intra prediction modes. The video decoding device can search a preset number of neighboring blocks in a preset order.
[0254] As an example, if a surrounding block is predicted in an intra prediction mode, the image decoding device can add the intra prediction mode to the candidate list.
[0255] As another example, the video decoding device can sequentially search for a target block having a size of N×M (where M and N are positive integers) in an adjacent restored area around the current block. If the target block is intra-predicted, the video decoding device can add the intra-prediction mode of the target block to a candidate list.
[0256] As another example, if a surrounding block is intra-predicted but not predicted according to a directional prediction mode, the image decoding device can derive an intra-prediction mode of the surrounding block and add the derived intra-prediction mode to the candidate list.
[0257] As another example, if a neighboring block is inter-predicted or predicted according to the IBC mode, the video decoding device can search for an intra-predicted block by sequentially searching for reference blocks within the current picture or reference picture using motion vector information or block vector information of the neighboring blocks. The video decoding device can add the intra-prediction mode of the searched block to a candidate list.
[0258] The video decoding device rearranges the candidate list (S1606).
[0259] The video decoding device can rearrange the candidate list based on the distance between the current block and surrounding blocks. Here, the distance can be calculated based on the positional relationship between the current block and each surrounding block.
[0260] The video decoding device can rearrange the candidate intra prediction modes associated with each candidate block by rearranging the surrounding blocks included in the candidate list, i.e., the candidate blocks. In other words, the video decoding device can increase the priority of the prediction mode associated with candidate blocks with a small distance by utilizing the rearrangement of the candidate list.
[0261] The video decoding device constructs an occurrence histogram of candidate intra prediction modes within the candidate list based on the size of each surrounding block (S1608).
[0262] The video decoding device can use the size of each surrounding block as the strength of the candidate intra prediction mode corresponding to each surrounding block.
[0263] Additionally, the image decoding device can derive at least one directionality from a restored area surrounding the current block and derive prediction modes of the current block using the at least one directionality. The image decoding device can update the generation histogram based on the prediction modes derived according to the at least one directionality.
[0264] The video decoding device selects at least one intra prediction mode of the current block based on the occurrence histogram and the size of the current block (S1610).
[0265] The video decoding device may select at least one intra prediction mode from a predetermined number of candidate intra prediction modes having the highest intensity of the occurrence histogram. Here, the predetermined number may be determined based on the size of the current block.
[0266] The video decoding device generates at least one prediction block of the current block according to at least one intra prediction mode (S1612).
[0267] The video decoding device calculates at least one weight corresponding to at least one prediction block (S1614).
[0268] The video decoding device can induce a non-directional prediction mode, generate a second prediction block of the current block according to the non-directional prediction mode, and generate a second weight corresponding to the second prediction block. One of planar and block vector-based prediction can be used as the non-directional mode.
[0269] The video decoding device can calculate the weights of each prediction block based on the intensity values of the occurrence histogram. For non-directional modes, fixed weights can be applied.
[0270] The video decoding device can generate a final prediction block of the current block by weighting at least one prediction block and a second prediction block using at least one weight and a second weight.
[0271] An image decoding device can decode quantized transform coefficients of a current block from a bitstream and apply inverse quantization / inverse transformation to the quantized transform coefficients to generate a residual block. The image decoding device can reconstruct the current block by adding the prediction block (or final prediction block) and the residual block.
[0272] Although the flowchart / timing diagram of this specification describes each process as being executed sequentially, this is merely an illustrative description of the technical idea of one embodiment of the present disclosure. In other words, a person of ordinary skill in the art to which one embodiment of the present disclosure belongs may modify and apply various modifications and variations by changing the order described in the flowchart / timing diagram without departing from the essential characteristics of one embodiment of the present disclosure, or by executing one or more of the processes in parallel. Therefore, the flowchart / timing diagram is not limited to a chronological order.
[0273] It should be understood that the exemplary embodiments described above can be implemented in many different ways. The functions or methods described in one or more examples can be implemented in hardware, software, firmware, or any combination thereof. It should be understood that the functional components described herein are labeled as "units" to further emphasize their implementation independence.
[0274] Meanwhile, the various functions or methods described in this embodiment may also be implemented as instructions stored on a non-transitory storage medium that can be read and executed by one or more processors. Non-transitory storage media include, for example, all types of storage devices that store data in a form readable by a computer system. For example, non-transitory storage media include storage media such as erasable programmable read-only memory (EPROM), flash drives, optical drives, magnetic hard drives, and solid-state drives (SSDs).
[0275] The above description is merely an example of the technical idea of the present embodiment, and those skilled in the art will appreciate that various modifications and variations can be made without departing from the essential characteristics of the present embodiment. Therefore, the present embodiments are not intended to limit the technical idea of the present embodiment, but rather to explain it, and the scope of the technical idea of the present embodiment is not limited by these embodiments. The scope of protection of the present embodiment should be interpreted by the claims below, and all technical ideas within a scope equivalent thereto should be interpreted as being included in the scope of rights of the present embodiment.
[0276]
[0277] CROSS-REFERENCE TO RELATED APPLICATION
[0278] This patent application claims priority to Korean patent application No. 10-2024-0116021, filed on August 28, 2024, the entire contents of which are incorporated herein by reference.
Claims
1. In a method for restoring a current block performed by an image decryption device, A step of obtaining candidate intra prediction modes based on prediction information of surrounding blocks of the current block, wherein the surrounding blocks include restored adjacent blocks and restored non-adjacent blocks, and the candidate intra prediction modes are directional intra prediction modes; A step of constructing a histogram of occurrence of each candidate intra prediction mode based on the size of each surrounding block; A step of selecting at least one intra prediction mode of the current block based on the occurrence histogram and the size of the current block; and A step of generating at least one prediction block of the current block according to at least one intra prediction mode. A method comprising:
2. In paragraph 1, a step of deriving a non-directional prediction mode; and A step of generating a second prediction block of the current block according to the above non-directional prediction mode. A method further comprising:
3. In paragraph 2, A step of calculating at least one weight corresponding to at least one prediction block; A step of generating a second weight corresponding to the second prediction block; and A step of weighting the at least one prediction block and the second prediction block using the at least one weight and the second weight. A method further comprising:
4. In paragraph 1, Further comprising a step of decoding a flag indicating derivation of an intra prediction mode based on occurrence frequency, A method comprising a step of selecting at least one intra prediction mode when the flag indicates derivation of an intra prediction mode based on occurrence frequency.
5. In paragraph 1, The step of obtaining the above candidate intra prediction modes is: A step of constructing a candidate list including candidate intra prediction modes based on prediction information of surrounding blocks of the current block; and Step of rearranging the above candidate list A method comprising:
6. In paragraph 5, The steps for constructing the above candidate list are: Sequentially search for target blocks having a size of N×M (where M and N are positive integers) in the adjacent restored area around the current block. A method for adding an intra prediction mode of a target block to the candidate list when the target block being searched is intra predicted.
7. In paragraph 5, The steps for constructing the above candidate list are: If the surrounding blocks are inter-predicted or predicted according to intra block copy (IBC) mode, A step of searching for an intra-predicted block by sequentially searching for reference blocks within the current picture or reference picture using motion vector information or block vector information of the surrounding blocks; and A step of adding the intra prediction mode of the searched block to the candidate list. How to include rules.
8. In paragraph 5, The step of rearranging the above candidate list is: Rearrange the candidate list based on the distance between the current block and the surrounding blocks, A method in which the above distance is calculated based on the positional relationship between the current block and each surrounding block.
9. In paragraph 1, The steps for constructing the above occurrence histogram are: A method that uses the size of each surrounding block as the strength of the candidate intra prediction mode corresponding to each surrounding block.
10. In paragraph 9, The step of selecting at least one intra prediction mode is: A method for selecting a predetermined number of candidate intra prediction modes having the greatest strength as at least one intra prediction mode, wherein the predetermined number is determined based on the size of the current block.
11. In a method for encoding a current block performed by a video encoding device, A step of obtaining candidate intra prediction modes based on prediction information of surrounding blocks of the current block, wherein the surrounding blocks include restored adjacent blocks and restored non-adjacent blocks, and the candidate intra prediction modes are directional intra prediction modes; A step of constructing a histogram of occurrence of each candidate intra prediction mode based on the size of each surrounding block; A step of selecting at least one intra prediction mode of the current block based on the occurrence histogram and the size of the current block; and A step of generating at least one prediction block of the current block according to at least one intra prediction mode. A method comprising:
12. In paragraph 11, A step of determining a flag that instructs the derivation of an intra prediction mode based on occurrence frequency; and Further comprising a step of encoding the above flag, A method comprising a step of selecting at least one intra prediction mode when the flag indicates derivation of an intra prediction mode based on occurrence frequency.
13. In paragraph 11, The step of obtaining the above candidate intra prediction modes is: A step of constructing a candidate list including candidate intra prediction modes based on prediction information of surrounding blocks of the current block; and Step of rearranging the above candidate list A method comprising:
14. In paragraph 11, The steps for constructing the above occurrence histogram are: A method that uses the size of each surrounding block as the strength of the candidate intra prediction mode corresponding to each surrounding block.
15. In paragraph 14, The step of selecting at least one intra prediction mode is: A method for selecting a predetermined number of candidate intra prediction modes having the greatest strength as at least one intra prediction mode, wherein the predetermined number is determined based on the size of the current block.
16. In a method for providing video data to a video decoding device, A step of encoding the above video data into a bitstream; and A step of transmitting the above bitstream to the image decoding device Including, The step of encoding the above video data is: A step of obtaining candidate intra prediction modes based on prediction information of surrounding blocks of a current block, wherein the surrounding blocks include restored adjacent blocks and restored non-adjacent blocks, and the candidate intra prediction modes are directional intra prediction modes; A step of constructing a histogram of occurrence of each candidate intra prediction mode based on the size of each surrounding block; A step of selecting at least one intra prediction mode of the current block based on the occurrence histogram and the size of the current block; and A step of generating at least one prediction block of the current block according to at least one intra prediction mode. A method comprising:
Citation Information
Patent Citations
Energy saving system and method for Cargo Hold within ventilation system
KR1020240045630A