Method for determining intra prediction mode, image encoding and image decoding

By using the first chroma intra-frame prediction mode in video coding technology to determine candidate chroma prediction values, the process of determining coefficient values ​​is simplified, the problem of long image coding time is solved, and more efficient coding and higher quality image reconstruction are achieved.

CN115988223BActive Publication Date: 2026-03-24ALIBABA (CHINA) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-26
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing video coding technologies, such as AV1 video coding, are time-consuming in the image encoding process, resulting in low coding efficiency.

Method used

By using the first chroma intra-prediction mode to determine the candidate chroma prediction values ​​in the coding block, and using the candidate chroma prediction values ​​to determine the coefficient values ​​of the target coefficients in the second chroma intra-prediction mode, the process of determining coefficient values ​​is simplified, and the amount of computation and time consumption are reduced.

Benefits of technology

It reduces the time required for image encoding, improves encoding efficiency, and reduces resource consumption, while ensuring high compression rate and high fidelity of the reconstructed image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115988223B_ABST
    Figure CN115988223B_ABST
Patent Text Reader

Abstract

The application provides a method for determining an intra prediction mode, an image encoding method, an image decoding method, an electronic device and a storage medium, and relates to the technical field of image processing. The method for determining the intra prediction mode comprises: for a coding block in a to-be-encoded image, using a first chroma intra prediction mode to determine a candidate chroma prediction value corresponding to a pixel in the coding block; using the candidate chroma prediction value to determine a coefficient value of a target coefficient in a second chroma intra prediction mode, to obtain the second chroma intra prediction mode after the coefficient value is determined; and the second chroma intra prediction mode is used to predict a chroma value according to a luminance value of the pixel. The scheme of the application can reduce the time consumption of image encoding, reduce the resources required for image encoding, and improve the encoding efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and particularly relates to a method for determining an intra prediction mode. The present application also relates to an image encoding method, an image decoding method, an electronic device and a storage medium. BACKGROUND

[0002] Video encoding technology is a technology for converting a file in an original video format into a file in another video format. Video encoding technology can be applied not only to encoding video frames, but also to encoding other image types of images other than video frames. However, in the application of video encoding technology, there is often a problem of long image encoding time.

[0003] Taking AOMedia Video 1 (AV1) video encoding technology as an example, as a video encoding technology designed for video transmission over the Internet, the AV1 video encoding technology has been widely used because of its good compression performance and high fidelity. However, the AV1 video encoding technology also has the problem of long image encoding time in the application process.

[0004] Therefore, how to reduce the time consumption of image encoding has become a technical problem that must be faced in the application of video encoding technology. SUMMARY

[0005] The embodiments of the present application provide a method for determining an intra prediction mode, an image encoding method, an image decoding method, an electronic device and a storage medium to reduce the time consumption of image encoding.

[0006] In a first aspect, the embodiments of the present application provide a method for determining an intra prediction mode, comprising:

[0007] For a coding block in a to-be-encoded image, a first chroma intra prediction mode is used to determine a candidate chroma prediction value corresponding to a pixel in the coding block;

[0008] A coefficient value of a target coefficient in a second chroma intra prediction mode is determined by using the candidate chroma prediction value, to obtain the second chroma intra prediction mode after the coefficient value is determined; the second chroma intra prediction mode is used to predict a chroma value according to a luminance value of the pixel.

[0009] In a second aspect, the embodiments of the present application provide an image encoding method, comprising:

[0010] For a coding block in a to-be-encoded image, a first chroma intra prediction mode is used to determine a candidate chroma prediction value corresponding to a pixel in the coding block;

[0011] The coefficient value of the target coefficient in the second chroma intra prediction mode is determined by using a candidate chroma prediction value, the second chroma intra prediction mode being used to predict a chroma value according to a luminance value of a pixel;

[0012] A target chroma intra prediction mode is determined from a plurality of chroma intra prediction modes, the plurality of chroma intra prediction modes including at least the second chroma intra prediction mode after the coefficient value is determined;

[0013] The target chroma intra prediction mode is used to encode the coding block.

[0014] In a third aspect, an embodiment of the present application provides an image decoding method, including:

[0015] A data stream obtained by encoding the target image is decoded to determine a target chroma intra prediction mode used when the coding block in the target image is encoded, the target chroma intra prediction mode being determined from a plurality of chroma intra prediction modes including a first chroma intra prediction mode after a coefficient value is determined, the first chroma intra prediction mode being used to predict a chroma value according to a luminance value of a pixel, the coefficient value of a target coefficient in the first chroma intra prediction mode being obtained according to a candidate chroma prediction value corresponding to a pixel in the coding block, the candidate chroma prediction value being obtained by using a second chroma intra prediction mode to perform chroma prediction on the coding block;

[0016] A reconstructed image corresponding to the target image is constructed according to at least the target chroma intra prediction mode.

[0017] In a fourth aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, the processor implementing the method provided by any of the embodiments of the present application when executing the computer program.

[0018] In a fifth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being executed by a processor to implement the method provided by any of the embodiments of the present application.

[0019] Compared with the related art, the present application has the following advantages:

[0020] According to the technical solution of the present application, for a coding block in a to-be-coded image, a first chroma intra prediction mode is used to determine candidate chroma prediction values corresponding to pixels in the coding block, and then the candidate chroma prediction values are used to determine the coefficient value of a target coefficient in a second chroma intra prediction mode, so that the second chroma intra prediction mode with the determined coefficient value is obtained. Since the candidate chroma prediction values are used to determine the coefficient value of the target coefficient in the second chroma intra prediction mode in the process of obtaining the second chroma intra prediction mode with the determined coefficient value, the parameters required in the process of determining the coefficient value are relatively small, so that the process of determining the coefficient value is relatively simple, the time length required for the process of determining the coefficient value is reduced, that is, the time required for obtaining the second chroma intra prediction mode with the determined coefficient value is reduced.

[0021] In addition, the time required for obtaining the second chroma intra prediction mode with the determined coefficient value is reduced, which further reduces the time required for image coding and improves the coding efficiency. At the same time, since the amount of calculation required in the process of determining the coefficient value is reduced, the technical solution of the present application can also reduce the resources required for image coding.

[0022] The above summary is merely intended to illustrate the present application and is not intended to limit the present application in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features of the present application will be apparent to those skilled in the art from the drawings and the following detailed description. BRIEF DESCRIPTION OF DRAWINGS

[0023] In the drawings, like reference numerals refer to same or similar functionalities throughout the several views. The drawings are not necessarily to scale. It is to be understood that the drawings only depict several embodiments in accordance with the disclosure and should not be interpreted to limit the scope of the disclosure.

[0024] Figure 1 A schematic diagram of a process of determining an intra prediction mode is shown in the embodiments of the present application;

[0025] Figure 2 A flowchart of a method of determining an intra prediction mode is shown in the embodiments of the present application;

[0026] Figure 3 A flowchart of a method of image coding is shown in the embodiments of the present application;

[0027] Figure 4 A flowchart of a method of image decoding is shown in the embodiments of the present application;

[0028] Figure 5A structural block diagram of a device for determining an intra prediction mode is shown in the embodiments of the present application.

[0029] Figure 6 A structural block diagram of a device for encoding an image is shown in the embodiments of the present application.

[0030] Figure 7 A structural block diagram of a device for decoding an image is shown in the embodiments of the present application.

[0031] Figure 8 A block diagram of an electronic device is shown in the embodiments of the present application. DETAILED DESCRIPTION

[0032] In the following, only some exemplary embodiments are simply described. As those skilled in the art can recognize, the described embodiments can be modified in various different ways without departing from the concept or scope of the present application. Therefore, the drawings and the description are considered to be exemplary in nature, rather than limiting.

[0033] To facilitate understanding of the technical solutions of the embodiments of the present application, the related technologies of the embodiments of the present application are described below. The following related technologies can be combined with the technical solutions of the embodiments of the present application in any manner as optional solutions, and all of them belong to the protection scope of the embodiments of the present application.

[0034] The embodiments of the present application relate to a scheme of encoding, decoding an image and determining an intra prediction mode in the process of encoding. In the process of encoding, the image is taken as a to-be-encoded image, which can be a video frame or an image of other image types except for a video frame.

[0035] The to-be-encoded image corresponds to an image format. In an example, the image format is a luminance chrominance (YUV) format, in which Y represents a luminance (Luminance or Luma) component of a pixel, the luminance component of the pixel is a gray value of the pixel, and the luminance can also be referred to as brightness; U and V represent chrominance (Chrominance or Chroma) components of the pixel, the chrominance components are used to describe color and saturation of the pixel, and determine the color of the pixel. Specifically, U represents a blue chrominance component of the pixel, and V represents a red chrominance component of the pixel.

[0036] The YUV format can further be a YUV420 format, a YUV422 format or a YUV444 format, wherein in the YUV444 format each Y corresponds to one U and one V, in the YUV422 format each two Ys correspond to one U and one V, and in the YUV420 format each four Ys correspond to one U and one V. By way of an example, the size of the to-be-encoded image is denoted as W (Wide) * H (Height), which means that the to-be-encoded image has W*H pixels, including W pixels in the width and H pixels in the length. When the image format of the to-be-encoded image is YUV420, the W*H pixels in the to-be-encoded image correspond to W*H luminance values, the W*H pixels in the to-be-encoded image correspond to (W / 4)*(H / 4) chrominance values in the blue chrominance component, and the W*H pixels in the to-be-encoded image correspond to (W / 4)*(H / 4) chrominance values in the red chrominance component. When the image format of the to-be-encoded image is YUV422, the W*H pixels in the to-be-encoded image correspond to W*H luminance values, the W*H pixels in the to-be-encoded image correspond to (W / 2)*(H / 2) chrominance values in the blue chrominance component, and the W*H pixels in the to-be-encoded image correspond to (W / 2)*(H / 2) chrominance values in the red chrominance component. When the image format of the to-be-encoded image is YUV444, the W*H pixels in the to-be-encoded image correspond to W*H luminance values, the W*H pixels in the to-be-encoded image correspond to W*H chrominance values in the blue chrominance component, and the W*H pixels in the to-be-encoded image correspond to W*H chrominance values in the red chrominance component.

[0037] Intra prediction refers to predicting the to-be-reconstructed pixels by using the already-reconstructed pixels in the same to-be-encoded image, and the intra prediction can be specifically divided into luminance intra prediction and chrominance intra prediction. The luminance intra prediction is used for luminance prediction of the coding block to obtain the luminance prediction value corresponding to the pixel, and the chrominance intra prediction is used for chrominance prediction of the coding block to obtain the chrominance prediction value corresponding to the pixel. The chrominance intra prediction includes chrominance prediction of the blue chrominance of the pixel and chrominance prediction of the red chrominance of the pixel.

[0038] In video coding technology, a plurality of intra prediction modes are usually included, and in the process of encoding a to-be-encoded image, an optimal intra prediction mode with better compression performance and higher fidelity is selected from the plurality of intra prediction modes to perform the encoding of the to-be-encoded image. Specifically, the luminance prediction is implemented by using a luminance intra prediction mode, and the chrominance prediction is implemented by using a chrominance intra prediction mode. The luminance intra prediction mode includes but is not limited to a luminance DC (direct current) intra prediction mode, a luminance Smooth (smooth) intra prediction mode, and a plurality of luminance angle intra prediction modes. In the embodiments of the present application, an optimal luminance intra prediction mode for encoding a coding block is determined from the plurality of luminance intra prediction modes, and is recorded as a target luminance intra prediction mode. The chrominance intra prediction mode includes but is not limited to a CFL (Chroma From Luma, chrominance from luminance) intra prediction mode, a chrominance DC (direct current) intra prediction mode, a chrominance Smooth (smooth) intra prediction mode, and a plurality of chrominance angle intra prediction modes. In the embodiments of the present application, an optimal chrominance intra prediction mode for encoding a coding block is determined from the plurality of chrominance intra prediction modes.

[0039] In the embodiments of the present application, when encoding a to-be-encoded image, the to-be-encoded image can be first divided into a plurality of non-overlapping coding units (Super Block, super block), and the coding units are further divided into smaller coding blocks (Code Block, code block), and then the to-be-encoded image is encoded by taking the coding block as the encoding unit. In an example, the to-be-encoded image can be divided into a plurality of coding blocks with square or rectangular shapes, wherein the size of the square coding block can be 32 (W) x 32 (H), 16 (W) x 16 (H) or 8 (W) x 8 (H), and the size of the rectangular coding block can be 32 (W) x 16 (H), 16 (W) x 32 (H), 16 (W) x 8 (H) or 8 (W) x 16 (H). It should be noted that the division method of the super block and the coding block is not limited in the embodiments of the present application.

[0040] In the embodiments of the present application, the luminance prediction value refers to a luminance value obtained by using a luminance intra prediction mode to perform luminance prediction on pixels of a coding block, the luminance real value refers to a real luminance value corresponding to a pixel, the difference between the luminance real value corresponding to the pixel and the luminance prediction value is referred to as a luminance residual value, and a luminance residual coefficient is obtained by performing transformation, quantization and other processing on the luminance residual value. Further, a reconstructed luminance residual value is obtained by performing inverse transformation, inverse quantization and other processing on the luminance residual coefficient, and a reconstructed luminance value can be constructed based on the luminance prediction value and the reconstructed luminance residual value, for example, the sum of the luminance prediction value and the reconstructed luminance residual value is taken as the reconstructed luminance value. After the target luminance intra prediction mode is determined, the corresponding obtained luminance prediction value is the target luminance reconstructed value, and the luminance residual coefficient corresponding to the target luminance intra prediction mode is referred to as the target luminance residual coefficient.

[0041] In the embodiments of the present application, the chroma prediction value refers to a chroma value obtained by using a chroma intra prediction mode to perform chroma prediction on pixels of a coding block, and the chroma prediction value determined using the first chroma intra prediction mode is referred to as a candidate chroma prediction value. The chroma real value refers to a real chroma value corresponding to a pixel in the coding block, the difference between the chroma real value corresponding to the pixel and the chroma prediction value is referred to as a chroma residual value, and a chroma residual coefficient is obtained by performing transformation, quantization and other processing on the chroma residual value. Further, a reconstructed chroma residual value is obtained by performing inverse transformation, inverse quantization and other processing on the chroma residual coefficient, and a reconstructed chroma value can be constructed based on the chroma prediction value and the reconstructed chroma residual value, for example, the sum of the chroma prediction value and the reconstructed chroma residual value is taken as the reconstructed chroma value. After the target chroma intra prediction mode is determined, the corresponding obtained chroma prediction value is the target chroma reconstructed value, and the chroma residual coefficient corresponding to the target chroma intra prediction mode is referred to as the target chroma residual coefficient.

[0042] The transformation, quantization, inverse quantization and inverse transformation refer to operations such as DFT (Discrete Fourier Transform), DCT (Discrete Cosine Transform) and the like on the chroma residual value or the luminance residual value.

[0043] After the target luma intra prediction mode and the target chroma intra prediction mode are determined, the encoding block can be encoded according to the target luma intra prediction mode and the target chroma intra prediction mode to obtain a corresponding data stream. In an example, the data stream is a binary (0 or 1) bit stream. At this time, the encoding of the encoding block according to the target luma intra prediction mode and the target chroma intra prediction mode to obtain the corresponding data stream can mean that the target luma intra prediction mode, the target chroma intra prediction mode are encoded, and the target luma residual coefficients and the target chroma residual coefficients are entropy coded or statistically coded to obtain the binary bit stream. That is, the bit stream not only includes the information of the target luma residual coefficients and the target chroma residual coefficients, but also includes the information of the target luma intra prediction mode and the target chroma intra prediction mode.

[0044] In the process of determining the target luma intra prediction mode, the luma rate-distortion cost (RD Cost) is an important basis, which is a parameter of luma rate-distortion optimization, used to reflect the distortion degree between the luma reconstructed value and the luma real value, and the number of bits consumed by encoding the luma intra prediction mode, the corresponding residual coefficients, etc. The process of luma rate-distortion optimization means selecting a luma intra prediction mode with a luma rate-distortion cost meeting a preset requirement as the target luma intra prediction mode from multiple luma intra prediction modes. In the process of determining the target luma intra prediction mode, the chroma rate-distortion cost is an important basis, which is a parameter of chroma rate-distortion optimization, used to reflect the distortion degree between the chroma reconstructed value and the chroma real value, and the number of bits consumed by encoding the chroma intra prediction mode, the corresponding residual coefficients, etc. The process of chroma rate-distortion optimization means selecting a chroma intra prediction mode with a chroma rate-distortion cost meeting a preset requirement as the target chroma intra prediction mode from multiple chroma intra prediction modes.

[0045] Since in the process of encoding a to-be-encoded image, an optimal intra prediction mode is often selected from multiple intra prediction modes to ensure better compression performance and higher fidelity, and since the chroma intra prediction mode (second chroma intra prediction mode) for predicting a chroma value according to a luminance value of a pixel can reduce the complexity of image decoding and make the reconstructed image have higher fidelity, in many video coding technologies (for example, the AV1 video coding technology), the second chroma intra prediction mode is taken as one of the multiple chroma intra prediction modes. In addition, since the second chroma intra prediction mode can reduce the complexity of image decoding and make the reconstructed image have higher fidelity, in some scenarios, after the coefficient value of the target coefficient in the second chroma intra prediction mode is determined, the second chroma intra prediction mode after the coefficient value of the target coefficient is determined is used to encode the coding block.

[0046] The prediction of the chroma value according to the luminance value of the pixel refers to predicting the chroma value corresponding to the pixel by using the luminance value corresponding to the pixel based on the correlation between the luminance value corresponding to the pixel and the chroma value corresponding to the pixel. Specifically, a linear model y = ax + b between the luminance value corresponding to the pixel and the chroma value corresponding to the pixel can be established first, and then the prediction of the chroma value corresponding to the pixel is implemented by using the linear model (y = ax + b) and the luminance value corresponding to the pixel. In the linear model y = ax + b, y is used to represent the chroma value corresponding to the pixel, x is used to represent the luminance value corresponding to the pixel (for a to-be-encoded image in YUV444 format) or the down-sampled value of the luminance value corresponding to the pixel (for a to-be-encoded image in YUV422 or YUV420 format), a is the target coefficient, and b is another parameter in the linear model.

[0047] However, in the related art, the process of determining the coefficient value of the target coefficient often accompanies a large amount of calculation and a relatively long operation time, thereby causing the part of the video coding technology to have the problem of long image encoding time in the application process. However, in some scenarios, there is a demand to reduce the time consumption of image encoding, and therefore, how to reduce the time consumption of image encoding becomes a technical problem that the part of the video coding technology has to face in the application process.

[0048] Therefore, the embodiment of the present application provides a method for determining an intra prediction mode, and provides a corresponding image encoding method and image decoding method.

[0049] In order to more clearly show the method for determining an intra prediction mode provided in the embodiment of the present application, first, an application example of the method for determining an intra prediction mode provided in the embodiment of the present application is introduced. The specific implementation process of the example can be referred to Figure 1 The determination process of the intra prediction mode is shown as follows.

[0050] In the process of determining the intra prediction mode, the encoder with the image encoding function can first perform a luma intra prediction operation. The luma intra prediction operation refers to determining, for a coding block in a to-be-encoded image, a luma prediction value corresponding to a pixel in the coding block using a plurality of luma intra prediction modes, and calculating luma residual values corresponding to the plurality of luma intra prediction modes, and storing the obtained data in a pre-configured data storage.

[0051] After obtaining the luma residual value corresponding to each luma intra prediction mode, the encoder sequentially performs transform and quantization processing on the corresponding luma residual value to obtain luma residual coefficients corresponding to the luma intra prediction mode. After obtaining the luma residual coefficients corresponding to a luma intra prediction mode, the encoder sequentially performs inverse quantization and inverse transform processing on the corresponding luma residual coefficients to obtain reconstructed luma residual values corresponding to the luma intra prediction mode.

[0052] After obtaining the reconstructed luma residual values corresponding to each luma intra prediction mode, the encoder performs a data reconstruction operation. At this time, the data reconstruction operation refers to calculating luma reconstruction values corresponding to the luma intra prediction mode based on the reconstructed luma residual values corresponding to the luma intra prediction mode and the luma residual values. After obtaining the luma reconstruction values corresponding to each luma intra prediction mode, the encoder can store the luma reconstruction values corresponding to the luma intra prediction mode in the pre-configured data storage in a raster manner until the luma reconstruction values corresponding to the plurality of luma intra prediction modes are obtained.

[0053] After determining the luma reconstruction values corresponding to the plurality of luma intra prediction modes, the encoder further performs a rate-distortion optimization operation. At this time, the encoder performs rate-distortion optimization on the plurality of luma intra prediction modes to determine a target luma intra prediction mode. It should be noted that, in order to reduce the time length consumed in the process of determining the target chroma intra prediction mode and thus reduce the time consumption of image encoding, the encoder can further perform a chroma intra prediction operation in the process of determining the luma reconstruction values corresponding to the plurality of luma intra prediction modes. In the process of performing the chroma intra prediction operation, the encoder first determines candidate chroma prediction values corresponding to pixels in a coding block using a first chroma intra prediction mode, and stores the candidate chroma prediction values in a pre-configured data storage. That is, in the process of determining the target luma intra prediction, the coding block is chroma-predicted using the first chroma intra prediction mode to obtain the candidate chroma prediction values.

[0054] The first chroma intra prediction mode can be a chroma DC intra prediction mode. Alternatively, the first chroma intra prediction mode can be a chroma intra prediction mode other than the chroma DC intra prediction mode and the second chroma intra prediction mode.

[0055] After the candidate chroma prediction value is determined, the encoder further performs a coefficient value calculation operation. The coefficient value calculation operation refers to determining a coefficient value of a target coefficient in the second chroma intra prediction mode by using the candidate chroma prediction value, to obtain the second chroma intra prediction mode after the coefficient value is determined. Since the coefficient value of the target coefficient in the second chroma intra prediction mode can be determined by using the candidate chroma prediction value, the parameters required in the process of determining the coefficient value are relatively less, and thus the process of determining the coefficient value is relatively simple, and the time length consumed in the process of determining the coefficient value is reduced.

[0056] The coefficient value of the target coefficient in the second chroma intra prediction mode can be determined by using the candidate chroma prediction value and the target luma reconstructed value, to obtain the second chroma intra prediction mode after the coefficient value is determined. The second chroma intra prediction mode includes a CFL chroma intra prediction mode. Since the candidate chroma prediction value can be obtained in the process of determining the target luma intra prediction, the candidate chroma prediction value and the target luma reconstructed value can be directly obtained when the coefficient value is determined by using the candidate chroma prediction value and the target luma reconstructed value, and thus the time length consumed in the process of determining the coefficient value by using the candidate chroma prediction value and the target luma reconstructed value is reduced.

[0057] It should be noted that, in order to further reduce the time length consumed in determining the target chroma intra prediction mode, the chroma prediction value and the chroma residual value corresponding to the pixels in the coding block can be determined for the chroma intra prediction mode other than the first chroma intra prediction mode and the second chroma intra prediction mode in the process of determining the candidate chroma prediction value, and the chroma prediction value and the chroma residual value corresponding to the pixels in the coding block can be further determined for the second chroma intra prediction mode after the coefficient value is determined.

[0058] Since the encoder, in the process of obtaining the luma residual coefficients corresponding to a luma intra prediction mode, can start the process of obtaining the luma residual coefficients corresponding to the next luma intra prediction mode while performing the luma intra prediction operation, and can further perform the chroma intra prediction operation while performing the luma intra prediction operation, in the process of obtaining the chroma prediction value and the chroma residual value corresponding to a chroma intra prediction mode, the encoder can start the process of obtaining the chroma prediction value and the chroma residual value corresponding to the next chroma intra prediction mode. Therefore, the encoder can further perform the next operation or the next process without waiting for the previous operation or the previous process to be completed, thereby reducing the time required for determining the target chroma intra prediction mode and improving the encoding efficiency.

[0059] After obtaining the chroma residual value corresponding to each chroma intra prediction mode, the encoder can sequentially perform transform and quantization on the corresponding chroma residual value to obtain the chroma residual coefficients corresponding to the chroma intra prediction mode. After obtaining the chroma residual coefficients corresponding to a chroma intra prediction mode, the encoder can sequentially perform dequantization and inverse transform on the corresponding chroma residual coefficients to obtain the reconstructed chroma residual value corresponding to the chroma intra prediction mode.

[0060] After obtaining the reconstructed chroma residual value corresponding to each chroma intra prediction mode, the encoder can perform data reconstruction processing. At this time, the data reconstruction processing refers to calculating the chroma reconstructed value corresponding to the chroma intra prediction mode based on the reconstructed chroma residual value and the chroma residual value corresponding to the chroma intra prediction mode. After obtaining the chroma reconstructed value corresponding to each chroma intra prediction mode, the encoder can store the chroma reconstructed value corresponding to the chroma intra prediction mode in the preconfigured data storage in a raster scan manner until the chroma reconstructed values corresponding to multiple chroma intra prediction modes are obtained.

[0061] After determining the chroma reconstructed values corresponding to multiple chroma intra prediction modes, the encoder can further perform rate-distortion optimization operation. At this time, the encoder can perform rate-distortion optimization on the multiple chroma intra prediction modes to determine the target chroma intra prediction mode.

[0062] Since the candidate chroma prediction value can be used to determine the coefficient value of the target coefficient in the second chroma intra prediction mode after obtaining the determined coefficient value, the parameters required in the process of determining the coefficient value are relatively few, and thus the process of determining the coefficient value becomes relatively simple, the time required for obtaining the second chroma intra prediction mode after determining the coefficient value is reduced.

