CN117044197A - Method and apparatus for video encoding and decoding using derived intra prediction modes - Google Patents

Method and apparatus for video encoding and decoding using derived intra prediction modes Download PDF

Info

Publication number
CN117044197A
CN117044197A CN202280017239.2A CN202280017239A CN117044197A CN 117044197 A CN117044197 A CN 117044197A CN 202280017239 A CN202280017239 A CN 202280017239A CN 117044197 A CN117044197 A CN 117044197A
Authority
CN
China
Prior art keywords
block
current block
prediction
prediction mode
mode
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202280017239.2A
Other languages
Chinese (zh)
Inventor
边柱衡
朴时奈
沈东圭
朴胜煜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hyundai Motor Co
Industry Academic Collaboration Foundation of Kwangwoon University
Kia Corp
Original Assignee
Hyundai Motor Co
Industry Academic Collaboration Foundation of Kwangwoon University
Kia Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from KR1020220026549A external-priority patent/KR20220125175A/en
Application filed by Hyundai Motor Co, Industry Academic Collaboration Foundation of Kwangwoon University, Kia Corp filed Critical Hyundai Motor Co
Priority claimed from PCT/KR2022/002985 external-priority patent/WO2022186616A1/en
Publication of CN117044197A publication Critical patent/CN117044197A/en
Pending legal-status Critical Current

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The present invention relates to a method and apparatus for video coding and decoding using derived intra prediction modes. The present embodiments provide a method and apparatus for video encoding and decoding, in which an intra prediction mode of a current block is derived using restored neighboring reference sample values, and then a prediction block of the current block is generated based on the derived prediction mode.

Description

