Intra prediction method and apparatus based on encoding side and decoding side
By optimizing the preprocessing and prediction modes of the blocks to be encoded during the video encoding process, the problems of low encoding efficiency and large chip area are solved, and a more efficient and accurate encoding process is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING ZHONGXING MICRO ARTIFICIAL INTELLIGENCE CHIP TECH CO LTD
- Filing Date
- 2022-12-19
- Publication Date
- 2026-05-01
AI Technical Summary
In existing technologies, video encoding is inefficient, requires a large chip area for encoding, and causes encoding delays for the next block to be encoded.
By acquiring reference pixels at multiple preset orientations of the original image, the block to be encoded is preprocessed. Multiple prediction blocks are obtained using the preprocessed block to be encoded, reference pixels, and prediction mode. The residuals are calculated, and the optimal prediction mode is determined based on the residuals and preset conditions.
It improves coding efficiency and accuracy, reduces chip area requirements, and avoids coding delays.
Smart Images

Figure CN116055747B_ABST
Abstract
Description
Intra-frame prediction methods and devices based on the encoder and decoder ends Technical Field
[0001] This application relates to the field of video coding technology in information processing, specifically to intra-frame prediction methods and apparatus based on the encoding end and the decoding end. Background Technology
[0002] Currently, H.264, H.265, and H.266 technologies are new video compression coding standards. H.264 employs several techniques to improve image quality and increase compression ratio, and can be used in SDTV, HDTV, and DVD. H.264 encoding is more efficient in terms of bitrate; it not only saves 50% of the bitrate compared to MPEG-4, but also has strong error resilience, making it suitable for video transmission in wireless channels with high packet loss rates and severe interference, thus achieving stable image quality. H.265 is a new video coding standard developed by ITU-T VCEG following H.264. The H.265 standard builds upon the existing H.264 standard, retaining some original technologies while improving upon others. The new technology uses advanced techniques to optimize the relationship between bitrate, coding quality, latency, and algorithm complexity. Specific research areas include: improving compression efficiency, enhancing robustness and error recovery capabilities, reducing real-time latency, reducing channel acquisition time and random access latency, and reducing complexity. H.266 is a new generation of video coding technology that is an improvement on H.265 / HEVC.
[0003] In real-time software implementations using H.264, H.265, and H.266 standards, the encoding end typically needs to predict the original image during encoding to compress it. Existing technologies usually derive the actual intra-frame prediction mode of the current block based on the prediction mode information obtained from decoding adjacent encoded blocks. This means the prediction mode for the next block to be encoded needs to be determined based on the previous encoded block, leading to reduced encoding efficiency, requiring a larger chip area for encoding, and ultimately causing encoding delays for the next block to be encoded. Summary of the Invention
[0004] To address the aforementioned technical problems, this application is proposed. Embodiments of this application provide an intra-frame prediction method and apparatus based on both the encoding and decoding ends, solving the problems of reduced encoding efficiency, the need for a large chip area for encoding, and the resulting encoding delay in the next block to be encoded.
[0005] According to one aspect of this application, an intra-frame prediction method based on the encoding end is provided, comprising: acquiring an original image; wherein the original image includes a block to be encoded; acquiring a plurality of reference pixels at preset orientations; wherein each of the reference pixels at the preset orientations is adjacent to a pixel of the block to be encoded; performing a first image preprocessing on the block to be encoded based on the plurality of reference pixels at the preset orientations to obtain a preprocessed block to be encoded; acquiring a plurality of prediction blocks based on the preprocessed block to be encoded, the plurality of reference pixels at the preset orientations, and a plurality of preset prediction modes; acquiring a plurality of residuals based on each prediction block and the preprocessed block to be encoded; wherein the residuals represent the difference between the predicted block to be encoded and the prediction blocks; and determining the optimal prediction mode for decoding the block to be encoded based on the plurality of residuals and preset conditions.
[0006] In one embodiment, obtaining reference pixels at multiple preset orientations includes: if there is no target orientation of an adjacent coding block among the multiple preset orientations of the block to be encoded, then setting the reference pixels at the target orientation to a fixed value.
[0007] In one embodiment, obtaining reference pixels at multiple preset orientations includes: performing a second image preprocessing on the reference pixels at the multiple preset orientations to obtain processed reference pixels at the multiple preset orientations.
[0008] In one embodiment, the second image preprocessing of the plurality of reference pixels at preset orientations to obtain processed reference pixels at the plurality of preset orientations includes: filtering each reference pixel at the preset orientation to obtain filtered reference pixels at the plurality of preset orientations; quantizing the filtered reference pixels at the plurality of preset orientations to obtain quantized reference pixels at the plurality of preset orientations; and reconstructing the quantized reference pixels at the plurality of preset orientations to obtain reconstructed reference pixels at the plurality of preset orientations.
[0009] In one embodiment, filtering each reference pixel at a preset orientation to obtain multiple filtered reference pixels at preset orientations includes: performing a discrete cosine transform on each reference pixel at a preset orientation to obtain frequency domain coefficients at multiple preset orientations; and performing integer operations on the frequency domain coefficients at each preset orientation to obtain the multiple filtered reference pixels at preset orientations.
[0010] In one embodiment, quantizing the filtered reference pixels at the plurality of preset orientations to obtain quantized reference pixels at the plurality of preset orientations includes: calculating a quantization step size based on the quantization coefficients of the original image and the frequency domain coefficients at the plurality of preset orientations; and calculating the quantized reference pixels at the plurality of preset orientations based on the quantization step size and the filtered reference pixels at the plurality of preset orientations.
[0011] In one embodiment, reconstructing the quantized reference pixels at the plurality of preset orientations to obtain the reconstructed reference pixels at the plurality of preset orientations includes: performing an inverse discrete cosine transform on the quantized reference pixels at the plurality of preset orientations to obtain the reconstructed reference pixels at the plurality of preset orientations.
[0012] In one embodiment, the step of performing a first image preprocessing on the block to be encoded based on the reference pixels at the plurality of preset orientations to obtain a preprocessed block to be encoded includes: constructing a plurality of pixel blocks based on each reference pixel at the preset orientation and the corresponding surrounding pixels; wherein each pixel block includes one reference pixel and eight surrounding pixels; calculating the mean value of each pixel block; and using the mean value as the value of the corresponding preprocessed block to be encoded.
[0013] In one embodiment, determining the optimal prediction mode for decoding the block to be encoded based on the plurality of residuals and preset conditions includes: selecting the prediction mode corresponding to the residuals that are less than or equal to a preset difference threshold from the plurality of residuals as the optimal prediction mode.
[0014] According to another aspect of this application, an intra-frame prediction apparatus based on the encoding end is provided, comprising: an image acquisition module for acquiring an original image; wherein the original image includes a block to be encoded; a pixel acquisition module for acquiring a plurality of reference pixels at preset orientations; wherein each reference pixel at a preset orientation is adjacent to a pixel of the block to be encoded; a preprocessing module for acquiring a plurality of prediction blocks based on the preprocessed prediction blocks, the plurality of reference pixels at preset orientations, and a plurality of preset prediction modes; a post-prediction module for acquiring a plurality of prediction blocks based on the preprocessed prediction blocks, the plurality of reference pixels at preset orientations, and a plurality of preset prediction modes; a residual acquisition module for acquiring a plurality of residuals based on each prediction block and the preprocessed block to be encoded; wherein the residuals represent the difference between the post-predicted block to be encoded and the prediction blocks; and a mode determination module for determining the optimal prediction mode for decoding the block to be encoded based on the plurality of residuals and preset conditions.
[0015] According to another aspect of this application, an intra-frame prediction method based on the decoding end is provided, comprising: decoding the original image according to the residual of the original image and the optimal prediction mode corresponding to the residual to obtain a reconstructed image; wherein the residual and the optimal prediction mode are obtained by the intra-frame prediction method based on the encoding end as described in any of the above claims.
[0016] This application provides an intra-frame prediction method and apparatus based on the encoding end and the decoding end. The method includes: acquiring an original image to be encoded, wherein the original image to be encoded includes a block to be encoded; acquiring multiple reference pixels at preset orientations, wherein each reference pixel at a preset orientation is adjacent to a pixel of the block to be encoded; performing a first image preprocessing on the block to be encoded based on the multiple reference pixels at preset orientations to obtain a preprocessed block to be encoded; acquiring multiple predicted blocks of the block to be encoded based on the preprocessed block to be encoded, the multiple reference pixels at preset orientations, and multiple preset prediction modes; acquiring multiple residuals based on each of the multiple predicted blocks of the block to be encoded and the preprocessed block to be encoded, wherein the residuals represent the difference between the predicted blocks of the block to be encoded and the predicted blocks of the preprocessed block to be encoded; and determining the optimal prediction mode for decoding the block to be encoded based on the multiple residuals and preset conditions. This application filters the reference pixels of the current block to be encoded to approximate the pixels in the image reconstructed after decoding the previous block. Therefore, unlike the prior art, it does not need to wait for the previous block to determine the accurate prediction mode and then reconstruct the image based on the prediction mode, using the pixels of the reconstructed image as the reference pixels for encoding the current block. In other words, when determining the optimal prediction mode for each block to be encoded, it is not necessary to encode them one by one. The optimal prediction mode for each block to be encoded can be determined in parallel. This application can not only improve the encoding efficiency but also the encoding accuracy. Attached Figure Description
[0017] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.
[0018] Figure 1 is a flowchart illustrating an exemplary embodiment of the intra-frame prediction method based on the encoder end provided in this application.
[0019] Figure 2 is a schematic diagram of the structure of a plurality of reference pixels in preset orientations provided in an exemplary embodiment of this application.
[0020] Figure 3 is a flowchart illustrating a preprocessing method for encoding provided in an exemplary embodiment of this application.
[0021] Figure 4 is a schematic diagram of the mean calculation method provided in an exemplary embodiment of this application.
[0022] Figure 5 is a schematic diagram of the structure of an intra-frame prediction device based on the coding end provided in an exemplary embodiment of this application.
[0023] Figure 6 is a schematic diagram of the structure of an intra-frame prediction device based on the coding end provided in another exemplary embodiment of this application.
[0024] Figure 7 is a structural diagram of an electronic device provided in an exemplary embodiment of this application. Detailed Implementation
[0025] Hereinafter, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.
[0026] Figure 1 is a flowchart illustrating an intra-frame prediction method based on the encoder end according to an exemplary embodiment of this application. Figure 2 is a structural diagram illustrating multiple reference pixels at preset orientations according to an exemplary embodiment of this application. As shown in Figures 1-2, the intra-frame prediction method based on the encoder end includes:
[0027] Step 110: Obtain the original image, wherein the original image includes the block to be encoded.
[0028] In this embodiment, the original image can be acquired by capturing video using a video capture device. Multiple original images are obtained from the captured video (the video includes a video sequence, and a video sequence includes multiple original images, each original image being a frame). The video capture device can be a camera, mobile phone, or iPad, etc., and the video capture method is not limited. If the video is in RGB format, it can first be converted to YUV format. Then, the YUV format video is encoded, and the encoded video is sent to an electronic device. The decoder of the electronic device reconstructs the video to obtain the reconstructed original image, which is approximately similar to the original image before encoding. YUV format video can remove redundant information and save network bandwidth.
[0029] The original image is divided into multiple blocks to be encoded during encoding, each block consisting of multiple pixels. The encoding process includes frame type analysis, intra / inter-frame prediction, transform, quantization, filtering, and entropy coding, resulting in the encoded video. This is essentially video compression to transmit the compressed video with less network bandwidth. Specifically, the original image can be divided into rectangular blocks of various sizes during encoding, such as 4x4 pixels, 8x8 pixels, 16x16 pixels, 32x32 pixels, 64x64 pixels, 4x8 pixels, 8x4 pixels, 18x8 pixels, and 8x16 pixels.
[0030] Step 120: Obtain multiple reference pixels at preset orientations, wherein each reference pixel at a preset orientation is adjacent to the pixels of the block to be encoded.
[0031] A crucial step in the encoding process is predicting the block to be encoded. Prediction involves using reference pixels at multiple preset locations, as shown in Figure 2. These preset locations can be left, lower left, top, upper right, and upper left. Each reference pixel at a preset location is adjacent to a pixel in the block to be encoded, A. Each reference pixel can be 1×N pixels or N×1 pixels.
[0032] Step 130: Based on reference pixels at multiple preset orientations, perform first image preprocessing on the block to be encoded to obtain the preprocessed block to be encoded.
[0033] In existing technologies, during encoding, there is a predictor. Prediction requires using the reconstructed image of the previous coded block as neighbor values and employing 35 prediction modes to predict the current block, thus obtaining a predicted block. The difference between the predicted block and the current block is used to determine the accuracy of the prediction and to identify the optimal prediction mode. However, the neighbor values of the current block require the previous coded block to be encoded and the optimal prediction mode to be determined. The image reconstructed using the optimal prediction mode is then used as the neighbor values of the current block. This results in the current block being encoded only after the previous coded block has been fully encoded.
[0034] In this embodiment, neighboring pixels at multiple preset orientations of the current block to be encoded are preprocessed to approximate the reconstructed pixels of the previous block. However, since the neighboring pixels are not the actual reconstructed image but rather the modified original image, they can only guarantee that the distribution is the same as the reconstructed image. Therefore, the pixels of the current block to be encoded should also be modified accordingly. That is, based on the reference pixels at multiple preset orientations, the block to be encoded is preprocessed to obtain the preprocessed block to be encoded.
[0035] Step 140: Obtain multiple prediction blocks based on the preprocessed block to be encoded, multiple reference pixels at multiple preset orientations, and multiple preset prediction modes.
[0036] In this embodiment, the preset prediction modes include 35 types. Based on the preprocessed block to be encoded and reference pixels at multiple preset orientations, these 35 prediction modes are used to obtain 35 prediction blocks.
[0037] Step 150: Based on each predicted block and the preprocessed block to be encoded, obtain multiple residuals, where the residuals represent the difference between the predicted block to be encoded and the predicted block.
[0038] To obtain the similarity value between the predicted block and the preprocessed block to be encoded, the difference between each predicted block and the predicted block to be encoded is calculated to obtain multiple residuals, which are the similarity values between each predicted block and the predicted block to be encoded.
[0039] Step 160: Based on multiple residuals and preset conditions, determine the optimal prediction mode for decoding the block to be encoded.
[0040] To obtain the optimal prediction mode for decoding the block to be encoded, preset conditions are set, and the prediction mode corresponding to the residual that satisfies the preset conditions is selected, which is the optimal prediction mode for decoding the block to be encoded.
[0041] The intra-frame prediction method based on the encoding end provided in this application includes: acquiring an original image to be encoded; wherein the original image to be encoded includes a block to be encoded; acquiring multiple reference pixels at preset orientations, wherein each reference pixel at a preset orientation is adjacent to a pixel of the block to be encoded; performing a first image preprocessing on the block to be encoded based on the multiple reference pixels at preset orientations to obtain a preprocessed block to be encoded; acquiring multiple predicted blocks of the block to be encoded based on the preprocessed block to be encoded, the multiple reference pixels at preset orientations, and multiple preset prediction modes; acquiring multiple residuals based on each of the multiple predicted blocks of the block to be encoded and the preprocessed block to be encoded, wherein the residuals represent the difference between the predicted blocks of the block to be encoded and the predicted blocks of the preprocessed block to be encoded; and determining the optimal prediction mode for decoding the block to be encoded based on the multiple residuals and preset conditions. This application filters the reference pixels of the current block to be encoded to approximate the pixels in the image reconstructed after decoding the previous block. Therefore, unlike the prior art, it does not need to wait for the previous block to determine the accurate prediction mode and then reconstruct the image based on the prediction mode, using the pixels of the reconstructed image as the reference pixels for encoding the current block. In other words, when determining the optimal prediction mode for each block to be encoded, it is not necessary to encode them one by one. The optimal prediction mode for each block to be encoded can be determined in parallel. This application can not only improve the encoding efficiency but also the encoding accuracy.
[0042] In one embodiment, step 120 can be specifically implemented as follows: if there is no target orientation of an adjacent coding block among the multiple preset orientations of the block to be encoded, then the reference pixel at the target orientation is set to a fixed value.
[0043] In the original image, among multiple blocks to be encoded, some blocks have no adjacent blocks, meaning there are no adjacent blocks at the target location of the block to be encoded. For example, the left, lower left, top, upper right, and upper left sides of the first block have no adjacent blocks, meaning there are no reference pixels. In this case, the magnitude of the reference pixel at the target location can be fixed, which can be 128. This is because a pixel is represented by 8 bits (a byte), and the maximum grayscale value is 255. The grayscale value of the reference pixel after preprocessing can be 128.
[0044] In one embodiment, step 120 may be specifically implemented as: performing a second image preprocessing on a plurality of reference pixels at a preset orientation to obtain processed reference pixels at a plurality of preset orientations.
[0045] In this embodiment of the application, in order to transform the reference pixels of the current block to be encoded into pixels in the reconstructed image of the previous block, a second image preprocessing can be performed on the reference pixels at multiple preset orientations to obtain the processed reference pixels at multiple preset orientations, thereby predicting the current block to be encoded.
[0046] In one embodiment, step 120 may be specifically implemented as follows: filtering the reference pixel at each preset orientation to obtain multiple filtered reference pixels at multiple preset orientations, quantizing the multiple filtered reference pixels at multiple preset orientations to obtain multiple quantized reference pixels at multiple preset orientations, and reconstructing the multiple quantized reference pixels at multiple preset orientations to obtain multiple reconstructed reference pixels at multiple preset orientations.
[0047] First, the reference pixels at each preset orientation are filtered to compress them. Then, the filtered reference pixels at each preset orientation are quantized. Quantization aims to achieve a higher compression ratio by discarding information with minimal visual impact while maintaining a certain level of subjective image fidelity. Finally, the quantized reference pixels at each preset orientation are reconstructed to obtain the reconstructed reference pixels.
[0048] In one embodiment, step 120 may be specifically implemented as follows: performing discrete cosine transform on the reference pixel at each preset orientation to obtain frequency domain coefficients at multiple preset orientations; performing integer operations on the frequency domain coefficients at each preset orientation to obtain the filtered reference pixel at the multiple preset orientations.
[0049] The reference pixel at each preset orientation undergoes a discrete cosine transform (DCT) to obtain frequency domain coefficients at multiple preset orientations. The DCT is used to ensure that the reference image, after processing, obtains a statistical distribution consistent with the reconstructed image, thereby increasing the accuracy of the prediction.
[0050] In this embodiment of the application, it is also necessary to perform integer operations on the frequency domain coefficients at each preset orientation, that is, to divide the reference pixel at each preset orientation by the corresponding frequency domain coefficient, then discard the decimal part, and then perform inverse quantization and inverse transformation to obtain the filtered reference pixels at multiple preset orientations.
[0051] The frequency domain coefficients at each preset orientation may be real numbers. For real frequency domain coefficients, due to the precision issues of floating-point operations at the decoding end, mismatches will occur in the decoded data, which will cause drift. Intra-frame prediction is very sensitive to prediction drift. Therefore, using integer operations can avoid losing the accuracy of the image.
[0052] In one embodiment, step 120 may be specifically implemented as follows: calculating the quantization step size based on the quantization coefficients of the original image and the frequency domain coefficients at multiple preset orientations; and calculating the quantized reference pixels at multiple preset orientations based on the quantization step size and the filtered reference pixels at multiple preset orientations.
[0053] Since frequency domain coefficients contain spatial frequency information, the varying sensitivity of the human eye to different frequencies can be fully utilized to select the values of elements in the quantization table. Quantization removes correlations from image signals, reducing the dynamic range of image coding. The quantization step size determines the quantizer's coding compression ratio and image precision. Therefore, based on the quantization coefficients of the original image and the frequency domain coefficients at multiple preset orientations, the quantization step size is calculated. Multiplying the quantization step size by the filtered reference pixel at each preset orientation yields the quantized reference pixel at each preset orientation. This multiplication operation reduces the computational load of coding, improving the real-time performance of image compression.
[0054] In one embodiment, step 120 can be specifically implemented as: performing inverse discrete cosine transform on multiple quantized reference pixels at multiple preset orientations to obtain multiple reconstructed reference pixels at multiple preset orientations.
[0055] In this embodiment, the image is compressed by discrete cosine transform and quantization. The compressed image is not the original image. Therefore, it is necessary to perform inverse discrete cosine transform on the quantized reference pixel at each preset position to display the original image corresponding to the reference pixel.
[0056] Figure 3 is a flowchart illustrating a preprocessing method for encoding provided in an exemplary embodiment of this application. Figure 4 is a structural diagram illustrating a mean calculation method provided in an exemplary embodiment of this application.
[0057] As shown in Figure 3-4, step 130 may include:
[0058] Step 131: Construct multiple pixel blocks based on the reference pixel at each preset orientation and the corresponding surrounding pixels, wherein each pixel block includes a reference pixel and eight surrounding pixels.
[0059] Multiple pixel blocks are formed based on the reference pixel at each preset orientation and the surrounding pixels. The surrounding pixels may include the reference pixel at the preset orientation and the pixels in the preprocessed block to be encoded.
[0060] Step 132: Calculate the mean value for each pixel block.
[0061] As shown in Figure 4, the pixel value A of the block to be encoded is the average of the pixel values corresponding to the reference pixels BCDEF and the pixel values of the block to be encoded GHI. This average value improves the ease of calculation for each pixel.
[0062] Step 133: Use the mean as the value of the corresponding preprocessed block to be encoded.
[0063] Following the calculation method described above, the pixel value of each pixel in the preprocessed block to be encoded is replaced sequentially.
[0064] In one embodiment, step 160 can be specifically implemented as: selecting the prediction mode corresponding to the residual that is less than or equal to a preset difference threshold from the plurality of residuals as the optimal prediction mode.
[0065] To obtain the similarity value between the predicted block and the preprocessed block to be encoded, the difference between each predicted block and the predicted block to be encoded is calculated to obtain multiple residuals, which are the similarity values between each predicted block and the predicted block to be encoded.
[0066] It is understandable that the higher the similarity value between each predicted block and the predicted block to be encoded, the smaller the corresponding residual. Therefore, the prediction mode corresponding to the residual that is less than or equal to the preset difference threshold among multiple residuals is selected as the optimal prediction mode. When the image is decoded using the optimal prediction mode and the corresponding residual, the reconstructed image is more similar to the original image.
[0067] Figure 5 is a schematic diagram of the structure of an intra-frame prediction device based on the encoding end provided in an exemplary embodiment of this application. As shown in Figure 5, the intra-frame prediction device 20 based on the encoding end includes: an image acquisition module 201, used to acquire an original image, wherein the original image includes a block to be encoded; a pixel acquisition module 202, used to acquire multiple reference pixels at preset orientations; wherein each reference pixel at a preset orientation is adjacent to a pixel of the block to be encoded; a preprocessing module 203, used to acquire multiple prediction blocks based on the preprocessed prediction blocks, the multiple reference pixels at preset orientations, and multiple preset prediction modes; a prediction post-module 204, used to acquire multiple prediction blocks based on the preprocessed prediction blocks, the multiple reference pixels at preset orientations, and multiple preset prediction modes; a residual acquisition module 205, used to acquire multiple residuals based on each prediction block and the preprocessed block to be encoded; wherein the residuals represent the difference between the predicted block to be encoded and the prediction blocks; and a mode determination module 206, used to determine the optimal prediction mode for decoding the block to be encoded based on the multiple residuals and preset conditions.
[0068] The intra-frame prediction apparatus based on the encoding end provided in this application includes: an image acquisition module 201 acquiring an original image to be encoded, wherein the original image to be encoded includes a block to be encoded; a pixel acquisition module 202 acquiring multiple reference pixels at preset orientations, wherein each reference pixel at a preset orientation is adjacent to a pixel of the block to be encoded; a preprocessing module 203 performing a first image preprocessing on the block to be encoded based on the multiple reference pixels at preset orientations to obtain a preprocessed block to be encoded; a prediction module 204 acquiring multiple predicted result prediction blocks of the block to be encoded based on the preprocessed block to be encoded, the multiple reference pixels at preset orientations, and multiple preset prediction modes; a residual acquisition module 205 acquiring multiple residuals based on each of the multiple predicted result blocks of the block to be encoded and the preprocessed block to be encoded, wherein the residual represents the difference between the predicted block to be encoded and the predicted block to be encoded based on the preprocessed block to be encoded; and a mode determination module 206 determining the optimal prediction mode for decoding the block to be encoded based on the multiple residuals and preset conditions. This application filters the reference pixels of the current block to be encoded to approximate the pixels in the image reconstructed after decoding the previous block. Therefore, unlike the prior art, it does not need to wait for the previous block to determine the accurate prediction mode and then reconstruct the image based on the prediction mode, using the pixels of the reconstructed image as the reference pixels for encoding the current block. In other words, when determining the optimal prediction mode for each block to be encoded, it is not necessary to encode them one by one. The optimal prediction mode for each block to be encoded can be determined in parallel. This application can not only improve the encoding efficiency but also the encoding accuracy.
[0069] Figure 6 is a schematic diagram of an intra-frame prediction device based on the encoding end provided in another exemplary embodiment of this application. As shown in Figure 6, the pixel acquisition module 202 may include: a setting unit 2021, used to set a reference pixel at the target orientation to a fixed value if there is no target orientation of an adjacent coding block among the plurality of preset orientations of the block to be encoded.
[0070] In one embodiment, as shown in FIG6, the pixel acquisition module 202 may include: a preprocessing subunit 2022, used to perform a second image preprocessing on the multiple preset orientation reference pixels to obtain the processed reference pixels at the multiple preset orientations.
[0071] In one embodiment, the preprocessing subunit 2021 may be specifically configured to: filter each reference pixel at the preset orientation to obtain multiple filtered reference pixels at the preset orientation; quantize the multiple filtered reference pixels at the preset orientation to obtain multiple quantized reference pixels at the preset orientation; and reconstruct the multiple quantized reference pixels at the preset orientation to obtain multiple reconstructed reference pixels at the preset orientation.
[0072] In one embodiment, the preprocessing subunit 2021 may be specifically configured to perform discrete cosine transform on each reference pixel at a preset orientation to obtain frequency domain coefficients at multiple preset orientations.
[0073] Integer operations are performed on the frequency domain coefficients at each of the preset orientations to obtain the filtered reference pixels at the multiple preset orientations.
[0074] In one embodiment, the preprocessing subunit 2021 may be specifically configured to: calculate the quantization step size based on the quantization coefficients of the original image and the frequency domain coefficients at the plurality of preset orientations; and calculate the quantized reference pixels at the plurality of preset orientations based on the quantization step size and the filtered reference pixels at the plurality of preset orientations.
[0075] In one embodiment, the preprocessing subunit 2021 may be specifically configured to perform inverse discrete cosine transform on the quantized reference pixels at the plurality of preset orientations to obtain the reconstructed reference pixels at the plurality of preset orientations.
[0076] In one embodiment, the preprocessing module 203 may be specifically configured to: construct multiple pixel blocks based on a reference pixel at each preset orientation and its corresponding surrounding pixels; wherein each pixel block includes a reference pixel and eight surrounding pixels; calculate the mean value of each pixel block; and use the mean value as the value of the corresponding preprocessed block to be encoded.
[0077] In one embodiment, as shown in FIG6, the mode determination module 206 may include a selection unit 2061, which is used to select the prediction mode corresponding to the residuals that are less than or equal to a preset difference threshold from the plurality of residuals as the optimal prediction mode.
[0078] This application provides an intra-frame prediction method based on the decoding end, comprising: decoding the original image according to the residual of the original image and the optimal prediction mode corresponding to the residual to obtain the reconstructed image; wherein the residual and the optimal prediction mode are obtained by any of the above-mentioned intra-frame prediction methods based on the encoding end.
[0079] Figure 7 illustrates a block diagram of an electronic device according to an embodiment of this application.
[0080] As shown in Figure 7, the electronic device 10 includes one or more processors 11 and memory 12.
[0081] The processor 11 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 10 to perform desired functions.
[0082] The memory 12 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 11 may execute the program instructions to implement the intra-frame prediction methods based on the encoding end and the intra-frame prediction methods based on the decoding end of the various embodiments of this application described above, and / or other desired functions. Various contents such as input signals, signal components, and noise components may also be stored in the computer-readable storage medium.
[0083] In one example, the electronic device 10 may also include an input device 13 and an output device 14, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0084] When the electronic device is a standalone device, the input device 13 can be a communication network connector for receiving the collected input signals from the first device and the second device.
[0085] In addition, the input device 13 may also include, for example, a keyboard, a mouse, etc.
[0086] The output device 14 can output various information to the outside, including determined distance information, direction information, etc. The output device 14 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0087] Of course, for simplicity, Figure 7 only shows some of the components of the electronic device 10 that are relevant to this application, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 10 may include any other suitable components depending on the specific application.
[0088] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0089] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0090] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A frame prediction method based on the coding end, characterized in that, include: The process involves: acquiring an original image, wherein the original image includes a block to be encoded; acquiring multiple filtered reference pixels at preset orientations, wherein each reference pixel at a preset orientation is adjacent to a pixel in the block to be encoded; performing a first image preprocessing on the block to be encoded based on the multiple filtered reference pixels at preset orientations to obtain a preprocessed block to be encoded; acquiring multiple prediction blocks based on the preprocessed block to be encoded, the multiple filtered reference pixels at preset orientations, and multiple preset prediction modes; acquiring multiple residuals based on each prediction block and the preprocessed block to be encoded, wherein the residuals represent the difference between the preprocessed block to be encoded and the prediction blocks; and determining the optimal prediction mode for decoding the block to be encoded based on the multiple residuals and preset conditions.
2. The intra-frame prediction method based on the coding end according to claim 1, characterized in that, The step of obtaining filtered reference pixels at multiple preset orientations includes: if there is no target orientation of an adjacent coding block among the multiple preset orientations of the block to be encoded, then the filtered reference pixels at the target orientation are set to a fixed value.
3. The intra-frame prediction method based on the coding end according to claim 1, characterized in that, The step of obtaining multiple filtered reference pixels at preset orientations includes: performing a second image preprocessing on the multiple filtered reference pixels at preset orientations to obtain multiple processed reference pixels at preset orientations.
4. The intra-frame prediction method based on the coding end according to claim 3, characterized in that, The step of performing a second image preprocessing on the filtered reference pixels at the plurality of preset orientations to obtain processed reference pixels at the plurality of preset orientations includes: filtering each reference pixel at the preset orientation to obtain filtered reference pixels at the plurality of preset orientations; quantizing the filtered reference pixels at the plurality of preset orientations to obtain quantized reference pixels at the plurality of preset orientations; and reconstructing the quantized reference pixels at the plurality of preset orientations to obtain reconstructed reference pixels at the plurality of preset orientations.
5. The intra-frame prediction method based on the coding end according to claim 4, characterized in that, The step of filtering each reference pixel at a preset orientation to obtain multiple filtered reference pixels at preset orientations includes: performing a discrete cosine transform on each reference pixel at a preset orientation to obtain frequency domain coefficients at multiple preset orientations; and performing integer operations on the frequency domain coefficients at each preset orientation to obtain the multiple filtered reference pixels at preset orientations.
6. The intra-frame prediction method based on the coding end according to claim 5, characterized in that, The step of quantizing the filtered reference pixels at the plurality of preset orientations to obtain quantized reference pixels at the plurality of preset orientations includes: calculating a quantization step size based on the quantization coefficients of the original image and the frequency domain coefficients at the plurality of preset orientations; and calculating the quantized reference pixels at the plurality of preset orientations based on the quantization step size and the filtered reference pixels at the plurality of preset orientations.
7. The intra-frame prediction method based on the coding end according to claim 4, characterized in that, The step of reconstructing the quantized reference pixels at the plurality of preset orientations to obtain the reconstructed reference pixels at the plurality of preset orientations includes: performing an inverse discrete cosine transform on the quantized reference pixels at the plurality of preset orientations to obtain the reconstructed reference pixels at the plurality of preset orientations.
8. The intra-frame prediction method based on the coding end according to claim 1, characterized in that, The step of performing a first image preprocessing on the block to be encoded based on the filtered reference pixels at the plurality of preset orientations to obtain the preprocessed block to be encoded includes: constructing a plurality of pixel blocks based on each filtered reference pixel at the preset orientation and its corresponding surrounding pixels; wherein each pixel block includes one reference pixel and eight surrounding pixels; calculating the mean value of each pixel block; and using the mean value as the value of the corresponding preprocessed block to be encoded.
9. The intra-frame prediction method based on the coding end according to claim 1, characterized in that, The step of determining the optimal prediction mode for decoding the block to be encoded based on the plurality of residuals and preset conditions includes: selecting the prediction mode corresponding to the residuals that are less than or equal to a preset difference threshold from the plurality of residuals as the optimal prediction mode.
10. An intra-frame prediction device based on the coding end, characterized in that, include: An image acquisition module is used to acquire an original image, wherein the original image includes a block to be encoded; a pixel acquisition module is used to acquire multiple filtered reference pixels at preset orientations, wherein each reference pixel at a preset orientation is adjacent to a pixel of the block to be encoded; a preprocessing module is used to perform a first image preprocessing on the block to be encoded based on the multiple filtered reference pixels at preset orientations to obtain a preprocessed block to be encoded; a prediction module is used to acquire multiple prediction blocks based on the preprocessed prediction blocks, the multiple filtered reference pixels at preset orientations, and multiple preset prediction modes; a residual acquisition module is used to acquire multiple residuals based on each prediction block and the preprocessed block to be encoded, wherein the residual represents the difference between the preprocessed block to be encoded and the prediction block; and a mode determination module is used to determine the optimal prediction mode for decoding the block to be encoded based on the multiple residuals and preset conditions.
Citation Information
Patent Citations
A H.264 standard in-frame prediction mode selection method
CN101087427A
Intra-frame predictor implementing method based on AVS parallel flow
CN101383970A