[0063] In addition, the time consumption required for determining the second chroma intra prediction mode is reduced, and the time consumption of image coding is further reduced, and the coding efficiency is improved. Meanwhile, the required calculation amount in the coefficient value determination process is reduced, and the resources required for image coding are also reduced.

[0064] In addition, since the target chroma intra prediction mode can make the distortion degree between the chroma reconstructed value and the chroma real value lower, and further can have a higher compression rate for the image to be coded, and can make the reconstructed image have a higher fidelity, the technical scheme provided in the present application can ensure that the image to be coded has a higher compression rate and the reconstructed image has a higher fidelity while reducing the time consumption of image coding.

[0065] It should be noted that the above application examples of the intra prediction mode determination method provided in the embodiments of the present application are for the purpose of understanding and are not intended to limit the application of the intra prediction mode determination method provided in the embodiments of the present application. Specifically, the application scenarios of the intra prediction mode determination method provided in the embodiments of the present application are not limited.

[0066] The determination scheme of the intra prediction mode, the encoding scheme and the decoding scheme of the present application can be an application program, a service, an instance, a functional module in the form of software, a virtual machine (VM), a container or a cloud server, etc., or a hardware device (such as a server, a terminal device) or a hardware chip (such as a CPU (Central Processing Unit), a GPU (Graphics Processing), a FPGA (Field Programmable Gate Array), a NPU (Neural-network Processing Unit), an AI (Artificial Intelligence) accelerator card or a DPU (Data Processing Unit)) with a data processing function, etc. Among them, the device for realizing the determination of the intra prediction mode, the device for realizing the image encoding or the device for realizing the image decoding can be deployed on a local computing device or a cloud computing platform providing computing power, storage and network resources. The mode of the cloud computing platform providing services to the outside can be IaaS (Infrastructure as a Service), PaaS (Platform as a Service), SaaS (Software-as-a-service) or DaaS (Data-as-a-service). Taking the platform providing SaaS (Software-as-a-Service) as an example, the cloud computing platform can provide the functions of the determination of the intra prediction mode, the image encoding or the image decoding by using its own computing resources, and the specific application architecture can be built according to the service requirements.

[0067] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific embodiments. The following related technologies can be combined with the technical solutions of the embodiments of the present application as optional schemes, which all belong to the protection scope of the embodiments of the present application, and the same or similar concepts or processes can not be described in detail in some embodiments.

[0068] Figure 2 A flowchart of a method 200 for determining an intra prediction mode provided in an embodiment of the present application is shown, which can include steps S201-S202.

[0069] In step S201, for a coding block in a to-be-encoded image, a first chroma intra prediction mode is used to determine a candidate chroma prediction value corresponding to a pixel in the coding block.

[0070] In an example, the image to be encoded can be a video frame, and the size of the coding block can be 8*8. According to the coding mode, the video frame can be further divided into I frames (Intra coded frames), P frames (Predicted frames) and B frames (Bi directional predicted frames). Specifically, the I frames are encoded by using an intra prediction coding mode, the P frames are encoded by using an inter prediction coding mode, and the B frames are encoded by using a bi-directional temporal prediction coding mode. When the I frames are encoded by using the intra prediction coding mode, the coding block is encoded according to the luminance intra prediction mode and the chrominance intra prediction mode. When the P frames are encoded by using the inter prediction coding mode and the B frames are encoded by using the bi-directional temporal prediction coding mode, the coding block is also encoded according to the luminance intra prediction mode and the chrominance intra prediction mode. That is, the video frame is generally an I frame, and can also be a P frame or a B frame.

[0071] The first chrominance intra prediction mode is used to determine the chrominance prediction value corresponding to the pixel in the coding block, which means that the first chrominance intra prediction mode is used to perform chrominance prediction on the coding block to obtain the candidate chrominance prediction value. The first chrominance intra prediction mode can be one of the chrominance intra prediction modes corresponding to the coding block, except for the second chrominance intra prediction mode.

[0072] In a possible implementation, the chrominance direct current intra prediction mode is selected as the first chrominance intra prediction mode as a mature and fast-to-implement chrominance intra prediction mode. That is, the first chrominance intra prediction mode includes the chrominance direct current intra prediction mode. When the first chrominance intra prediction mode is the chrominance direct current intra prediction mode, the first chrominance intra prediction mode is used to determine the chrominance prediction value corresponding to the pixel in the coding block, which means that the chrominance direct current intra prediction mode is used to perform chrominance prediction on the coding block to obtain the candidate chrominance prediction value. Since the chrominance direct current intra prediction mode can be quickly implemented, selecting the chrominance direct current intra prediction mode as the first chrominance intra prediction mode can improve the determination speed of the target chrominance intra prediction mode.

[0073] After the candidate chrominance prediction value is obtained, step S202 can be further performed. In step S202, the coefficient value of the target coefficient in the second chrominance intra prediction mode is determined by using the candidate chrominance prediction value, to obtain the second chrominance intra prediction mode after the coefficient value is determined; and the second chrominance intra prediction mode is used to predict the chrominance value according to the luminance value of the pixel.

[0074] The predicting the chroma value according to the luma value of the pixel refers to predicting the chroma value corresponding to the pixel based on the correlation between the luma value corresponding to the pixel and the chroma value corresponding to the pixel. The correlation between the luma value corresponding to the pixel and the chroma value corresponding to the pixel can reduce the complexity of the coefficient value. In an example, the determining the coefficient value of the target coefficient in the second chroma intra prediction mode by using the candidate chroma prediction value refers to determining the coefficient value by using the candidate chroma prediction value and the luma reconstructed value. In addition, in order to make the determined coefficient value more accurate, the target luma reconstructed value can be used for the determination of the coefficient value. At this time, the determining the coefficient value of the target coefficient in the second chroma intra prediction mode by using the candidate chroma prediction value refers to determining the coefficient value by using the candidate chroma prediction value and the target luma reconstructed value.

[0075] The second chroma intra prediction mode can refer to a CFL intra prediction mode. The CFL intra prediction mode needs to predict the chroma prediction value corresponding to the pixel according to the linear model between the luma reconstructed value corresponding to the pixel and the chroma prediction value corresponding to the pixel, and the luma reconstructed value corresponding to the pixel. The CFL intra prediction mode includes two different linear models: a first linear model and a second linear model. The first linear model is: Cfl (a) = Clip (Round (a x Luma AC ÷ 2 6 ) + Chroma DC , where Cfl (a) is used to represent the chroma prediction value corresponding to the CFL intra prediction mode, Luma AC is used to represent the target luma reconstructed value or the down-sampling value of the target luma reconstructed value, a is the target coefficient, and Chroma DC is used to represent the chroma prediction value corresponding to the chroma DC intra prediction mode. The second linear model is: Predcfl = Clip (Chroma DC + ScaledLuma), where Predcfl is used to represent the chroma prediction value corresponding to the CFL intra prediction mode, a is the target coefficient, Chroma DC is used to represent the chroma prediction value corresponding to the chroma DC intra prediction mode, and ScaledLuma is the luma scaling value calculated for the target luma intra prediction mode.

[0076] Specifically, ScaledLuma = Round2Signed (2 x a x (Down_Sample_Sum - LumaAvg), 6), where, Down_Sample_Sum is the sum of the down-sampling values of the target luma reconstructed value, and LumaAvg is the average value of the target luma reconstructed value.

[0077] When the second chroma intra prediction mode is the CFL intra prediction mode, the coefficient value of the target coefficient can be determined according to the first linear model, that is, the coefficient value can be determined by using the chroma prediction value corresponding to the direct current chroma intra prediction mode and the target luma reconstructed value. In addition, after the second chroma intra prediction mode is determined, the chroma prediction value corresponding to the CFL intra prediction mode needs to be determined by using the second linear model.

[0078] Since the sum of the down-sampling values of the target luma reconstructed value and the average of the target luma reconstructed value are used when the chroma prediction value corresponding to the CFL intra prediction mode is determined by using the second linear model, in order to further reduce the time length consumed by the determination process of the target chroma intra prediction mode, when the luma reconstructed value corresponding to each luma intra prediction mode is determined, the sum of the down-sampling values of the luma reconstructed value corresponding to the luma intra prediction mode and the average of the luma reconstructed value can be further calculated. In this way, after the target chroma intra prediction mode is determined, the sum of the down-sampling values of the target luma reconstructed value and the average of the target luma reconstructed value can be obtained immediately, so that the time length consumed by the determination process of the target chroma intra prediction mode can be reduced.

[0079] The target luma intra prediction mode refers to an optimal luma intra prediction mode determined from a plurality of luma intra prediction modes for encoding processing of the coding block, which can make the distortion degree between the luma reconstructed value and the luma true value lower, and further make the compression rate of the to-be-encoded image higher, and the reconstructed image has higher fidelity.

[0080] In a possible implementation, in the case of determining the coefficient value by using the candidate chroma prediction value and the target luma reconstructed value, the target luma intra prediction mode for the coding block is determined first. In an example, in order to reduce the time length consumed by the determination process of the target chroma intra prediction mode, and thus reduce the time consumption of image encoding, the coding block can be chroma-predicted by using the first chroma intra prediction mode to obtain the candidate chroma prediction value in the process of determining the target luma intra prediction. Since the candidate chroma prediction value is obtained in the process of determining the target luma intra prediction, compared with sequentially determining the target luma intra prediction mode and obtaining the candidate chroma prediction value, the time length consumed by determining the target luma intra prediction and obtaining the candidate chroma prediction value can be reduced, and thus the time length consumed by the determination process of the target chroma intra prediction mode can be reduced, thereby reducing the time consumption of image encoding.

[0081] In a possible implementation, to make the distortion between the luminance reconstructed value and the luminance real value lower, the determining the target luminance intra prediction mode can include: first determining luminance prediction values corresponding to the pixels in the coding block using multiple luminance intra prediction modes; then, based on the luminance prediction values corresponding to the multiple luminance intra prediction modes, determining luminance reconstructed values corresponding to the multiple luminance intra prediction modes; and further determining the target luminance intra prediction mode from the multiple luminance intra prediction modes based on a luminance rate distortion cost after the luminance reconstructed values corresponding to the multiple luminance intra prediction modes are determined. The luminance rate distortion cost is obtained based on at least the luminance real values corresponding to the pixels in the coding block and the luminance reconstructed values corresponding to the multiple luminance intra prediction modes.

[0082] In a possible implementation, the determining the coefficient value of the target coefficient in the second chroma intra prediction mode by using the candidate chroma prediction value can include: first constructing an expression of a chroma residual matrix by using the linear model corresponding to the second chroma intra prediction mode, the chroma real values corresponding to the pixels in the coding block, and the candidate chroma prediction value; and then determining the coefficient value by using the expression of the chroma residual matrix. The target coefficient is included in the linear model, and an element in the chroma residual matrix is used to represent a difference between the chroma real value and the chroma prediction value corresponding to the second chroma intra prediction mode, that is, the element in the chroma residual matrix is used to represent a chroma residual value corresponding to the pixels in the coding block.

[0083] In the case of determining the coefficient value by using the candidate chroma prediction value and the target luminance reconstructed value, the way of constructing the expression of the chroma residual matrix can include: constructing the expression of the chroma residual matrix by using the linear model corresponding to the second chroma intra prediction mode, the chroma real values corresponding to the pixels in the coding block, the target luminance reconstructed value, and the candidate chroma prediction value.

[0084] Specifically, when the second chroma intra prediction mode is a CFL intra prediction mode, the linear model corresponding to the second chroma intra prediction mode is a first linear model: Cfl (α) = Clip (Round (α × Luma AC ÷ 2 6 ) + Chroma DC ). Without considering the Clip () function, and after matrix processing of Luma AC and Chroma DC , the first linear model can be transformed into: wherein, PRED CFL (α) is used to represent a matrix constructed for the chroma prediction value corresponding to the CFL intra prediction mode; LUMA AC is used to represent a matrix constructed for the target luminance reconstructed value or a down-sampled value of the target luminance reconstructed value; and PREDDC for representing a matrix constructed for chroma prediction values corresponding to the chroma DC intra prediction mode.

[0085] In addition, since the chroma residual value refers to the difference between the chroma true value corresponding to the pixel in the coding block and the chroma prediction value corresponding to the pixel in the coding block, the expression of the chroma residual matrix can be constructed by using the chroma true value corresponding to the pixel in the coding block and the chroma prediction value corresponding to the pixel in the coding block: where DIFF CFL (α) for representing a chroma residual matrix, which is a matrix constructed for chroma residual values corresponding to the pixels in the coding block; SRC is a matrix constructed for chroma true values corresponding to the pixels in the coding block. By constructing the expression of the chroma residual matrix to solve the coefficient value of the target coefficient, the parameters required in the process of determining the coefficient value of the target coefficient can be reduced, thereby reducing the calculation amount in the process of determining the coefficient value of the target coefficient.

[0086] The process of solving the coefficient value of the target coefficient based on the constructed expression of the chroma residual matrix is actually a process of finding the optimal coefficient value. In order to reduce the process of solving the coefficient value of the target coefficient, it can be considered that the optimal coefficient value can minimize the error sum of squares of the sum of squares of the elements in the chroma residual matrix. At this time, by using the expression of the chroma residual matrix to determine the coefficient value, the expression for calculating the error sum of squares of the sum of squares of the elements in the chroma residual matrix can be constructed based on the expression of the chroma residual matrix, and then the value of the target coefficient when the expression of the error sum of squares takes a minimum value is determined, and after determining the value of the target coefficient when the expression of the error sum of squares takes a minimum value, the value of the coefficient is determined based on the value of the target coefficient when the expression of the error sum of squares takes a minimum value. The expression of the error sum of squares includes the target coefficient.

[0087] Specifically, the expression of the chroma residual matrix can be changed to DIFF(γ) = Y - γ * X, where X = LUMA DIFF(γ) = Y - γ * X, where X = LUMA AC , At this time, based on the expression of the chroma residual matrix, the expression of the error sum of squares constructed is: where SSE(Y - γ * X) is the error sum of squares of the sum of squares of the elements in the chroma residual matrix, and (i, j) represents the element in the i-th row and the j-th column of the chroma residual matrix. After constructing the expression of the error sum of squares, the process of determining the value of the target coefficient when the expression of the error sum of squares takes a minimum value is as follows: first, the partial derivative of J(γ) is obtained: Second, another and solve the value of γ, that is to say, the value of γ is solved the value of γ. Again, after the value of γ is solved wherein α1 and α2 are the preferred value and the sub-preferred value of α respectively. Finally, the coefficient value is determined according to α1 and α2. The specific process is: the coefficient value is determined for the blue chroma component and the red chroma component respectively.

[0088] Since the pixel has the blue chroma component and the red chroma component, the coefficient value needs to be determined for the blue chroma component and the red chroma component, that is to say, α1 corresponding to the blue chroma component and α2 corresponding to the blue chroma component, and α1 corresponding to the red chroma component and α2 corresponding to the red chroma component need to be calculated respectively by using the above process. After α1 corresponding to the blue chroma component and α2 corresponding to the blue chroma component, and α1 corresponding to the red chroma component and α2 corresponding to the red chroma component are determined, the way to determine the coefficient value corresponding to the blue chroma component and the red chroma component respectively can be: when α1 corresponding to the blue chroma component and α1 corresponding to the red chroma component are both 0, α2 corresponding to the blue chroma component is determined as the coefficient value corresponding to the blue chroma component, and α2 corresponding to the red chroma component is determined as the coefficient value corresponding to the red chroma component. When α1 corresponding to the blue chroma component and α1 corresponding to the red chroma component are not both 0, α1 corresponding to the blue chroma component is determined as the coefficient value corresponding to the blue chroma component, and α1 corresponding to the red chroma component is determined as the coefficient value corresponding to the red chroma component.

[0089] In a possible implementation, after the second chroma intra prediction mode after the coefficient value is determined is obtained, a target chroma intra prediction mode can be determined from the plurality of chroma intra prediction modes for encoding processing of the coding block; the plurality of chroma intra prediction modes at least include the second chroma intra prediction mode after the coefficient value is determined.

[0090] The target chroma intra prediction mode refers to the preferred chroma intra prediction mode determined from the plurality of chroma intra prediction modes for encoding processing of the coding block, which can make the distortion degree between the chroma reconstructed value and the chroma true value lower, thereby having a higher compression rate for the to-be-encoded image, and can make the reconstructed image have a higher fidelity.

[0091] ​​In a possible implementation, to make the distortion between the chroma reconstructed value and the chroma true value lower, determining the target chroma intra prediction mode from the plurality of chroma intra prediction modes can include: first determining the chroma prediction value corresponding to the pixel in the coding block using the plurality of chroma intra prediction modes; then determining the chroma reconstructed value corresponding to the plurality of chroma intra prediction modes based on the chroma prediction value corresponding to the plurality of chroma intra prediction modes; and further determining the target chroma intra prediction mode from the plurality of chroma intra prediction modes based on the chroma rate-distortion cost after the chroma reconstructed value corresponding to the plurality of chroma intra prediction modes is determined. The chroma rate-distortion cost is obtained based on at least the chroma true value corresponding to the pixel in the coding block and the chroma reconstructed value corresponding to the plurality of chroma intra prediction modes.

[0092] Since the pixel has a blue chroma component and a red chroma component, the target chroma intra prediction mode needs to be determined for both the blue chroma component and the red chroma component, to ensure that the distortion between the chroma reconstructed value corresponding to each chroma component and the chroma true value is lower. Moreover, the target chroma intra prediction mode determined for the blue chroma component and the target chroma intra prediction mode determined for the red chroma component are likely to be different. Therefore, in an example, determining the target chroma intra prediction mode from the plurality of chroma intra prediction modes means determining the target chroma intra prediction mode for the blue chroma component of the pixel in the coding block, and determining the target chroma intra prediction mode for the red chroma component of the pixel in the coding block.

[0093] In a possible implementation, to improve the image coding efficiency as much as possible, after the second chroma intra prediction mode after the coefficient value is determined is obtained, the coding block can be directly encoded using the second chroma intra prediction mode after the coefficient value is determined.

[0094] The method for determining the intra prediction mode provided in the embodiments of the present application first determines the candidate chroma prediction value corresponding to the pixel in the coding block using the first chroma intra prediction mode, and then determines the coefficient value of the target coefficient in the second chroma intra prediction mode using the candidate chroma prediction value. After the coefficient value of the target coefficient in the second chroma intra prediction mode is determined, the second chroma intra prediction mode after the coefficient value is determined is obtained.

[0095] Since the coefficient value of the target coefficient in the second chroma intra prediction mode can be determined using the candidate chroma prediction value in the process of obtaining the second chroma intra prediction mode after the coefficient value is determined, the parameters required in the process of determining the coefficient value are relatively few, and therefore the process of determining the coefficient value is relatively simple, the time length consumed in the process of determining the coefficient value is reduced, that is, the time consumed in obtaining the second chroma intra prediction mode after the coefficient value is determined is reduced.

[0096] In addition, the time consumption required for determining the second chroma intra prediction mode after the coefficient value is obtained is reduced, and the time consumption of image coding is further reduced, and the coding efficiency is improved. Meanwhile, since the amount of calculation required in the coefficient value determination process is reduced, the image coding resource required by the intra prediction mode determination method provided in the embodiments of the present application can also be reduced.

[0097] Corresponding to the intra prediction mode determination method provided in the embodiments of the present application, an image coding method is also provided in the embodiments of the present application, which refers to Figure 3 , Figure 3 A flowchart of an image coding method 300 provided in the embodiments of the present application is shown, which can include steps S301-S304.

[0098] In step 301, for a coding block in a to-be-coded image, a candidate chroma prediction value corresponding to a pixel in the coding block is determined using a first chroma intra prediction mode.

[0099] In step 302, a coefficient value of a target coefficient in a second chroma intra prediction mode is determined using the candidate chroma prediction value, and the second chroma intra prediction mode is used to predict a chroma value according to a luminance value of the pixel.

[0100] In step 303, a target chroma intra prediction mode is determined from a plurality of chroma intra prediction modes; the plurality of chroma intra prediction modes at least include the second chroma intra prediction mode after the coefficient value is determined.

[0101] In step 304, the coding block is coded according to the target chroma intra prediction mode.

[0102] The coding of the coding block according to the target chroma intra prediction mode refers to coding the target luminance intra prediction mode, the target chroma intra prediction mode, and entropy coding or statistical coding the target luminance residual coefficient and the target chroma residual coefficient to obtain a corresponding data stream, for example, a binary bit stream.

[0103] The image coding method provided in the embodiments of the present application first uses the first chroma intra prediction mode to determine the candidate chroma prediction value corresponding to the pixel in the coding block, and then uses the candidate chroma prediction value to determine the coefficient value of the target coefficient in the second chroma intra prediction mode. After the coefficient value of the target coefficient in the second chroma intra prediction mode is determined, the target chroma intra prediction mode can be determined from the plurality of chroma intra prediction modes at least including the second chroma intra prediction mode after the coefficient value is determined, and used for coding the coding block.

[0104] Since the coefficient value of the target coefficient in the second chroma intra prediction mode can be determined by using the candidate chroma prediction value, relatively less parameters are required to be used in the process of determining the coefficient value, the time length consumed in the process of determining the coefficient value is reduced, and the time consumption of image encoding can be further reduced, and the encoding efficiency is improved. Meanwhile, since the calculation amount required in the process of determining the coefficient value is reduced, the image encoding method provided in the embodiments of the present application can also reduce the resources required to be occupied by image encoding.

[0105] Corresponding to the determination method of the intra prediction mode and the image encoding method provided in the embodiments of the present application, the embodiments of the present application also provide an image encoding method, which refers to Figure 4 , Figure 4 A flowchart of an image decoding method 400 provided in the embodiments of the present application is shown, which can include steps S401-S402.

[0106] In step S401, a data stream obtained by encoding a target image is decoded, and a target chroma intra prediction mode used when encoding a coding block in the target image is determined; the target chroma intra prediction mode is determined from a plurality of chroma intra prediction modes including a first chroma intra prediction mode after determining the coefficient value, and the first chroma intra prediction mode is used to predict a chroma value according to a luminance value of a pixel; a coefficient value of a target coefficient in the first chroma intra prediction mode is obtained according to a candidate chroma prediction value corresponding to the pixel in the coding block, and the candidate chroma prediction value is obtained by using a second chroma intra prediction mode to perform chroma prediction on the coding block.

[0107] The process of encoding the target image to obtain the data stream can be that first determining a to-be-encoded image as the target image, then determining a target luminance intra prediction mode, a target chroma intra prediction mode, target luminance residual coefficients and target chroma residual coefficients for a coding block in the to-be-encoded image, and encoding the target luminance intra prediction mode and the target chroma intra prediction mode, and entropy encoding or statistical encoding the target luminance residual coefficients and the target chroma residual coefficients to obtain a corresponding data stream, for example, a binarized bit stream. Therefore, analyzing the data stream obtained by encoding the target image can not only obtain the target chroma intra prediction mode, but also obtain the target luminance intra prediction mode, the target luminance residual coefficients and the target chroma residual coefficients.

[0108] In step S402, a reconstructed image corresponding to the target image is constructed at least according to the target chroma intra prediction mode.

[0109] At least according to the target chroma intra prediction mode, the reconstructed image corresponding to the target image is constructed, which can be a target luma intra prediction mode, a target chroma intra prediction mode, target luma residual coefficients and target chroma residual coefficients, and the luma reconstructed value and the chroma reconstructed value corresponding to the pixels in the to-be-reconstructed block are constructed. The to-be-reconstructed block corresponds to the coding block.

[0110] The image decoding method provided in the embodiments of the present application can be used to determine the target chroma intra prediction mode in the plurality of chroma intra prediction modes for the coding block in the to-be-encoded image, so as to code the coding block, after the target luma intra prediction mode, the target chroma intra prediction mode, the target luma residual coefficients and the target chroma residual coefficients are determined, and the luma reconstructed value and the chroma reconstructed value corresponding to the pixels in the to-be-reconstructed block are constructed.

[0111] Since the coefficient value of the target coefficient in the first chroma intra prediction mode is determined by using the candidate chroma prediction value, the parameters required in the process of determining the coefficient value are relatively small, the time length consumed in the process of determining the coefficient value is reduced, the time consumption of image coding is further reduced, and the coding efficiency is improved. At the same time, with the reduction of the time consumption of image coding, the time consumption of the overall process of image coding and image decoding is also reduced.

[0112] Corresponding to the determination method of the intra prediction mode provided in the embodiments of the present application, the embodiments of the present application also provide a determination device of the intra prediction mode. Figure 5 As shown in the figure. Figure 5 The structure block diagram of the determination device 500 of the intra prediction mode provided in the embodiments of the present application is shown, which can include:

[0113] The chroma prediction value determination module 501 is configured to determine the candidate chroma prediction value corresponding to the pixels in the coding block in the to-be-encoded image by using the first chroma intra prediction mode.

[0114] The coefficient value determination module 502 is configured to determine the coefficient value of the target coefficient in the second chroma intra prediction mode by using the candidate chroma prediction value, so as to obtain the second chroma intra prediction mode after the coefficient value is determined. The second chroma intra prediction mode is used to predict the chroma value according to the luma value of the pixel.

[0115] In a possible implementation manner, the device further includes a target mode determination module configured to determine the target chroma intra prediction mode in the plurality of chroma intra prediction modes for coding the coding block. The plurality of chroma intra prediction modes at least includes the second chroma intra prediction mode after the coefficient value is determined.

[0116] In a possible implementation, the first chroma intra prediction mode comprises a chroma direct current (DC) intra prediction mode; and the chroma prediction value determination module 501 comprises:

[0117] a chroma prediction value determination sub-module, configured to perform chroma prediction on the coding block by using at least the chroma DC intra prediction mode, to obtain a candidate chroma prediction value.

[0118] In a possible implementation, the coefficient value determination module 502 comprises:

[0119] a first coefficient value determination sub-module, configured to determine the coefficient value by using the candidate chroma prediction value and a target luma reconstructed value, wherein the target luma reconstructed value is obtained according to the target luma intra prediction mode.

[0120] In a possible implementation, the intra prediction mode determination apparatus further comprises:

[0121] a target mode determination sub-module, configured to determine the target luma intra prediction mode for the coding block before the coefficient value is determined by using the candidate chroma prediction value and the target luma reconstructed value.

[0122] The chroma prediction value determination module 501 comprises a chroma prediction value determination sub-module, configured to perform chroma prediction on the coding block by using the first chroma intra prediction mode in the process of determining the target luma intra prediction, to obtain a candidate chroma prediction value.

[0123] In a possible implementation, the chroma prediction value determination sub-module comprises:

[0124] a luma prediction value determination sub-module, configured to determine a luma prediction value corresponding to a pixel in the coding block by using a plurality of luma intra prediction modes;

[0125] a luma reconstructed value determination sub-module, configured to determine a luma reconstructed value corresponding to the plurality of luma intra prediction modes based on the luma prediction values corresponding to the plurality of luma intra prediction modes;

[0126] a luma intra prediction mode selection sub-module, configured to determine a target luma intra prediction mode from the plurality of luma intra prediction modes based on a luma rate-distortion cost, wherein the luma rate-distortion cost is obtained at least according to a luma real value corresponding to the pixel in the coding block and the luma reconstructed value corresponding to the plurality of luma intra prediction modes.

[0127] In a possible implementation, the target mode determination module comprises:

[0128] a chroma prediction value determination sub-module, configured to determine a chroma prediction value corresponding to a pixel in the coding block by using a plurality of chroma intra prediction modes;

[0129] The chroma reconstruction value determination submodule is configured to determine chroma reconstruction values corresponding to the plurality of chroma intra prediction modes based on the chroma prediction values corresponding to the plurality of chroma intra prediction modes.

[0130] The chroma intra prediction mode selection submodule is configured to determine a target chroma intra prediction mode from the plurality of chroma intra prediction modes based on a chroma rate-distortion cost.

[0131] In a possible implementation, the coefficient value determination module 502 includes:

[0132] The chroma residual matrix construction submodule is configured to construct an expression of a chroma residual matrix by using the linear model corresponding to the second chroma intra prediction mode, the chroma real values of the pixels in the coding block, and the candidate chroma prediction value.

[0133] The second coefficient value determination submodule is configured to determine the coefficient value by using the expression of the chroma residual matrix.

[0134] In a possible implementation, the chroma residual matrix construction submodule includes:

[0135] The error sum of squares construction submodule is configured to construct an expression of an error sum of squares for calculating a sum of squares of elements in the chroma residual matrix based on the expression of the chroma residual matrix.

[0136] The value determination submodule is configured to determine a value of the target coefficient when the expression of the error sum of squares takes a minimum value.

[0137] The third coefficient value determination submodule is configured to determine the coefficient value based on the value of the target coefficient when the expression of the error sum of squares takes the minimum value.

[0138] In a possible implementation, the target mode determination module 503 includes a first target chroma intra prediction mode submodule configured to determine the target chroma intra prediction mode for the blue chroma component of the pixels in the coding block.

[0139] In a possible implementation, the target mode determination module 503 includes a first target chroma intra prediction mode submodule configured to determine the target chroma intra prediction mode for the red chroma component of the pixels in the coding block.

[0140] Corresponding to the image encoding method provided in the embodiments of the present application, the embodiments of the present application further provide an image encoding apparatus. Figure 6As shown. Figure 6 A structural block diagram of an image encoding apparatus 600 provided in an embodiment of the present application is shown. The image encoding apparatus can include:

[0141] A chroma prediction value determination module 601 is configured to determine, for a coding block in a to-be-encoded image, a candidate chroma prediction value corresponding to a pixel in the coding block using a first chroma intra prediction mode.

[0142] A coefficient value determination module 602 is configured to determine a coefficient value of a target coefficient in a second chroma intra prediction mode using the candidate chroma prediction value, the second chroma intra prediction mode being used to predict a chroma value according to a luminance value of the pixel.

[0143] A target mode determination module 603 is configured to determine a target chroma intra prediction mode from a plurality of chroma intra prediction modes, the plurality of chroma intra prediction modes including at least the second chroma intra prediction mode after the coefficient value is determined.

[0144] An encoding processing module 604 is configured to perform encoding processing on the coding block according to the target chroma intra prediction mode.

[0145] Corresponding to the image decoding method provided in the embodiments of the present application, the embodiments of the present application further provide an image decoding apparatus. The apparatus is shown as follows. Figure 7 Figure 7 A structural block diagram of an image decoding apparatus 700 provided in an embodiment of the present application is shown. The image decoding apparatus can include:

[0146] A data stream decoding module 701 is configured to decode a data stream obtained by encoding a target image, and determine a target chroma intra prediction mode used when a coding block in the target image is encoded. The target chroma intra prediction mode is determined from a plurality of chroma intra prediction modes including a first chroma intra prediction mode after a coefficient value is determined, the first chroma intra prediction mode being used to predict a chroma value according to a luminance value of a pixel. The coefficient value of a target coefficient in the first chroma intra prediction mode is obtained according to a candidate chroma prediction value corresponding to a pixel in the coding block, the candidate chroma prediction value being obtained by performing chroma prediction on the coding block using a second chroma intra prediction mode.

[0147] An image reconstruction module 702 is configured to construct a reconstructed image corresponding to the target image according to at least the target chroma intra prediction mode.

[0148] Figure 8 A block diagram of an electronic device for implementing the embodiments of the present application is shown. As shown in Figure 8 ​As shown, the electronic device includes a memory 801 and a processor 802, and the memory 801 stores a computer program capable of running on the processor 802. The processor 802 implements the method in the above embodiment when executing the computer program. The number of the memory 801 and the processor 802 can be one or more.

[0149] The electronic device further includes:

[0150] A communication interface 803 is configured to communicate with external devices and transmit data.

[0151] If the memory 801, the processor 802 and the communication interface 803 are independently implemented, the memory 801, the processor 802 and the communication interface 803 can be connected to each other through a bus and complete communication between each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 8 Only one thick line is used to represent the bus in the figure, but it does not mean that there is only one bus or only one type of bus.

[0152] Optionally, in a specific implementation, if the memory 801, the processor 802 and the communication interface 803 are integrated on a chip, the memory 801, the processor 802 and the communication interface 803 can complete communication between each other through an internal interface.

[0153] The embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the method provided in the embodiment of the present application.

[0154] The embodiment of the present application further provides a chip, which includes a processor, and the processor is configured to call and run instructions stored in a memory, so that a communication device installed with the chip executes the method provided in the embodiment of the present application.

[0155] The embodiment of the present application further provides a chip, which includes an input interface, an output interface, a processor and a memory, and the input interface, the output interface, the processor and the memory are connected through an internal connection path. The processor is configured to execute code in the memory, and when the code is executed, the processor is configured to execute the method provided in the embodiment of the present application.

[0156] It is to be understood that the above-mentioned processor can be a central processing unit (CPU), but can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. It is worth noting that the processor can be a processor supporting an advanced RISC machine (ARM) architecture.

[0157] Further, the above-mentioned memory can include read-only memory and random access memory, and can also include non-volatile random access memory. The memory can be volatile memory or non-volatile memory, or can include both volatile and non-volatile memory. Among them, the non-volatile memory can include read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can include random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM).

[0158] In the above-described embodiments, all or part can be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed by a computer, all or part generates the processes or functions according to the present application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another computer-readable storage medium.

[0159] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. Also, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the present specification and the features of the different embodiments or examples, without contradiction.

[0160] In addition, the terms "first", "second", etc. are used only for the purpose of description and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "a plurality of" is two or more, unless otherwise explicitly specified.

[0161] Any process or method descriptions or descriptions in flow charts or otherwise described herein can be understood as representing code modules, segments, or portions of code that include one or more executable instructions for implementing specific logic functions or steps in the process. And the scope of the preferred embodiments of the present application includes additional implementation in which the functions can be performed in different orders, including substantially simultaneously or in reverse order, according to the functions involved.

[0162] The logic and / or steps represented in the flow chart or otherwise described herein, for example, can be considered as a list of executable instructions for implementing the logic function, which can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus or device, such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, apparatus or device and execute them, or in conjunction with these instructions execution system, apparatus or device.

[0163] It should be understood that each part of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above-mentioned embodiment method can be completed by a program instructing the relevant hardware, which can be stored in a computer readable storage medium, and the program includes one or a combination of the steps of the method embodiment when executed.

[0164] In addition, each functional unit in each embodiment of the present application can be integrated in one processing module, or each unit can be physically present separately, or two or more units can be integrated in one module. The above-mentioned integrated module can be realized in the form of hardware or in the form of a software functional module. The above-mentioned integrated module, if realized in the form of a software functional module and sold or used as an independent product, can also be stored in a computer readable storage medium. The storage medium can be a read-only memory, a magnetic disk or an optical disk, etc.

[0165] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of various changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for determining an intra-frame prediction mode, comprising: For a coding block in the image to be encoded, the candidate chroma prediction value corresponding to the pixel in the coding block is determined using the first chroma intra-frame prediction mode; Using the candidate chroma prediction values, the coefficient values ​​of the target coefficients in the second chroma intra-frame prediction mode are determined, so as to obtain the second chroma intra-frame prediction mode after determining the coefficient values. The second chroma intra-frame prediction mode is used to predict chroma values ​​based on the luminance values ​​of pixels; The step of determining the coefficient values ​​of the target coefficients in the second chroma intra-frame prediction mode using the candidate chroma prediction values ​​includes: Using the linear model corresponding to the second chroma intra-frame prediction mode, the true chroma values ​​corresponding to the pixels in the coding block, and the candidate chroma prediction values, an expression for the chroma residual matrix is ​​constructed; the linear model includes the target coefficients, and the elements in the chroma residual matrix are used to represent the difference between the true chroma values ​​and the chroma prediction values ​​corresponding to the second chroma intra-frame prediction mode; The coefficient values ​​are determined using the expression for the chromaticity residual matrix.

2. The method according to claim 1, wherein, After obtaining the second chroma intra-frame prediction mode with determined coefficient values, the method further includes: A target chroma intra-prediction mode is determined among multiple chroma intra-prediction modes for encoding the coded block; the multiple chroma intra-prediction modes include at least the second chroma intra-prediction mode after determining the coefficient value.

3. The method according to claim 1, wherein, The first chroma intra-frame prediction mode includes a chroma DC intra-frame prediction mode; The step of determining candidate chroma prediction values ​​for pixels in a coding block of an image to be encoded using a first chroma intra-frame prediction mode includes: At least the chroma DC intra-frame prediction mode is used to perform chroma prediction on the coded block to obtain the candidate chroma prediction value.

4. The method according to claim 1 or 3, wherein, The step of determining the coefficient values ​​of the target coefficients in the second chroma intra-frame prediction mode using the candidate chroma prediction values ​​includes: The coefficient value is determined using the candidate chromaticity prediction value and the target luminance reconstruction value; the target luminance reconstruction value is obtained based on the target luminance intra-frame prediction mode.

5. The method according to claim 4, wherein, Before determining the coefficient value using the candidate chromaticity prediction value and the target luminance reconstruction value, the method further includes: Determine the target lumen intra-frame prediction mode for the coded block; The step of determining candidate chroma prediction values ​​for pixels in a coding block of an image to be encoded using a first chroma intra-frame prediction mode includes: In the process of determining the target luminance intra-frame prediction, the first chroma intra-frame prediction mode is used to perform chroma prediction on the coding block to obtain the candidate chroma prediction value.

6. The method according to claim 5, wherein, The determination of the target lumen intra-frame prediction mode for the coded block includes: Multiple intra-frame prediction modes are used to determine the predicted brightness values ​​of pixels in the coding block; Based on the brightness prediction values ​​corresponding to the various brightness intra-frame prediction modes, the brightness reconstruction values ​​corresponding to the various brightness intra-frame prediction modes are determined. Based on the luminance rate distortion cost, the target luminance intra-prediction mode is determined among the multiple luminance intra-prediction modes; the luminance rate distortion cost is obtained at least based on the true luminance value corresponding to the pixel in the coding block and the luminance reconstruction value corresponding to the multiple luminance intra-prediction modes.

7. The method according to claim 2, wherein, Determining the target chroma intra-frame prediction mode among multiple chroma intra-frame prediction modes includes: The chroma prediction values ​​corresponding to the pixels in the coding block are determined using the various chroma intra-frame prediction modes. Based on the chroma prediction values ​​corresponding to the various chroma intra-frame prediction modes, determine the chroma reconstruction values ​​corresponding to the various chroma intra-frame prediction modes. Based on the chroma rate distortion cost, the target chroma intra-prediction mode is determined among the multiple chroma intra-prediction modes; the chroma rate distortion cost is obtained at least based on the true chroma value corresponding to the pixel in the coding block and the chroma reconstruction value corresponding to the multiple chroma intra-prediction modes.

8. The method according to claim 1, wherein, Determining the coefficient values ​​using the expression of the chromaticity residual matrix includes: Based on the expression of the chromaticity residual matrix, an expression for calculating the sum of squares of the errors in the sum of squares of the elements in the chromaticity residual matrix is ​​constructed; the expression for the sum of squares of errors includes the target coefficients; The value of the target coefficient is determined when the expression for the sum of squared errors reaches its minimum. The value of the target coefficient is determined based on the value of the expression for the sum of squared errors when it reaches its minimum.

9. The method according to claim 2, wherein, Determining the target chroma intra-frame prediction mode among multiple chroma intra-frame prediction modes includes: For the blue chroma component of the pixels in the coded block, the target chroma intra-frame prediction mode is determined.

10. The method according to claim 2, wherein, Determining the target chroma intra-frame prediction mode among multiple chroma intra-frame prediction modes includes: For the red chroma component of the pixels in the coded block, determine the target chroma intra-frame prediction mode.

11. An image encoding method, comprising: For a coding block in the image to be encoded, the candidate chroma prediction value corresponding to the pixel in the coding block is determined using the first chroma intra-frame prediction mode; Using the candidate chromaticity prediction values, the coefficient values ​​of the target coefficients in the second chromaticity intra-frame prediction mode are determined. The second chromaticity intra-frame prediction mode is used to predict chromaticity values ​​based on the luminance values ​​of pixels. Determine the target chroma intra-prediction mode among multiple chroma intra-prediction modes; The multiple chroma intra-frame prediction modes include at least a second chroma intra-frame prediction mode after determining the coefficient values. The coding block is encoded according to the target chroma intra-frame prediction mode; The step of determining the coefficient values ​​of the target coefficients in the second chroma intra-frame prediction mode using the candidate chroma prediction values ​​includes: Using the linear model corresponding to the second chroma intra-frame prediction mode, the true chroma values ​​corresponding to the pixels in the coding block, and the candidate chroma prediction values, an expression for the chroma residual matrix is ​​constructed; the linear model includes the target coefficients, and the elements in the chroma residual matrix are used to represent the difference between the true chroma values ​​and the chroma prediction values ​​corresponding to the second chroma intra-frame prediction mode; The coefficient values ​​are determined using the expression for the chromaticity residual matrix.

12. An image decoding method, comprising: Decoding involves encoding a data stream of a target image to determine the target chroma intra-frame prediction mode used when encoding coded blocks in the target image. The target chroma intra-frame prediction mode is determined among multiple chroma intra-frame prediction modes, including a first chroma intra-frame prediction mode after determining coefficient values. The first chroma intra-frame prediction mode is used to predict chroma values ​​based on the luminance values ​​of pixels. In the first chroma intra-frame prediction mode, the coefficient value of the target coefficient is obtained based on the candidate chroma prediction value corresponding to the pixel in the coding block. The candidate chroma prediction value is obtained by performing chroma prediction on the coding block using the second chroma intra-frame prediction mode. At least based on the target chroma intra-frame prediction mode, a reconstructed image corresponding to the target image is constructed; The candidate chroma prediction values ​​are obtained by performing chroma prediction on the coded block using the second chroma intra-frame prediction mode in the following manner: An expression for the chroma residual matrix is ​​constructed using the linear model corresponding to the second chroma intra-frame prediction mode, the true chroma values ​​corresponding to the pixels in the coding block, and the candidate chroma prediction values. The linear model includes the target coefficients, and the elements in the chroma residual matrix are used to represent the difference between the true chroma value and the chroma prediction value corresponding to the second chroma intra-frame prediction mode. The coefficient values ​​are determined using the expression for the chromaticity residual matrix.

13. An electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein the processor, when executing the computer program, implements the method of any one of claims 1-12.

14. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method of any one of claims 1-12.

Citation Information

Patent Citations

  • Method and system for intra mode coding

    CN113767636A