An intra prediction method, apparatus, electronic device, and storage medium
By obtaining mode selection identifier information during video encoding, a target mode that is not a preset intra-prediction mode is selected, which solves the problem of high complexity in VVC intra-prediction and achieves more efficient video encoding and a better user experience.
Patent Information
- Application Number
- CN202211485667.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-24
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2042-11-24
AI Technical Summary
The intra-frame prediction process of the existing video coding standard VVC is highly complex, resulting in excessive computational resources and costs, which affects its practicality in video coding.
During intra-frame prediction, by acquiring mode selection identifier information, it is determined whether to select a preset intra-frame prediction mode. The target intra-frame prediction mode is selected only from other intra-frame prediction modes that do not include the preset intra-frame prediction mode, thereby reducing the computation of candidate modes and lowering the complexity of intra-frame prediction.
It reduces the complexity and computational cost of intra-frame prediction, improves the efficiency of video coding, and enhances the practicality of video coding and the user's viewing experience.
Smart Images

Figure CN115834882B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video processing technology, and in particular to intra-frame prediction methods, apparatus, electronic devices, and storage media. Background Technology
[0002] With technological advancements, people's demands for multimedia entertainment are increasing, leading to higher resolutions and frame rates in video content, which in turn drives up bandwidth and storage costs. Therefore, video encoding is necessary to reduce these costs. Against this backdrop, a new video coding standard, Versatile Video Coding (VVC), was developed. VVC can save 30% of the bitrate compared to High Efficiency Video Coding (HEVC) (currently one of the most efficient coding standards). However, its complexity is also 10 times that of HEVC, consuming significant computational resources and costs. Intra-frame prediction is a very time-consuming process in video coding, further complicating the process. Therefore, reducing the complexity of intra-frame prediction has become a pressing issue. Summary of the Invention
[0003] The purpose of this invention is to provide an intra-frame prediction method, apparatus, electronic device, and storage medium to reduce the complexity of intra-frame prediction. The specific technical solution is as follows:
[0004] In a first aspect of the present invention, an intra-frame prediction method is provided, the method comprising:
[0005] Obtain the encoding block to be encoded, wherein the encoding block is the encoding block corresponding to the video frame to be encoded;
[0006] Obtain the mode selection identifier information corresponding to the video frame to be encoded. The mode selection identifier information is used to identify whether a preset intra-frame prediction mode is selected during the intra-frame prediction of the coding block in the video frame to be encoded.
[0007] If the preset intra-prediction mode is not selected during the intra-prediction process of the coded block in the video frame to be encoded, the target intra-prediction mode is selected from other intra-prediction modes that do not include the preset intra-prediction mode to perform intra-prediction on the coded block.
[0008] In one possible implementation, the mode selection identification information includes high-edge video frame identification information and non-high-edge video frame identification information. The high-edge video frame identification information is used to identify that a preset intra-prediction mode is selected during the intra-prediction process of the coding block in the video frame to be encoded, and the non-high-edge video frame identification information is used to identify that a preset intra-prediction mode is not selected during the intra-prediction process of the coding block in the video frame to be encoded.
[0009] In one possible implementation, before obtaining the mode selection identifier information corresponding to the video frame to be encoded, the method further includes:
[0010] An edge detection algorithm is used to perform edge detection on the video frame to be encoded to obtain the pixel values of the edge pixels of the video frame to be encoded; wherein, pixels other than the edge pixels are non-edge pixels;
[0011] If the absolute value of the difference between the pixel value of the edge pixel and the pixel value of the non-edge pixel adjacent to the edge pixel is greater than a first preset threshold, the edge pixel is regarded as a strong edge pixel.
[0012] If the proportion of strong edge pixels in the video frame to be encoded to all edge pixels is greater than a second preset threshold, the video frame to be encoded is marked with high edge video frame identification information.
[0013] If the proportion of strong edge pixels in the video frame to be encoded to all edge pixels is less than or equal to a second preset threshold, the video frame to be encoded is marked with non-high edge video frame identification information.
[0014] In one possible implementation, after obtaining the mode selection identifier information corresponding to the video frame to be encoded, the method further includes:
[0015] When the mode selection identifier indicates that a preset intra-prediction mode is selected during the intra-prediction process of the coded block in the video frame to be encoded, a target intra-prediction mode is selected from a variety of intra-prediction modes including the preset intra-prediction mode to perform intra-prediction on the coded block.
[0016] In one possible implementation, the preset intra-frame prediction mode is a block-based incremental pulse decoding modulation (BDPCM) mode, and the other intra-frame prediction modes include DC mode, planar mode, and angle mode.
[0017] In one possible implementation, selecting a target intra-prediction mode from other intra-prediction modes that do not include the preset intra-prediction mode to perform intra-prediction on the coding block includes:
[0018] For each intra-prediction mode in other intra-prediction modes, the predicted pixel value of the coding block in the video frame to be encoded corresponding to the intra-prediction mode is calculated to obtain multiple predicted pixel values.
[0019] Based on the multiple predicted pixel values, the rate-distortion cost corresponding to the intra-frame prediction mode is calculated respectively.
[0020] The intra-prediction mode with the lowest rate-distortion cost among the other intra-prediction modes is selected as the target intra-prediction mode, and the target intra-prediction mode is used to perform intra-prediction on the coding block.
[0021] In a second aspect of the invention, an intra-frame prediction apparatus is also provided, the apparatus comprising:
[0022] The first acquisition module is used to acquire the encoding block to be encoded, wherein the encoding block is the encoding block corresponding to the video frame to be encoded;
[0023] The second acquisition module is used to acquire the mode selection identifier information corresponding to the video frame to be encoded. The mode selection identifier information is used to identify whether a preset intra-frame prediction mode is selected during the intra-frame prediction of the coding block in the video frame to be encoded.
[0024] The first prediction module is used to select a target intra-prediction mode from other intra-prediction modes that do not include the preset intra-prediction mode to perform intra-prediction on the coded block when the mode selection identification information indicates that no preset intra-prediction mode is selected during the intra-prediction of the coded block in the video frame to be encoded.
[0025] In one possible implementation, the mode selection identification information includes high-edge video frame identification information and non-high-edge video frame identification information. The high-edge video frame identification information is used to identify that a preset intra-prediction mode is selected during the intra-prediction process of the coding block in the video frame to be encoded, and the non-high-edge video frame identification information is used to identify that a preset intra-prediction mode is not selected during the intra-prediction process of the coding block in the video frame to be encoded.
[0026] In one possible implementation, before acquiring the mode selection identifier information corresponding to the video frame to be encoded, the apparatus further includes:
[0027] An edge detection module is used to perform edge detection on the video frame to be encoded using an edge detection algorithm to obtain the pixel values of the edge pixels of the video frame to be encoded; wherein, pixels other than the edge pixels are non-edge pixels;
[0028] A strong edge pixel generation module is used to identify an edge pixel as a strong edge pixel when the absolute value of the difference between the pixel value of the edge pixel and the pixel value of the non-edge pixel adjacent to the edge pixel is greater than a first preset threshold.
[0029] The first identification module is used to identify high edge video frame identification information for the video frame to be encoded when the proportion of strong edge pixels in the video frame to be encoded to all edge pixels is greater than a second preset threshold.
[0030] The second identification module is used to identify non-high-edge video frame identification information for the video frame to be encoded when the proportion of strong edge pixels in the video frame to be encoded to all edge pixels is less than or equal to a second preset threshold.
[0031] In one possible implementation, after obtaining the mode selection identifier information corresponding to the video frame to be encoded, the apparatus further includes:
[0032] The second prediction module is used to select a target intra-prediction mode from a variety of intra-prediction modes that include the preset intra-prediction mode when the mode selection identification information indicates that a preset intra-prediction mode is selected during the intra-prediction process of the coding block in the video frame to be encoded.
[0033] In one possible implementation, the preset intra-frame prediction mode is a block-based incremental pulse decoding modulation (BDPCM) mode, and the other intra-frame prediction modes include DC mode, planar mode, and angle mode.
[0034] In one possible implementation, the first prediction module is specifically configured to, for each of the other intra-prediction modes, calculate the predicted pixel value of the coding block in the video frame to be encoded corresponding to the intra-prediction mode, thereby obtaining multiple predicted pixel values; calculate the rate-distortion cost corresponding to the intra-prediction mode based on the multiple predicted pixel values; select the intra-prediction mode with the smallest rate-distortion cost among the other intra-prediction modes as the target intra-prediction mode, and use the target intra-prediction mode to perform intra-prediction on the coding block.
[0035] According to a third aspect of the present invention, an electronic device is also provided, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus.
[0036] Memory, used to store computer programs;
[0037] When a processor executes a program stored in memory, it implements any of the steps of the method described in the first aspect.
[0038] In another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements any of the intra-frame prediction methods described above.
[0039] In another aspect of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the intra-frame prediction methods described above.
[0040] This invention provides an intra-frame prediction method. Before performing intra-frame prediction on a coded block in a video frame to be encoded, the method first obtains the mode selection identifier information corresponding to the video frame to which the coded block belongs. If the mode selection identifier information indicates that a preset intra-frame prediction mode is not selected during the intra-frame prediction of the coded block in the video frame to be encoded, the method selects a target intra-frame prediction mode from other intra-frame prediction modes that do not include the preset intra-frame prediction mode to perform intra-frame prediction on the coded block. Compared with related technologies, selecting a target intra-frame prediction mode from all intra-frame prediction modes that include the preset intra-frame prediction mode and other intra-frame prediction modes to perform intra-frame prediction on the coded block can reduce the complexity of intra-frame prediction. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0042] Figure 1 This is a flowchart of an intra-frame prediction method provided in an embodiment of the present invention.
[0043] Figure 2 The encoding flowchart of the VVC encoder provided in the embodiment of the present invention is shown.
[0044] Figure 3 This is a flowchart for obtaining mode selection identifier information provided in an embodiment of the present invention.
[0045] Figure 4 This is a schematic diagram of strong edge pixels and non-strong edge pixels provided in an embodiment of the present invention.
[0046] Figure 5 This is a flowchart illustrating the identification information of high-edge video frames or non-high-edge video frames for identification purposes in an embodiment of the present invention.
[0047] Figure 6 The flowchart of the algorithm for selecting the target intra-frame prediction mode is provided in an embodiment of the present invention.
[0048] Figure 7This is a flowchart for selecting the target intra-frame prediction mode according to an embodiment of the present invention.
[0049] Figure 8 This is a schematic diagram of reference pixels in a coding block of a video frame to be encoded, provided in an embodiment of the present invention.
[0050] Figure 9 This is a schematic diagram of the angle mode provided for an embodiment of the present invention.
[0051] Figure 10 This is a schematic diagram of an intra-frame prediction device provided in an embodiment of the present invention.
[0052] Figure 11 This is a schematic diagram of an electronic device structure provided in an embodiment of the present invention. Detailed Implementation
[0053] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention.
[0054] For ease of understanding, the following explanation is provided regarding intra-frame prediction.
[0055] Intra-frame prediction refers to the process in which, during encoding, the current coded block references neighboring pixels to obtain predicted pixel values, subtracts the predicted pixel values from the original pixel values to obtain residual pixel values, and finally transforms, quantizes, and entropy-codes these residual pixel values to obtain the final bitstream. For a single video frame, the luminance and chrominance values of two adjacent pixels are usually quite similar, meaning the color changes gradually. Intra-frame prediction utilizes the spatial correlation of the video, using neighboring encoded pixels within the same video frame to predict the current pixel, thereby effectively removing spatial redundancy from the video.
[0056] To reduce the complexity of intra-frame prediction, embodiments of the present invention provide an intra-frame prediction method, apparatus, electronic device, and storage medium.
[0057] The intra-frame prediction method provided in the embodiments of the present invention will be described in detail below.
[0058] Figure 1 This is a flowchart of an intra-frame prediction method provided in an embodiment of the present invention. Figure 1 As shown, it includes the following steps:
[0059] Step S101: Obtain the encoding block to be encoded. The encoding block is the encoding block corresponding to the video frame to be encoded.
[0060] Before encoding a video frame, it can be divided into encoding blocks. This process can be understood as block partitioning.
[0061] There are various ways to divide a video frame into blocks, which can be chosen based on actual needs and experience. As an example, we choose the partitioning method in VVC to obtain the coded block (CU). A video frame to be encoded contains multiple coded blocks, and the current coded block to be encoded is obtained from these multiple coded blocks.
[0062] For example, in HEVC, the video frame to be encoded is first divided into a series of coding tree units (CTUs). CTUs can be 16x16, 32x32, or 64x64 in size. A CTU contains one luma coding tree block and two chroma coding tree blocks at the same location. In HEVC, a CTU is divided into coding units (CUs) using a tree structure. During intra-frame prediction, CUs, as leaf nodes, can be divided into one, two, or four prediction units (PUs). Each PU uses the same prediction process and sends it to the decoder. In VVC, the complex distinction between CUs and PUs is eliminated; a CU can be either square or rectangular. VVC uses a hybrid tree partitioning approach. A CTU is first divided into a quadtree, and then the leaf nodes of the quadtree can be further divided into different tree partitions. Currently, horizontal binary tree partitioning, vertical binary tree partitioning, horizontal ternary tree partitioning, and vertical ternary tree partitioning have been newly introduced. The leaf nodes generated by this partitioning are called CUs. If the size of the CU meets the constraints of the current partitioning, the current CU can be predicted and transformed without further partitioning.
[0063] Step S102: Obtain the mode selection identifier information corresponding to the video frame to be encoded. The mode selection identifier information is used to identify whether a preset intra-frame prediction mode is selected during the intra-frame prediction process of the coding block in the video frame to be encoded.
[0064] In this embodiment of the invention, the video frames to be encoded can be classified based on a preset classification criterion, and different mode selection identification information can be assigned to different video frames to be encoded. For example, the mode selection identification information can be determined based on the detection results by performing category detection on the video frames to be encoded.
[0065] In one possible approach, the mode selection identifier information of the video frames to be encoded is predetermined and obtained directly before intra-frame prediction. For example, image analysis is performed on each video frame to be encoded to obtain the mode selection identifier information of the video frames to be encoded, and the mode selection identifier information of each video frame to be encoded is saved. In this way, after the coding block is obtained during the intra-frame prediction process, the mode selection identifier information of the video frames to be encoded corresponding to the coding block can be obtained directly.
[0066] In another possible approach, the mode selection identifier information can be obtained by identifying and acquiring it simultaneously during intra-frame prediction of the coded block.
[0067] The mode selection identifier can take many forms, such as numbers or text, with different values representing different meanings. Taking text-based mode selection identifiers as an example, when the identifier is "Select," it means that a preset intra-prediction mode is selected during intra-frame prediction of the coded blocks in the video frame to be encoded; when the identifier is "Not Selected," it means that the preset intra-prediction mode is not selected during intra-frame prediction of the coded blocks in the video frame to be encoded.
[0068] Preset intra-prediction modes can be set according to actual needs, experience, experiments, etc. A preset intra-prediction mode can be one or more of all intra-prediction modes in the intra-prediction domain. Among all intra-prediction modes, those other than the preset intra-prediction mode are considered other intra-prediction modes. Various video coding standards include multiple intra-prediction modes. For example, HEVC has 35 intra-prediction modes, including one Direct Current (DC) mode, one Planar mode, and 33 angular modes. When DC and Planar modes are the preset intra-prediction modes, the remaining 33 angular modes are considered other intra-prediction modes. VVC has 67 intra-prediction modes, including one DC mode, one Planar mode, and 65 angular modes. Block Differential Pulse Coded Modulation (BDPCM) is a newly introduced intra-prediction mode in VVC. When the BDPCM mode is the preset intra-prediction mode, the DC mode, PLANA mode, and 65 angle modes are other intra-prediction modes.
[0069] Step S103: If the mode selection identifier indicates that no preset intra-prediction mode is selected during the intra-prediction process of the coding block in the video frame to be encoded, the target intra-prediction mode is selected from other intra-prediction modes that do not include the preset intra-prediction mode to perform intra-prediction on the coding block.
[0070] Selecting a target intra-prediction mode from other intra-prediction modes that do not include a preset intra-prediction mode for intra-prediction of a coded block can include calculating the rate-distortion cost value corresponding to each of the other intra-prediction modes, and selecting the intra-prediction mode with the lowest rate-distortion cost value among the other intra-prediction modes as the target intra-prediction mode. Calculating the rate-distortion cost value for each intra-prediction mode can include: calculating the predicted pixel values of the coded block in the video frame to be encoded corresponding to the intra-prediction mode, obtaining multiple predicted pixel values, and calculating the rate-distortion cost value corresponding to the intra-prediction mode based on the multiple predicted pixel values. The calculation of the rate-distortion cost value corresponding to the intra-prediction mode based on multiple predicted pixel values will be described in detail in the following embodiments, and will not be repeated here.
[0071] In related technologies, it is necessary to traverse every intra-prediction mode among all intra-prediction modes to select the target intra-prediction mode from all intra-prediction modes. In the embodiments of the present invention, when the mode selection identification information indicates that a preset intra-prediction mode is not selected during the intra-prediction of the coded block in the video frame to be encoded, it is not necessary to traverse all intra-prediction modes again. It is only necessary to select the target intra-prediction mode from other intra-prediction modes that do not include the preset intra-prediction mode to perform intra-prediction on the coded block. For example, there are 4 types of intra-prediction modes. In the embodiments of the present invention, the preset intra-prediction mode is not selected during the intra-prediction of the coded block, that is, one type of preset intra-prediction mode is removed from the 4 types of intra-prediction modes, reducing the candidate intra-prediction modes to 3 types. Thus, during the intra-prediction process, it is only necessary to select the target intra-prediction mode from the 3 types of intra-prediction modes.
[0072] This invention provides an intra-frame prediction method, which involves obtaining a coding block to be encoded, wherein the coding block is the coding block corresponding to a video frame to be encoded; obtaining mode selection identifier information corresponding to the video frame to be encoded, wherein the mode selection identifier information is used to identify whether a preset intra-frame prediction mode is selected during the intra-frame prediction process of the coding block in the video frame to be encoded; and selecting an intra-frame prediction mode to be used from other intra-frame prediction modes that do not include the preset intra-frame prediction mode to perform intra-frame prediction on the coding block when the mode selection identifier information indicates that the preset intra-frame prediction mode is not selected during the intra-frame prediction process of the coding block to be encoded. In this embodiment of the invention, before performing intra-frame prediction on the coded blocks in the video frame to be encoded, the mode selection identifier information corresponding to the video frame to be encoded to which the coded block belongs is first obtained. If the mode selection identifier information indicates that a preset intra-frame prediction mode is not selected during the intra-frame prediction process of the coded blocks in the video frame to be encoded, the target intra-frame prediction mode is selected from other intra-frame prediction modes that do not include the preset intra-frame prediction mode to perform intra-frame prediction on the coded blocks. Compared with related technologies, which select the target intra-frame prediction mode from all intra-frame prediction modes that include the preset intra-frame prediction mode and other intra-frame prediction modes to perform intra-frame prediction on the coded blocks, the complexity of intra-frame prediction can be reduced.
[0073] Furthermore, since the process of selecting a target intra-prediction mode requires calculating the rate-distortion cost corresponding to each candidate intra-prediction mode, compared to related technologies which require calculating the rate-distortion cost corresponding to all intra-prediction modes, this embodiment of the invention only requires calculating the rate-distortion cost corresponding to other intra-prediction modes besides the preset intra-prediction mode. Therefore, the intra-prediction method provided by this embodiment of the invention can also reduce computational costs, thereby reducing the time consumed in the intra-prediction process.
[0074] In one possible implementation, after obtaining the mode selection identifier information corresponding to the video frame to be encoded, the above intra-frame prediction method further includes the following steps:
[0075] When the mode selection identifier indicates that a preset intra prediction mode is selected during the intra prediction process of the coded block in the video frame to be encoded, the target intra prediction mode is selected from a variety of intra prediction modes including the preset intra prediction mode to perform intra prediction on the coded block.
[0076] When the mode selection identifier indicates that a preset intra-prediction mode is selected during the intra-prediction process of the coding block in the video frame to be encoded, that is, the preset intra-prediction mode is included in the candidate intra-prediction modes.
[0077] In this embodiment of the invention, depending on the different scenarios identified by the mode selection identifier information, different candidate intra-prediction modes are used when performing intra-prediction on the coding blocks in the video frame to be encoded. That is, the video frames to be encoded are classified according to the mode selection identifier information, and different video frames to be encoded correspond to different candidate intra-prediction modes, which makes the intra-prediction process more complete.
[0078] VVC is the latest video coding standard. When encoding video using VVC, the above-mentioned intra-frame prediction method can be used to perform intra-frame prediction on the coding blocks of the video frames to be encoded. Figure 2 The encoding flowchart of the VVC encoder provided in the embodiment of the present invention is shown below. Figure 2 , combined Figure 1 The intra-frame prediction method shown is for Figure 2 The coding flowchart shown is explained as follows:
[0079] Figure 2 The encoding process of the VVC encoder shown can be implemented through the following steps:
[0080] S201, Input video.
[0081] S202, Transformation / Quantization
[0082] S203, Intra prediction;
[0083] S204; Motion compensation, motion estimation (Motion est. / comp.);
[0084] S205, Entropy coding;
[0085] S206, inverse quantization / inv.transform;
[0086] S207, In-loop filter;
[0087] S208, reference frame buffer (decoded picture buffer).
[0088] First, predictive coding is performed. Intra-frame predictive coding can use either intra-frame prediction or inter-frame prediction. Typically, inter-frame predictive coding includes motion compensation and motion estimation.
[0089] Before intra-frame prediction, the input video is first converted into multiple video frames to be encoded. A mode selection identifier is assigned to each video frame to be encoded. When performing intra-frame prediction on a coded block within the video frame to be encoded, the mode selection identifier corresponding to that video frame is obtained. This identifier indicates whether a preset intra-frame prediction mode is selected during the intra-frame prediction process. If the mode selection identifier indicates that a preset intra-frame prediction mode is not selected, a target intra-frame prediction mode is selected from other intra-frame prediction modes that do not include the preset mode for intra-frame prediction. Compared to related technologies, where a target intra-frame prediction mode needs to be selected from all intra-frame prediction modes, in this embodiment, only the target intra-frame prediction mode needs to be selected from other intra-frame prediction modes that do not include the preset mode, thus reducing the complexity of intra-frame prediction. Since the process of selecting the target intra-prediction mode requires calculating the predicted pixel value, rate-distortion cost, etc., corresponding to each candidate intra-prediction mode, in this embodiment of the invention, if the preset intra-prediction mode is not selected during the intra-prediction of the coding block, it is not necessary to calculate the predicted pixel value, rate-distortion cost, etc., corresponding to the preset intra-prediction mode. Therefore, the computational cost can be reduced, thereby reducing the time consumed in the intra-prediction process.
[0090] The prediction residual pixel values obtained from the input video through intra-frame prediction or inter-frame prediction are transformed and quantized. Specifically, the prediction residual pixel values are transformed to obtain transformation coefficients, and the transformation coefficients are quantized to obtain quantization coefficients.
[0091] After quantization, entropy encoding is performed to obtain the encoding result.
[0092] The transformation can include a primary transformation and a secondary transformation. The primary transformation can be a discrete cosine transform, and the secondary transformation can be a low-frequency inseparable transform.
[0093] In related technologies, an image frame to be encoded is first input, and encoded one by one according to CTUs (e.g., 128x128 square blocks). Then, the CTUs are divided into blocks called CUs. Predictive coding is then performed (including intra-frame prediction and inter-frame prediction modes, one of which can be chosen), followed by transform, quantization, and finally entropy coding. To obtain a reference frame, the transformed and quantized data needs to be inversely transformed and dequantized, then the predicted blocks are added to obtain reconstructed blocks. These reconstructed blocks are then filtered to obtain the final reconstructed block, which is saved in the DPB (decoded picture buffer) for use in inter-frame prediction.
[0094] For example, after inputting a video frame, image analysis is performed on the frame to determine whether secondary transformation should be disabled, and this information is recorded. During video encoding, this recorded information is used to determine whether secondary transformation should be performed on the encoded blocks of the video frame. If the current frame is determined to require LFNST, it is marked, and subsequent transformations of all blocks in this frame will perform the primary transformation first, followed by the secondary transformation. If the current frame is determined not to require LFNST, it is also marked, and subsequent transformations of all blocks in this frame will only perform the primary transformation, without the secondary transformation.
[0095] The specific determination of the secondary transformation identifier information and the determination of whether to skip the secondary transformation or perform the secondary transformation based on the secondary transformation identifier information have been described in detail in the above embodiments, and will not be repeated here.
[0096] Entropy coding compresses all the obtained data, including motion vectors, residual quantization coefficients, and parameters of predictive coding. Entropy coding includes variable-length coding, arithmetic coding, and Huffman coding.
[0097] The encoded result can then be decoded. Video decoding can be seen as the inverse process of video encoding, corresponding to transform and quantization. The coefficients obtained after inverse quantization are inversely transformed to obtain the residual data.
[0098] During video decoding, the encoded data is expanded according to the type of entropy coding to obtain the converted encoded data.
[0099] The corresponding encoding process involves converting the encoded data, including motion vectors, quantization coefficients of residuals, and some parameters of predictive coding.
[0100] Specifically, the encoded results can be dequantized, inverse transformed, etc.
[0101] A loop filter is a linear low-pass filter that can filter out high-frequency components and noise. Based on the prediction mode of inter-frame prediction or intra-frame prediction, motion vectors are processed to generate predicted frames from the reference frame buffer. Residual data is then superimposed on these predicted frames to obtain the current frame, thus achieving decoding of the coded video.
[0102] The transformation process can include a primary transformation and a secondary transformation. In video decoding, the inverse transformation can include an inverse primary transformation and an inverse secondary transformation. The inverse primary transformation can be understood as the inverse process of the primary transformation, and the inverse secondary transformation can be understood as the inverse process of the secondary transformation. In this embodiment of the invention, for the transformed block of a video frame, the flag bit corresponding to the coded block can be obtained. If the flag bit indicates that no low-frequency inseparable transformation was performed on the coded block during video encoding, then after inverse quantization of the encoding result of the coded block, the inverse low-frequency inseparable transformation is skipped, and the subsequent decoding process is performed.
[0103] because Figure 1 The intra-prediction method shown can reduce the complexity and computational cost of intra-prediction, thereby reducing the time consumed in the intra-prediction process. Figure 1 The intra-frame prediction method shown, when applied to VVC encoding, can reduce the complexity of video encoding, decrease computational costs, and thus reduce encoding time. Furthermore, the high complexity of VVC limits its practicality in intra-frame prediction. The intra-frame prediction method provided in this invention effectively saves computational and bandwidth costs, improves the practicality of VVC in intra-frame prediction, and promotes the maturity of VVC usage. Consequently, when encoding and decoding video based on VVC, the video presentation effect on the terminal can be improved, thus enhancing the viewing experience for users.
[0104] In one possible implementation, the mode selection identification information includes high-edge video frame identification information and non-high-edge video frame identification information. The high-edge video frame identification information is used to identify the selection of a preset intra-prediction mode during the intra-prediction process of the coding block in the video frame to be encoded, and the non-high-edge video frame identification information is used to identify the selection of no preset intra-prediction mode during the intra-prediction process of the coding block in the video frame to be encoded.
[0105] The video frames to be encoded can be detected and categorized into high-edge frames and non-high-edge frames. For example, high-edge frames contain more high-frequency signals. Signal detection can be performed on the video frames to be encoded, identifying those containing more high-frequency signals than a preset threshold as high-edge frames, and classifying the rest as non-high-edge frames. Since there are differences in the edges between high-edge and non-high-edge frames, edge detection algorithms can be used to classify the video frames to be encoded based on these differences. Then, high-edge frames are identified with high-edge frame identifiers, and non-high-edge frames are identified with non-high-edge frame identifiers.
[0106] High-edge video frames contain a lot of high-frequency signals. Transforming high-edge video frames does not reduce the amount of information and may even increase the amount of information, thus failing to improve the compression rate. However, some intra-frame prediction modes skip the transformation process and directly quantize and entropy encode the spatial signal, thus achieving better prediction results for high-edge video frames.
[0107] High-edge video frame identification information and non-high-edge video frame identification information can be represented in different forms, such as text, numbers, etc.
[0108] In this embodiment of the invention, the mode selection identification information includes high-edge video frame identification information and non-high-edge video frame identification information. The video frame to be encoded is detected using an edge strength detection algorithm, and the video frame to be encoded is divided into high-edge video frames and non-high-edge video frames. The high-edge video frames and non-high-edge video frames are respectively identified with corresponding mode selection identification information, which is beneficial to obtain the corresponding candidate intra-frame prediction mode based on the mode selection identification information of the video frame to be encoded in the subsequent intra-frame prediction process.
[0109] Based on the differences between high-edge and non-high-edge video frames, the video frames to be encoded are divided into high-edge and non-high-edge video frames. There are various ways to identify high-edge or non-high-edge video frame identification information for the video frames to be encoded. For example, signal detection can be performed on the video frames to be encoded, and the identification information can be based on the detection results.
[0110] In one possible implementation, such as Figure 3 As shown, before obtaining the mode selection identifier information corresponding to the video frame to be encoded, the above intra-frame prediction method also includes the following steps:
[0111] Step S301: Using an edge detection algorithm, perform edge detection on the video frame to be encoded to obtain the pixel values of the edge pixels of the video frame to be encoded; wherein, pixels other than edge pixels are non-edge pixels.
[0112] The edge detection algorithms mentioned above can be Laplacian edge detection algorithms, differential edge detection algorithms, etc., and the specific choice can be made based on actual needs or experience. Image edges are the most basic features of an image. An edge refers to a discontinuity in the local characteristics of an image; a sudden change in grayscale or structural information is called an edge. For example, a sudden change in grayscale level, color, or texture structure, i.e., a sudden change in pixel value. An edge is the end of one region and the beginning of another; this feature can be used to extract image edges. By using edge detection algorithms to perform edge detection on the video frame to be encoded, the pixel values of the edge pixels of objects in the encoded video frame can be obtained. For example, if the image in the video to be encoded is an image of an apple, the pixel values of the apple's edge pixels can be obtained.
[0113] In step S302, if the absolute value of the difference between the pixel value of an edge pixel and the pixel value of a non-edge pixel adjacent to the edge pixel is greater than a first preset threshold, the edge pixel is designated as a strong edge pixel.
[0114] The first preset threshold can be set according to actual needs or experience. For different video frames to be encoded, the first preset threshold can be the same or different.
[0115] like Figure 4 The diagram shown is a schematic representation of strong edge pixels and non-strong edge pixels provided in an embodiment of the present invention. Figure 4 In the diagram, A represents a non-strong edge pixel, and B represents a strong edge pixel.
[0116] Step S303: When the proportion of strong edge pixels in the video frame to be encoded to all edge pixels is greater than the second preset threshold, mark the video frame to be encoded with high edge video frame identification information.
[0117] The second preset threshold can be set according to actual needs or experience, for example, to 85%, 90%, etc. As an example, the high-edge video frame identification information for the video frame to be encoded can be Flag=1.
[0118] Step S304: If the proportion of strong edge pixels in the video frame to be encoded to all edge pixels is less than or equal to the second preset threshold, identify the video frame to be encoded as a non-high edge video frame.
[0119] As an example, the identification information for non-high-edge video frames to be encoded can be Flag=0.
[0120] In this embodiment of the invention, edge detection is performed on the video frame to be encoded to obtain the pixel values of edge pixels. Based on a first preset threshold, strong edge pixels are obtained among the edge pixels. Then, based on whether the proportion of strong edge pixels to all edge pixels is greater than a second preset threshold, the video frame to be encoded is marked with either high-edge video frame identification information or non-high-edge video frame identification information. Using the high-edge or non-high-edge video frame identification information for the video frame to be encoded facilitates the generation of corresponding candidate intra-frame prediction modes based on the identification information of the video frame to be encoded in subsequent intra-frame prediction processes.
[0121] Figure 5 A flowchart for obtaining mode selection identifier information provided in an embodiment of the present invention, such as... Figure 5 As shown, the video frames to be encoded are analyzed before encoding. An edge strength detection algorithm is used to detect whether the video frame to be encoded is a high-edge video frame. If it is, the high-edge video frame flag is set to 1; otherwise, the non-high-edge video frame flag is set to 0.
[0122] In one possible implementation, the preset intra-frame prediction mode is a block-based incremental pulse decoding modulation (BDPCM) mode, and the other intra-frame prediction modes include DC mode, planar mode, and angle mode.
[0123] BDPCM modes include horizontal BDPCM and vertical BDPCM. When the preset intra-frame prediction mode is BDPCM, the candidate intra-frame prediction mode can be determined based on the mode selection identifier information corresponding to the video frame to be encoded. For example, when the mode selection identifier information corresponding to the video frame to be encoded is a high-edge video frame identifier, the candidate intra-frame prediction mode includes BDPCM; when the mode selection identifier information corresponding to the video frame to be encoded is a non-high-edge video frame identifier, the candidate intra-frame prediction mode does not include BDPCM.
[0124] The BDPCM mode performs better on high-edge video frames than on non-high-edge video frames. This is because high-edge video frames contain more high-frequency signals, and transforming them does not reduce information content; in fact, it may even increase information content, thus failing to improve compression ratio. The BDPCM mode, however, skips the transformation process and directly quantizes and entropy-encodes the spatial signal. Therefore, the BDPCM mode performs better on high-edge video frames.
[0125] Because BDPCM mode performs better in predicting high-edge video frames than in predicting non-high-edge video frames, the video frames to be encoded are analyzed before encoding. These frames are divided into high-edge and non-high-edge frames. BDPCM mode is enabled for high-edge frames and disabled for non-high-edge frames. See [link to details] for further information. Figure 6 , Figure 6 The flowchart of the algorithm for selecting the target intra-frame prediction mode provided in the embodiments of the present invention is as follows: Figure 6 As shown, for each coded block in the video frame to be encoded, the predicted pixel values of the coded blocks corresponding to the three intra-frame prediction modes are calculated sequentially using DC mode, planar PLANAR mode, and angle mode. Then, it is determined whether the value of the flag Flag (equivalent to the above mode selection flag information) corresponding to the video frame to which the current coded block belongs is 1 (equivalent to determining whether the video frame to which the current coded block belongs is a high-edge video frame). If so, the predicted pixel values of the coded blocks are calculated again using the block-based incremental pulse decoding modulation (BDPCM) mode. Based on the predicted pixel values of the coded blocks corresponding to DC mode, PLANAR mode, angle mode, and BDPCM mode, the target intra-frame prediction mode is selected. If not, the target intra-frame prediction mode is selected based on the predicted pixel values of the coded blocks corresponding to DC mode, PLANAR mode, and angle mode. The process ends with END, which is the result of obtaining the target intra-frame prediction mode. Figure 6The execution process shown is for illustrative purposes only. This invention does not limit the execution order of different intra-frame prediction modes. Different intra-frame prediction modes can be executed in any order.
[0126] To facilitate understanding of the intra-frame prediction method provided by this invention when the preset intra-frame mode is BDPCM mode, the principle of BDPCM mode is explained below:
[0127] VVC video coding supports BDPCM intra-frame prediction mode. At the sequence level of the video frame to be encoded, the BDPCM enable switch is marked in the Sequence Parameter Set (SPS); this flag is only marked when the Transform Skip (TS) tool is turned on.
[0128] When BDPCM is enabled, if the CU size is less than or equal to the maximum transform skip mode size (MaxTsSize × MaxTsSize), and the CU is an intra-predictive single-coded block, a flag will be transmitted at the CU level. MaxTsSize is the maximum CU block allowed by the TS tool. This flag indicates whether the current block uses regular intra-predictive mode or BDPCM mode. If it is BDPCM mode, a BDPCM prediction direction symbol will be transmitted to indicate whether the current block uses horizontal or vertical prediction. Then, the block will perform regular horizontal or vertical intra-predictive using unfiltered reference pixels. The residual pixel values are quantized, and the difference between the quantized residual pixel values and the predicted pixel values is encoded.
[0129] For a coded block of size M (height) × N (width), r i, Let ,0≤i≤M-1,0≤j≤N-1 be the prediction residual of the i-th row and j-th column. Q(r) i, ), 0≤i≤M-1, 0≤j≤N-1 are the quantized residuals r i,j That is, for the predicted residual r i,j The quantized value is then applied. BDPCM is applied to the quantized residual to obtain a modified M×N matrix. The elements are It is predicted by the residual pixel values of adjacent quantized pixels, i.e. The predictions were obtained using the BDPCM prediction model. For the vertical BDPCM prediction model, 0 ≤ j ≤ (N-1).
[0130]
[0131] For horizontal BDPCM prediction patterns, 0 ≤ i ≤ (M-1)
[0132]
[0133] At the decoding end, the reverse process described above is used to calculate Q(r). i,j ), 0≤i≤M-1, 0≤j≤N-1,
[0134] Vertical BDPCM
[0135] Horizontal BDPCM
[0136] The residual Q after dequantization -1 (Q(r i, The reconstructed pixels are obtained by adding the intra-frame predicted values to the original values.
[0137] Predicted quantized residual values The residual pixel values are transmitted to the decoder. The same residual coding process as in TS mode is used. For lossless coding, if `slice_ts_residual_coding_disabled_flag` is set to 1, the quantized residual pixel values are transmitted to the decoder using regular variational residual coding. For multi-processing module (MPM) mode, the horizontal or vertical prediction mode is stored if the BDPCM prediction direction is the corresponding horizontal or vertical mode. For deblocking filtering, if adjacent blocks at a boundary are all encoded using BDPCM, then that boundary is not filtered.
[0138] The algorithm for selecting the target intra-frame prediction mode provided in this embodiment of the invention can increase the encoder's encoding speed by 1.06 times compared to not using this algorithm, while the encoding loss efficiency is small. With Peak Signal-to-Noise Ratio (PSNR) alignment, the bitrate increases by only 0.03%, and with Structural Similarity (SSIM) alignment, the bitrate increases by only 0.012%. The cost-effectiveness ratio (CP-PSNR) of this algorithm under the PSNR metric is calculated as: (speedup ratio - 1) × 100 / bdrate - psnr, where bdrate - psnr represents the bitrate change of the video encoded by this algorithm under the PSNR metric. Substituting the data into the formula, we get: (1.06 - 1) × 100 / 0.03 = 200. The cost-effectiveness ratio (CP-SSIM) of this algorithm under the SSIM metric is calculated as follows: (Speedup ratio -1×100 / bdrate-ssim, where bdrate-ssim represents the bitrate change of the video encoded by the algorithm under the SSIM index. Substituting the data into the formula, we get: (1.06-1)×100 / 0.012=50.
[0139] In related technologies, selecting a target intra-prediction mode from all intra-prediction modes involves predicting the coded block using each intra-prediction mode separately, and finally obtaining the target intra-prediction mode through rate distortion optimization (RDO).
[0140] In this embodiment of the invention, the preset intra-frame prediction mode is BDPCM mode. Using the algorithm for selecting the target intra-frame prediction mode provided in this embodiment of the invention, when the video frame to be encoded to which the current coding block belongs is not a high-edge video frame, it is only necessary to traverse DC mode, PLANAR mode, and angle mode to select the target intra-frame prediction mode, which can effectively reduce the time consumption of intra-frame prediction and reduce the complexity of intra-frame prediction.
[0141] In one possible implementation, such as Figure 7 As shown, selecting a target intra prediction mode from other intra prediction modes that do not include a preset intra prediction mode to perform intra prediction on a coded block includes the following steps:
[0142] Step S701: For each intra-prediction mode in other intra-prediction modes, calculate the predicted pixel value of the coding block in the video frame to be encoded corresponding to the intra-prediction mode, and obtain multiple predicted pixel values.
[0143] Step S702: Calculate the rate-distortion cost corresponding to the intra-frame prediction mode based on multiple predicted pixel values.
[0144] Step S703: Select the intra prediction mode with the lowest rate-distortion cost among other intra prediction modes as the target intra prediction mode, and use the target intra prediction mode to perform intra prediction on the coded block.
[0145] Specifically, step S701 may include the following steps:
[0146] Step A: Obtain the adjacent reference pixels of the coded block in the video frame to be encoded.
[0147] refer to Figure 8 This is a schematic diagram of the reference pixels of the current coding block in the video frame to be encoded, such as... Figure 8As shown in the diagram on the left, the current coding block size is NxN, where N is an integer greater than 1. The reference pixels of the coding block can be divided into 5 parts according to the region: lower left (equivalent to p[-1][2N-1] in the diagram), left side (equivalent to p[-1][N-1] in the diagram), upper left (equivalent to p[-1][-1] in the diagram), upper top (equivalent to p[0][-1] in the diagram), and upper right (equivalent to p[2N-1][-1] in the diagram), for a total of 4xN+1 points. In the diagram, A, B, C, and D represent the reference pixels of the left region, and E, F, G, and H represent the reference pixels of the upper region, respectively. In some cases, adjacent reference pixels may not exist or may be unavailable. For example, the current CU may be located at the image boundary, slice boundary, tile boundary, or the coding block in the lower left or upper right region may not have been encoded yet. When adjacent reference pixels are missing or unavailable, the nearest neighboring pixel can be used to fill the gap. For example, if the reference pixel in the lower left corner is missing, all reference pixels in the lower left area can be filled using the bottommost pixel in the left area. Figure 8 In the diagram on the right, fill the lower left area with A; if the reference pixel in the upper right area does not exist, the rightmost pixel in the upper area can be used to fill it. Figure 8 The diagram on the right side of the image shows the upper right area filled with the letter H.
[0148] If all adjacent reference pixels are available, all reference pixels are filled with fixed values. For example, for 8-bit pixels, the predicted pixel value of the coded block is 128, and for 10-bit pixels, the predicted pixel value of the coded block is 512.
[0149] Step B involves filtering the adjacent reference pixels to obtain the filtered adjacent reference pixels.
[0150] When filtering adjacent reference pixels, a preset filtering algorithm can be used, such as using a Gaussian interpolation filter or a 1:2:1 filter.
[0151] Step C: Based on the filtered adjacent reference pixels and each intra-prediction mode in other intra-prediction modes, calculate the predicted pixel value of the coding block in the video frame to be encoded corresponding to the intra-prediction mode, and obtain multiple predicted pixel values.
[0152] Different calculation methods can be used to obtain the predicted pixel values of the coded block for different intra-frame prediction modes. For DC prediction mode, all predicted pixel values use the same value, which is generated by averaging the pixel values of the neighboring reference pixels to the left and above.
[0153] For angle mode, refer to Figure 9 The angular pattern diagram shown can be used to obtain the predicted pixel values of the coded block. Figure 9The angle prediction modes shown are based on HEVC's angle prediction modes. There are a total of 33 angle prediction directions. Modes numbered 2 to 17 are horizontal modes, modes numbered 18 to 34 are vertical modes, mode number 10 is a horizontal prediction mode, and mode number 26 is a vertical prediction mode. During the specific intra-frame prediction process, based on the selected intra-frame prediction mode... Figure 9 The diagram on the right takes the angle prediction mode numbered 29 as an example. By using the "projected pixel" method, the encoded reference pixels that are needed are mapped to the current coding block, which is transformed into a one-dimensional form to obtain the predicted pixel value of the coding block.
[0154] For BDPCM mode, the predicted pixel values of the coding block can be obtained by using horizontal BDPCM mode and vertical BDPCM mode. Horizontal BDPCM mode predicts the coding block in the horizontal direction, while vertical BDPCM mode predicts the coding block in the vertical direction.
[0155] In step S702, the rate-distortion cost (RD cost) can be calculated using the formula J = D + Lambda × R. J represents the rate-distortion cost, D represents the degree of distortion, i.e., the degree of difference between the received short signal and the source signal, Lambda is the Lagrange parameter, and R is the bit rate.
[0156] In step S703, the predicted pixel value of the coding block corresponding to the intra-frame prediction mode is used as the predicted pixel value of the coding block.
[0157] In this embodiment of the invention, the target intra-prediction mode is selected only from other intra-prediction modes that do not include the preset intra-prediction mode. The intra-prediction mode with the lowest rate-distortion cost is selected as the target intra-prediction mode. Calculating the rate-distortion cost requires first calculating the predicted pixel value of the coding block corresponding to the intra-prediction mode, and then calculating the rate-distortion cost based on the predicted pixel value. That is, calculating the rate-distortion cost is a relatively complex process. In this embodiment of the invention, only the rate-distortion cost corresponding to other intra-prediction modes that do not include the preset intra-prediction mode needs to be calculated, without having to calculate the rate-distortion cost corresponding to the preset intra-prediction mode. Compared with related technologies, which require calculating all intra-prediction modes including the preset intra-prediction mode and other intra-prediction modes, this reduces computational costs, reduces the time consumed by intra-prediction, and further makes the intra-prediction process more convenient.
[0158] Figure 10 This is a schematic diagram of an intra-frame prediction device provided in an embodiment of the present invention, with reference to... Figure 10 The device includes:
[0159] The first acquisition module 1001 is used to acquire the encoding block to be encoded, wherein the encoding block is the encoding block corresponding to the video frame to be encoded;
[0160] The second acquisition module 1002 is used to acquire the mode selection identifier information corresponding to the video frame to be encoded. The mode selection identifier information is used to identify whether a preset intra-frame prediction mode is selected during the intra-frame prediction of the coding block in the video frame to be encoded.
[0161] The first prediction module 1003 is used to select a target intra-prediction mode from other intra-prediction modes that do not include the preset intra-prediction mode to perform intra-prediction on the coded block when the mode selection identification information indicates that no preset intra-prediction mode is selected during the intra-prediction of the coded block in the video frame to be encoded.
[0162] In this embodiment of the invention, a coding block to be encoded is obtained, which is the coding block corresponding to the video frame to be encoded; mode selection identification information corresponding to the video frame to be encoded is obtained, which is used to identify whether a preset intra-prediction mode is selected during the intra-frame prediction process of the coding block in the video frame to be encoded; when the mode selection identification information indicates that the preset intra-frame prediction mode is not selected during the intra-frame prediction process of the coding block in the video frame to be encoded, an intra-frame prediction mode to be used is selected from other intra-frame prediction modes that do not include the preset intra-frame prediction mode to perform intra-frame prediction on the coding block. In this embodiment of the invention, before performing intra-frame prediction on the coded blocks in the video frame to be encoded, the mode selection identifier information corresponding to the video frame to be encoded to which the coded block belongs is first obtained. If the mode selection identifier information indicates that a preset intra-frame prediction mode is not selected during the intra-frame prediction process of the coded blocks in the video frame to be encoded, the target intra-frame prediction mode is selected from other intra-frame prediction modes that do not include the preset intra-frame prediction mode to perform intra-frame prediction on the coded blocks. Compared with related technologies, which select the target intra-frame prediction mode from all intra-frame prediction modes that include the preset intra-frame prediction mode and other intra-frame prediction modes to perform intra-frame prediction on the coded blocks, the complexity of intra-frame prediction can be reduced.
[0163] In one possible implementation, the mode selection identification information includes high-edge video frame identification information and non-high-edge video frame identification information. The high-edge video frame identification information is used to identify that a preset intra-prediction mode is selected during the intra-prediction process of the coding block in the video frame to be encoded, and the non-high-edge video frame identification information is used to identify that a preset intra-prediction mode is not selected during the intra-prediction process of the coding block in the video frame to be encoded.
[0164] In one possible implementation, before acquiring the mode selection identifier information corresponding to the video frame to be encoded, the apparatus further includes:
[0165] An edge detection module is used to perform edge detection on the video frame to be encoded using an edge detection algorithm to obtain the pixel values of the edge pixels of the video frame to be encoded; wherein, pixels other than the edge pixels are non-edge pixels;
[0166] A strong edge pixel generation module is used to identify an edge pixel as a strong edge pixel when the absolute value of the difference between the pixel value of the edge pixel and the pixel value of the non-edge pixel adjacent to the edge pixel is greater than a first preset threshold.
[0167] The first identification module is used to identify high edge video frame identification information for the video frame to be encoded when the proportion of strong edge pixels in the video frame to be encoded to all edge pixels is greater than a second preset threshold.
[0168] The second identification module is used to identify non-high-edge video frame identification information for the video frame to be encoded when the proportion of strong edge pixels in the video frame to be encoded to all edge pixels is less than or equal to a second preset threshold.
[0169] In one possible implementation, after obtaining the mode selection identifier information corresponding to the video frame to be encoded, the apparatus further includes:
[0170] The second prediction module is used to select a target intra-prediction mode from a variety of intra-prediction modes that include the preset intra-prediction mode when the mode selection identification information indicates that a preset intra-prediction mode is selected during the intra-prediction process of the coding block in the video frame to be encoded.
[0171] In one possible implementation, the preset intra-frame prediction mode is a block-based incremental pulse decoding modulation (BDPCM) mode, and the other intra-frame prediction modes include DC mode, planar mode, and angle mode.
[0172] In one possible implementation, the first prediction module is specifically configured to, for each of the other intra-prediction modes, calculate the predicted pixel value of the coding block in the video frame to be encoded corresponding to the intra-prediction mode, thereby obtaining multiple predicted pixel values; calculate the rate-distortion cost corresponding to the intra-prediction mode based on the multiple predicted pixel values; select the intra-prediction mode with the smallest rate-distortion cost among the other intra-prediction modes as the target intra-prediction mode, and use the target intra-prediction mode to perform intra-prediction on the coding block.
[0173] This invention also provides an electronic device, such as... Figure 11As shown, it includes a processor 1101, a communication interface 1102, a memory 1103, and a communication bus 1104. The processor 1101, communication interface 1102, and memory 1103 communicate with each other via the communication bus 1104.
[0174] Memory 1103 is used to store computer programs;
[0175] The processor 1101, when executing the program stored in the memory 1103, implements the method steps of any of the above-described intra-frame prediction methods.
[0176] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0177] The communication interface is used for communication between the aforementioned terminal and other devices.
[0178] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0179] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0180] In another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements any of the intra-frame prediction methods described in the above embodiments.
[0181] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the intra-frame prediction methods described in the above embodiments.
[0182] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0183] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0184] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, electronic devices, storage media, and computer program products are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0185] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. An intra-frame prediction method, characterized in that, The method includes: Obtain the encoding block to be encoded, wherein the encoding block is the encoding block corresponding to the video frame to be encoded; Obtain the mode selection identifier information corresponding to the video frame to be encoded. The mode selection identifier information is used to identify whether a preset intra-frame prediction mode is selected during the intra-frame prediction of the coding block in the video frame to be encoded. If the mode selection identification information indicates that no preset intra-prediction mode is selected during the intra-prediction of the coding block in the video frame to be encoded, a target intra-prediction mode is selected from other intra-prediction modes that do not include the preset intra-prediction mode to perform intra-prediction of the coding block. The mode selection identification information includes high-edge video frame identification information and non-high-edge video frame identification information. The high-edge video frame identification information is used to identify that a preset intra-prediction mode is selected during the intra-prediction process of the coding block in the video frame to be encoded. The non-high-edge video frame identification information is used to identify that a preset intra-prediction mode is not selected during the intra-prediction process of the coding block in the video frame to be encoded. The preset intra-frame prediction mode is a block-based incremental pulse decoding modulation (BDPCM) mode, and the other intra-frame prediction modes include DC mode, planar mode, and angle mode.
2. The method according to claim 1, characterized in that, Before obtaining the mode selection identifier information corresponding to the video frame to be encoded, the method further includes: An edge detection algorithm is used to perform edge detection on the video frame to be encoded to obtain the pixel values of the edge pixels of the video frame to be encoded; wherein, pixels other than the edge pixels are non-edge pixels; If the absolute value of the difference between the pixel value of the edge pixel and the pixel value of the non-edge pixel adjacent to the edge pixel is greater than a first preset threshold, the edge pixel is regarded as a strong edge pixel. If the proportion of strong edge pixels in the video frame to be encoded to all edge pixels is greater than a second preset threshold, the video frame to be encoded is marked with high edge video frame identification information. If the proportion of strong edge pixels in the video frame to be encoded to all edge pixels is less than or equal to a second preset threshold, the video frame to be encoded is marked with non-high edge video frame identification information.
3. The method according to claim 1, characterized in that, After obtaining the mode selection identifier information corresponding to the video frame to be encoded, the method further includes: When the mode selection identifier indicates that a preset intra-prediction mode is selected during the intra-prediction process of the coded block in the video frame to be encoded, a target intra-prediction mode is selected from a variety of intra-prediction modes including the preset intra-prediction mode to perform intra-prediction on the coded block.
4. The method according to any one of claims 1 to 3, characterized in that, Selecting a target intra-prediction mode from other intra-prediction modes that do not include the preset intra-prediction mode to perform intra-prediction on the coding block includes: For each intra-prediction mode in other intra-prediction modes, the predicted pixel value of the coding block in the video frame to be encoded corresponding to the intra-prediction mode is calculated to obtain multiple predicted pixel values. Based on the multiple predicted pixel values, the rate-distortion cost corresponding to the intra-frame prediction mode is calculated respectively. The intra-prediction mode with the lowest rate-distortion cost among the other intra-prediction modes is selected as the target intra-prediction mode, and the target intra-prediction mode is used to perform intra-prediction on the coding block.
5. An intra-frame prediction device, characterized in that, The device includes: The first acquisition module is used to acquire the encoding block to be encoded, wherein the encoding block is the encoding block corresponding to the video frame to be encoded; The second acquisition module is used to acquire the mode selection identifier information corresponding to the video frame to be encoded. The mode selection identifier information is used to identify whether a preset intra-frame prediction mode is selected during the intra-frame prediction of the coding block in the video frame to be encoded. The first prediction module is used to select a target intra-prediction mode from other intra-prediction modes that do not include the preset intra-prediction mode to perform intra-prediction on the coding block in the video frame to be encoded when the mode selection identification information indicates that no preset intra-prediction mode is selected during the intra-prediction of the coding block in the video frame to be encoded. The mode selection identification information includes high-edge video frame identification information and non-high-edge video frame identification information. The high-edge video frame identification information is used to identify that a preset intra-prediction mode is selected during the intra-prediction process of the coding block in the video frame to be encoded. The non-high-edge video frame identification information is used to identify that a preset intra-prediction mode is not selected during the intra-prediction process of the coding block in the video frame to be encoded. The preset intra-frame prediction mode is a block-based incremental pulse decoding modulation (BDPCM) mode, and the other intra-frame prediction modes include DC mode, planar mode, and angle mode.
6. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-4.
Citation Information
Patent Citations
Disabling intra prediction filtering
CN105379266A
Fast inter-frame predictive coding method in video coding
CN110351557A