Intra Prediction Method, Apparatus, Electronic Device, and Storage Medium

By determining the intra prediction mode of the target image block and the compensation mode of the reference pixel in video encoding, the problem that the reference pixel distortion affects the prediction accuracy is solved, and the accuracy of intra prediction and video encoding efficiency are improved.

CN115086679BActive Publication Date: 2025-07-04BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210642288.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-08
Publication Date
2025-07-04
Estimated Expiration
2042-06-08

AI Technical Summary

Technical Problem

In the existing video encoding technology, distortion of the reference pixel will affect the prediction accuracy of subsequent unencoded image blocks, resulting in inaccurate prediction results.

Method used

By determining the intra prediction mode and reference pixel of the target image block, reconstructed and original pixel values ​​are obtained, residual information is calculated, compensation mode is determined, and reference pixels are compensated to reduce their distortion and improve prediction accuracy.

Benefits of technology

By compensating the reference pixels, their distortion is reduced, the accuracy of intra prediction results is improved, and the quality and efficiency of video encoding are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115086679B_ABST
    Figure CN115086679B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an intra prediction method, apparatus, electronic device, and storage medium. The method includes: determining a target intra prediction mode and reference pixels for a target image block in a video frame; obtaining reconstructed pixel values of the target image block in the target intra prediction mode, and predicting first residual information of other image blocks through the reconstructed pixel values of the target image block; predicting second residual information of other image blocks through the original pixel values of the target image block; determining a compensation mode for the reference pixels in the target image block based on the first residual information, the second residual information, the original pixel values and the reconstructed pixel values of the reference pixels; compensating the pixel values of the reference pixels according to the compensation mode, and performing intra prediction on other image blocks affected by the target image block based on the compensated pixel values of the reference pixels. This method compensates the pixel values of the reference pixels to reduce the distortion of the reference pixels, thereby improving the accuracy of the intra prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of video coding technologies, and in particular, to an intra-frame prediction method, apparatus, electronic device, storage medium, and program product. Background Art

[0002] Video coding refers to the technology of converting one video format into another. The purpose of video coding is to compress video data, reduce the amount of data, and meet the requirements of storage and transmission. Intra-frame prediction is a main prediction method in existing coding standards. By dividing each frame image of a video into square image blocks of a fixed size as the basic unit, the reconstructed pixels in the already encoded image blocks in the current frame are used to predict the yet-to-be-encoded image blocks.

[0003] However, since the video coding process compresses and quantizes the video, discarding some unnecessary data that has little impact on the reconstruction quality, there will be varying degrees of distortion in the reconstructed pixels of the already encoded image blocks. Since the subsequent yet-to-be-encoded image blocks will use the reconstructed pixels in the already encoded image blocks as reference pixels for predicting the current yet-to-be-encoded image blocks, the degree of distortion of the reference pixels will affect the prediction accuracy of the subsequent yet-to-be-encoded image blocks, thereby reducing the accuracy of the intra-frame prediction results. Summary of the Invention

[0004] The present disclosure provides an intra-frame prediction method, apparatus, electronic device, storage medium, and program product to at least solve the problem that the degree of distortion of reference pixels in related technologies affects the prediction accuracy of subsequent yet-to-be-encoded image blocks, thereby reducing the accuracy of the intra-frame prediction results. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, an intra-frame prediction method is provided, including:

[0006] Determine a target intra-frame prediction mode and reference pixels for a target image block in a video frame; the target image block is any one of multiple image blocks obtained by dividing the video frame, the reference pixels represent the pixels in the target image block that affect the intra-frame prediction results of other image blocks, and the other image blocks represent the image blocks adjacent to the target image block and whose pixel values are affected by the target image block;

[0007] Obtain the reconstructed pixel values of the target image block in the target intra-frame prediction mode, and predict the first residual information of the other image blocks through the reconstructed pixel values of the target image block;

[0008] Predict the second residual information of the other image blocks through the original pixel values of the target image block;

[0009] Determine a compensation mode for a reference pixel in the target image block based on the first residual information, the second residual information, the original pixel value of the reference pixel, and the reconstructed pixel value of the reference pixel;

[0010] Compensate the pixel value of the reference pixel according to the compensation mode, and perform intra prediction on other image blocks affected by the target image block based on the compensated reference pixel value.

[0011] In an exemplary embodiment, the obtaining the first residual information of the other image blocks by predicting through the reconstructed pixel value of the target image block includes:

[0012] Perform intra prediction on the other image blocks through the reconstructed pixel value of the target image block to obtain the first predicted pixel value of the other image blocks;

[0013] Obtain the first residual information of the other image blocks based on the first predicted pixel value and the original pixel value of the other image blocks.

[0014] In an exemplary embodiment, the obtaining the second residual information of the other image blocks by predicting through the original pixel value of the target image block includes:

[0015] Perform intra prediction on the other image blocks through the original pixel value of the target image block to obtain the second predicted pixel value of the other image blocks;

[0016] Obtain the second residual information of the other image blocks based on the second predicted pixel value and the original pixel value of the other image blocks.

[0017] In an exemplary embodiment, the determining a compensation mode for a reference pixel in the target image block based on the first residual information, the second residual information, the original pixel value of the reference pixel, and the reconstructed pixel value of the reference pixel includes:

[0018] Subtract the second residual information from the first residual information to obtain a first generation value for the other image blocks, and subtract the reconstructed pixel value of the reference pixel from the original pixel value of the reference pixel to obtain a second generation value for the reference pixel;

[0019] Determine a compensation mode for a reference pixel in the target image block based on the first generation value for the other image blocks and the second generation value for the reference pixel.

[0020] In an exemplary embodiment, the reference pixel includes the rightmost pixel column and the bottommost pixel row of the target image block, and the other image blocks include the right image block of the target image block and the bottom image block of the target image block;

[0021] Determining a compensation mode for a reference pixel in the target image block based on a first-generation value for the other image block and a second-generation value for the reference pixel includes:

[0022] Obtaining a first-generation value of the right image block, a first-generation value of the bottom image block, a second-generation value of the rightmost pixel column, and a second-generation value of the bottommost pixel row;

[0023] When the first-generation value of the right image block is greater than a first threshold and the second-generation value of the rightmost pixel column is greater than a second threshold, determining the compensation mode for the reference pixel as a right compensation mode;

[0024] When the first-generation value of the bottom image block is greater than a first threshold and the second-generation value of the bottommost pixel row is greater than a second threshold, determining the compensation mode for the reference pixel as a bottom compensation mode;

[0025] When the first-generation values of both the right image block and the bottom image block are greater than a first threshold and the second-generation values of both the rightmost pixel column and the bottommost pixel row are greater than a second threshold, determining the compensation mode for the reference pixel as a bilateral compensation mode; the bilateral compensation mode includes the right compensation mode and the bottom compensation mode.

[0026] In an exemplary embodiment, the subtracting the first residual information from the second residual information to obtain a first-generation value for the other image block includes:

[0027] Subtracting the first residual information from the second residual information to obtain a first initial-generation value for the other image block;

[0028] Obtaining a weight value for the reference pixel; the weight value characterizes the influence degree of the reference pixel on the intra-frame prediction result of the other image block;

[0029] Performing a weighting process on the first initial-generation value by the weight value to obtain a first-generation value for the other image block.

[0030] In an exemplary embodiment, the obtaining a weight value for the reference pixel includes:

[0031] Performing texture detection on the other image block to obtain a texture direction of the other image block;

[0032] Determining a weight value for the reference pixel based on an angle corresponding to the texture direction.

[0033] In an exemplary embodiment, determining a compensation mode for a reference pixel in the target image block based on the first residual information, the second residual information, the original pixel value of the reference pixel, and the reconstructed pixel value of the reference pixel further includes:

[0034] Predicting third residual information of the target image block through the original pixel value of the video frame;

[0035] When it is determined that the first residual information, the second residual information, the third residual information, the original pixel value of the reference pixel, and the reconstructed pixel value of the reference pixel do not meet a preset compensation condition, determining that the compensation mode for the reference pixel is non-compensation.

[0036] In an exemplary embodiment, compensating the pixel value of the reference pixel according to the compensation mode includes:

[0037] According to the compensation mode, determining a compensation value calculation relation for the reference pixel, and based on the compensation value calculation relation, determining a compensated pixel value for the reference pixel;

[0038] Compensating the pixel value of the reference pixel based on the compensated pixel value.

[0039] In an exemplary embodiment, determining a target intra prediction mode for a target image block in a video frame includes:

[0040] Determining rate-distortion cost values of the target image block under multiple candidate intra prediction modes through a rate-distortion cost estimation model; the rate-distortion cost estimation model includes a first cost estimation unit for other image blocks and a second cost estimation unit for reference pixels in the target image block;

[0041] Determining the candidate intra prediction mode corresponding to the rate-distortion cost value with the smallest value in the rate-distortion cost values as the target intra prediction mode.

[0042] According to a second aspect of the embodiments of the present disclosure, there is provided an intra prediction device, including:

[0043] A prediction mode determination unit configured to determine a target intra prediction mode and reference pixels for a target image block in a video frame; the target image block is any one of multiple image blocks obtained by dividing the video frame, the reference pixel represents a pixel in the target image block that affects the intra prediction result of other image blocks, and the other image blocks represent image blocks adjacent to the target image block and whose pixel values are affected by the target image block;

[0044] The first residual obtaining unit is configured to obtain the reconstructed pixel values obtained by the target image block in the intra-prediction mode within the target frame, and predict the first residual information of the other image blocks through the reconstructed pixel values of the target image block;

[0045] The second residual obtaining unit is configured to predict the second residual information of the other image blocks through the original pixel values of the target image block;

[0046] The compensation mode determining unit is configured to determine a compensation mode for the reference pixels in the target image block based on the first residual information, the second residual information, the original pixel values of the reference pixels, and the reconstructed pixel values of the reference pixels;

[0047] The intra-prediction unit is configured to compensate the pixel values of the reference pixels according to the compensation mode, and perform intra-prediction on the other image blocks affected by the target image block based on the compensated reference pixel values.

[0048] In an exemplary embodiment, the first residual obtaining unit is specifically configured to perform intra-prediction on the other image blocks through the reconstructed pixel values of the target image block to obtain the first predicted pixel values of the other image blocks; based on the first predicted pixel values and the original pixel values of the other image blocks, obtain the first residual information of the other image blocks.

[0049] In an exemplary embodiment, the second residual obtaining unit is specifically configured to perform intra-prediction on the other image blocks through the original pixel values of the target image block to obtain the second predicted pixel values of the other image blocks; based on the second predicted pixel values and the original pixel values of the other image blocks, obtain the second residual information of the other image blocks.

[0050] In an exemplary embodiment, the compensation mode determining unit is specifically configured to subtract the first residual information from the second residual information to obtain a first generation value for the other image blocks, and subtract the original pixel value of the reference pixel from the reconstructed pixel value of the reference pixel to obtain a second generation value for the reference pixel; based on the first generation value for the other image blocks and the second generation value for the reference pixel, determine a compensation mode for the reference pixels in the target image block.

[0051] In an exemplary embodiment, the reference pixel includes the rightmost pixel column and the bottommost pixel row of the target image block, and the other image blocks include the right image block and the bottom image block of the target image block; the compensation mode determination unit is further configured to obtain the first-generation value of the right image block, the first-generation value of the bottom image block, the second-generation value of the rightmost pixel column, and the second-generation value of the bottommost pixel row; in a case where the first-generation value of the right image block is greater than a first threshold and the second-generation value of the rightmost pixel column is greater than a second threshold, determine that the compensation mode for the reference pixel is a right-side compensation mode; in a case where the first-generation value of the bottom image block is greater than the first threshold and the second-generation value of the bottommost pixel row is greater than the second threshold, determine that the compensation mode for the reference pixel is a bottom-side compensation mode; in a case where the first-generation values of both the right image block and the bottom image block are greater than the first threshold and the second-generation values of both the rightmost pixel column and the bottommost pixel row are greater than the second threshold, determine that the compensation mode for the reference pixel is a bilateral compensation mode; the bilateral compensation mode includes the right-side compensation mode and the bottom-side compensation mode.

[0052] In an exemplary embodiment, the compensation mode determination unit is further configured to perform a subtraction of the first residual information and the second residual information to obtain a first initial generation value for the other image block; obtain a weight value for the reference pixel; the weight value characterizes the influence degree of the reference pixel on the intra-frame prediction result of the other image block; perform a weighted process on the first initial generation value by the weight value to obtain a first-generation value for the other image block.

[0053] In an exemplary embodiment, the compensation mode determination unit includes a weight value determination subunit configured to perform a texture detection on the other image block to obtain a texture direction of the other image block; determine a weight value for the reference pixel based on an angle corresponding to the texture direction.

[0054] In an exemplary embodiment, the compensation mode determination unit is further configured to perform a prediction through the original pixel value of the video frame to obtain a third residual information of the target image block; in a case where it is determined that the first residual information, the second residual information, the third residual information, the original pixel value of the reference pixel, and the reconstructed pixel value of the reference pixel do not satisfy a preset compensation condition, determine that the compensation mode for the reference pixel is non-compensation.

[0055] In an exemplary embodiment, the intra prediction unit is specifically configured to execute: determining a compensation value calculation relation for the reference pixels according to the compensation mode, and determining a compensated pixel value for the reference pixels based on the compensation value calculation relation; compensating the pixel value of the reference pixels based on the compensated pixel value.

[0056] In an exemplary embodiment, the prediction mode determination unit is specifically configured to execute: determining rate-distortion cost values of the target image block under multiple candidate intra prediction modes through a rate-distortion cost estimation model; the rate-distortion cost estimation model includes a first cost estimation unit for the other image blocks and a second cost estimation unit for the reference pixels in the target image block; determining the candidate intra prediction mode corresponding to the rate-distortion cost value with the smallest value among the rate-distortion cost values as the target intra prediction mode.

[0057] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including:

[0058] a processor;

[0059] a memory for storing instructions executable by the processor;

[0060] wherein, the processor is configured to execute the instructions to implement the method as described in any one of the above.

[0061] According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, enabling the electronic device to execute the method as described in any one of the above.

[0062] According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, the computer program product includes instructions, when the instructions are executed by a processor of an electronic device, enabling the electronic device to execute the method as described in any one of the above.

[0063] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects:

[0064] This method respectively performs intra prediction on other image blocks through the original pixel values and reconstructed pixel values of the target image block to obtain first residual information and second residual information, determines a compensation mode for the reference pixels in the target image block according to the first residual information, the second residual information, and the original pixel values and reconstructed pixel values of the reference pixels, and then compensates the pixel values of the reference pixels according to the reference mode, so that the pixel values of the reference pixels are closer to the original pixel values, reducing the distortion of the reference pixels, thereby improving the accuracy of the intra prediction result.

[0065] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit the present disclosure. Brief Description of the Drawings

[0066] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure, and do not constitute an undue limitation to the present disclosure.

[0067] FIG. 1(a) is a schematic diagram of image content shown according to an exemplary embodiment.

[0068] FIG. 1(b) is a schematic diagram of intra prediction shown according to an exemplary embodiment.

[0069] Figure 2 is a schematic flowchart of an intra prediction method shown according to an exemplary embodiment.

[0070] Figure 3 is a schematic diagram of 34 candidate intra prediction modes shown according to an exemplary embodiment.

[0071] Figure 4 is a schematic flowchart of an intra prediction method shown according to another exemplary embodiment.

[0072] Figure 5 is an overall flowchart of an intra prediction and coding method based on pattern dependency and reference pixel compensation shown according to an exemplary embodiment.

[0073] Figure 6 is a schematic diagram of a compensation order for compensation according to compensation pixel values shown according to an exemplary embodiment.

[0074] Figure 7 is a block diagram of an intra prediction device shown according to an exemplary embodiment.

[0075] Figure 8 is a block diagram of an electronic device shown according to an exemplary embodiment. Detailed Embodiments

[0076] In order to enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0077] It should be noted that the embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0078] It should be noted that the terms "first", "second", etc. in the specification, claims and above-mentioned drawings of the present disclosure are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described here can be implemented in an order other than those illustrated or described here. It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in the present disclosure are all information and data authorized by the user or fully authorized by all parties.

[0079] In existing coding standards, such as the international standards HEVC (High Efficiency Video Coding) and VVC (Versatile Video Coding), etc., both intra-frame and inter-frame prediction methods are included. Taking the HEVC standard as an example, it still adopts a block-based hybrid coding framework structure. First, each frame image of the video needs to be divided into square image blocks of a fixed size as the basic unit, and each image block is encoded in sequence according to the raster order. The image block first undergoes coding block partitioning, and each coding block uses a reference image for intra-frame / inter-frame prediction. The difference between the predicted block and the original block is the residual block. The generated residual block undergoes transformation and quantization in sequence, and together with the coding mode, is entropy-coded to form a bitstream. The predicted residual generally has a much smaller amplitude than the original pixel value. Therefore, using the coded pixel difference to replace directly coding the original pixel value can greatly improve the coding efficiency. In order to provide a prediction reference for subsequent coding blocks, the quantized residual block will also undergo inverse transformation, inverse quantization, and loop filtering processes to finally generate a reconstructed image. The generated reconstructed image provides a reference for the intra-frame or inter-frame prediction process, and the process of generating the reconstructed image is also part of the decoding process.

[0080] Referring to FIG. 1(a), it is a schematic diagram of intra-frame prediction in an exemplary embodiment. Intra-frame prediction uses the reconstructed pixels of the current frame that have been encoded to predict the image block that has not been encoded, thereby removing the spatial redundancy in the video. And during intra-frame prediction, the positions of the reference pixels used in different intra-frame prediction modes are also different. For example, taking the HEVC standard as an example, in FIG. 1(b), the horizontal mode (mode 10) uses the reconstructed pixels in the left column of the current block as the reference pixels (the pixels in the left slanted shaded part in the following figure), and the vertical mode (mode 26) uses the reconstructed pixels in the upper row of the current block as the reference pixels (the pixels in the upper slanted shaded part in the following figure).

[0081] As can be known from the above encoding method, in lossy video compression, reference pixels usually go through a quantization process, so there will be different degrees of distortion. Since subsequent blocks use the reconstructed pixels of the encoded ones as reference pixels for current block prediction, obviously, the distortion level of the reference pixels will affect the prediction accuracy of the current block.

[0082] To address the above problems, the present disclosure proposes an intra prediction and encoding method based on pattern dependency and reference pixel compensation, using RDO (Rate–Distortion Optimization) to determine and compensate for the distortion of reference pixels, so as to minimize the distortion of reference pixels as much as possible and improve video compression efficiency.

[0083] Reference Figure 2 is a flowchart of an intra prediction method shown according to an exemplary embodiment. In this embodiment, the method is exemplified by being applied to a terminal. It can be understood that the method can also be applied to a server, or to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented by an independent server or a server cluster composed of multiple servers. In this embodiment, the method includes the following steps:

[0084] In step S210, determine the target intra prediction mode and reference pixels for a target image block in a video frame; the target image block is any one of multiple image blocks obtained by dividing the video frame, and the reference pixels represent the pixels in the target image block that affect the intra prediction results of other image blocks, and the other image blocks represent the image blocks adjacent to the target image block and whose pixel values are affected by the target image block.

[0085] Among them, the target intra prediction mode represents the optimal intra prediction mode when the target image block is used as a reference image block, and specifically can be the intra prediction mode with the minimum rate-distortion cost value among multiple intra prediction modes corresponding to the encoder.

[0086] Among them, the reference pixels of the target image block can be understood as the pixels in the target image block used when the target image block is used as a reference image block to perform intra prediction on other image blocks.

[0087] In a specific implementation, referring to FIG. 1(a), when performing intra-frame prediction, it is based on the bottom pixel row or the rightmost pixel column of the reference image block for prediction. Therefore, the reference pixels of the target image block may include the rightmost pixel column and the bottom pixel row in the target image block. When determining the target intra-frame prediction mode of the target image block, first determine the candidate intra-frame prediction modes based on the type of the encoder. For example, if the HEVC encoder is used for encoding, the corresponding candidate intra-frame prediction modes are 35, including the dc mode (a non-directional prediction mode, in which the pixel values of all prediction pixels are equal to the mean value of the pixel values of the reference pixels), the planner mode (a non-directional prediction mode, in which the pixel values of the prediction pixels are obtained by interpolating the reference pixels), and 33 angular prediction modes. Refer to Figure 3 , Figure 3 shows the specific directions of the 33 angular prediction modes. Among them, Figure 3 h and v in Figure 3 respectively represent the horizontal direction and the vertical direction. The prediction directions of the remaining angular prediction modes except h and v, that is,

[0088] v-8, v-7…v+8, h-7, h-6…h+8 in

[0089] can all be regarded as offsets made in the vertical or horizontal direction. Then, calculate the rate-distortion cost values of the target image block in each candidate intra-frame prediction mode through a preset rate-distortion cost estimation model, determine the rate-distortion cost value with the smallest numerical value from each rate-distortion cost value, and determine the candidate intra-frame prediction mode corresponding to the rate-distortion cost value with the smallest numerical value as the target intra-frame prediction mode. Among them, the rate-distortion cost estimation model includes a first cost estimation unit for other image blocks and a second cost estimation unit for the reference pixels in the target image block. Therefore, the rate-distortion cost values in various determined modes also include the first cost value for other image blocks and the second cost value for the reference pixels in the target image block.

[0090] Among them, the reconstructed pixel value represents the pixel value of the reconstructed image generated based on the target image block. Among them, the reconstructed image is generated by performing inverse transformation, inverse quantization, and loop filtering on the quantized residual block corresponding to the target image block in the intra-frame prediction mode of the target frame. The quantized residual block is obtained by performing transformation and quantization on the residual block of the target image block. The residual block of the target image block represents the difference between the predicted image block obtained by performing intra-frame prediction on the target image block in the intra-frame prediction mode of the target frame and the original image block of the target image block.

[0091] In specific implementation, after determining the target image block, perform intra-frame prediction on the target image block in the intra-frame prediction mode of the target frame to obtain a predicted image block. Based on the predicted image block and the original image block of the target image block, obtain a residual block. After performing transformation and quantization on the residual block, obtain a quantized residual block. After performing inverse transformation, inverse quantization, and loop filtering on the quantized residual block, generate the reconstructed image corresponding to the target image block. The pixel value of the pixel point in this reconstructed image represents the reconstructed pixel value obtained by the target image block in the intra-frame prediction mode of the target frame. Further, perform intra-frame prediction on other image blocks through the reconstructed pixel value of the target image block to obtain a first predicted pixel value. Based on the predicted first predicted pixel value and the original pixel value of other image blocks, obtain the first residual of other image blocks, and calculate the SATD value of the first residual as the first residual information of other image blocks.

[0092] In step S230, the second residual information of other image blocks is predicted through the original pixel value of the target image block.

[0093] Among them, the second residual information can be the SATD value of the second residual, and the second residual information represents the residual information between the second predicted pixel value of other image blocks and the original pixel value of other image blocks.

[0094] In specific implementation, perform intra-frame prediction on other image blocks through the original pixel value of the target image block to obtain a second predicted pixel value. Based on the predicted second predicted pixel value and the original pixel value of other image blocks, obtain the second residual of other image blocks, and calculate the SATD value of the second residual as the second residual information of other image blocks.

[0095] In step S240, based on the first residual information, the second residual information, the original pixel value of the reference pixel, and the reconstructed pixel value of the reference pixel, determine the compensation mode for the reference pixel in the target image block.

[0096] Among them, the compensation modes may include a right-side compensation mode, a bottom-side compensation mode, a bilateral compensation mode, and no compensation. The right-side compensation mode means compensating the rightmost pixel column in the target image block. The bottom-side compensation mode means compensating the bottommost pixel row in the target image block. The bilateral compensation mode means that it is necessary to compensate both the rightmost pixel column and the bottommost pixel row in the target image block.

[0097] In specific implementation, based on the first residual information and the second residual information, the first-generation value for other image blocks can be obtained. Based on the original pixel value and the reconstructed pixel value of the reference pixel, the second-generation value for the reference pixel in the target image block can be obtained. Compare the first-generation value, the second-generation value, with a preset compensation condition, and determine the compensation mode for the reference pixel in the target image block according to the comparison result.

[0098] More specifically, when performing intra-frame prediction, it is based on the bottommost pixel row or the rightmost pixel column of the reference image block for prediction. Therefore, the position of the reference pixel in the target image block is the bottommost pixel row or the rightmost pixel column. Correspondingly, other image blocks may include right-side image blocks and bottom-side image blocks. Therefore, both the right-side image blocks and the bottom-side image blocks have their respective corresponding first-generation values, and both the bottommost pixel row and the rightmost pixel column have their respective corresponding second-generation values. When determining the compensation mode for the reference pixel, the compensation mode for the reference pixel in the target image block can be determined based on the first-generation value of the right-side image block, the first-generation value of the bottom-side image block, the second-generation value of the bottommost pixel row, and the second-generation value of the rightmost pixel column.

[0099] In step S250, compensate the pixel value of the reference pixel according to the compensation mode, and perform intra-frame prediction on other image blocks affected by the target image block based on the compensated reference pixel value.

[0100] In specific implementation, different compensation modes correspond to different calculation relationships for compensation values. After determining the compensation mode for the reference pixel in the target image block, according to the calculation relationship corresponding to this compensation mode, determine the compensated pixel value for the reference pixel, and then compensate the pixel value of the target reference pixel according to the compensated pixel value, so that the pixel value of the reference pixel is close to the original pixel of the target image block, and the compensated reference pixel value is obtained. Thus, when performing intra-frame prediction on other image blocks affected by the target image block, intra-frame prediction can be performed based on the compensated reference pixel value.

[0101] In the above intra-frame prediction method, the first residual information and the second residual information are obtained by performing intra-frame prediction on other image blocks through the original pixel values and the reconstructed pixel values of the target image block respectively. According to the first residual information, the second residual information, and the original pixel values and the reconstructed pixel values of the reference pixels, the compensation mode for the reference pixels in the target image block is determined. Then, the pixel values of the reference pixels are compensated according to the reference mode, so that the pixel values of the reference pixels are closer to the original pixel values, reducing the distortion of the reference pixels, thereby improving the accuracy of the intra-frame prediction result.

[0102] In an exemplary embodiment, in step S220, the first residual information of other image blocks is predicted through the reconstructed pixel values of the target image block, and it can be specifically implemented through the following steps:

[0103] Step S2201: Perform intra-frame prediction on other image blocks through the reconstructed pixel values of the target image block to obtain the first predicted pixel values of the other image blocks;

[0104] Step S2202: Based on the first predicted pixel values and the original pixel values of the other image blocks, obtain the first residual information of the other image blocks.

[0105] In a specific implementation, intra-frame prediction is performed on other image blocks through the reconstructed pixel values of the target image block to obtain the first predicted pixel values. The difference between the predicted first predicted pixel values and the original pixel values of the other image blocks is calculated to obtain the first residuals of the other image blocks. Further, the SATD value of the first residuals is calculated as the first residual information of the other image blocks.

[0106] More specifically, since an image block includes multiple pixel points, when calculating the difference between the first predicted pixel values and the original pixel values of the other image blocks, the difference between the first predicted pixel value and the original pixel value of each pixel point in the other image blocks is calculated to obtain the first residual of each pixel point. The first residuals of each pixel point form a residual matrix, denoted as the first residual matrix, which has the same size as the other image blocks. Calculating the SATD value of the first residuals, that is, calculating the SATD value of this first residual matrix, specifically, after performing the Hadamard transform on each pixel point, the transformed residuals of each pixel point are obtained, and the sum of the absolute values of the transformed residuals of each pixel point is calculated to obtain the SATD value of the first residuals.

[0107] In this embodiment, the first residual information of other image blocks is obtained by performing intra-frame prediction on other image blocks through the reconstructed pixel values of the target image block, so as to be combined with the second residual information subsequently to determine the compensation mode for the reference pixels.

[0108] In an exemplary embodiment, in step S230, second residual information of other image blocks is predicted through the original pixel values of a target image block, and specifically, it can be implemented through the following steps:

[0109] Step S2301, perform intra prediction on other image blocks through the original pixel values of the target image block to obtain second predicted pixel values of the other image blocks;

[0110] Step S2302, based on the second predicted pixel values and the original pixel values of the other image blocks, obtain second residual information of the other image blocks.

[0111] In a specific implementation, perform intra prediction on other image blocks through the original pixel values of the target image block to obtain second predicted pixel values, subtract the predicted second predicted pixel values from the original pixel values of the other image blocks to obtain second residuals of the other image blocks, and further calculate the SATD value of the second residuals as second residual information of the other image blocks.

[0112] More specifically, since an image block includes multiple pixel points, when subtracting the second predicted pixel values from the original pixel values of the other image blocks, the second predicted pixel values and the original pixel values of each pixel point in the other image blocks are subtracted to obtain second residuals of each pixel point. The second residuals of each pixel point form a residual matrix, denoted as the second residual matrix, which has the same size as the other image block. Calculate the SATD value of the second residuals, that is, calculate the SATD value of this second residual matrix. Specifically, first perform the Hadamard transform on each pixel point to obtain the changed residuals of each pixel point, and perform a summation process on the absolute values of the changed residuals of each pixel point, that is, obtain the SATD value of the second residuals.

[0113] In this embodiment, perform intra prediction on other image blocks through the original pixel values of the target image block to obtain second residual information of the other image blocks, so as to facilitate subsequent combination with the first residual information to determine a compensation mode for the reference pixel.

[0114] In an exemplary embodiment, in step S240, based on the first residual information, the second residual information, the original pixel value of the reference pixel, and the reconstructed pixel value of the reference pixel, determine a compensation mode for the reference pixel in the target image block, and specifically, it can be implemented through the following steps:

[0115] In step S2401, subtract the first residual information from the second residual information to obtain a first-generation value for the other image blocks, and subtract the original pixel value of the reference pixel from the reconstructed pixel value of the reference pixel to obtain a second-generation value for the reference pixel;

[0116] In step S2402, based on the first-generation value for other image blocks and the second-generation value for reference pixels, determine the compensation mode for the reference pixels in the target image block.

[0117] Among them, the reference pixels include multiple pixel points. Therefore, the second-generation value can be the SAD value (Sum of Absolute Difference) of the reference pixels, that is, the sum of the absolute errors of each pixel point.

[0118] In specific implementation, other image blocks can include the right image block and the bottom image block. Therefore, both the right image block and the bottom image block can calculate the first residual information and the second residual information. The reference pixels in the target image block can include the rightmost pixel column and the bottommost pixel row of the target image block. Therefore, the rightmost pixel column and the bottommost pixel row of the target image block also have the original pixel values and the reconstructed pixel values respectively.

[0119] Furthermore, the first residual information and the second residual information of the right image block can be subtracted to obtain the first-generation value for the right image block, and the first residual information and the second residual information of the bottom image block can be subtracted to obtain the first-generation value for the bottom image block. The original pixel value and the reconstructed pixel value of the rightmost pixel column of the target image block are subtracted to obtain the second-generation value for the rightmost pixel column, and the original pixel value and the reconstructed pixel value of the bottommost pixel row of the target image block are subtracted to obtain the second-generation value for the bottommost pixel row. Based on the first-generation value for the right image block, the first-generation value for the bottom image block, the second-generation value for the rightmost pixel column, and the second-generation value for the bottommost pixel row, determine the compensation mode for the reference pixels in the target image block.

[0120] For example, if the first residual information of the right image block R is denoted as SATD-R 重构 , and the second residual information of the right image block is denoted as SATD-R 原始 , then the first-generation value of the right image block can be expressed as: |SATD-R 重构 - SATD-R 原始 |.

[0121] If the first residual information of the bottom image block B is denoted as SATD-B 重构 , and the second residual information of the bottom image block is denoted as SATD-B 原始 , then the first-generation value of the bottom image block can be expressed as: |SATD-B 重构 - SATD-B 原始 |.

[0122] If the original pixel value of the rightmost pixel column is denoted as Pix-right 原始, the reconstructed pixel value of the rightmost pixel column in the target frame prediction mode is Pix-right 重构 , then the second-generation value of the rightmost pixel column can be expressed as: SAD(Pix-right 原始 -Pix-right 重构 ).

[0123] If the original pixel value of the bottommost pixel row is denoted as Pix-bottow 原始 , and the reconstructed pixel value of the bottommost pixel row in the target frame prediction mode is Pix-bottow 重构 , then the second-generation value of the bottommost pixel row can be expressed as: SAD(Pix-bottow 原始 -Pix-bottow 重构 ).

[0124] It should be noted that the first-generation value and the second-generation value in the present disclosure are used to characterize the deviation degree. Therefore, both the first-generation value and the second-generation value are positive numbers. That is, if the difference between the first residual information and the second residual information of the image block is less than 0, the absolute value of the difference needs to be taken as the first-generation value.

[0125] In this embodiment, by taking the difference between the first residual information and the second residual information of other image blocks, the first-generation value for other image blocks is obtained. By taking the difference between the original pixel value and the reconstructed pixel value of the reference pixel, the second-generation value for the reference pixel is obtained. Finally, based on the first-generation value and the second-generation value, the compensation mode for the reference pixel in the target image block is determined. Considering both the reference pixel and the other image blocks affected by the reference pixel in two dimensions to jointly determine the compensation mode can ensure the accuracy of the determined compensation mode.

[0126] In an exemplary embodiment, the reference pixel includes the rightmost pixel column and the bottommost pixel row of the target image block, and the other image blocks include the right image block and the bottom image block of the target image block; therefore, the first-generation value of the right image block, the first-generation value of the bottom image block, the second-generation value of the rightmost pixel column, and the second-generation value of the bottommost pixel row can be obtained; then in step S2402 above, based on the first-generation value for other image blocks and the second-generation value for the reference pixel, determining the compensation mode for the reference pixel in the target image block specifically includes the following situations:

[0127] Step S2402A, when the first-generation value of the right image block is greater than the first threshold and the second-generation value of the rightmost pixel column is greater than the second threshold, determine that the compensation mode for the reference pixel is the right compensation mode;

[0128] Step S2402B, when the first-generation value of the lower image block is greater than the first threshold and the second-generation value of the bottom pixel row is greater than the second threshold, determine that the compensation mode for the reference pixel is the lower-side compensation mode;

[0129] Step S2402C, when the first-generation values of both the right image block and the lower image block are greater than the first threshold and the second-generation values of both the rightmost pixel column and the bottom pixel row are greater than the second threshold, determine that the compensation mode for the reference pixel is the bilateral compensation mode; the bilateral compensation mode includes the right-side compensation mode and the lower-side compensation mode.

[0130] Among them, the first threshold and the second threshold may be equal or may not be equal.

[0131] In specific implementation, let the first threshold be ThD, the second threshold be ThE, the first-generation value of the right image block be: |SATD-R 重构 -SATD-R 原始 |, the first-generation value of the lower image block be: |SATD-B 重构 -SATD-B 原始 |, the second-generation value of the rightmost pixel column be: SAD(Pix-right 原始 -Pix-right 重构 ), the second-generation value of the bottom pixel row be: SAD(Pix-bottow 原始 -Pix-bottow 重构 ), then there are:

[0132] (1) The condition for the compensation mode for the reference pixel to be the right-side compensation mode is: |SATD-B 重构 -SATD-B 原始 |>ThD, and SAD(Pix-right 原始 -Pix-right 重构 )>ThE.

[0133] (2) The condition for the compensation mode for the reference pixel to be the lower-side compensation mode is: |SATD-B 重构 -SATD-B 原始 |>ThD, SAD(Pix-bottow 原始 -Pix-bottow 重构 )>ThE.

[0134] (3) The condition for the compensation mode for the reference pixel to be the bilateral compensation mode is: simultaneously satisfy the conditions of (1) and (2).

[0135] In this embodiment, by matching the first-generation values of the right image block and the bottom image block, as well as the second-generation values of the rightmost pixel column and the bottommost pixel row, with the preset compensation conditions, the compensation mode for the reference pixel is determined. Through the division of the compensation mode, it is convenient to quickly determine the corresponding compensation pixel value according to different compensation modes, avoiding compensation errors, resulting in waste of time and reducing the coding efficiency of video frames.

[0136] In an exemplary embodiment, in the above step S2401, the first-generation value for other image blocks is obtained by taking the difference between the first residual information and the second residual information, which can be specifically implemented through the following steps:

[0137] Step S2401A: Take the difference between the first residual information and the second residual information to obtain the first initial-generation value for other image blocks;

[0138] Step S2401B: Obtain the weight for the reference pixel; the weight represents the influence degree of the reference pixel on the intra-frame prediction result of other image blocks;

[0139] Step S2401C: Perform weighted processing on the first initial-generation value by the weight to obtain the first-generation value for other image blocks.

[0140] In specific implementation, different influence degrees of the reference pixel on the intra-frame prediction result of other image blocks will affect the determination of the generation value for other image blocks. Therefore, before determining the first-generation value for other image blocks, it is also necessary to obtain the weight for the reference pixel. Then, after taking the difference between the first residual information of other image blocks and the second residual information of other image blocks to obtain the first initial-generation value for other image blocks, the first initial-generation value can be weighted by the weight for the reference pixel to obtain the first-generation value for other image blocks.

[0141] More specifically, when the reference pixel includes the rightmost pixel column and the bottommost pixel row of the target image block, and other image blocks include the right image block and the bottom image block of the target image block, the weights of the rightmost pixel column and the bottommost pixel row are obtained respectively. The weight of the rightmost pixel column is used to perform weighted processing on the first initial-generation value of the right image block to obtain the first-generation value for the right image block, and the weight of the bottommost pixel row is used to perform weighted processing on the first initial-generation value of the bottom image block to obtain the first-generation value for the bottom image block.

[0142] For example, if the weight of the rightmost pixel column is denoted as K-R and the weight of the bottommost pixel row is denoted as K-B, then the first-generation value of the right image block corresponds to: K-R * (|SATD-R 重构 -SATD-R 原始|), the first-generation value of the lower image block is: K - B * (|SATD - B 重构 -SATD - B 原始 |).

[0143] In this embodiment, considering the influence degree of the reference pixel on the intra prediction result of other image blocks, a scheme is proposed to determine the weight value of the reference pixel and correct the first initial generation value of other image blocks through the weight value of the reference pixel, which can improve the accuracy of the determined first-generation value for other image blocks, thereby improving the accuracy of determining the compensation mode for the reference pixel according to the first-generation value of other image blocks, and further better compensating for the distortion of the reference pixel.

[0144] In an exemplary embodiment, in step S2401B, obtaining the weight value for the reference pixel includes: performing texture detection on other image blocks to obtain the texture direction of other image blocks; determining the weight value for the reference pixel based on the angle corresponding to the texture direction.