Method and apparatus for video encoding and decoding using derived intra prediction modes
Technical Field
The present invention relates to a video encoding and decoding method and apparatus using a derived intra prediction mode.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
Since video data has a larger data amount than audio data or still image data, the video data requires a large amount of hardware resources (including a memory) to store or transmit the video data that is not subjected to compression processing.
Accordingly, encoders are typically used to compress and store or transmit video data. The decoder receives the compressed video data, decompresses the received compressed video data, and plays the decompressed video data. Video compression techniques include h.264/AVC, high efficiency video codec (High Efficiency Video Coding, HEVC), and multi-function video codec (Versatile Video Coding, VVC) that has an increase in codec efficiency of HEVC of about 30% or more.
However, as the image size, resolution, and frame rate gradually increase, the amount of data to be encoded is also increasing. Accordingly, a new compression technique providing higher codec efficiency and improved image enhancement effect compared to the existing compression technique is needed. In particular, in terms of coding efficiency, it is necessary to consider a method of deriving an intra prediction mode of a current block, instead of parsing the intra prediction mode.
Disclosure of Invention
Technical problem
The present invention seeks to provide a video encoding and decoding method and apparatus that derives an intra prediction mode of a current block using pre-restored neighboring reference sample values, and generates a prediction block of the current block based on the derived prediction mode.
Technical proposal
At least one aspect of the present invention provides a method performed by a video decoding device for intra prediction of a current block. The method includes parsing a prediction mode derivation flag from the bitstream, the prediction mode derivation flag indicating whether to derive a prediction mode of the current block, and the method includes checking the prediction mode derivation flag. When the prediction mode derivation flag is true, the method includes: determining a calculation region for calculating a gradient value according to the restored neighboring samples of the current block; calculating a gradient histogram of the direction pattern in a calculation region for the current block; deriving a prediction mode of the current block based on the gradient histogram; and generating a prediction block of the current block by performing intra prediction using the derived prediction mode.
Another aspect of the present invention provides an intra prediction apparatus. The apparatus includes a prediction mode derivation determining unit configured to determine whether to derive a prediction mode of the current block by parsing a prediction mode derivation flag from a bitstream. The apparatus further includes a gradient calculation region determining unit configured to determine a calculation region for calculating a gradient value from the restored neighboring samples of the current block. The apparatus further includes a histogram calculation unit configured to calculate a gradient histogram of the direction pattern in a calculation region for the current block. The apparatus further comprises a prediction mode derivation unit configured to derive a prediction mode of the current block based on the gradient histogram. The apparatus further includes an intra prediction performing unit configured to generate a prediction block of the current block by performing intra prediction using the derived prediction mode.
Advantageous effects
As described above, the present invention provides a video encoding and decoding method and apparatus that derives an intra prediction mode of a current block using pre-restored neighboring reference sample values, and generates a prediction block of the current block based on the derived prediction mode to improve encoding and decoding efficiency.
Drawings
Fig. 1 is a block diagram of a video encoding device in which the techniques of the present invention may be implemented.
Fig. 2 illustrates a method of partitioning a block using a quadtree plus binary tree trigeminal tree (QTBTTT) structure.
Fig. 3a and 3b illustrate a plurality of intra prediction modes including a wide-angle intra prediction mode.
Fig. 4 shows neighboring blocks of the current block.
Fig. 5 is a block diagram of a video decoding apparatus in which the techniques of the present invention may be implemented.
Fig. 6 is a block diagram of an intra prediction device utilizing prediction mode derivation according to one embodiment of the present invention.
Fig. 7 shows a calculation region for calculating gradient values according to an embodiment of the present invention.
Fig. 8 shows a gradient histogram of a direction pattern according to an embodiment of the present invention.
Fig. 9 shows sub-sampled pixels for calculating gradient values according to one embodiment of the invention.
Fig. 10 shows weight values in the form of a matrix according to an embodiment of the present invention.
Fig. 11 shows the derivation of prediction modes at the time of sub-block partitioning according to one embodiment of the present invention.
Fig. 12 is a flowchart illustrating an intra prediction method using prediction mode derivation according to one embodiment of the present invention.
Detailed Description
Hereinafter, some embodiments of the present invention will be described in detail with reference to the accompanying illustrative drawings. In the following description, like reference numerals denote like elements, although the elements are shown in different drawings. Furthermore, in the following description of some embodiments, detailed descriptions of related known components and functions may be omitted for clarity and conciseness when it may be considered that the subject matter of the present invention is obscured.
Fig. 1 is a block diagram of a video encoding device in which the techniques of the present invention may be implemented. Hereinafter, a video encoding apparatus and components of the apparatus are described with reference to the diagram of fig. 1.
The encoding apparatus may include: an image divider 110, a predictor 120, a subtractor 130, a transformer 140, a quantizer 145, a reordering unit 150, an entropy encoder 155, an inverse quantizer 160, an inverse transformer 165, an adder 170, a loop filtering unit 180, and a memory 190.
Each component of the encoding apparatus may be implemented as hardware or software, or as a combination of hardware and software. In addition, the function of each component may be implemented as software, and the microprocessor may also be implemented to execute the function of the software corresponding to each component.
A video is made up of one or more sequences comprising a plurality of images. Each image is divided into a plurality of regions, and encoding is performed on each region. For example, an image is segmented into one or more tiles (tiles) or/and slices (slices). Here, one or more tiles may be defined as a tile set. Each tile or/and slice is partitioned into one or more Coding Tree Units (CTUs). In addition, each CTU is partitioned into one or more Coding Units (CUs) by a tree structure. Information applied to each CU is encoded as a syntax of the CU, and information commonly applied to CUs included in one CTU is encoded as a syntax of the CTU. In addition, information commonly applied to all blocks in one slice is encoded as syntax of a slice header, and information applied to all blocks constituting one or more pictures is encoded as a picture parameter set (Picture Parameter Set, PPS) or a picture header. Furthermore, information commonly referred to by the plurality of images is encoded as a sequence parameter set (Sequence Parameter Set, SPS). In addition, information commonly referenced by the one or more SPS is encoded as a set of video parameters (Video Parameter Set, VPS). Furthermore, information commonly applied to one tile or group of tiles may also be encoded as syntax of the tile or group of tiles header. The syntax included in the SPS, PPS, slice header, tile, or tile set header may be referred to as a high level syntax.
The image divider 110 determines the size of a Coding Tree Unit (CTU). Information about the size of the CTU (CTU size) is encoded as a syntax of the SPS or PPS and transmitted to the video decoding apparatus.
The image divider 110 divides each image constituting a video into a plurality of CTUs having a predetermined size, and then recursively divides the CTUs by using a tree structure. Leaf nodes in the tree structure become CUs, which are the basic units of coding.
The tree structure may be a Quadtree (QT) in which a higher node (or parent node) is partitioned into four lower nodes (or child nodes) of the same size. The tree structure may also be a Binary Tree (BT) in which a higher node is split into two lower nodes. The tree structure may also be a Trigeminal Tree (TT), where the higher nodes are split into three lower nodes at a ratio of 1:2:1. The tree structure may also be a structure in which two or more of a QT structure, a BT structure, and a TT structure are mixed. For example, a quadtree plus binary tree (quadtree plus binarytree, QTBT) structure may be used, or a quadtree plus binary tree (quadtree plus binarytree ternarytree, QTBTTT) structure may be used. Here, BTTT is added to the tree structure to be called multiple-type tree (MTT).
Fig. 2 is a schematic diagram for describing a method of dividing a block by using the QTBTTT structure.
As shown in fig. 2, the CTU may be first partitioned into QT structures. Quadtree partitioning may be recursive until the size of the partitioned block reaches the minimum block size (MinQTSize) of leaf nodes allowed in QT. A first flag (qt_split_flag) indicating whether each node of the QT structure is partitioned into four lower-layer nodes is encoded by the entropy encoder 155 and signaled to the video decoding apparatus. When the leaf node of QT is not greater than the maximum block size (MaxBTSize) of the root node allowed in BT, the leaf node may be further divided into at least one of BT structure or TT structure. There may be multiple directions of segmentation in the BT structure and/or the TT structure. For example, there may be two directions, i.e., a direction of dividing the block of the corresponding node horizontally and a direction of dividing the block of the corresponding node vertically. As shown in fig. 2, when the MTT division starts, a second flag (MTT _split_flag) indicating whether a node is divided, and a flag additionally indicating a division direction (vertical or horizontal) and/or a flag indicating a division type (binary or trigeminal) in the case that a node is divided are encoded by the entropy encoder 155 and signaled to the video decoding apparatus.
Alternatively, a CU partition flag (split_cu_flag) indicating whether a node is partitioned may be further encoded before encoding a first flag (qt_split_flag) indicating whether each node is partitioned into four nodes of a lower layer. When the value of the CU partition flag (split_cu_flag) indicates that each node is not partitioned, the block of the corresponding node becomes a leaf node in the partition tree structure and becomes a CU, which is a basic unit of encoding. When the value of the CU partition flag (split_cu_flag) indicates that each node is partitioned, the video encoding apparatus first starts encoding the first flag in the above scheme.
When QTBT is used as another example of the tree structure, there may be two types, i.e., a type of horizontally dividing a block of a corresponding node into two blocks having the same size (i.e., symmetrical horizontal division) and a type of vertically dividing a block of a corresponding node into two blocks having the same size (i.e., symmetrical vertical division). A partition flag (split_flag) indicating whether each node of the BT structure is partitioned into lower-layer blocks and partition type information indicating a partition type are encoded by the entropy encoder 155 and transmitted to the video decoding apparatus. On the other hand, there may additionally be a type in which a block of a corresponding node is divided into two blocks in an asymmetric form to each other. The asymmetric form may include a form in which a block of a corresponding node is divided into two rectangular blocks having a size ratio of 1:3, or may also include a form in which a block of a corresponding node is divided in a diagonal direction.
A CU may have various sizes according to QTBT or QTBTTT divided from CTUs. Hereinafter, a block corresponding to a CU to be encoded or decoded (i.e., a leaf node of QTBTTT) is referred to as a "current block". When QTBTTT segmentation is employed, the shape of the current block may also be rectangular in shape, in addition to square shape.
The predictor 120 predicts the current block to generate a predicted block. Predictor 120 includes an intra predictor 122 and an inter predictor 124.
In general, each of the current blocks in the image may be predictively encoded. In general, prediction of a current block may be performed by using an intra prediction technique using data from an image including the current block or an inter prediction technique using data from an image encoded before the image including the current block. Inter prediction includes both unidirectional prediction and bi-directional prediction.
The intra predictor 122 predicts pixels in the current block by using pixels (reference pixels) located adjacent to the current block in the current image including the current block. Depending on the prediction direction, there are multiple intra prediction modes. For example, as shown in fig. 3a, the plurality of intra prediction modes may include two non-directional modes including a Planar (Planar) mode and a DC mode, and may include 65 directional modes. The neighboring pixels and algorithm equations to be used are defined differently according to each prediction mode.
For efficient direction prediction of a current block having a rectangular shape, direction modes (# 67 to # 80) indicated by dotted arrows in fig. 3b, intra prediction modes # -1 to # -14) may be additionally used. The direction mode may be referred to as a "wide angle intra-prediction mode". In fig. 3b, the arrows indicate the respective reference samples for prediction, rather than representing the prediction direction. The prediction direction is opposite to the direction indicated by the arrow. When the current block has a rectangular shape, the wide-angle intra prediction mode is a mode in which prediction is performed in a direction opposite to a specific direction mode without additional bit transmission. In this case, in the wide-angle intra prediction mode, some of the wide-angle intra prediction modes available for the current block may be determined by a ratio of a width to a height of the current block having a rectangular shape. For example, when the current block has a rectangular shape having a height smaller than a width, wide-angle intra prediction modes (intra prediction modes #67 to # 80) having angles smaller than 45 degrees are available. When the current block has a rectangular shape with a width greater than a height, a wide-angle intra prediction mode having an angle greater than-135 degrees is available.
The intra predictor 122 may determine intra prediction to be used for encoding the current block. In some examples, intra predictor 122 may encode the current block by utilizing a plurality of intra prediction modes, and may also select an appropriate intra prediction mode to use from among the test modes. For example, the intra predictor 122 may calculate a rate distortion value by using rate-distortion (rate-distortion) analysis of a plurality of tested intra prediction modes, and may also select an intra prediction mode having the best rate distortion characteristics among the test modes.
The intra predictor 122 selects one intra prediction mode among a plurality of intra prediction modes, and predicts the current block by using neighboring pixels (reference pixels) determined according to the selected intra prediction mode and an algorithm equation. Information about the selected intra prediction mode is encoded by the entropy encoder 155 and transmitted to a video decoding device.
The inter predictor 124 generates a prediction block of the current block by using a motion compensation process. The inter predictor 124 searches for a block most similar to the current block in a reference picture that has been encoded and decoded earlier than the current picture, and generates a predicted block of the current block by using the searched block. In addition, a Motion Vector (MV) is generated, which corresponds to a displacement (displacement) between a current block in the current image and a prediction block in the reference image. In general, motion estimation is performed on a luminance (luma) component, and a motion vector calculated based on the luminance component is used for both the luminance component and the chrominance component. Motion information including information of the reference picture and information on a motion vector for predicting the current block is encoded by the entropy encoder 155 and transmitted to a video decoding device.
The inter predictor 124 may also perform interpolation of reference pictures or reference blocks to increase the accuracy of prediction. In other words, the sub-samples are interpolated between two consecutive integer samples by applying the filter coefficients to a plurality of consecutive integer samples comprising the two integer samples. When the process of searching for a block most similar to the current block is performed on the interpolated reference image, the decimal-unit precision may be represented for the motion vector instead of the integer-sample-unit precision. The precision or resolution of the motion vector may be set differently for each target region to be encoded, e.g., a unit such as a slice, tile, CTU, CU, etc. When such adaptive motion vector resolution (adaptive motion vector resolution, AMVR) is applied, information on the motion vector resolution to be applied to each target area should be signaled for each target area. For example, when the target area is a CU, information about the resolution of a motion vector applied to each CU is signaled. The information on the resolution of the motion vector may be information representing the accuracy of a motion vector difference to be described below.
On the other hand, the inter predictor 124 may perform inter prediction by using bi-directional prediction. In the case of bi-prediction, two reference pictures and two motion vectors representing block positions most similar to the current block in each reference picture are used. The inter predictor 124 selects a first reference picture and a second reference picture from the reference picture list0 (RefPicList 0) and the reference picture list1 (RefPicList 1), respectively. The inter predictor 124 also searches for a block most similar to the current block in the corresponding reference picture to generate a first reference block and a second reference block. Further, a prediction block of the current block is generated by averaging or weighted-averaging the first reference block and the second reference block. Further, motion information including information on two reference pictures for predicting the current block and information on two motion vectors is transmitted to the entropy encoder 155. Here, the reference image list0 may be constituted by an image preceding the current image in display order among the pre-restored images, and the reference image list1 may be constituted by an image following the current image in display order among the pre-restored images. However, although not particularly limited thereto, a pre-restored image following the current image in the display order may be additionally included in the reference image list 0. Conversely, a pre-restored image preceding the current image may be additionally included in the reference image list 1.
In order to minimize the amount of bits consumed for encoding motion information, various methods may be used.
For example, when a reference image and a motion vector of a current block are identical to those of a neighboring block, information capable of identifying the neighboring block is encoded to transmit motion information of the current block to a video decoding apparatus. This method is called merge mode (merge mode).
In the merge mode, the inter predictor 124 selects a predetermined number of merge candidate blocks (hereinafter, referred to as "merge candidates") from neighboring blocks of the current block.
As the neighboring blocks used to derive the merge 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 image may be used, as shown in fig. 4. In addition, in addition to the current picture in which the current block is located, a block located within a reference picture (which may be the same as or different from the reference picture used to predict the current block) may also be used as a merging candidate. For example, a co-located block (co-located block) of a current block within a reference picture or a block adjacent to the co-located block may additionally be used as a merging candidate. If the number of merging candidates selected by the above method is less than a preset number, a zero vector is added to the merging candidates.
The inter predictor 124 configures a merge list including a predetermined number of merge candidates by using neighboring blocks. A merge candidate to be used as motion information of the current block is selected from among the merge candidates included in the merge list, and merge index information for identifying the selected candidate is generated. The generated merging index information is encoded by the entropy encoder 155 and transmitted to a video decoding apparatus.
The merge skip mode is a special case of the merge mode. After quantization, when all transform coefficients used for entropy coding are near zero, only neighboring block selection information is transmitted without transmitting a residual signal. By using the merge skip mode, relatively high encoding efficiency can be achieved for images with slight motion, still images, screen content images, and the like.
Hereinafter, the merge mode and the merge skip mode are collectively referred to as a merge/skip mode.
Another method for encoding motion information is advanced motion vector prediction (advanced motion vector prediction, AMVP) mode.
In the AMVP mode, the inter predictor 124 derives a motion vector prediction candidate for a motion vector of a current block by using neighboring blocks of the current block. As the neighboring blocks used to derive the motion vector prediction candidates, all or some of the left block A0, the lower left block A1, the upper side block B0, the upper right block B1, and the upper left block B2 adjacent to the current block in the current image shown in fig. 4 may be used. In addition, in addition to the current picture in which the current block is located, a block located within a reference picture (which may be the same as or different from a reference picture used to predict the current block) may also be used as a neighboring block used to derive a motion vector prediction candidate. For example, a co-located block of the current block within the reference picture or a block adjacent to the co-located block may be used. If the number of motion vector candidates selected by the above method is less than a preset number, a zero vector is added to the motion vector candidates.
The inter predictor 124 derives a motion vector prediction candidate by using the motion vector of the neighboring block, and determines a motion vector prediction of the motion vector of the current block by using the motion vector prediction candidate. In addition, a motion vector difference is calculated by subtracting a motion vector prediction from a motion vector of the current block.
Motion vector prediction may be obtained by applying a predefined function (e.g., median and average calculations, etc.) to the motion vector prediction candidates. In this case, the video decoding device is also aware of the predefined function. Further, since the neighboring block used to derive the motion vector prediction candidates is a block for which encoding and decoding have been completed, the video decoding apparatus may also already know the motion vector of the neighboring block. Therefore, the video encoding device does not need to encode information for identifying motion vector prediction candidates. Accordingly, in this case, information on a motion vector difference and information on a reference image for predicting a current block are encoded.
On the other hand, motion vector prediction may also be determined by selecting a scheme of any one of the motion vector prediction candidates. In this case, the information for identifying the selected motion vector prediction candidates is additionally encoded together with the information about the motion vector difference and the information about the reference picture for predicting the current block.
The subtractor 130 generates a residual block by subtracting the current block from the prediction block generated by the intra predictor 122 or the inter predictor 124.
The transformer 140 transforms a residual signal in a residual block having pixel values of a spatial domain into transform coefficients of a frequency domain. The transformer 140 may transform a residual signal in a residual block by using the entire size of the residual block as a transform unit, or may divide the residual block into a plurality of sub-blocks, and may perform the transform by using the sub-blocks as transform units. Alternatively, the residual block is divided into two sub-blocks, i.e., a transform region and a non-transform region, to transform the residual signal by using only the transform region sub-block as a transform unit. Here, the transform region sub-block may be one of two rectangular blocks having a size ratio of 1:1 based on a horizontal axis (or a vertical axis). In this case, a flag (cu_sbt_flag) indicating that only the sub-block is transformed, and direction (vertical/horizontal) information (cu_sbt_horizontal_flag) and/or position information (cu_sbt_pos_flag) are encoded by the entropy encoder 155 and signaled to the video decoding apparatus. In addition, the size of the transform region sub-block may have a size ratio of 1:3 based on the horizontal axis (or vertical axis). In this case, a flag (cu_sbt_quad_flag) dividing the corresponding division is additionally encoded by the entropy encoder 155 and signaled to the video decoding device.
On the other hand, the transformer 140 may perform transformation of the residual block separately in the horizontal direction and the vertical direction. For this transformation, various types of transformation functions or transformation matrices may be used. For example, the pair-wise transformation function for horizontal and vertical transformations may be defined as a transformation set (multiple transform set, MTS). The transformer 140 may select one transform function pair having the highest transform efficiency among the MTSs, and may transform the residual block in each of the horizontal and vertical directions. Information (mts_idx) about the transform function pairs in the MTS is encoded by the entropy encoder 155 and signaled to the video decoding means.
The quantizer 145 quantizes the transform coefficient output from the transformer 140 using a quantization parameter, and outputs the quantized transform coefficient to the entropy encoder 155. The quantizer 145 may also immediately quantize the relevant residual block without transforming any block or frame. The quantizer 145 may also apply different quantization coefficients (scaling values) according to the positions of the transform coefficients in the transform block. A quantization matrix applied to quantized transform coefficients arranged in two dimensions may be encoded and signaled to a video decoding apparatus.
The reordering unit 150 may perform the rearrangement of the coefficient values on the quantized residual values.
The rearrangement unit 150 may change the 2D coefficient array to a 1D coefficient sequence by using coefficient scanning. For example, the rearrangement unit 150 may scan the DC coefficients to the coefficients of the high frequency region using zigzag scanning (zig-zag scan) or diagonal scanning (diagonal scan) to output a 1D coefficient sequence. Instead of the zig-zag scan, a vertical scan that scans the 2D coefficient array in the column direction and a horizontal scan that scans the 2D block type coefficients in the row direction may also be utilized, depending on the size of the transform unit and the intra prediction mode. In other words, the scanning method to be used may be determined in zigzag scanning, diagonal scanning, vertical scanning, and horizontal scanning according to the size of the transform unit and the intra prediction mode.
The entropy encoder 155 encodes the sequence of the 1D quantized transform coefficients output from the rearrangement unit 150 by using various encoding schemes including Context-based adaptive binary arithmetic coding (Context-based Adaptive Binary Arithmetic Code, CABAC), exponential golomb (Exponential Golomb), and the like to generate a bitstream.
Further, the entropy encoder 155 encodes information related to block division (e.g., CTU size, CTU division flag, QT division flag, MTT division type, MTT division direction, etc.) so that the video decoding apparatus can divide blocks equally to the video encoding apparatus. Further, the entropy encoder 155 encodes information on a prediction type indicating whether the current block is encoded by intra prediction or inter prediction. The entropy encoder 155 encodes intra prediction information (i.e., information about an intra prediction mode) or inter prediction information (a merge index in the case of a merge mode, and information about a reference picture index and a motion vector difference in the case of an AMVP mode) according to a prediction type. Further, the entropy encoder 155 encodes information related to quantization (i.e., information about quantization parameters and information about quantization matrices).
The inverse quantizer 160 inversely quantizes the quantized transform coefficient output from the quantizer 145 to generate a transform coefficient. The inverse transformer 165 transforms the transform coefficients output from the inverse quantizer 160 from the frequency domain to the spatial domain to restore a residual block.
The adder 170 adds the restored residual block and the prediction block generated by the predictor 120 to restore the current block. The pixels in the restored current block are used as reference pixels when intra-predicting the next block.
The loop filtering unit 180 performs filtering on the restored pixels to reduce block artifacts (blocking artifacts), ringing artifacts (ringing artifacts), blurring artifacts (blurring artifacts), etc., which occur due to block-based prediction and transform/quantization. The loop filtering unit 180 as an in-loop filter may include all or some of a deblocking filter 182, a sample adaptive offset (sample adaptive offset, SAO) filter 184, and an adaptive loop filter (adaptive loop filter, ALF) 186.
Deblocking filter 182 filters boundaries between restored blocks to remove block artifacts (blocking artifacts) that occur due to block unit encoding/decoding, and SAO filter 184 and ALF 186 additionally filter the deblock filtered video. The SAO filter 184 and ALF 186 are filters for compensating for differences between restored pixels and original pixels that occur due to lossy coding (loss coding). The SAO filter 184 applies an offset as a CTU unit to enhance subjective image quality and coding efficiency. On the other hand, the ALF 186 performs block unit filtering, and applies different filters to compensate for distortion by dividing boundaries of respective blocks and the degree of variation. Information about filter coefficients to be used for ALF may be encoded and signaled to the video decoding apparatus.
The restored blocks filtered by the deblocking filter 182, the SAO filter 184, and the ALF 186 are stored in the memory 190. When all blocks in one image are restored, the restored image may be used as a reference image for inter-predicting blocks within a picture to be subsequently encoded.
Fig. 5 is a functional block diagram of a video decoding apparatus in which the techniques of the present invention may be implemented. Hereinafter, with reference to fig. 5, a video decoding apparatus and components of the apparatus are described.
The video decoding apparatus may include an entropy decoder 510, a reordering unit 515, an inverse quantizer 520, an inverse transformer 530, a predictor 540, an adder 550, a loop filtering unit 560, and a memory 570.
Similar to the video encoding apparatus of fig. 1, each component of the video decoding apparatus may be implemented as hardware or software, or as a combination of hardware and software. In addition, the function of each component may be implemented as software, and the microprocessor may also be implemented to execute the function of the software corresponding to each component.
The entropy decoder 510 extracts information related to block segmentation by decoding a bitstream generated by a video encoding apparatus to determine a current block to be decoded, and extracts prediction information required to restore the current block and information on a residual signal.
The entropy decoder 510 determines the size of CTUs by extracting information about the CTU size from a Sequence Parameter Set (SPS) or a Picture Parameter Set (PPS), and partitions a picture into CTUs having the determined size. Further, the CTU is determined as the highest layer (i.e., root node) of the tree structure, and the partition information of the CTU is extracted to partition the CTU by using the tree structure.
For example, when dividing a CTU by using the QTBTTT structure, first a first flag (qt_split_flag) related to the division of QT is extracted to divide each node into four nodes of the lower layer. In addition, a second flag (MTT _split_flag), a split direction (vertical/horizontal), and/or a split type (binary/trigeminal) related to the split of the MTT are extracted with respect to a node corresponding to the leaf node of the QT to split the corresponding leaf node into the MTT structure. As a result, each node below the leaf node of QT is recursively partitioned into BT or TT structures.
As another example, when a CTU is divided by using the QTBTTT structure, a CU division flag (split_cu_flag) indicating whether to divide the CU is extracted. When the corresponding block is partitioned, a first flag (qt_split_flag) may also be extracted. During the segmentation process, recursive MTT segmentation of 0 or more times may occur after recursive QT segmentation of 0 or more times for each node. For example, for CTUs, MTT partitioning may occur immediately, or conversely, QT partitioning may occur only multiple times.
As another example, when dividing the CTU by using the QTBT structure, a first flag (qt_split_flag) related to the division of QT is extracted to divide each node into four nodes of the lower layer. In addition, a split flag (split_flag) indicating whether or not a node corresponding to a leaf node of QT is further split into BT and split direction information are extracted.
On the other hand, when the entropy decoder 510 determines the current block to be decoded by using the partition of the tree structure, the entropy decoder 510 extracts information on a prediction type indicating whether the current block is intra-predicted or inter-predicted. When the prediction type information indicates intra prediction, the entropy decoder 510 extracts syntax elements for intra prediction information (intra prediction mode) of the current block. When the prediction type information indicates inter prediction, the entropy decoder 510 extracts information representing syntax elements of the inter prediction information, i.e., a motion vector and a reference picture to which the motion vector refers.
Further, the entropy decoder 510 extracts quantization-related information and extracts information on transform coefficients of the quantized current block as information on a residual signal.
The reordering unit 515 may change the sequence of the 1D quantized transform coefficients entropy-decoded by the entropy decoder 510 into a 2D coefficient array (i.e., block) again in the reverse order of the coefficient scan order performed by the video encoding device.
The inverse quantizer 520 inversely quantizes the quantized transform coefficient and inversely quantizes the quantized transform coefficient by using a quantization parameter. The inverse quantizer 520 may also apply different quantization coefficients (scaling values) to the quantized transform coefficients arranged in 2D. The inverse quantizer 520 may perform inverse quantization by applying a matrix of quantized coefficients (scaled values) from the video encoding device to a 2D array of quantized transform coefficients.
The inverse transformer 530 restores a residual signal by inversely transforming the inversely quantized transform coefficients from the frequency domain to the spatial domain to generate a residual block of the current block.
Further, when the inverse transformer 530 inversely transforms a partial region (sub-block) of the transform block, the inverse transformer 530 extracts a flag (cu_sbt_flag) transforming only the sub-block of the transform block, direction (vertical/horizontal) information (cu_sbt_horizontal_flag) of the sub-block, and/or position information (cu_sbt_pos_flag) of the sub-block. The inverse transformer 530 also inversely transforms transform coefficients of the corresponding sub-block from the frequency domain to the spatial domain to restore a residual signal, and fills the region that is not inversely transformed with a value of "0" as the residual signal to generate a final residual block of the current block.
Further, when applying MTS, the inverse transformer 530 determines a transform index or a transform matrix to be applied in each of the horizontal direction and the vertical direction by using MTS information (mts_idx) signaled from the video encoding apparatus. The inverse transformer 530 also performs inverse transformation on the transform coefficients in the transform block in the horizontal direction and the vertical direction by using the determined transform function.
The predictor 540 may include an intra predictor 542 and an inter predictor 544. The intra predictor 542 is activated when the prediction type of the current block is intra prediction, and the inter predictor 544 is activated when the prediction type of the current block is inter prediction.
The intra predictor 542 determines an intra prediction mode of the current block among the plurality of intra prediction modes according to syntax elements of the intra prediction mode extracted from the entropy decoder 510. The intra predictor 542 also predicts the current block by using neighboring reference pixels of the current block according to an intra prediction mode.
The inter predictor 544 determines a motion vector of the current block and a reference picture to which the motion vector refers by using syntax elements of the inter prediction mode extracted from the entropy decoder 510.
The adder 550 restores the current block by adding the residual block output from the inverse transformer 530 to the prediction block output from the inter predictor 544 or the intra predictor 542. In intra prediction of a block to be decoded later, pixels within the restored current block are used as reference pixels.
The loop filtering unit 560, which is an in-loop filter, may include a deblocking filter 562, an SAO filter 564, and an ALF 566. Deblocking filter 562 performs deblocking filtering on boundaries between restored blocks to remove block artifacts occurring due to block unit decoding. The SAO filter 564 and ALF 566 perform additional filtering on the restored block after deblocking filtering to compensate for differences between restored pixels and original pixels that occur due to lossy encoding. The filter coefficients of the ALF are determined by using information on the filter coefficients decoded from the bitstream.
The restored blocks filtered by the deblocking filter 562, the SAO filter 564, and the ALF 566 are stored in the memory 570. When all blocks in one image are restored, the restored image may be used as a reference image for inter-predicting blocks within a picture to be subsequently encoded.
In some embodiments, the invention relates to encoding and decoding video imagery as described above. More particularly, the present invention provides a video encoding and decoding method and apparatus that derive an intra prediction mode of a current block using pre-restored neighboring reference sample values, and generate a prediction block of the current block based on the derived prediction mode.
The following embodiments may be applied to the entropy decoder 510 and the intra predictor 542 in the video decoding apparatus. The following embodiments may also be applied to the intra predictor 122 in the video encoding apparatus.
In the following description, a block has an aspect ratio defined as the horizontal length (W: width) divided by the vertical length (H: height) of the block, i.e., the ratio of the horizontal length to the vertical length.
Hereinafter, the fact that the specific flag is true indicates that the value of the flag is 1, and the fact that the specific flag is false indicates that the value of the flag is 0.
In the following description, intra prediction is described with respect to a video decoding apparatus, and for convenience, a video encoding apparatus may be mentioned if necessary. Furthermore, the following description may be similarly applied to a video encoding apparatus.
Hereinafter, a phrase of the video decoding apparatus or the entropy decoder 510 therein decoding data from a bitstream is used interchangeably with a phrase of parsing data by the same apparatus or unit.
I. Intra prediction and Intra Sub-Partition (ISP)
In a multi-function video coding (VVC) technique, a luminance block has intra prediction modes of a non-directional mode (i.e., plane and DC) and the remaining subdivided directional modes (i.e., modes 2 through 66), as illustrated in fig. 3 a. As added for example in fig. 3b, the luminance block further has intra prediction modes based on the direction modes (modes-14 to-1 and modes 67 to 80) of the wide-angle intra prediction.
In a multi-function video codec (VVC) technique, a luminance block has intra prediction modes of a non-directional mode (i.e., plane and DC) and the remaining subdivided directional modes (i.e., modes 2 through 66), as illustrated in fig. 3 a. As added for example in fig. 3b, the luminance block further has intra prediction modes based on the direction modes (modes-14 to-1 and modes 67 to 80) of the wide-angle intra prediction.
In the following description, a large block before a partition is referred to as a current block, and each of smaller blocks of a sub-partition is referred to as a sub-block.
The operation of ISP technology is as follows.
When the ISP enable flag sps_isp_enabled_flag located on the high-level SPS is true, the video encoding apparatus transmits intra_sub-alternatives_mode_flag and intra_sub-alternatives_split_flag. The video decoding apparatus first parses an ISP enable flag sps_isp_enabled_flag from the bitstream. When the ISP enable flag is true, the video decoding apparatus may decode the intra_sub-alternatives_mode_flag and the intra_sub-alternatives_split_flag from the bitstream.
The video encoding apparatus signals to the video decoding apparatus an intra_sub-areas_mode_flag indicating whether to apply the ISP and an intra_sub-areas_split_flag indicating the sub-division method. Table 1 shows the sub-partition types intra sub-partitionsplit type according to intra_sub-partitions_mode_flag and intra_sub-partitions_split_flag.
TABLE 1
IntraSubPartitionsSplitType Name of IntraParticSplitType
0 ISP_NO_SPLIT
1 ISP_HOR_SPLIT
2 ISP_VER_SPLIT
The ISP technology sets the sub-partition type intrasubpartitionsplit type as follows.
When intra_sub_distributions_mode_flag is 0, intra_sub_distributions SPLIT type is set to 0, and sub block partitioning (isp_no_split) is not performed. That is, no ISP is applied.
If intra_sub_modes_flag is not 0, ISP is applied. At this time, the intra_sub-partition type is set to a value of 1+intra_sub-partitions_partition_flag, and sub-block partitioning is performed according to the sub-partition type. Horizontal sub-block division (isp_hor_split) is performed if intra-sub-partitionsplit type=1, and sub-block division (isp_ver_split) is performed in the vertical direction if intra-sub-partitionsplit type=2. In other words, intra_sub_split_flag may indicate a sub-block partition direction.
For example, when the ISP mode indicating sub-partitioning in the horizontal direction is applied to the current block, intra_sub-partitionsplit type is 1, intra_sub-partitionjmode_flag is 1, and intra_sub-partitionjsplit_flag is 0.
In the following description, intra_sub_modes_flag is denoted as a sub-block partition application flag, intra_sub_split_flag is denoted as a sub-block partition direction flag, and intra sub-partitionsplit type is denoted as a sub-block partition type.
Derivation of intra prediction modes
In the following description, an intra prediction apparatus derived using a prediction mode is described with reference to fig. 6.
Fig. 6 is a block diagram of an intra prediction device using prediction mode derivation according to one embodiment of the present invention.
The intra prediction apparatus according to the present embodiment calculates a histogram from gradients of pre-restored neighboring reference sample values, derives an intra prediction mode of a current block using the calculated histogram, and generates a prediction block of the current block based on the derived prediction mode. The intra prediction apparatus includes all or part of the following: a prediction mode derivation determination unit 602, a gradient calculation region determination unit 604, a histogram calculation unit 606, a prediction mode derivation unit 608, and an intra prediction execution unit 610.
The prediction mode derivation determining unit 602 parses a flag indicating whether to derive a prediction mode of the current block to determine derivation of an intra prediction mode. In the following description, the above-described flag is referred to as a prediction mode derivation flag. The video encoding apparatus may set a prediction mode derivation flag according to rate distortion optimization, and then may transmit the set prediction mode derivation flag to the video decoding apparatus. After deriving the flag from the bitstream decoding prediction mode, the video decoding apparatus may perform the steps described below. On the other hand, the video encoding apparatus may obtain the prediction mode derivation flag from a high level, and perform the subsequent steps.
When the prediction mode derivation flag is true, the intra prediction apparatus derives an intra prediction mode based on the restored neighboring samples of the current block while omitting parsing of the intra prediction mode of the current block. At this time, when the current block cannot use the left and/or upper reference samples (including the image boundary, the slice boundary, or the tile boundary), decoding of the prediction mode derivation flag may be implicitly omitted.
As another embodiment, before determining whether to perform prediction mode derivation, the intra prediction apparatus may determine from bitstream parsing whether a prediction mode of the current block is one or more flags of a non-directional mode, such as a Planar (Planar) mode, a DC mode, or a matrix-based mode. When all the corresponding flags are 0, the prediction mode derivation determination unit 602 may parse the prediction mode derivation flag and then may determine whether to perform prediction mode derivation.
Further, after the prediction mode derivation determination unit 602 determines that the prediction mode is derived, the intra prediction apparatus may decode the sub-block partition application flag from the bitstream and determine whether to apply the ISP technique, i.e., whether to perform the sub-block partition of the current block.
Fig. 7 shows a calculation region for calculating gradient values according to an embodiment of the present invention.
The gradient calculation region determining unit 604 determines a calculation region for calculating a gradient value from the restored neighboring samples of the current block to derive an intra prediction mode. As shown in fig. 7, three lines of restored reference pixels belonging to the restored regions located at the left and top of the current block may be used as the gradient calculation region. In the example of fig. 7, the length M of the upper reference sample and the length N of the left reference sample may be set based on the width W and the height H of the current block. For example, based on (-3, -3) pixels located at the upper left of the current block, M is set to a value such as W+3, 2 XW+3, or W+H+3, and N is set to a value such as H+3, 2 XH+3, or W+H+3.
As another embodiment, the gradient calculation region determining unit 604 may parse a flag indicating a calculation region from the bitstream to set the left side or upper side of the current block as the calculation region. Alternatively, the gradient calculation region determining unit 604 may parse an index indicating a calculation region from the bitstream to determine the left side, the upper side, or the left/upper side of the current block as the calculation region.
As another embodiment, the calculation region may be implicitly determined according to a protocol between the video encoding device and the video decoding device. In this case, the operation of the gradient calculation region determining unit 604 may be omitted.
The histogram calculation unit 606 calculates a gradient histogram H () of the direction mode in the gradient calculation region. First, a vertical gradient value and a horizontal gradient value may be calculated in a 3×3 region, a 3×1 region, or a 1×3 region based on reference samples restored on the second side of the current block. The histogram calculation unit 606 may calculate the gradient using an edge detection filter such as a Sobel or Prewitt filter. Table 2 shows an example of a filter used in gradient calculation.
TABLE 2
Vertical filter of horizontal filter
As shown in equation 1, the histogram calculation unit 606 may determine the gradient direction θ and the magnitude I at the corresponding pixel based on the calculated vertical/horizontal direction gradient Gv/Gh.
[ equation 1]
Fig. 8 shows a gradient histogram of a direction pattern according to an embodiment of the present invention.
The histogram calculation unit 606 calculates a direction pattern of the intra-prediction closest to the gradient direction θ from the respective directions of the pixels within the calculation region, accumulates the gradient magnitude I in the histogram of the respective direction patterns, and generates a gradient histogram H () of the direction pattern, as shown in fig. 8.
As shown in fig. 9, when calculating the gradient histogram, the histogram calculation unit 606 may sub-sample pixels based on a preset sampling interval, and then may calculate the gradient histogram using the sub-sampled pixels. At this time, the sampling interval and the sub-sampling position of the pixel may be defined according to a protocol between the video encoding apparatus and the video decoding apparatus. Alternatively, the sampling interval and sub-sampling position of the pixel may be determined based on the size and/or aspect ratio of the current block.
The prediction mode derivation unit 608 derives the prediction mode of the current block based on the gradient histogram, as shown in fig. 8. At this time, the derived intra prediction mode may be a directional mode or a non-directional mode. Further, the derived intra prediction modes may include both directional and non-directional modes.
The prediction mode derivation unit 608 may derive the direction mode as follows.
The prediction mode derivation unit 608 may determine the mode M having the maximum value according to the calculated histogram b As intra prediction mode of the current block.
Alternatively, the prediction mode derivation unit 608 may determine the mode M having the first maximum value b And a mode M having a second maximum value a As intra prediction mode of the current block. By using weights obtained from histogram values of two modes, the intra prediction apparatus pair uses two modes M b And M a Predicted signal P 1 And P 2 A weighted average is performed to generate the final predicted signal.
As another embodiment, the prediction mode derivation unit 608 additionally parses the indication with maximum gradient histogramPattern of values M b And a mode M having a second maximum gradient histogram value a To determine a prediction mode of the current block according to the parsed flag value. In the following description, the above-described flag is referred to as a prediction mode indication flag. The prediction mode derivation unit 608 may parse the prediction mode indication flag from the bitstream when the difference between the histogram values of the two modes is less than or equal to a predetermined threshold. On the other hand, when the difference between the histogram values of the two modes is greater than the predetermined threshold, the prediction mode derivation unit 608 may skip the parsing of the prediction mode indication flag. Alternatively, as shown in equation 2, when the difference between the two histogram values is greater than or equal to a preset ratio compared to the sum of all the histogram values, the prediction mode derivation unit 608 may skip the parsing of the prediction mode indication flag.
[ equation 2]
In another embodiment, the prediction mode derivation unit 608 may parse an index of an increment mode of the default mode exhibiting the maximum histogram value from the bitstream to determine the prediction mode. For example, the delta mode may be an offset of the default mode. Accordingly, the prediction mode derivation unit 608 may determine the prediction mode by adding the delta mode to the default mode. At this time, an index indicating the delta mode may be set according to a protocol between the video encoding apparatus and the video decoding apparatus. Furthermore, the delta mode may be changed according to a default mode.
On the other hand, the prediction mode derivation unit 608 may derive the non-directional mode as follows.
The prediction mode derivation unit 608 may set the non-directional mode as the prediction mode of the current block when the maximum histogram value of the directional mode is less than a preset threshold value, or the sum of all histogram values is less than a preset threshold value. At this time, the non-directional mode may be a DC mode or a planar mode, wherein the prediction mode deriving unit 608 may always determine the prediction mode of the current block as the DC mode (or the planar mode). Alternatively, the prediction mode derivation unit 608 may parse a flag indicating one of the modes from the bitstream, and may determine one of the two modes according to the parsed flag. On the other hand, the predetermined threshold value may be set according to a protocol between the video encoding apparatus and the video decoding apparatus, or may be transmitted from the video encoding apparatus to the video decoding apparatus on a per image or slice basis at a higher level.
In another embodiment, as shown in equation 3, when the maximum histogram value of the direction mode is less than a preset ratio compared to the sum of all histogram values, the prediction mode derivation unit 608 may determine the non-direction mode as the prediction mode of the current block.
[ equation 3]
At this time, the preset threshold may be determined based on the size of the current block.
In still another embodiment, the prediction deriving unit 608 may determine the non-directional mode as the prediction mode of the current block when a value obtained by dividing the sum of all histogram values by the number of pixels for gradient calculation is less than a preset threshold. Further, when a value obtained by dividing the maximum histogram value of the direction mode by the number of pixels used for gradient calculation is smaller than a preset threshold value, the prediction mode deriving unit 608 may determine the non-direction mode as the prediction mode of the current block.
Further, when a value obtained by dividing the sum of all histogram values by the number of gradients used for histogram calculation is smaller than a preset threshold, the prediction deriving unit 608 may determine the non-directional mode as the prediction mode of the current block. Further, when a value obtained by dividing the maximum histogram value of the direction mode by the number of gradients used for histogram calculation is smaller than a preset threshold, the prediction mode deriving unit 608 may determine the non-direction mode as the prediction mode of the current block.
On the other hand, according to table 2, the number of pixels used for gradient calculation may be 9 times or 3 times the number of gradients used for histogram calculation.
In still another embodiment, when the derived prediction mode of the current block is a directional mode, the prediction mode derivation unit 608 may add a non-directional mode as the prediction mode of the current block. At this time, the added non-directional mode may be set according to a protocol between the video encoding apparatus and the video decoding apparatus.
The intra prediction performing unit 610 generates a prediction block of the current block by performing intra prediction using the derived prediction mode. The intra prediction performing unit 610 may perform intra prediction using reference samples closest to the left and top sides of the current block among the restored reference samples belonging to the left and top sides without additional parsing. Alternatively, the intra prediction performing unit 610 may determine the reference sample sides for intra prediction by parsing an index indicating the reference sample sides to be used in the polygonal reference samples.
In one embodiment, the intra prediction performing unit 610 may generate the direction pattern M according to the direction pattern having the maximum gradient histogram value b Predicted signal P 1 As predicted signal P d . Further, as described above, the intra prediction performing unit 610 may perform the prediction by performing the prediction on the prediction according to the direction pattern M having the maximum gradient histogram value b Predicted signal P 1 And according to mode M having the second largest gradient histogram value a Predicted signal P 2 Performing a weighted average to generate a predicted signal P d . At this time, the weight value may be determined in proportion to the histogram value of the corresponding pattern.
In another embodiment, when the derived mode is a directional mode as described above, the intra prediction performing unit 610 may additionally use a preset non-directional mode (e.g., a plane). As shown in equation 4, the intra prediction performing unit 610 may perform prediction on a predicted signal P generated according to the direction mode prediction d And a predicted signal P generated from non-directional mode prediction nd A weighted average is applied to generate the final predicted signal P.
[ equation 4]
P=w 1 ·P d +w 2 ·P nd (w 1 +w 2 =2 b )
In equation 4, b represents a shift value of the integer operation. In addition, the weight w for weighted averaging 1 、w 2 May be a scalar or matrix. The weights may be set according to a protocol between the video encoding apparatus and the video decoding apparatus.
Fig. 10 shows weight values in the form of a matrix according to an embodiment of the present invention.
On the other hand, the weights in the form of a matrix may be determined based on the direction pattern. For example, according to a prediction mode, a matrix may be formed in such a manner that weight values decrease as samples of a current block move away from reference samples for prediction.
In another embodiment, the intra prediction execution unit 610 may parse an index indicating one of the predefined k weights or matrices from the bitstream to determine the weight value or weight matrix.
In yet another embodiment, when ISP techniques are applied, sub-blocks of a partition may share the derived prediction mode of the current block as the same intra prediction mode. Alternatively, the intra prediction apparatus may derive a prediction mode of the current sub-block based on the restored samples of the restored previous sub-block, and then may perform intra prediction on the current sub-block using the derived prediction mode. At this time, whether to derive a prediction mode for each sub-block may be implicitly determined based on the size of the sub-block.
As shown in fig. 11, when the current block is vertically partitioned into two sub-blocks, the intra prediction apparatus may derive a prediction mode of the current sub-block based on the restored samples according to the previous sub-block. On the other hand, although the example of fig. 11 shows sub-blocks partitioned in the vertical direction, the prediction mode of the current sub-block may be similarly derived for sub-blocks partitioned in the horizontal direction.
Further, when the ISP technique is applied, the intra prediction apparatus may sequentially restore each sub-block and perform intra prediction of the current sub-block using the restored reference samples according to the previous sub-block.
Fig. 12 is a flowchart illustrating an intra prediction method using prediction mode derivation according to one embodiment of the present invention.
The video decoding apparatus parses a prediction mode derivation flag S1200 indicating whether to derive a prediction mode of the current block from the bitstream. On the other hand, the prediction mode derivation flag may be set by the video encoding apparatus regarding the bit rate distortion optimization, and transmitted to the video decoding apparatus.
Resolution of the prediction mode derivation flag may be implicitly omitted when the current block cannot use left and/or upper reference samples (including image boundaries, slice boundaries, or tile boundaries).
As another implementation, before determining whether to perform prediction mode derivation, the video decoding device may parse one or more flags from the bitstream indicating whether the prediction mode of the current block is a non-directional mode, such as a planar mode, a DC mode, or a matrix-based mode. When all corresponding flags are false, the prediction mode derivation flag may be parsed.
The video decoding apparatus checks the prediction mode derivation flag S1202.
When the prediction mode derivation flag is false (no at S1202), the video decoding apparatus may parse the prediction mode of the current block from the bitstream and may generate a prediction block of the current block using the parsed prediction mode S1204.
On the other hand, when the prediction mode derivation flag is true (yes at S1202), the video decoding apparatus skips parsing of the intra prediction mode of the current block and performs the subsequent steps S1210 to S1216.
The video decoding apparatus determines a calculation region for calculating a gradient value from the restored neighboring samples of the current block S1210.
The video decoding apparatus may determine three restored lines of reference pixels on the left and top sides of the current block as the calculation region. At this time, the length of the calculation region located at the left and top of the current block may be set based on the width and height of the current block.
In another embodiment, the video decoding apparatus may parse a flag indicating a calculation region from the bitstream to set the calculation region between the left and upper portions of the current block.
In yet another embodiment, the calculation region may be implicitly determined according to a protocol between the video encoding device and the video decoding device. In this case, the step of determining the calculation region may be omitted.
The video decoding apparatus calculates a gradient histogram of the direction mode in the calculation region of the current block S1212.
The video decoding apparatus calculates a vertical gradient value and a horizontal gradient value of a restored reference sample located on a second side of the current block using a preset boundary detection filter. The video decoding device uses the vertical gradient values and the horizontal gradient values to calculate gradient directions and magnitudes at the recovered reference samples located on the second side. The video decoding apparatus calculates a gradient histogram of the direction pattern by calculating a direction pattern of intra prediction closest to the gradient direction and then accumulating gradient magnitudes in a histogram corresponding to the calculated direction pattern.
The video decoding apparatus may sub-sample the restored reference samples located on the second side based on a predetermined sampling interval, and then may calculate a gradient histogram of the sub-sampled pixels. At this time, a predetermined sampling interval and a position of the sub-sampled pixel may be defined according to a protocol between the video encoding apparatus and the video decoding apparatus. Alternatively, the sampling interval and sub-sampling position of the pixel may be determined based on the size and/or aspect ratio of the current block.
The video decoding apparatus derives a prediction mode of the current block based on the gradient histogram S1214. At this time, the derived intra prediction mode may be a directional mode or a non-directional mode.
The video decoding apparatus may derive the direction mode as follows.
The video decoding apparatus may determine a first direction mode having a maximum value as a prediction mode of the current block according to the gradient histogram.
Alternatively, the video decoding apparatus may determine the first direction mode having the maximum value and the second direction mode having the second maximum value as the prediction mode of the current block according to the gradient histogram.
As another embodiment, the video decoding apparatus may additionally parse a prediction mode indication flag indicating one of the first direction mode and the second direction mode to determine a prediction mode of the current block according to the parsed flag value. The video decoding apparatus may parse the prediction mode indication flag from the bitstream when a difference between histogram values of the first direction mode and the second direction mode is less than or equal to a predetermined threshold. On the other hand, when the difference between the histogram values of the two modes is greater than the predetermined threshold, the video decoding apparatus may skip parsing of the prediction mode indication flag. Alternatively, the video decoding apparatus may skip parsing of the prediction mode indication flag when the difference between the two histogram values is greater than or equal to a preset ratio as compared to the sum of all the histogram values.
The video decoding apparatus may derive the non-directional mode as follows.
The video decoding apparatus may determine the non-directional prediction mode as the prediction mode of the current block when the histogram value of the first directional mode is less than a preset first threshold value or the sum of values of the gradient histograms is less than a preset second threshold value. At this time, the non-directional mode may be a DC or planar mode.
In another embodiment, the video decoding device may determine the non-directional mode as the prediction mode of the current block when a ratio between a histogram value of the first directional mode and a sum of gradient histogram values is less than a preset ratio.
As another embodiment, the video decoding device may determine the non-directional prediction mode as the prediction mode of the current block when a ratio between a sum of gradient histogram values and the number of pixels for gradient calculation is less than a preset first ratio, or a ratio between a histogram value of the first direction mode and the number of pixels for gradient calculation is less than a preset second ratio.
The video decoding apparatus generates a prediction block of the current block by performing intra prediction using the derived prediction mode S1216.
The video decoding apparatus may perform intra prediction using reference samples closest to the left and top sides of the current block among the reference samples belonging to the left and top restoration, without additional parsing. Alternatively, the video decoding apparatus may determine the reference sample sides for intra prediction by parsing an index indicating the reference sample sides to be used in the polygonal reference samples from the bitstream.
As another embodiment, the video decoding apparatus may generate a prediction block of a current block by generating a first prediction block of the current block using a first direction mode, generating a second prediction block of the current block using a second direction mode, and performing weighted average on the first prediction block and the second prediction block. At this time, the weight value may be determined in proportion to the histogram value of the corresponding pattern.
Although steps in the respective flowcharts are described as sequentially performed, these steps merely exemplify the technical ideas of some embodiments of the present invention. Accordingly, one of ordinary skill in the art to which the invention pertains may perform the steps by changing the order depicted in the various figures or by performing two or more steps in parallel. Accordingly, the steps in the various flowcharts are not limited to the order in which they occur as shown.
It should be understood that the foregoing description presents illustrative embodiments that may be implemented in various other ways. The functions described in some embodiments may be implemented by hardware, software, firmware, and/or combinations thereof. It should also be understood that the functional components described in this specification are labeled "… … units" to highlight the possibility of their independent implementation.
On the other hand, the various methods or functions described in some embodiments may be implemented as instructions stored in a non-volatile recording medium, which may be read and executed by one or more processors. The nonvolatile recording medium may include various types of recording devices that store data in a form readable by a computer system, for example. For example, the nonvolatile recording medium may include a storage medium such as an erasable programmable read-only memory (EPROM), a flash memory drive, an optical disk drive, a magnetic hard disk drive, a Solid State Drive (SSD), and the like.
Although exemplary embodiments of the present invention have been described for illustrative purposes, those skilled in the art to which the present invention pertains will appreciate that various modifications, additions and substitutions are possible, without departing from the scope and spirit of the invention. Accordingly, embodiments of the present invention have been described for brevity and clarity. The scope of the technical idea of the embodiment of the invention is not limited by the illustration. Accordingly, it will be understood by those of ordinary skill in the art that the scope of the present invention is not limited by the embodiments explicitly described above, but is limited by the claims and their equivalents.
(reference numerals)
122: intra-frame predictor
510: entropy decoder
542: intra-frame predictor
602: prediction mode derivation determination unit
604: gradient calculation region determination unit
606: histogram calculation unit
608: prediction mode deriving unit
610: and an intra prediction execution unit.
Cross Reference to Related Applications
The present application claims priority from korean patent application No.10-2021-0028795, filed on 3 months 4 of 2021, and korean patent application No.10-2022-0026549, filed on 3 months 2 of 2022, each of which is incorporated herein by reference in its entirety.

Claims (20)

1. A method performed by a video decoding device for intra prediction of a current block, the method comprising:
parsing a prediction mode derivation flag from a bitstream, the prediction mode derivation flag indicating whether to derive a prediction mode of a current block; and
the prediction mode derivation flag is checked and a prediction mode is checked,
wherein when the prediction mode derivation flag is true, the method comprises:
determining a calculation region for calculating a gradient value according to the restored neighboring samples of the current block;
calculating a gradient histogram of the direction pattern in a calculation region for the current block;
deriving a prediction mode of the current block based on the gradient histogram; and
A prediction block of the current block is generated by performing intra prediction using the derived prediction mode.
2. The method of claim 1, further comprising:
one or more flags indicating whether the prediction mode of the current block is a non-directional mode are parsed from the bitstream,
wherein when all flags indicating one of the non-directional modes are false, the prediction mode derivation flag is parsed.
3. The method of claim 1, wherein when the prediction mode derivation flag is true, parsing the sub-block partition application flag from the bitstream to determine whether to perform sub-block partitioning of the current block.
4. The method of claim 1, wherein determining a computing region comprises:
determining three restored reference pixels of left and top lines of the current block as a calculation region, and
wherein the length of the calculation region located at the left and top of the current block is set based on the width and height of the current block.
5. The method of claim 1, further comprising:
a flag indicating a calculation region is parsed from the bitstream to set the calculation region between the left and upper portions of the current block according to the flag indicating the calculation region.
6. The method of claim 1, wherein calculating a histogram comprises:
A vertical gradient value and a horizontal gradient value of the restored reference samples located on the second side of the current block are calculated using a preset boundary detection filter.
7. The method of claim 6, wherein calculating a histogram comprises:
calculating a gradient direction and magnitude at the recovered reference sample on the second side using the vertical gradient value and the horizontal gradient value;
calculating a direction mode of intra prediction closest to the gradient direction; and
the gradient magnitudes are accumulated in the histogram corresponding to the direction pattern.
8. The method of claim 6, wherein calculating a histogram comprises:
the recovered reference samples on the second side are sub-sampled based on a predetermined sampling interval, and then a gradient histogram of the sub-sampled pixels is calculated.
9. The method of claim 8, wherein the predetermined sampling interval and the location of the sub-sampled pixels are determined based on the size and/or aspect ratio of the current block.
10. The method of claim 1, wherein deriving a prediction mode comprises:
a first direction mode having the maximum value is determined as a prediction mode of the current block according to the gradient histogram.
11. The method of claim 1, wherein deriving a prediction mode comprises:
According to the gradient histogram, a first direction mode having a maximum value and a second direction mode having a second maximum value are determined as prediction modes of the current block.
12. The method of claim 10, wherein deriving a prediction mode comprises:
and determining the non-directional prediction mode as the prediction mode of the current block when the histogram value of the first direction mode is smaller than a preset first threshold value or the sum of the values of the gradient histograms is smaller than a preset second threshold value.
13. The method of claim 10, wherein deriving a prediction mode comprises:
when the ratio between the histogram value of the first direction mode and the sum of the gradient histogram values is smaller than a preset ratio, determining the non-direction mode as a prediction mode of the current block.
14. The method of claim 3, wherein when the sub-block partition application flag is true, the current block is partitioned into sub-blocks, and the derived prediction mode of the current block is shared as the same intra prediction mode of the sub-blocks.
15. The method of claim 3, wherein when the sub-block partition application flag is true, the current block is partitioned into sub-blocks, and the prediction mode of the current sub-block is derived based on the restored samples of the restored previous sub-block, and
Wherein it is implicitly determined whether a prediction mode is derived for each sub-block based on the size of the sub-block.
16. The method of claim 11, wherein generating a prediction block comprises:
a prediction block of the current block is generated by generating a first prediction block of the current block using a first direction mode, generating a second prediction block of the current block using a second direction mode, and performing weighted average on the first prediction block and the second prediction block.
17. The method of claim 11, wherein generating a prediction block comprises:
when the prediction mode of the current block is a directional mode, a non-directional mode is utilized, and
wherein the prediction block of the current block is generated by generating a third prediction block of the current block using the non-directional mode and performing weighted average on the first prediction block, the second prediction block, and the third prediction block.
18. An intra prediction apparatus, comprising:
a prediction mode derivation determining unit configured to determine whether to derive a prediction mode of the current block by parsing a prediction mode derivation flag from the bitstream;
a gradient calculation region determining unit configured to determine a calculation region for calculating a gradient value from the restored neighboring samples of the current block;
A histogram calculation unit configured to calculate a gradient histogram of the direction pattern in a calculation region for the current block;
a prediction mode deriving unit configured to derive a prediction mode of the current block based on the gradient histogram; and
an intra prediction execution unit configured to generate a prediction block of the current block by performing intra prediction using the derived prediction mode.
19. The apparatus of claim 18, wherein the prediction mode derivation determination unit is further configured to parse, from the bitstream, one or more flags indicating whether the prediction mode of the current block is a non-directional mode, and
wherein when all flags indicating one of the non-directional modes are false, the prediction mode derivation flag is parsed.
20. The apparatus of claim 18, wherein the prediction mode derivation determination unit is configured to determine to derive the prediction mode of the current block when the prediction mode derivation flag is true.
CN202280017239.2A 2021-03-04 2022-03-03 Method and apparatus for video encoding and decoding using derived intra prediction modes Pending CN117044197A (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR10-2021-0028795 2021-03-04
KR1020220026549A KR20220125175A (en) 2021-03-04 2022-03-02 Video Coding Method and Apparatus Using Derivation of Intra Prediction Mode
KR10-2022-0026549 2022-03-02
PCT/KR2022/002985 WO2022186616A1 (en) 2021-03-04 2022-03-03 Method and apparatus for video coding by using derivation of intra prediction mode

Publications (1)

Publication Number Publication Date
CN117044197A true CN117044197A (en) 2023-11-10

Family

ID=88626780

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202280017239.2A Pending CN117044197A (en) 2021-03-04 2022-03-03 Method and apparatus for video encoding and decoding using derived intra prediction modes

Country Status (1)

Country Link
CN (1) CN117044197A (en)

Similar Documents

Publication Publication Date Title
US20230412799A1 (en) Method and apparatus for video coding using derivation of intra prediction mode
CN116530082A (en) Method and apparatus for video coding using intra prediction
CN113892268A (en) Intra-frame prediction device and method based on prediction mode estimation
CN113812147B (en) Image encoding and decoding using intra-block copy
CN116472709A (en) Apparatus and method for video encoding and decoding
CN116491114A (en) Image encoding and decoding method and apparatus using sub-block unit intra prediction
CN116113985A (en) Video encoding and decoding using deep learning based in-loop filters
CN117044197A (en) Method and apparatus for video encoding and decoding using derived intra prediction modes
US20230283768A1 (en) Method for predicting quantization parameter used in a video encoding/decoding apparatus
US20240031564A1 (en) Method and apparatus for video coding using adaptive intra prediction precision
US20230388541A1 (en) Method and apparatus for video coding using intra prediction based on subblock partitioning
US20230412811A1 (en) Method and apparatus for video coding using spiral scan order
US20240114148A1 (en) Video encoding and decoding method for adaptively determining chroma intra directional prediction mode
US20240179303A1 (en) Video encoding/decoding method and apparatus
US20230291928A1 (en) Video encoding and decoding method and apparatus using selective subblock split information signaling
US20240007623A1 (en) Block splitting structure for efficient prediction and transform, and method and appartus for video encoding and decoding using the same
US20230300325A1 (en) Video coding method and apparatus using intra prediction
US20230388494A1 (en) Method for generating prediction block by using weighted-sum of intra prediction signal and inter prediction signal, and device using same
US20230055497A1 (en) Image encoding and decoding based on reference picture having different resolution
CN117044200A (en) Method and apparatus for video encoding and decoding using spiral scan order
CN117917072A (en) Video encoding/decoding method and apparatus
CN117917071A (en) Method and apparatus for video coding using sub-block coding order change and intra prediction according to sub-block coding order change
CN117063466A (en) Video encoding method and apparatus using adaptive intra prediction precision
KR20230059135A (en) Video Coding Method And Apparatus Using Various Block Partitioning Structure
CN116982310A (en) Video encoding method and apparatus using motion vector with adaptive spatial resolution for each component

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination