Intra-frame prediction method, electronic equipment and storage medium
By selecting appropriate filter shapes and coefficients for video encoding and decoding, determining the target prediction block, and selecting the transform kernel, the problem of poor intra-frame prediction performance for luminance blocks with large aspect ratios is solved, improving prediction performance and reducing computational complexity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZTE CORP
- Filing Date
- 2024-10-18
- Publication Date
- 2026-04-21
AI Technical Summary
In existing video coding standards, intra-frame prediction performance is poor for luma blocks with large aspect ratios, especially when using filters with shapes of 2x8 and 8x2, where there is still room for improvement in prediction performance.
An intra-frame prediction method is provided, which determines the target prediction block by identifying filters with different shapes and coefficients, including a first shape and a second shape, applicable to lumen blocks of various sizes, selecting an appropriate filter shape and coefficients, and selecting the transform kernel of the lumen block according to the intra-frame prediction angle.
It improves intra-frame prediction performance, reduces computational complexity, and increases the efficiency of video encoding and decoding.
Smart Images

Figure CN121908009A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of encoding and decoding technology, such as an intra-frame prediction method, electronic device, and storage medium. Background Technology
[0002] Enhanced Compression Model (ECM) is an advanced standard for video encoding and decoding. In ECM, Extrapolation Filter-Based Intra Prediction (EIP) mode is used for intra-frame prediction. Currently, EIP mode uses filters of three shapes: 4x4, 2x8, and 8x2. It also specifies that luma blocks larger than 32x32 and smaller than 64 (e.g., 4x8, 8x4, 8x8) are not used for intra-frame prediction using EIP mode. For luma blocks with relatively large aspect ratios (e.g., 4x32, 32x4), filters of shapes 2x8 and 8x2 are better suited to these luma blocks than filters of shape 4x4, but the prediction performance is still unsatisfactory, and there is room for optimization. Summary of the Invention
[0003] This application provides an intra-frame prediction method, including:
[0004] Determine the filter shape and filter coefficients, wherein the filter shape includes at least one of a first shape and a second shape, and the first shape and the second shape are different;
[0005] The target prediction block for the luminance block is determined based on the filter shape and filter coefficients.
[0006] Based on the target prediction block, determine the intra-frame prediction angle, and select the transform kernel for the luma block based on the intra-frame prediction angle.
[0007] This application provides an electronic device, including: a processor; the processor is configured to implement the intra-frame prediction method of any of the above embodiments when executing a computer program.
[0008] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the intra-frame prediction method of any of the above embodiments.
[0009] Further details regarding the above embodiments and other aspects of this application, as well as their implementations, are provided in the accompanying drawings, detailed description, and claims. Attached Figure Description
[0010] Figure 1 This is a schematic diagram of an existing block-based hybrid video coding framework;
[0011] Figure 2 This is a schematic diagram of an existing block-based hybrid video decoding framework;
[0012] Figure 3 This is a flowchart illustrating an intra-frame prediction method provided in one embodiment;
[0013] Figure 4 This is a schematic diagram of a filter of a first shape provided in one embodiment;
[0014] Figure 5 This is a schematic diagram of a filter of a second shape provided in one embodiment;
[0015] Figure 6 This is a diagram illustrating the positional relationship between a luminance block and a reconstructed region, provided in one embodiment.
[0016] Figure 7 This is a flowchart illustrating a method for determining a first prediction block according to one embodiment;
[0017] Figure 8 This is a schematic diagram illustrating a filter sliding diagonally within a brightness block, as provided in one embodiment.
[0018] Figure 9 This is a schematic diagram illustrating three scenarios for calculating predicted pixels, provided in one embodiment.
[0019] Figure 10 This is a flowchart illustrating another method for determining the first prediction block provided in one embodiment;
[0020] Figure 11 This is a flowchart illustrating another method for determining a first prediction block provided in one embodiment;
[0021] Figure 12 This is a flowchart illustrating another method for determining a first prediction block provided in one embodiment;
[0022] Figure 13 This is a schematic diagram of the structure of an intra-frame prediction device provided in one embodiment;
[0023] Figure 14 This is a schematic diagram of the structure of an electronic device provided in one embodiment. Detailed Implementation
[0024] It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. The embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0025] Figure 1 This is a schematic diagram of an existing block-based hybrid video coding framework. For example... Figure 1As shown, the block-based hybrid video coding process includes: 1) dividing the current block according to several partitioning types; 2) making predictions based on the partitioned results, mainly involving intra-frame prediction and inter-frame prediction, which are respectively used to remove spatial redundancy and temporal redundancy; 3) subtracting the predicted reconstructed image from the original image, and further reducing redundancy through transformation and quantization of the residual, and then performing binary encoding through entropy coding; 4) eliminating block artifacts and other problems through post-processing modules such as deblocking filtering and adaptive sample offset.
[0026] Therefore, it can be seen that raw YUV can be compressed into video through several key modules: prediction, transformation, quantization, entropy coding, bitrate control, and post-processing. Specifically, compression is mainly achieved from the perspectives of temporal redundancy and spatial redundancy.
[0027] Figure 2 This is a schematic diagram of an existing block-based hybrid video decoding framework. For example... Figure 2 As shown, the video decoding process includes: 1) decoding the encoded binary bitstream; 2) performing inverse quantization and inverse transform on the decoded result; 3) adding the prediction result based on the mode selection with the result after inverse quantization and inverse transform to obtain the reconstructed image; 4) performing post-processing on the reconstructed image, namely operations such as deblocking filter (DBF), sample adaptive offset (SAO), and adaptive loop filter (ALF), and finally storing it in the decoded image buffer.
[0028] Current video coding standards, whether AVS4, H.267, or VVC, all use the aforementioned block-based hybrid video coding and decoding framework. In ECM, the EIP mode is used for intra-frame prediction. Existing EIP modes use filters in three shapes: 4x4, 2x8, and 8x2. It is stipulated that luma blocks larger than 32x32 and smaller than 64 (such as 4x8, 8x4, and 8x8) are not used for intra-frame prediction using EIP mode. For luma blocks with relatively large aspect ratios (such as 4x32 and 32x4), filters with shapes of 2x8 and 8x2 are better suited to these luma blocks than filters with a 4x4 shape, but the prediction performance is still unsatisfactory, and there is room for optimization.
[0029] The intra-frame prediction method provided in this application can be applied to the above-mentioned block-based hybrid video coding and decoding frameworks, and can select appropriate filters for luma blocks of various sizes, thereby improving prediction performance and reducing computational complexity.
[0030] The following describes the intra-frame prediction method, electronic equipment, and its technical effects.
[0031] Figure 3 This is a flowchart illustrating an intra-frame prediction method provided in one embodiment. For example... Figure 3 As shown, the method provided in this embodiment is applicable to electronic devices, such as encoding devices or decoding devices. The method includes the following steps.
[0032] S310. Determine the filter shape and filter coefficients of the filter, wherein the filter shape includes at least one of a first shape and a second shape, and the first shape and the second shape are different.
[0033] Intra-frame prediction includes various modes, such as Decoder-side Intra Mode Derivation (DIMD), Spatial Geometric Partitioning Mode (SGPM), EIP, and Intra Template Matching Prediction (IntraTMP). The intra-frame prediction method provided in this application primarily targets the EIP mode and can be applied in both video encoding and decoding processes. Correspondingly, the luma block can be either a coding block or a decoding block. When applied in video encoding, the electronic device performs video encoding, and the luma block is the coding block; when applied in video decoding, the electronic device performs video decoding, and the luma block is the decoding block.
[0034] In one embodiment, the EIP mode includes the EIP derivation mode and the EIP merging mode, therefore the filter also includes the filter corresponding to the EIP derivation mode and the filter corresponding to the EIP merging mode.
[0035] The shape of the filter includes at least one of a first shape and a second shape.
[0036] Figure 4 This is a schematic diagram of a filter of a first shape provided in one embodiment. For example... Figure 4 As shown, the first shape can include 4x4, 2x8, and 8x2, which is the filter shape commonly used in EIP mode (also known as the original shape or the original shape). The filter of the first shape has 16 taps, of which 15 taps are used as EIP inputs and 1 tap is used as an EIP output.
[0037] Figure 5 This is a schematic diagram of a filter of a second shape provided in one embodiment. For example... Figure 5As shown, the second shape can include 16x1, 1x16, 2x2, 1x4, 4x1, 3x3, and 5x5. That is, the second shape is a newly added filter shape in the EIP mode (also called a new shape). The number of taps in the filter of the second shape can be 16 or more. For example, the 16x1 and 1x16 filters have 16 taps, with 15 taps as EIP inputs and 1 tap as an EIP output; the 2x2, 1x4, and 4x1 filters have 4 taps, with 3 taps as EIP inputs and 1 tap as an EIP output; the 3x3 filter has 9 taps, with 8 taps as EIP inputs and 1 tap as an EIP output; and the 5x5 filter has 25 taps, with 24 taps as EIP inputs and 1 tap as an EIP output.
[0038] Therefore, although the first shape and the second shape are different, the number of taps of the filter of the first shape can be equal to or unequal to the number of taps of the filter of the second shape.
[0039] When the number of taps of the first-shaped filter is equal to the number of taps of the second-shaped filter, the second shape includes at least one of 16x1 and 1x16; when the number of taps of the first-shaped filter is not equal to the number of taps of the second-shaped filter, the second shape includes at least one of 2x2, 1x4, 4x1, 3x3, and 5x5.
[0040] In one embodiment, this application can determine the filter shape and filter coefficients from the EIP derivation mode and the EIP merging mode, respectively. Specifically, for the filter corresponding to the EIP derivation mode, the filter shape is determined based on the size of the luma block, and the filter coefficients are derived; for the filter corresponding to the EIP merging mode, the filter shape and filter coefficients corresponding to the previously encoded EIP derivation mode or EIP merging mode are inherited.
[0041] For the filter corresponding to the EIP derivation mode: first, the filter shape needs to be determined based on the size of the luma block, and then the filter coefficients are derived.
[0042] The size of the luminance block and the shape of the filter satisfy at least one of the following relationships.
[0043] Relationship 1: When the size of the luminance block is 4x16, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0044] Relationship 2: When the size of the luminance block is 16x4, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0045] Relationship 3: When the size of the luminance block is 8x32, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0046] Relationship 4: When the size of the luminance block is 32x8, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0047] Relationship 5: When the size of the luminance block is 4x32, the filter shape includes a first shape and a second shape. The first shape includes 4x4 and 2x8, and the second shape includes 1x16.
[0048] Relationship 6: When the size of the luminance block is 32x4, the filter shape includes a first shape and a second shape. The first shape includes 4x4 and 8x2, and the second shape includes 16x1.
[0049] Relationship 7: When the luma block size is 4x4, 4x8, or 8x4, the luma block allows intra-frame prediction using the EIP derivation mode. In this case, the filter shape includes a second shape, which includes 2x2, 1x4, 4x1, and 3x3.
[0050] Relationship 8: When the size of the luminance block is 32x32, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 5x5.
[0051] Figure 6 This is a diagram illustrating the positional relationship between a luminance block and a reconstructed region, provided in one embodiment. For example... Figure 6 As shown, the reconstruction region is typically located above, to the left of, or both above and to the left of the luma block. Filter coefficients can be derived from the reconstruction region surrounding the luma block. For example, by moving the filter horizontally or vertically within the reconstruction region with a one-pixel stride, and constructing an autocorrelation matrix and cocorrelation vector in a manner similar to that used in convolutional cross-component models (CCCM) for calculating filter coefficients, the filter coefficients can be derived from these constructed autocorrelation matrix and cocorrelation vector.
[0052] For filters corresponding to the EIP merging mode: simply inherit the filter shape and filter coefficients from the previously encoded EIP derivation mode or the EIP merging mode. It should be noted that during the video decoding process, the EIP merging flag can be decoded to determine whether to use the EIP merging mode.
[0053] The EIP merging list includes spatially adjacent, non-adjacent, temporal, and historical candidates. It contains a maximum of 12 candidate patterns, which are then reordered based on a template, and the top 6 with the lowest cost are selected.
[0054] S320. Determine the target prediction block for the luminance block based on the filter shape and filter coefficients.
[0055] In this application, the target prediction block of the lumen block refers to the optimal prediction block obtained by performing intra-frame prediction on the lumen block using all the filters determined in step S310.
[0056] Specifically, the method for determining the target prediction block of a luminance block based on the filter shape and filter coefficients can include the following three steps.
[0057] Step 1: For the filter corresponding to the EIP derivation mode, determine the first prediction block of the luminance block based on the filter shape and filter coefficients.
[0058] In the first possible implementation, Figure 7 This is a flowchart illustrating a method for determining a first prediction block according to one embodiment. Figure 7 As shown, the steps include the following.
[0059] S710. For a filter of the first shape, determine the third prediction block of the luminance block based on the filter shape and filter coefficients.
[0060] In one embodiment, the number of filters of the first shape is at least one. For each filter of the first shape, step S710 needs to be performed to determine the third prediction block of the luma block when using the filter of the first shape for intra-frame prediction. That is, one filter of the first shape corresponds to one third prediction block of the luma block.
[0061] For example, if the filter of the first shape is a 4x4 filter A, the filter A can be slid in a diagonal scanning manner within the brightness block, and the predicted pixel at each slid is determined. The predicted pixel is calculated based on the pixel value at the location of the filter and the filter coefficient. Based on the predicted pixel, the third prediction block of the brightness block is determined.
[0062] Figure 8This is a schematic diagram illustrating an embodiment of a filter sliding in a diagonal scanning manner within a brightness block. For example... Figure 8 As shown, at the start of prediction, filter A is positioned such that its EIP output tap coincides with the pixel in the first row and first column of the luminance block. Based on the pixel value and filter coefficient at the corresponding position of filter A's EIP input tap, the predicted pixel in the first row and first column of the luminance block is calculated. Then, filter A is slid to the right in a step of one pixel. At this point, filter A is positioned such that its EIP output tap coincides with the pixel in the second row and second column of the luminance block. Based on the pixel value and filter coefficient at the corresponding position of filter A's EIP input tap, the predicted pixel in the second row and second column of the luminance block is calculated. Slide filter A to the lower left in a step of one pixel. At this point, filter A's EIP output tap coincides with the pixel in the first column of the second row of the luminance block. Based on the pixel value and filter coefficient at the corresponding position of filter A's EIP input tap, calculate the predicted pixel in the first column of the second row of the luminance block. Then slide filter A to the upper right in a step of one pixel. At this point, filter A's EIP output tap coincides with the pixel in the third column of the first row of the luminance block... and so on, until the predicted pixels of the entire luminance block are obtained, thus forming the second prediction block of the luminance block.
[0063] Specifically, the predicted pixel for each slide can be calculated based on the following formula:
[0064] Among them, pred (x,y) This represents the predicted pixel at the current block position (x, y), where m is the number of EIP input taps of the filter, and c i Let i be the i-th coefficient of the filter. To reconstruct samples or already predicted samples, offsetX i and offsetY i It represents the current position offset, and B represents the bit depth.
[0065] Because the location of the filter varies, the calculation of the predicted pixel may differ. Figure 9 This is a schematic diagram illustrating three scenarios for calculating predicted pixels, as provided in one embodiment. For example... Figure 9 As shown, Figure 9 In (a), the input to the filter is entirely composed of reconstructed samples (i.e., samples from the reconstructed region). Figure 9 In (b), the input part of the filter is the reconstructed sample, and the input part is the already predicted sample. Figure 9 In (c), the input to the filter consists entirely of already predicted samples.
[0066] S720. For the second-shaped filter, determine the fourth prediction block of the luminance block based on the filter shape and filter coefficients.
[0067] In one embodiment, the number of filters of the second shape is at least one. For each filter of the second shape, step S720 needs to be performed to determine the fourth prediction block of the luma block when using the filter of the second shape for intra-frame prediction. That is, one filter of the second shape corresponds to the fourth prediction block of one luma block.
[0068] For example, if the filter of the second shape is a 16x1 filter B, the filter B can be slid in a diagonal scanning manner within the luminance block, and the predicted pixel at each slid is determined. The predicted pixel is calculated based on the pixel value at the location of the filter and the filter coefficient; based on the predicted pixel, the fourth prediction block of the luminance block is determined.
[0069] The method by which the second-shaped filter slides diagonally within the brightness block, and the method for calculating the predicted pixel at each slide, are similar to those of the first-shaped filter described in step S710 above, and will not be repeated here for the sake of brevity.
[0070] S730. Select the prediction block with the lowest rate-distortion optimization (RDO) cost between the third and fourth prediction blocks as the first prediction block.
[0071] After steps S710 and S720, at least one third prediction block and at least one fourth prediction block can be determined, and the RDO cost of each prediction block is determined. The smaller the RDO cost, the better the prediction performance of the filter; the larger the RDO cost, the worse the prediction performance of the filter. Therefore, the prediction block with the smallest RDO cost among the third and fourth prediction blocks is selected as the first prediction block, which means that the filter with the optimal shape and its corresponding first prediction block are determined in the filter corresponding to the EIP derivation mode.
[0072] It should be noted that in the first possible implementation, there is no order of execution between steps S710 and S720. Step S710 can be executed first, followed by step S720; step S720 can be executed first, followed by step S710; or steps S710 and S720 can be executed simultaneously.
[0073] In the second possible implementation, Figure 10 This is a flowchart illustrating another method for determining the first prediction block provided in one embodiment. For example... Figure 10 As shown, the steps include the following.
[0074] S810. For a filter of the first shape, determine the third prediction block of the luminance block based on the filter shape and filter coefficients.
[0075] The method of step S810 is the same as that of step S710 above, and can be referred to the description of step S710 above, which will not be repeated here.
[0076] S820. Determine whether the filter shape corresponding to the prediction block with the lowest RDO cost in the third prediction block is a preset shape. If yes, proceed to S830; otherwise, proceed to S840-S850.
[0077] After step S810 is executed, the RDO cost of each third prediction block can be determined, and the filter shape corresponding to the prediction block with the smallest RDO cost can be determined. If the filter shape is a preset shape, it means that the current prediction effect is good enough and there is no need to use a second-shape filter for prediction (i.e., no secondary filtering is needed); if the filter shape is not a preset shape, it means that the current prediction effect may not be good enough and a second-shape filter needs to be used for prediction for further judgment.
[0078] S830. Select the prediction block with the lowest RDO cost in the third prediction block as the first prediction block.
[0079] If the filter shape is a preset shape, then the prediction block with the lowest RDO cost in the third prediction block can be directly used as the first prediction block. This determines the filter with the optimal shape among the filters corresponding to the EIP derivation mode and its corresponding first prediction block.
[0080] S840. For the second-shaped filter, determine the fourth prediction block of the luminance block based on the filter shape and filter coefficients.
[0081] S850: Select the prediction block with the lowest RDO cost among the third and fourth prediction blocks as the first prediction block.
[0082] The methods for steps S840-S850 are the same as those for steps S720-S730 above, and can be referred to the description of steps S720-S730 above, which will not be repeated here.
[0083] It should be noted that, unlike the first possible implementation, the second possible implementation has a strict execution order between steps S810-S850. Furthermore, compared to the first possible implementation, the determination of whether secondary filtering is needed effectively reduces computational complexity, saves computing power, and improves prediction efficiency while maintaining prediction accuracy.
[0084] In the third possible implementation, Figure 11 This is a flowchart illustrating another method for determining a first prediction block provided in one embodiment. For example... Figure 11 As shown, the steps include the following.
[0085] S910. For a filter of the first shape, determine the third prediction block of the luminance block based on the filter shape and filter coefficients.
[0086] The method of step S910 is the same as that of step S710 above, and can be referred to the description of step S710 above, which will not be repeated here.
[0087] S920. For the second-shaped filter, determine the fourth prediction block of the luminance block based on the filter shape and filter coefficients.
[0088] The method of step S920 is the same as that of step S720 above, and can be referred to the description of step S720 above, which will not be repeated here.
[0089] S930. Based on preset rules, select at least one group of prediction blocks for weighting to determine the fifth prediction block. Each group of prediction blocks includes a third prediction block and a fourth prediction block.
[0090] S940. Select the prediction block with the lowest RDO cost among the third, fourth, and fifth prediction blocks as the first prediction block.
[0091] In the third possible implementation, to further improve the prediction results, at least one set of prediction blocks can be selected and weighted based on preset rules to determine the fifth prediction block. Each set of prediction blocks includes a third prediction block and a fourth prediction block. The fifth prediction block also participates in the RDO cost determination. The prediction block with the smallest RDO cost among the third, fourth, and fifth prediction blocks is selected as the first prediction block. This determines the filter with the optimal shape (possibly including the two filters involved in the weighting) and its corresponding first prediction block in the filter corresponding to the EIP derivation mode.
[0092] It should be noted that in the third possible implementation, there is no order of execution between steps S910 and S920. Step S910 can be executed first, followed by step S920; step S920 can be executed first, followed by step S910; or steps S910 and S920 can be executed simultaneously.
[0093] In the fourth possible implementation, Figure 12 This is a flowchart illustrating another method for determining a first prediction block provided in one embodiment. For example... Figure 12 As shown, the steps include the following.
[0094] S1010. For a filter of the first shape, determine the third prediction block of the luminance block based on the filter shape and filter coefficients.
[0095] S1020. Determine whether the filter shape corresponding to the prediction block with the lowest RDO cost in the third prediction block is a preset shape. If yes, proceed to S1030; otherwise, proceed to S1040-S1060.
[0096] S1030. Select the prediction block with the smallest RDO cost in the third prediction block as the first prediction block.
[0097] S1040. For the second-shaped filter, determine the fourth prediction block of the luminance block based on the filter shape and filter coefficients.
[0098] The methods for steps S1010-S1040 are the same as those for steps S810-S840 above, and can be referred to the description of steps S810-S840 above, which will not be repeated here.
[0099] S1050. Based on preset rules, select at least one group of prediction blocks for weighting to determine the fifth prediction block. Each group of prediction blocks includes a third prediction block and a fourth prediction block.
[0100] S1060. Select the prediction block with the lowest RDO cost among the third, fourth, and fifth prediction blocks as the first prediction block.
[0101] It should be noted that in the fourth possible implementation, there is a strict execution order between steps S1010-S1060. Compared to the three possible implementations mentioned above: 1) Because a determination is made regarding whether secondary filtering is needed, computational complexity can be effectively reduced, saving computing power and improving prediction efficiency while maintaining prediction performance. 2) Since the fifth prediction block also participates in the RDO cost determination, the prediction block with the smallest RDO cost among the third, fourth, and fifth prediction blocks is selected as the first prediction block. This determines the filter with the optimal shape (possibly including the two filters involved in the weighting) and its corresponding first prediction block in the filter corresponding to the EIP derivation mode. This further improves the prediction results.
[0102] In one embodiment, the preset shape is 4x4.
[0103] In one embodiment, the preset rules include at least one of the following rules.
[0104] Rule 1: For a set of prediction blocks, the filter shape corresponding to the third prediction block is 2x8, and the filter shape corresponding to the fourth prediction block is 1x16.
[0105] Rule 2: For a set of prediction blocks, the filter shape corresponding to the third prediction block is 8x2 and the filter shape corresponding to the fourth prediction block is 16x1.
[0106] Step 2: For the filter corresponding to the EIP merging mode, determine the second prediction block of the luminance block based on the filter shape and filter coefficients.
[0107] For filters corresponding to EIP merging modes, their filter shape and filter coefficients are directly inherited from the filter shape and filter coefficients of previously encoded EIP derivation modes or EIP merging modes. The filter shape may be either a first shape or a second shape.
[0108] When the filter shape corresponding to the EIP merging mode is the first shape, the second prediction block of the luma block can be determined by referring to the method in step S710 above. When the filter shape corresponding to the EIP merging mode is the second shape, the second prediction block of the luma block can be determined by referring to the method in step S720 above.
[0109] Step 3: Select the prediction block with the lowest RDO cost between the first and second prediction blocks as the target prediction block.
[0110] Since a smaller RDO cost indicates better filter prediction performance, and a larger RDO cost indicates worse filter prediction performance, the prediction block with the smallest RDO cost between the first and second prediction blocks is selected as the target prediction block. This determines the filter with the optimal shape and its corresponding optimal prediction block in both the EIP derivation mode and the EIP merging mode.
[0111] S330. Determine the intra-frame prediction angle based on the target prediction block, and select the transform kernel of the luma block based on the intra-frame prediction angle.
[0112] In one embodiment, DIMD can be used to analyze the gradient and magnitude of the target prediction block to obtain a gradient histogram, thereby determining the intra-frame prediction angle, and selecting the transform kernel of the luma block based on the intra-frame prediction angle.
[0113] The transform core of the luminance block can be a Multiple Transform Selection (MTS) transform core, a low-frequency non-separable transform (LFNST) transform core, or a Non-Separable Primary Transform (NSPT) transform core.
[0114] Below are some examples to illustrate the intra-frame prediction method provided in this application.
[0115] Example 1
[0116] 1. For filters corresponding to EIP derivation modes, determine the filter shape based on the size of the luma block and derive the filter coefficients; for filters corresponding to EIP merging modes, inherit the filter shape and filter coefficients corresponding to the previously encoded EIP derivation or EIP merging modes.
[0117] The number of taps in the first-shape filter is equal to the number of taps in the second-shape filter, which includes 16x1 and 1x16 shapes. The second-shape filter is only suitable for luma blocks with a relatively large aspect ratio, such as luma blocks with dimensions of 4x32, 32x4, 8x32, 32x8, 4x16, and 16x4. Specifically, for luma blocks with dimensions of 4x32, 32x4, 8x32, 32x8, 4x16, and 16x4:
[0118] When the size of the luminance block is 4x16, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0119] When the size of the luminance block is 16x4, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0120] When the size of the luminance block is 8x32, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0121] When the size of the luminance block is 32x8, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0122] When the size of the luminance block is 4x32, the filter shape includes a first shape and a second shape. The first shape includes 4x4 and 2x8, and the second shape includes 1x16.
[0123] When the size of the luminance block is 32x4, the filter shape includes a first shape and a second shape. The first shape includes 4x4 and 8x2, and the second shape includes 16x1.
[0124] Other sizes of luminance blocks still use filters of the first shape, which includes 4x4, 2x8 and 8x2.
[0125] 2. Based on the filters obtained in the above steps, slide the filters in a diagonal scanning manner within the brightness block and determine the predicted pixels at each slide to obtain the prediction block corresponding to each filter, and select the optimal prediction block from them.
[0126] Since the length or width of the filter in the second shape has increased to 16, the size of the reconstruction region also needs to be increased accordingly during the prediction process.
[0127] 3. Use DIMD to analyze the gradient and magnitude of the optimal prediction block to obtain the gradient histogram, and then determine the intra-frame prediction angle. Select the transform kernel of the luma block based on the intra-frame prediction angle.
[0128] Example 2
[0129] 1. For filters corresponding to EIP derivation modes, determine the filter shape based on the size of the luma block and derive the filter coefficients; for filters corresponding to EIP merging modes, inherit the filter shape and filter coefficients corresponding to the previously encoded EIP derivation or EIP merging modes.
[0130] The number of taps in the first-shape filter is equal to the number of taps in the second-shape filter, which includes 16x1 and 1x16 shapes. The second-shape filter is only suitable for luma blocks with a relatively large aspect ratio, such as luma blocks with dimensions of 4x32, 32x4, 8x32, 32x8, 4x16, and 16x4. Specifically, for luma blocks with dimensions of 4x32, 32x4, 8x32, 32x8, 4x16, and 16x4:
[0131] When the size of the luminance block is 4x16, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0132] When the size of the luminance block is 16x4, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0133] When the size of the luminance block is 8x32, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0134] When the size of the luminance block is 32x8, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0135] When the size of the luminance block is 4x32, the filter shape includes a first shape and a second shape. The first shape includes 4x4 and 2x8, and the second shape includes 1x16.
[0136] When the size of the luminance block is 32x4, the filter shape includes a first shape and a second shape. The first shape includes 4x4 and 8x2, and the second shape includes 16x1.
[0137] Other sizes of luminance blocks still use filters of the first shape, which includes 4x4, 2x8 and 8x2.
[0138] 2. Based on the filters obtained in the above steps, slide the filters in a diagonal scanning manner within the brightness block and determine the predicted pixels at each slide to obtain the prediction block corresponding to each filter, and select the optimal prediction block from them.
[0139] Specifically, for a brightness block of a certain width and height, prediction is first performed according to the filter of the first shape. After the RDO decision, three cases are identified:
[0140] If the optimal filter shape after RDO decision is 4x4, then no further prediction will be made for 1x16 or 16x1 filters.
[0141] If the optimal filter shape after RDO decision is 2x8, then the newly added 1x16 filter shape is applied to the luma block for prediction again, and finally the 2x8 or 1x16 filter with lower RDO cost is selected.
[0142] If the optimal filter shape after RDO decision is 8x2, then the newly added 16x1 filter shape is applied to the luma block for prediction again, and finally the 8x2 or 16x1 filter with lower RDO cost is selected.
[0143] Since the length or width of the filter in the second shape has increased to 16, the size of the reconstruction region also needs to be increased accordingly during the prediction process.
[0144] 3. Use DIMD to analyze the gradient and magnitude of the optimal prediction block to obtain the gradient histogram, and then determine the intra-frame prediction angle. Select the transform kernel of the luma block based on the intra-frame prediction angle.
[0145] Example 3
[0146] 1. For filters corresponding to EIP derivation modes, determine the filter shape based on the size of the luma block and derive the filter coefficients; for filters corresponding to EIP merging modes, inherit the filter shape and filter coefficients corresponding to the previously encoded EIP derivation or EIP merging modes.
[0147] The number of taps in the first-shape filter is equal to the number of taps in the second-shape filter, which includes 16x1 and 1x16 shapes. The second-shape filter is only suitable for luma blocks with a relatively large aspect ratio, such as luma blocks with dimensions of 4x32, 32x4, 8x32, 32x8, 4x16, and 16x4. Specifically, for luma blocks with dimensions of 4x32, 32x4, 8x32, 32x8, 4x16, and 16x4:
[0148] When the size of the luminance block is 4x16, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0149] When the size of the luminance block is 16x4, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0150] When the size of the luminance block is 8x32, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0151] When the size of the luminance block is 32x8, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0152] When the size of the luminance block is 4x32, the filter shape includes a first shape and a second shape. The first shape includes 4x4 and 2x8, and the second shape includes 1x16.
[0153] When the size of the luminance block is 32x4, the filter shape includes a first shape and a second shape. The first shape includes 4x4 and 8x2, and the second shape includes 16x1.
[0154] Other sizes of luminance blocks still use filters of the first shape, which includes 4x4, 2x8 and 8x2.
[0155] 2. Based on the filters obtained in the above steps, slide the filters in a diagonal scanning manner within the brightness block and determine the predicted pixels at each slide to obtain the prediction block corresponding to each filter, and select the optimal prediction block from them.
[0156] Specifically, for a brightness block of a certain width and height, in addition to prediction using a filter of the first shape, prediction is also performed using a filter of the second shape. The prediction results corresponding to the first shape filter and the prediction results corresponding to the second shape filter are weighted, which includes two methods:
[0157] Method 1
[0158] For luminance blocks of 4x16, 16x4, 8x32 and 32x8, based on prediction using five filters (4x4, 2x8, 8x2, 1x16 and 16x1), the prediction results of the 1x16 and 2x8 filters are weighted in a 1:1 or 1:3 ratio, and the prediction results of the 16x1 and 8x2 filters are weighted in the same way. The weighted results are used as two new prediction modes to participate in the RDO decision.
[0159] For 4x32 and 32x4 luma blocks, based on prediction using three types of filters (4x32 blocks use filters of 4x4, 2x8, and 1x16 shapes, and 32x4 blocks use filters of 4x4, 8x2, and 16x1 shapes), for 4x32 luma blocks, the prediction results of the 2x8 and 1x16 filters are weighted in a 1:1 or 3:1 ratio, and the weighted result is used as a new prediction pattern in the RDO decision. For 32x4 blocks, the same approach is used in the RDO decision.
[0160] Method 2
[0161] For luminance blocks of 4x16, 16x4, 8x32, and 32x8, based on the original three filters (4x4, 2x8, and 8x2) for prediction, if the optimal filter shape after RDO decision is 4x4, no action is taken; if the optimal filter shape after RDO decision is 2x8, a newly added 1x16 filter is applied to the current luminance block for prediction, and the prediction results are weighted at a 3:1 ratio. The weighted result participates in the RDO decision as a new prediction mode. Similarly, if the optimal filter shape after RDO decision is 8x2, a newly added 16x1 filter is applied to the current luminance block for prediction, and the prediction results are weighted at a 3:1 ratio. The weighted result also participates in the RDO decision as a new prediction mode.
[0162] For 4x32 and 32x4 blocks, based on the original two types of filters (4x32 blocks use filters of 4x4 and 2x8 shapes, and 32x4 blocks use filters of 4x4 and 8x2 shapes) for prediction, for the 4x32 luma block, if the optimal filter shape after RDO decision is 4x4, no operation is performed; if the optimal filter shape after RDO decision is 2x8, a newly added 1x16 filter is applied to the current luma block for prediction, and the prediction results are weighted at a ratio of 3:1. The weighted result participates in the RDO decision as a new prediction mode; the 32x4 block participates in the RDO decision in a similar manner.
[0163] 3. Use DIMD to analyze the gradient and magnitude of the optimal prediction block to obtain the gradient histogram, and then determine the intra-frame prediction angle. Select the transform kernel of the luma block based on the intra-frame prediction angle.
[0164] Example 4
[0165] 1. For filters corresponding to EIP derivation modes, determine the filter shape based on the size of the luma block and derive the filter coefficients; for filters corresponding to EIP merging modes, inherit the filter shape and filter coefficients corresponding to the previously encoded EIP derivation or EIP merging modes.
[0166] The number of taps in the first-shape filter is not equal to the number of taps in the second-shape filter, which includes 2x2, 1x4, 4x1, 3x3, and 5x5. Because the number of taps in the second-shape filter changes compared to the first-shape filter, the number of filter coefficients that need to be derived also changes accordingly.
[0167] When the luma block size is 4x4, 4x8, or 8x4, the luma block allows for intra-frame prediction using the EIP derivation mode. In this case, the filter shape includes a second shape, which includes 2x2, 1x4, 4x1, and 3x3.
[0168] When the size of the luminance block is 32x32, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 5x5.
[0169] Other sizes of luminance blocks still use filters of the first shape, which includes 4x4, 2x8 and 8x2.
[0170] 2. Based on the filters obtained in the above steps, slide the filters in a diagonal scanning manner within the brightness block and determine the predicted pixels at each slide to obtain the prediction block corresponding to each filter, and select the optimal prediction block from them.
[0171] Since the number of filter taps in the second shape has changed and the shape is different from the first shape, the size of the reconstruction region is adjusted accordingly during the prediction process to prevent the filter from going out of bounds during prediction.
[0172] Furthermore, the second-shaped filter described in Example 4 can also be derived from the ideas in Examples 2 and 3, namely, the idea of determining whether to add secondary filtering and weighting can also be applied.
[0173] 3. Use DIMD to analyze the gradient and magnitude of the optimal prediction block to obtain the gradient histogram, and then determine the intra-frame prediction angle. Select the transform kernel of the luma block based on the intra-frame prediction angle.
[0174] Figure 13 This is a schematic diagram of an intra-frame prediction device provided in one embodiment. This device can be configured in an electronic device, such as... Figure 13 As shown, the device includes: a filter determination module 1301, a prediction module 1302, and a transform kernel determination module 1303.
[0175] The filter determination module 1301 is configured to determine the filter shape and filter coefficients of a filter, wherein the filter shape includes at least one of a first shape and a second shape, and the first shape and the second shape are different;
[0176] The prediction module 1302 is configured to determine the target prediction block of the brightness block based on the filter shape and filter coefficients of the filter.
[0177] The transform kernel determination module 1303 is configured to determine the intra-frame prediction angle based on the target prediction block, and select the transform kernel of the luminance block based on the intra-frame prediction angle.
[0178] The intra-frame prediction device provided in this embodiment is for implementing... Figure 3 The intra-frame prediction method of the illustrated embodiment and the intra-frame prediction device provided in this embodiment are similar in principle and technical effect to those of the above embodiments, and will not be repeated here.
[0179] In one embodiment, the filter includes a filter corresponding to the intra-prediction EIP derivation mode based on the extrapolation filter and a filter corresponding to the EIP merging mode.
[0180] In one embodiment, the filter determination module 1301 is configured to determine the filter shape and derive the filter coefficients based on the size of the luma block for the filter corresponding to the EIP derivation mode; and to inherit the filter shape and filter coefficients corresponding to the previously encoded EIP derivation mode or EIP merging mode for the filter corresponding to the filter.
[0181] In one embodiment, the number of taps of the first-shaped filter is equal to the number of taps of the second-shaped filter, or the number of taps of the first-shaped filter is not equal to the number of taps of the second-shaped filter.
[0182] In one embodiment, the first shape includes at least one of 4x4, 2x8, and 8x2;
[0183] When the number of taps of the first-shaped filter is equal to the number of taps of the second-shaped filter, the second shape includes at least one of 16x1 and 1x16;
[0184] When the number of taps of the first-shaped filter is not equal to the number of taps of the second-shaped filter, the second shape includes at least one of 2x2, 1x4, 4x1, 3x3, and 5x5.
[0185] In one embodiment, when the size of the luminance block is 4x16, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0186] When the size of the luminance block is 16x4, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0187] When the size of the luminance block is 8x32, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0188] When the size of the luminance block is 32x8, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16.
[0189] When the size of the luminance block is 4x32, the filter shape includes a first shape and a second shape. The first shape includes 4x4 and 2x8, and the second shape includes 1x16.
[0190] When the size of the luminance block is 32x4, the filter shape includes a first shape and a second shape. The first shape includes 4x4 and 8x2, and the second shape includes 16x1.
[0191] In one embodiment, when the size of the luma block is 4x4, 4x8, or 8x4, the luma block allows intra-frame prediction using the EIP derivation mode.
[0192] In one embodiment, when the size of the luminance block is 4x4, 4x8, or 8x4, the filter shape includes a second shape, which includes 2x2, 1x4, 4x1, and 3x3.
[0193] When the size of the luminance block is 32x32, the filter shape includes a first shape and a second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 5x5.
[0194] In one embodiment, the prediction module 1302 is configured to determine a first prediction block of the luminance block based on the filter shape and filter coefficients of the filter corresponding to the EIP derivation mode; and to determine a second prediction block of the luminance block based on the filter shape and filter coefficients of the filter corresponding to the EIP merging mode; and to select the prediction block with the lowest rate-distortion optimization (RDO) cost between the first and second prediction blocks as the target prediction block.
[0195] In one embodiment, the prediction module 1302 is configured to determine a third prediction block of the luminance block based on the filter shape and filter coefficients for a filter of a first shape; determine a fourth prediction block of the luminance block based on the filter shape and filter coefficients for a filter of a second shape; and determine a first prediction block based on the third and fourth prediction blocks.
[0196] In one embodiment, the prediction module 1302 is configured to, after determining the third prediction block of the luma block, determine whether the filter shape corresponding to the prediction block with the lowest RDO cost in the third prediction block is a preset shape; if the filter shape corresponding to the prediction block with the lowest RDO cost in the third prediction block is a preset shape, then the prediction block with the lowest RDO cost in the third prediction block is taken as the first prediction block; if the filter shape corresponding to the prediction block with the lowest RDO cost in the third prediction block is not a preset shape, then continue to execute the step of determining the fourth prediction block of the luma block based on the filter shape and filter coefficients for the filter with the second shape.
[0197] In one embodiment, the prediction module 1302 is configured to select the prediction block with the lowest RDO cost among the third and fourth prediction blocks as the first prediction block.
[0198] In one embodiment, the prediction module 1302 is configured to select at least one group of prediction blocks for weighting based on preset rules to determine a fifth prediction block, wherein each group of prediction blocks includes a third prediction block and a fourth prediction block; and the prediction block with the lowest RDO cost among the third prediction block, the fourth prediction block and the fifth prediction block is selected as the first prediction block.
[0199] In one embodiment, the prediction module 1302 is configured to slide the filter in a diagonal scanning manner within the brightness block and determine the predicted pixel at each slide. The predicted pixel is calculated based on the pixel value at the location of the filter and the filter coefficient. Based on the predicted pixel, a second prediction block / third prediction block / fourth prediction block of the brightness block is determined.
[0200] In one embodiment, the preset shape is 4x4.
[0201] In one embodiment, the preset rules include at least one of the following:
[0202] For a set of prediction blocks, the filter shape corresponding to the third prediction block is 2x8, and the filter shape corresponding to the fourth prediction block is 1x16;
[0203] For a set of prediction blocks, the filter shape corresponding to the third prediction block is 8x2, and the filter shape corresponding to the fourth prediction block is 16x1.
[0204] Figure 14 This is a schematic diagram of the structure of an electronic device according to one embodiment. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown in this application, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present application as described and / or claimed herein.
[0205] like Figure 14 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0206] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0207] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as intra-frame prediction methods.
[0208] In some embodiments, the intra-frame prediction method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the intra-frame prediction method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the intra-frame prediction method by any other suitable means (e.g., by means of firmware).
[0209] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0210] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0211] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0212] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0213] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0214] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0215] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the intra-frame prediction method provided in any embodiment of this application.
[0216] In the implementation of the computer program product, computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0217] Embodiments of this application can be implemented by executing computer program instructions through the data processor of a mobile device, for example, in a processor entity, or through hardware, or through a combination of software and hardware. The computer program instructions can be assembly instructions, Instruction Set Architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages.
[0218] Any block diagram of logical flow in the accompanying drawings of this application may represent program steps, or may represent interconnected logic circuits, modules, and functions, or may represent a combination of program steps and logic circuits, modules, and functions. The computer program may be stored in memory. The memory may be of any type suitable to the local technical environment and may be implemented using any suitable data storage technology, such as, but not limited to, read-only memory (ROM), random access memory (RAM), optical storage devices and systems (Digital Multifunction Discs, DVDs, or CDs), etc. Computer-readable media may include non-transitory storage media. The data processor may be of any type suitable to the local technical environment, such as, but not limited to, general-purpose computers, special-purpose computers, microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), and processors based on multi-core processor architectures.
[0219] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.
[0220] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. An intra-frame prediction method, characterized in that, include: Determine the filter shape and filter coefficients, wherein the filter shape includes at least one of a first shape and a second shape, and the first shape and the second shape are different; The target prediction block for the luminance block is determined based on the filter shape and filter coefficients of the filter. Based on the target prediction block, the intra-frame prediction angle is determined, and the transform kernel of the luma block is selected based on the intra-frame prediction angle.
2. The intra-frame prediction method according to claim 1, characterized in that, The filters include filters corresponding to the intra-prediction EIP derivation mode based on extrapolation filters and filters corresponding to the EIP merging mode.
3. The intra-frame prediction method according to claim 2, characterized in that, The determination of the filter shape and filter coefficients includes: For the filter corresponding to the EIP derivation mode, the filter shape is determined based on the size of the luminance block, and the filter coefficients are derived. For the filter corresponding to the EIP merging mode, the filter shape and filter coefficients are inherited from the previously encoded EIP derivation mode or EIP merging mode.
4. The intra-frame prediction method according to claim 1, characterized in that, The number of taps in the first-shaped filter is equal to the number of taps in the second-shaped filter, or the number of taps in the first-shaped filter is not equal to the number of taps in the second-shaped filter.
5. The intra-frame prediction method according to claim 4, characterized in that, The first shape includes at least one of 4x4, 2x8, and 8x2; When the number of taps of the filter of the first shape is equal to the number of taps of the filter of the second shape, the second shape includes at least one of 16x1 and 1x16; When the number of taps of the filter of the first shape is not equal to the number of taps of the filter of the second shape, the second shape includes at least one of 2x2, 1x4, 4x1, 3x3, and 5x5.
6. The intra-frame prediction method according to claim 3, characterized in that, When the size of the brightness block is 4x16, the filter shape includes the first shape and the second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16. When the size of the brightness block is 16x4, the filter shape includes the first shape and the second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16. When the size of the brightness block is 8x32, the filter shape includes the first shape and the second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16. When the size of the brightness block is 32x8, the filter shape includes the first shape and the second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 16x1 and 1x16. When the size of the brightness block is 4x32, the filter shape includes the first shape and the second shape, the first shape includes 4x4 and 2x8, and the second shape includes 1x16; When the size of the brightness block is 32x4, the filter shape includes the first shape and the second shape, the first shape includes 4x4 and 8x2, and the second shape includes 16x1.
7. The intra-frame prediction method according to claim 3, characterized in that, When the size of the luma block is 4x4, 4x8 or 8x4, the luma block allows intra-frame prediction using the EIP derivation mode.
8. The intra-frame prediction method according to claim 7, characterized in that, When the size of the brightness block is 4x4, 4x8 or 8x4, the filter shape includes a second shape, which includes 2x2, 1x4, 4x1 and 3x3; When the size of the brightness block is 32x32, the filter shape includes the first shape and the second shape. The first shape includes 4x4, 2x8 and 8x2, and the second shape includes 5x5.
9. The intra-frame prediction method according to claim 2, characterized in that, Determining the target prediction block for the luminance block based on the filter shape and filter coefficients includes: For the filter corresponding to the EIP derivation mode, the first prediction block of the luminance block is determined according to the filter shape and filter coefficients; For the filter corresponding to the EIP merging mode, the second prediction block of the luma block is determined according to the filter shape and filter coefficients; The prediction block with the lowest rate-distortion optimization (RDO) cost between the first and second prediction blocks is selected as the target prediction block.
10. The intra-frame prediction method according to claim 9, characterized in that, The step of determining the first prediction block of the lumen block based on the filter shape and filter coefficients of the filter corresponding to the EIP derivation mode includes: For the filter of the first shape, the third prediction block of the luminance block is determined according to the filter shape and filter coefficients; For the filter of the second shape, the fourth prediction block of the luminance block is determined according to the filter shape and filter coefficients; The first prediction block is determined based on the third prediction block and the fourth prediction block.
11. The intra-frame prediction method according to claim 10, characterized in that, After determining the third prediction block of the brightness block, the method further includes: Determine whether the filter shape corresponding to the prediction block with the lowest RDO cost in the third prediction block is a preset shape; If the filter shape corresponding to the prediction block with the smallest RDO cost in the third prediction block is a preset shape, then the prediction block with the smallest RDO cost in the third prediction block is taken as the first prediction block; If the filter shape corresponding to the prediction block with the lowest RDO cost in the third prediction block is not a preset shape, then the step of determining the fourth prediction block of the luminance block based on the filter shape and filter coefficients of the filter with the second shape continues.
12. The intra-frame prediction method according to claim 10 or 11, characterized in that, Determining the first prediction block based on the third prediction block and the fourth prediction block includes: The prediction block with the lowest RDO cost among the third and fourth prediction blocks is selected as the first prediction block.
13. The intra-frame prediction method according to claim 10 or 11, characterized in that, Determining the first prediction block based on the third prediction block and the fourth prediction block includes: Based on preset rules, at least one set of prediction blocks is selected and weighted to determine the fifth prediction block. Each set of prediction blocks includes one of the third prediction blocks and one of the fourth prediction blocks. The prediction block with the lowest RDO cost among the third, fourth, and fifth prediction blocks is selected as the first prediction block.
14. The intra-frame prediction method according to claim 9 or 10, characterized in that, The step of determining the second prediction block / third prediction block / fourth prediction block of the luminance block based on the filter shape and filter coefficients includes: The filter is slid within the brightness block in a diagonal scanning manner, and the predicted pixel is determined at each slide. The predicted pixel is calculated based on the pixel value at the location of the filter and the filter coefficient. Based on the predicted pixels, determine the second prediction block / third prediction block / fourth prediction block of the luminance block.
15. The intra-frame prediction method according to claim 11, characterized in that, The preset shape is 4x4.
16. The intra-frame prediction method according to claim 13, characterized in that, The preset rules include at least one of the following: For a set of prediction blocks, the filter shape corresponding to the third prediction block is 2x8, and the filter shape corresponding to the fourth prediction block is 1x16; For a set of prediction blocks, the filter shape corresponding to the third prediction block is 8x2, and the filter shape corresponding to the fourth prediction block is 16x1.
17. An electronic device, characterized in that, include: processor; The processor is configured to implement the intra-frame prediction method as described in any one of claims 1-16 when executing a computer program.
18. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the intra-frame prediction method as described in any one of claims 1-16.