[0145] In a specific implementation, the texture direction of other image blocks can be determined by using the intra prediction mode selection method in the coding standards HEVC and VVC, or the characteristics of the texture can be analyzed by using an image gradient detection method (calculating the gradient angle after filtering with the sobel operator), and then the texture of each block is classified to determine the texture direction of other image blocks. For example: detecting edges with the sobel operator, when the average edge intensity of other image blocks > th, after obtaining the mean value (0 - 180 degrees) of the overall gradient direction of other image blocks, the texture is classified into 34 categories, as Figure 3 shown Figure 3 The categories in include 33 texture directions and one category of no obvious texture (i.e., the average edge intensity < th, such as a completely white or completely black image block). After determining the texture direction of other image blocks, the texture direction can be input into a preset weight value estimation model to obtain the weight value for the reference pixel, where the weight value estimation model can be expressed as: K = clip3(0, X, abs(cot(ang - M)), where ang - M represents the angle value corresponding to the texture direction of other image blocks, cot represents the cotangent function, abs represents the absolute value function, X is a preset number less than 5, for example, X = 2; the function of the clip3 function is to limit the value of abs(cot(ang - M)) within the range of 0 - X, that is, when the value of abs(cot(ang - M)) is greater than X, make it equal to X; when the value of abs(cot(ang - M)) is less than 0, make it equal to 0.

[0146] More specifically, when the other image block is the right image block, the corresponding reference pixels are the rightmost pixel column, and its weight estimation model can be: K-R = clip3(0, X, abs(cot(ang - M-R)).

[0147] When the other image block is the bottom image block, the corresponding bottommost pixel row, and its weight estimation model can be: K-B = clip3(0, X, abs(cot(ang - M-B)).

[0148] Thus, the reference pixel weights for the other image block can be obtained: {K-R, K-B}.

[0149] In this embodiment, the texture direction obtained by performing texture detection on the other image block is used to determine the weight for the reference pixel, so as to correct the first initial cost value of the other image block through the weight of the reference pixel, improving the accuracy of the determined first cost value for the other image block.

[0150] In an exemplary embodiment, in step S240, based on the first residual information, the second residual information, the original pixel value of the reference pixel, and the reconstructed pixel value of the reference pixel, determining the compensation mode for the reference pixel in the target image block further includes: predicting the third residual information of the target image block from the original pixel value of the video frame; when it is determined that the first residual information, the second residual information, the third residual information, the original pixel value of the reference pixel, and the reconstructed pixel value of the reference pixel do not meet the preset compensation condition, determining that the compensation mode for the reference pixel is non-compensation.

[0151] Wherein, the third residual information can be the SATD value of the third residual, and the third residual information represents the residual information between the third predicted pixel value of the target image block and the original pixel value of the target image block.

[0152] In specific implementation, when determining the compensation mode for the reference pixel, based on the first residual information, the second residual information, the original pixel value of the reference pixel, and the reconstructed pixel value of the reference pixel, the third residual information of the target image block can also be combined to jointly determine the compensation mode for the reference pixel. Among them, predicting the third residual information of the target image block from the original pixel value of the video frame includes: first determining the reference image block affecting the target image block, performing intra-frame prediction on the target image block through the original pixel value of the reference image block in the video frame that is the target image block, obtaining the predicted pixel value of the target image block, subtracting the predicted pixel value of the target image block from the original pixel value of the target image block to obtain the third residual of the target image block, and calculating the SATD value of the third residual to obtain the third residual information of the target image block. Among them, the specific determination method of the third residual information is similar to that of the first residual information and the second residual information, and will not be elaborated here.

[0153] More specifically, the condition for the compensation mode of the reference pixel to be non-compensation can be: the third residual information is greater than the third threshold, or the second-generation value of the rightmost pixel column is less than the second threshold, or the second-generation value of the bottommost pixel row is less than the second threshold, or the sum of the first-generation value of the right image block and the second-generation value of the bottom image block is less than the fourth threshold.

[0154] For example, if the third residual information of the target image block i is denoted as SATD-i, the third threshold is ThA, and the fourth threshold is ThB, then the condition for the compensation mode to be non-compensation is to satisfy any one of the following conditions: (1) SATD-i > ThA; (2) SAD(Pix-right 原始 -Pix-right 重构 ) < ThE; (3) SAD(Pix-bottow 原始 -Pix-bottow 重构 ) < ThE; (4) K-R*(|SATD-R 重构 -SATD-R 原始 |) + K-B*(|SATD-B 重构 -SATD-B 原始 |) < ThB.

[0155] In this embodiment, by introducing the third residual information of the target image block, and determining the compensation mode for the reference pixel in combination with the first residual information, the second residual information, the original pixel value of the reference pixel, and the reconstructed pixel value of the reference pixel, based on the setting of multiple conditions, the accuracy of the determined compensation mode for the reference pixel can be ensured.

[0156] In an exemplary embodiment, in step S250, compensating the pixel value of the reference pixel according to the compensation mode includes:

[0157] Step S2501, according to the compensation mode, determine the compensation value calculation relationship for the reference pixel, and based on the compensation value calculation relationship, determine the compensated pixel value for the reference pixel;

[0158] Step S2502, compensate the pixel value of the reference pixel based on the compensated pixel value.

[0159] In specific implementation, the compensation value calculation relationship corresponding to the right-side compensation mode is: the original pixel value of the rightmost pixel column - the reconstructed pixel value of the rightmost pixel column; the compensation value calculation relationship corresponding to the bottom-side compensation mode is: the original pixel value of the bottommost pixel row - the reconstructed pixel value of the bottommost pixel row; the compensation value calculation relationship corresponding to the double-side compensation mode is: the original pixel value of the rightmost pixel column - the reconstructed pixel value of the rightmost pixel column, and the original pixel value of the bottommost pixel row - the reconstructed pixel value of the bottommost pixel row.

[0160] After determining the compensation mode for the reference pixel, calculate the compensation pixel value for the reference pixel according to the corresponding compensation value calculation relationship, and then the reference pixel can be compensated according to the compensation pixel value, so that the pixel value of the reference pixel is closer to the original pixel value of the reference pixel, reducing the distortion of the reference pixel.

[0161] In this embodiment, through the compensation mode, determine the compensation value calculation relationship for the reference pixel, and based on the compensation value calculation relationship, determine the compensation pixel value for the reference pixel, and compensate the reference pixel based on the compensation pixel value, so that the pixel value of the reference pixel is closer to the original pixel value of the reference pixel, reducing the distortion of the reference pixel, thereby improving the accuracy of the intra-frame prediction result of other image blocks predicted based on the reference pixel and improving the quality of video coding.

[0162] In an exemplary embodiment, in step S210, determining the target intra-frame prediction mode for the target image block in the video frame includes:

[0163] Step S2101, through the rate-distortion cost estimation model, determine the rate-distortion cost values of the target image block under multiple candidate intra-frame prediction modes; the rate-distortion cost estimation model includes a first cost estimation unit for other image blocks and a second cost estimation unit for the reference pixels in the target image block;

[0164] Step S2102, determine the candidate intra-frame prediction mode corresponding to the rate-distortion cost value with the smallest value in the rate-distortion cost values as the target intra-frame prediction mode.

[0165] In a specific implementation, let the target image block be i, the right image block of the target image block be R, and the lower image block be B, then the rate-distortion cost estimation model for the target image block i under any candidate intra-frame prediction mode can be expressed as: J(i-mode-j) = SSE(mode-j) + lambda * R(mode-j) + w1 * RD - RB(mode-j) + w2 * RD - rec(mode-j)

[0166] Among them, J(i-mode-j) represents the rate-distortion cost of the target image block i under mode-j (j can be any one of the intra-prediction mode indices 0-34); SSE represents the sum of squared differences between the reconstructed pixels and the original pixels of the target image block i under the candidate intra-prediction mode mode-j; R(mode-j) represents the bitrate of the candidate intra-prediction mode mode-j, lambda represents the rate-distortion cost coefficient of the bitrate; w1 and w2 are two adjustment coefficients that can be obtained through pre-experimentation; RD-RB(mode-j) represents the first cost estimation unit for other image blocks, and RD-rec(mode-j) represents the second cost estimation unit for reference pixels.

[0167] Among them, RD-RB(mode-j) = {K-R*(|SATD-R 重构 -SATD-R 原始 |)+K-B*(|SATD-B 重构 -SATD-B 原始 |)}, that is, the first cost estimation unit for other image blocks includes two parts: the first cost estimation unit for the right image block and the first cost estimation unit for the bottom image block. K-R and K-B respectively represent the weights for the rightmost pixel column and the bottommost pixel row, |SATD-R 重构 and S ATD-R 原始 | respectively represent the first residual information and the second residual information of the right image block, |SATD-B 重构 -SATD-B 原始 | respectively represent the first residual information and the second residual information of the bottom image block.

[0168] Among them, RD-rec(mode-j) = SAD(Pix-right 原始 -Pix-right 重构 )+SAD(Pix-bottow 原始 -Pix-bottow 重构 ), that is, the second cost estimation unit for reference pixels includes the second cost estimation unit for the rightmost pixel column and the second cost estimation unit for the bottommost pixel row. Pix-right 原始 and Pix-right 重构 respectively represent the original pixel value and the reconstructed pixel value of the rightmost pixel column, Pix-bottow 原始 -Pix-bottow 重构 respectively represent the original pixel value and the reconstructed pixel value of the bottommost pixel row, and SAD (Sum of Absolute Difference) represents the sum of absolute errors of each pixel point.

[0169] Through the above rate-distortion cost estimation model, the rate-distortion costs of the target image block under various candidate intra-frame prediction modes are estimated respectively, and the rate-distortion costs of the target image block under each candidate intra-frame prediction mode are obtained. The candidate intra-frame prediction mode corresponding to the rate-distortion cost with the smallest value among the rate-distortion costs is determined as the target intra-frame prediction mode.

[0170] In this embodiment, by introducing a first cost estimation unit for other image blocks and a second cost estimation unit for the reference pixels in the target image block into the rate-distortion cost estimation model, the influence of the intra-frame prediction mode on the target image block itself and other image blocks is fully considered. Therefore, the determined target intra-frame prediction mode is the optimal intra-frame prediction mode for the target image block, which can improve the accuracy of the intra-frame prediction result of the video frame, and thus improve the quality of video coding.

[0171] In another exemplary embodiment, as Figure 4 shown, it is a flowchart of another intra-frame prediction method shown according to an exemplary embodiment. In this embodiment, the method includes the following steps:

[0172] Step S410, determine the reference pixels for the target image block in the video frame, and through the rate-distortion cost estimation model, determine the rate-distortion costs of the target image block under various candidate intra-frame prediction modes;

[0173] Step S420, determine the candidate intra-frame prediction mode corresponding to the rate-distortion cost with the smallest value among the rate-distortion costs as the target intra-frame prediction mode of the target image block;

[0174] Step S430A, obtain the reconstructed pixel values obtained by the target image block under the target intra-frame prediction mode, perform intra-frame prediction on other image blocks through the reconstructed pixel values of the target image block, and based on the predicted first predicted pixel values and the original pixel values of other image blocks, obtain the first residual information of other image blocks;

[0175] Step S430B, perform intra-frame prediction on other image blocks through the original pixel values of the target image block, and based on the predicted second predicted pixel values and the original pixel values of other image blocks, obtain the second residual information of other image blocks;

[0176] Step S440, subtract the first residual information from the second residual information to obtain the first initial cost value for other image blocks; perform weighted processing on the first initial cost value through the weights for the reference pixels to obtain the first cost value for other image blocks;

[0177] Step S450, subtract the original pixel value of the reference pixel from the reconstructed pixel value of the reference pixel to obtain the second cost value for the reference pixel;

[0178] Step S460: Determine a compensation mode for a reference pixel in a target image block based on a first-generation value for other image blocks and a second-generation value for a reference pixel.

[0179] Step S470: Determine a compensation value calculation relation for the reference pixel according to the compensation mode, and determine a compensated pixel value for the reference pixel based on the compensation value calculation relation.

[0180] Step S480: Compensate the pixel value of the reference pixel based on the compensated pixel value.

[0181] The intra prediction method provided in this embodiment respectively performs intra prediction on other image blocks through the original pixel value and the reconstructed pixel value of the target image block to obtain first residual information and second residual information. According to the first residual information, the second residual information, and the original pixel value and the reconstructed pixel value of the reference pixel, a compensation mode for the reference pixel in the target image block is determined. Furthermore, the pixel value of the reference pixel is compensated according to the reference mode, so that the pixel value of the reference pixel is closer to the original pixel value, reducing the distortion of the reference pixel, thereby improving the accuracy of the intra prediction result.

[0182] In an exemplary embodiment, to facilitate the understanding of those skilled in the art of the embodiments of the present disclosure, specific examples in conjunction with the drawings will be described below. Refer to Figure 5 , which is an overall flowchart of an intra prediction and coding method based on mode dependency and reference pixel compensation in an application example.

[0183] Before encoding:

[0184] (1) Perform texture analysis on a video frame. Specifically, divide the video frame into NxN (N can be any value, such as 64, 32, 16, etc.) image blocks, perform texture detection on each image block, and obtain the texture category (or texture direction) of each image block.

[0185] (2) Determine the weights of the reference pixels of each image block according to the texture directions of the other image blocks affected by each image block. Specifically, traverse the video frame in raster order from top left to bottom right to determine the influence on subsequent coding blocks for each image block. Since the rightmost pixel column of the target image block affects the prediction result of the image block on the right side of the target image block, and the bottommost pixel row of the target image block affects the prediction result of the image block below the target image block, the weight of the rightmost pixel column can be determined according to the estimation model K-R = clip3(0, X, abs(cot(ang - M - R))), and the weight of the bottommost pixel row can be determined according to the estimation model K-B = clip3(0, X, abs(cot(ang - M - B))). Thus, the weights of the reference pixels of each image block are obtained: {K-R, K-B}.

[0186] In coding:

[0187] (3) Determine the compensation mode for the reference pixels in each image block based on the rate-distortion optimization method (RDO). Specifically, for each image block, estimate the rate-distortion cost values of the image block under multiple candidate frame prediction modes through the rate-distortion cost estimation model, and obtain the candidate frame prediction mode corresponding to the rate-distortion cost value with the smallest value among the rate-distortion cost values, which is determined as the optimal intra-frame prediction mode (i.e., the target intra-frame prediction mode) of the image block. Among them, the rate-distortion cost value of each image block includes the first-generation cost value for the right-side image block, the first-generation cost value for the bottom-side image block, the second-generation cost value for the rightmost pixel column, and the second-generation cost value for the bottommost pixel row.

[0188] The determination method of the compensation mode Use_Mode includes:

[0189] A: Use_Mode = 1, the compensation mode is set to the right-side compensation mode, and the condition is: the first-generation cost value of the right-side image block is greater than the first threshold, and the second-generation cost value of the rightmost pixel column is greater than the second threshold.

[0190] B: Use_Mode = 2, the compensation mode is set to the bottom-side compensation mode, and the condition is: the first-generation cost value of the bottom-side image block is greater than the first threshold, and the second-generation cost value of the bottommost pixel row is greater than the second threshold.

[0191] C: Use_Mode = 3, the compensation mode is set to the double-side compensation mode, and the condition is: the conditions of Use_Mode = 1 and Use_Mode = 2 are satisfied simultaneously.

[0192] D: Use_Mode = 0, the compensation mode is set to no compensation, and the condition is:

[0193] D1. The residual information of the image block predicted by the original pixel value is greater than the third threshold, or,

[0194] D2. The second-generation value of the rightmost pixel column is less than the second threshold, or,

[0195] D3. The second-generation value of the bottommost pixel row is less than the second threshold, or,

[0196] D4. The sum of the first-generation value of the right image block and the second-generation value of the bottom image block is less than the fourth threshold.

[0197] D5. And all other cases where the compensation conditions are not met.

[0198] (4) Perform coding compensation on the reference pixels based on the determined compensation mode. Specifically, the flag context model can be used for entropy coding. When Use_Mode > 1, according to the calculation relationship of the compensation value in different modes, determine the compensation pixel value and perform coding compensation. Among them, the coding method can refer to the encoder residual entropy coding, such as Figure 6 shown, the sorting of the compensation pixel values is in the order of top right → bottom right → bottom left.

[0199] At the decoding end:

[0200] (5) The decoder decodes the intra prediction mode according to the coding standard to obtain the reconstructed image block of each image block.

[0201] (6) Decode the compensation mode / compensation pixel value.

[0202] When Use_Mode = 0, skip the compensation method and perform decoding.

[0203] When Use_Mode > 1, decode the compensation mode of the image block and the compensation pixel values of the rightmost pixel column and the bottommost pixel row.

[0204] (7) Compensate the reference pixels. Add the corresponding compensation pixel values to the rightmost pixel column and the bottommost pixel row of the reconstructed image block of each image block.

[0205] The intra prediction rate distortion optimization method proposed in this embodiment combines the characteristics of video content, selectively reduces the distortion of reference pixels, thereby improving the intra prediction accuracy and the compression quality and efficiency of the encoder.

[0206] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least some of the steps or stages in other steps or other steps.

[0207] It can be understood that the same / similar parts among the various embodiments of the above methods in this specification can be referred to each other. Each embodiment focuses on the differences from other embodiments. For the relevant parts, refer to the descriptions of other method embodiments.

[0208] Based on the same inventive concept, the embodiments of the present disclosure also provide an intra prediction device for implementing the above-mentioned intra prediction method.

[0209] Figure 7 is a structural block diagram of an intra prediction device shown according to an exemplary embodiment. Referring to Figure 7 , the device includes: a prediction mode determination unit 710, a first residual acquisition unit 720, a second residual acquisition unit 730, a compensation mode determination unit 740, and an intra prediction unit 750, where

[0210] The prediction mode determination unit 710 is configured to determine a target intra prediction mode and reference pixels for a target image block in a video frame; the target image block is any one of a plurality of image blocks obtained by dividing the video frame, and the reference pixels represent the pixels in the target image block that affect the intra prediction results of other image blocks, and the other image blocks represent the image blocks adjacent to the target image block and whose pixel values are affected by the target image block;

[0211] The first residual acquisition unit 720 is configured to obtain the reconstructed pixel values of the target image block in the target intra prediction mode, and predict the first residual information of other image blocks through the reconstructed pixel values of the target image block;

[0212] The second residual acquisition unit 730 is configured to predict the second residual information of other image blocks through the original pixel values of the target image block;

[0213] A compensation mode determination unit 740, configured to determine a compensation mode for a reference pixel in a target image block based on first residual information, second residual information, an original pixel value of the reference pixel, and a reconstructed pixel value of the reference pixel;

[0214] An intra prediction unit 750, configured to perform compensating the pixel value of the reference pixel according to the compensation mode, and performing intra prediction on other image blocks affected by the target image block based on the compensated reference pixel value.

[0215] In an exemplary embodiment, the first residual acquisition unit 720 is specifically configured to perform intra prediction on other image blocks through the reconstructed pixel value of the target image block to obtain a first predicted pixel value of the other image blocks; and obtain first residual information of the other image blocks based on the first predicted pixel value and the original pixel value of the other image blocks.

[0216] In an exemplary embodiment, the second residual acquisition unit 730 is specifically configured to perform intra prediction on other image blocks through the original pixel value of the target image block to obtain a second predicted pixel value of the other image blocks; and obtain second residual information of the other image blocks based on the second predicted pixel value and the original pixel value of the other image blocks.

[0217] In an exemplary embodiment, the compensation mode determination unit 740 is specifically configured to perform subtracting the first residual information from the second residual information to obtain a first generation value for the other image blocks, and subtracting the original pixel value of the reference pixel from the reconstructed pixel value of the reference pixel to obtain a second generation value for the reference pixel; and determine a compensation mode for the reference pixel in the target image block based on the first generation value for the other image blocks and the second generation value for the reference pixel.

[0218] In an exemplary embodiment, the reference pixels include the rightmost pixel column and the bottommost pixel row of the target image block, and the other image blocks include the right image block and the bottom image block of the target image block; the compensation mode determination unit 740 is further configured to execute obtaining the first-generation value of the right image block, the first-generation value of the bottom image block, the second-generation value of the rightmost pixel column, and the second-generation value of the bottommost pixel row; in the case where the first-generation value of the right image block is greater than the first threshold and the second-generation value of the rightmost pixel column is greater than the second threshold, determining that the compensation mode for the reference pixels is the right compensation mode; in the case where the first-generation value of the bottom image block is greater than the first threshold and the second-generation value of the bottommost pixel row is greater than the second threshold, determining that the compensation mode for the reference pixels is the bottom compensation mode; in the case where the first-generation values of both the right image block and the bottom image block are greater than the first threshold and the second-generation values of both the rightmost pixel column and the bottommost pixel row are greater than the second threshold, determining that the compensation mode for the reference pixels is the bilateral compensation mode; the bilateral compensation mode includes the right compensation mode and the bottom compensation mode.

[0219] In an exemplary embodiment, the compensation mode determination unit 740 is further configured to execute subtracting the first residual information from the second residual information to obtain the first initial generation value for the other image blocks; obtaining the weight for the reference pixels; the weight characterizes the influence degree of the reference pixels on the intra-frame prediction result of the other image blocks; performing weighted processing on the first initial generation value by the weight to obtain the first-generation value for the other image blocks.

[0220] In an exemplary embodiment, the compensation mode determination unit includes a weight determination subunit configured to execute texture detection on the other image blocks to obtain the texture direction of the other image blocks; determining the weight for the reference pixels based on the angle corresponding to the texture direction.

[0221] In an exemplary embodiment, the compensation mode determination unit 740 is further configured to execute predicting the third residual information of the target image block from the original pixel values of the video frame; in the case where it is determined that the first residual information, the second residual information, the third residual information, the original pixel value of the reference pixels, and the reconstructed pixel value of the reference pixels do not meet the preset compensation condition, determining that the compensation mode for the reference pixels is non-compensation.

[0222] In an exemplary embodiment, the intra-frame prediction unit 750 is specifically configured to execute determining the compensation value calculation relation for the reference pixels according to the compensation mode, and determining the compensation pixel value for the reference pixels based on the compensation value calculation relation; compensating the pixel value of the reference pixels based on the compensation pixel value.

[0223] In an exemplary embodiment, the prediction mode determination unit 710 is specifically configured to execute a rate-distortion cost estimation model to determine the rate-distortion cost values of the target image block under multiple candidate intra-frame prediction modes; the rate-distortion cost estimation model includes a first cost estimation unit for other image blocks and a second cost estimation unit for reference pixels in the target image block; and the candidate intra-frame prediction mode corresponding to the rate-distortion cost value with the smallest numerical value among the rate-distortion cost values is determined as the target intra-frame prediction mode.

[0224] Regarding the device in the above embodiment, the specific manners in which each module performs operations have been described in detail in the embodiment related to the method, and will not be elaborated here.

[0225] Figure 8 FIG. is a block diagram of an electronic device 800 for implementing an intra-frame prediction method according to an exemplary embodiment. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0226] Referring to Figure 8 , the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0227] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0228] The memory 804 is configured to store various types of data to support the operation of the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, and the like. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disks, optical disks, or graphene memory.

[0229] The power supply component 806 provides power to various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.

[0230] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0231] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 further includes a speaker for outputting audio signals.

[0232] The I / O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power-on button, and a lock button.

[0233] The sensor assembly 814 includes one or more sensors for providing status assessments of various aspects for the electronic device 800. For example, the sensor assembly 814 can detect the on / off state of the electronic device 800, the relative positioning of components, such as the display and keypad of the electronic device 800. The sensor assembly 814 can also detect changes in the position of the electronic device 800 or components of the electronic device 800, the presence or absence of user contact with the electronic device 800, the orientation or acceleration / deceleration of the device 800, and temperature changes of the electronic device 800. The sensor assembly 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0234] The communication component 816 is configured to facilitate communication between the electronic device 800 and other devices in a wired or wireless manner. The electronic device 800 can access a wireless network based on communication standards, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0235] In an exemplary embodiment, the electronic device 800 can be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above methods.

[0236] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as the memory 804 including instructions, and the above instructions can be executed by the processor 820 of the electronic device 800 to complete the above methods. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0237] In an exemplary embodiment, a computer program product is further provided. The computer program product includes instructions that can be executed by a processor 820 of an electronic device 800 to implement the above method.

[0238] It should be noted that the above-mentioned devices, electronic devices, computer-readable storage media, computer program products, etc. may also include other implementation manners according to the description of the method embodiments. The specific implementation manners can refer to the description of the relevant method embodiments and will not be elaborated here one by one.

[0239] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the claims.

[0240] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. An intra prediction method, characterized in that, Including: Determining a target intra prediction mode and reference pixels for a target image block in a video frame; The target image block is any one of a plurality of image blocks obtained by dividing the video frame, the reference pixels represent pixels in the target image block that affect the intra prediction results of other image blocks, and the other image blocks represent image blocks adjacent to the target image block and whose pixel values are affected by the target image block; Obtaining reconstructed pixel values of the target image block in the target intra prediction mode, and predicting first residual information of the other image blocks through the reconstructed pixel values of the target image block; Predicting second residual information of the other image blocks through the original pixel values of the target image block; Based on the first residual information, the second residual information, the original pixel values of the reference pixels, and the reconstructed pixel values of the reference pixels, determining a compensation mode for the reference pixels in the target image block; Compensating the pixel values of the reference pixels according to the compensation mode, and performing intra prediction on other image blocks affected by the target image block based on the compensated reference pixel values.

2. The method according to claim 1, wherein The predicting the first residual information of the other image blocks through the reconstructed pixel values of the target image block includes: Performing intra prediction on the other image blocks through the reconstructed pixel values of the target image block to obtain first predicted pixel values of the other image blocks; Based on the first predicted pixel values and the original pixel values of the other image blocks, obtaining the first residual information of the other image blocks.

3. The method according to claim 1, wherein The predicting the second residual information of the other image blocks through the original pixel values of the target image block includes: Performing intra prediction on the other image blocks through the original pixel values of the target image block to obtain second predicted pixel values of the other image blocks; Based on the second predicted pixel values and the original pixel values of the other image blocks, obtaining the second residual information of the other image blocks.

4. The method according to claim 1, characterized in that, The determining the compensation mode for the reference pixels in the target image block based on the first residual information, the second residual information, the original pixel values of the reference pixels, and the reconstructed pixel values of the reference pixels includes: Subtracting the first residual information from the second residual information to obtain a first generation value for the other image blocks, and subtracting the original pixel values of the reference pixels from the reconstructed pixel values of the reference pixels to obtain a second generation value for the reference pixels; Based on the first generation value for the other image blocks and the second generation value for the reference pixels, determining the compensation mode for the reference pixels in the target image block.

5. The method according to claim 4, wherein The reference pixels include the rightmost pixel column and the bottommost pixel row of the target image block, and the other image blocks include the right image block and the bottom image block of the target image block; The determining the compensation mode for the reference pixels in the target image block based on the first generation value for the other image blocks and the second generation value for the reference pixels includes: Obtain the first-generation value of the right image block, the first-generation value of the lower image block, the second-generation value of the rightmost pixel column, and the second-generation value of the bottommost pixel row; When the first-generation value of the right image block is greater than the first threshold and the second-generation value of the rightmost pixel column is greater than the second threshold, determine that the compensation mode for the reference pixel is the right compensation mode; When the first-generation value of the lower image block is greater than the first threshold and the second-generation value of the bottommost pixel row is greater than the second threshold, determine that the compensation mode for the reference pixel is the bottom compensation mode; When the first-generation values of both the right image block and the lower image block are greater than the first threshold and the second-generation values of both the rightmost pixel column and the bottommost pixel row are greater than the second threshold, determine that the compensation mode for the reference pixel is the bilateral compensation mode; the bilateral compensation mode includes the right compensation mode and the bottom compensation mode.

6. The method according to claim 4, wherein The subtracting the second residual information from the first residual information to obtain the first-generation value for the other image block includes: Subtract the second residual information from the first residual information to obtain the first initial-generation value for the other image block; Obtain the weight for the reference pixel; the weight characterizes the influence degree of the reference pixel on the intra-frame prediction result of the other image block; Perform weighted processing on the first initial-generation value through the weight to obtain the first-generation value for the other image block.

7. The method according to claim 6, characterized in that, The obtaining the weight for the reference pixel includes: Perform texture detection on the other image block to obtain the texture direction of the other image block; Determine the weight for the reference pixel based on the angle corresponding to the texture direction.

8. The method according to claim 1, characterized in that The determining the compensation mode for the reference pixel in the target image block based on the first residual information, the second residual information, the original pixel value of the reference pixel, and the reconstructed pixel value of the reference pixel further includes: Predict the third residual information of the target image block through the original pixel value of the video frame; When it is determined that the first residual information, the second residual information, the third residual information, the original pixel value of the reference pixel, and the reconstructed pixel value of the reference pixel do not meet the preset compensation condition, determine that the compensation mode for the reference pixel is no compensation.

9. The method according to claim 1, characterized in that The compensating the pixel value of the reference pixel according to the compensation mode includes: According to the compensation mode, determine the compensation value calculation relation for the reference pixel, and based on the compensation value calculation relation, determine the compensation pixel value for the reference pixel; Compensate the pixel value of the reference pixel based on the compensation pixel value.

10. The method according to claim 1, wherein The determining the target intra-frame prediction mode for the target image block in the video frame includes: A rate-distortion cost estimation model determines the rate-distortion cost values of the target image block under multiple candidate intra-frame prediction modes; the rate-distortion cost estimation model includes a first cost estimation unit for the other image blocks and a second cost estimation unit for the reference pixels in the target image block; Determine the candidate intra-frame prediction mode corresponding to the rate-distortion cost value with the smallest numerical value among the rate-distortion cost values as the target intra-frame prediction mode.

11. An intra prediction apparatus, characterized in that, Comprising: A prediction mode determination unit configured to determine the target intra-frame prediction mode and reference pixels for a target image block in a video frame; The target image block is any one of multiple image blocks obtained by dividing the video frame, the reference pixels represent the pixels in the target image block that affect the intra-frame prediction results of other image blocks, and the other image blocks represent the image blocks adjacent to the target image block and whose pixel values are affected by the target image block; A first residual acquisition unit configured to obtain the reconstructed pixel values of the target image block in the target intra-frame prediction mode, and predict the first residual information of the other image blocks through the reconstructed pixel values of the target image block; A second residual acquisition unit configured to predict the second residual information of the other image blocks through the original pixel values of the target image block; A compensation mode determination unit configured to determine a compensation mode for the reference pixels in the target image block based on the first residual information, the second residual information, the original pixel values of the reference pixels, and the reconstructed pixel values of the reference pixels; An intra-frame prediction unit configured to compensate the pixel values of the reference pixels according to the compensation mode, and perform intra-frame prediction on the other image blocks affected by the target image block based on the compensated reference pixel values.

12. An electronic device, characterized in that, Comprising: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the instructions to implement the intra-frame prediction method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is enabled to execute the intra-frame prediction method according to any one of claims 1 to 10.

14. A computer program product, comprising instructions, characterized in that, When the instructions are executed by the processor of the electronic device, the electronic device is enabled to execute the intra-frame prediction method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Image encoding method, image decoding method, encoder, decoder and storage medium

    CN110650337A

  • Inter prediction method and related video processing device

    CN114143538A