Method, device and computer equipment for selecting chrominance coding mode
By determining a cross-component linear prediction mode and sharing identification information across sub-modes, the method addresses inefficiencies in chroma coding, reducing bit consumption and improving encoding efficiency in video coding standards like VVC.
Patent Information
- Application Number
- CN202210721785.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-06-24
AI Technical Summary
The existing video coding standards, such as VVC, require significant resource consumption during transmission due to the need to estimate and transmit mode information for each coding mode, particularly in chroma coding, which is inefficient.
A method and device for selecting a chroma coding mode by determining a cross-component linear prediction mode and its sub-modes, performing chrominance prediction on surrounding pixels to identify a target prediction sub-mode, and sharing identification information across sub-modes, reducing the bits required for encoding.
This approach reduces the number of bits needed for encoding, enhancing encoding performance and efficiency by utilizing shared identification information for chroma coding modes.
Smart Images

Figure CN115278225B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of media technology, and in particular to a method, device, computer equipment, storage medium and computer program product for selecting a chroma encoding mode, and a method, device, computer equipment, storage medium and computer program product for determining a chroma decoding mode. Background Art
[0002] With the development of video coding technology, a new generation of international video coding standard VVC (Versatile Video Coding) has emerged to achieve intra-frame prediction of video frames.
[0003] The VVC standard provides a variety of coding modes. In related technologies, the encoder needs to estimate the cost of each coding mode one by one, and write the mode information corresponding to the final chroma coding mode into the bitstream information to be transmitted to the decoder. However, this method will consume a lot of resources during the transmission process. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment, storage medium and computer program product for selecting a chrominance encoding mode, as well as a method, device, computer equipment, storage medium and computer program product for determining a chrominance decoding mode in response to the above-mentioned technical problems.
[0005] In one aspect, the present application provides a method for selecting a chroma coding mode. The method comprises:
[0006] Determining a plurality of preset coding modes, the plurality of preset coding modes comprising a cross-component linear prediction mode and at least one candidate coding mode, the cross-component linear prediction mode comprising a plurality of prediction sub-modes;
[0007] Based on the multiple prediction sub-modes, chrominance prediction is performed on the surrounding pixels of the current coding block in the video frame to be coded, respectively, to obtain chrominance prediction distortion results corresponding to the prediction sub-modes respectively;
[0008] Determining a target prediction sub-mode from the plurality of prediction sub-modes according to the chrominance prediction distortion results corresponding to the respective prediction sub-modes;
[0009] Determine a target coding mode from the at least one candidate coding mode and the target prediction sub-mode, wherein the target coding mode is used to perform coding processing on the current coding block;
[0010] Adding identification information corresponding to the target coding mode to the coding information of the current coding block, wherein a plurality of prediction sub-modes in the cross-component linear prediction mode correspond to the same identification information.
[0011] On the other hand, the present application also provides a device for selecting a chroma coding mode. The device comprises:
[0012] A determination module, configured to determine a plurality of preset coding modes, wherein the plurality of preset coding modes include a cross-component linear prediction mode and at least one candidate coding mode, wherein the cross-component linear prediction mode includes a plurality of prediction sub-modes;
[0013] A prediction module, configured to perform chrominance prediction on surrounding pixels of a current coding block in a to-be-coded video frame based on the multiple prediction sub-modes, respectively, to obtain chrominance prediction distortion results corresponding to the prediction sub-modes;
[0014] The determination module is further used to determine a target prediction sub-mode from the plurality of prediction sub-modes according to the chrominance prediction distortion results corresponding to each prediction sub-mode;
[0015] The determination module is further used to determine a target coding mode from the at least one candidate coding mode and the target prediction sub-mode, wherein the target coding mode is used to perform coding processing on the current coding block;
[0016] The encoding module is used to add identification information corresponding to the target encoding mode to the encoding information of the current encoding block, wherein multiple prediction sub-modes in the cross-component linear prediction mode correspond to the same identification information.
[0017] On the other hand, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the above-mentioned chroma coding mode selection method are implemented.
[0018] On the other hand, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-mentioned chroma coding mode selection method when executed by a processor.
[0019] On the other hand, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned chroma coding mode selection method are implemented.
[0020] The above-mentioned chroma coding mode selection method, device, computer equipment, storage medium and computer program product determine the target prediction sub-mode in the cross-component linear prediction mode by means of chroma prediction, then compare the target prediction sub-mode with the candidate coding mode, select the final target coding mode, and write the identification information corresponding to the target coding mode into the coding information. Since various prediction sub-modes in the cross-component linear prediction mode share the same identification information, the bits required for encoding are greatly reduced, and the encoding performance and encoding efficiency are improved.
[0021] On the other hand, the present application also provides a method for determining a chroma decoding mode. The method comprises:
[0022] Determine identification information corresponding to a current decoding block according to encoding information corresponding to the video to be decoded;
[0023] In a case where the identification information is preset identification information, determining that the encoding mode corresponding to the current decoding block is a cross-component linear prediction mode, wherein the cross-component linear prediction mode includes multiple prediction sub-modes;
[0024] For each prediction sub-mode, chrominance prediction is performed on surrounding pixels of a current decoding block in a to-be-decoded video frame to obtain chrominance prediction distortion results corresponding to each prediction sub-mode;
[0025] A target prediction sub-mode is determined from a plurality of prediction sub-modes according to the chrominance prediction distortion results corresponding to each prediction sub-mode, and the target prediction sub-mode is used to perform decoding processing on the current decoding block.
[0026] On the other hand, the present application also provides a device for determining a chroma decoding mode. The device comprises:
[0027] A parsing module, used to determine identification information corresponding to a current decoding block according to encoding information corresponding to a video to be decoded;
[0028] The determination module is further configured to determine, when the identification information is preset identification information, that the encoding mode corresponding to the current decoding block is a cross-component linear prediction mode, wherein the cross-component linear prediction mode includes a plurality of prediction sub-modes;
[0029] A prediction module, configured to perform chrominance prediction on surrounding pixels of a current decoding block in a to-be-decoded video frame for each prediction sub-mode, and obtain chrominance prediction distortion results corresponding to each prediction sub-mode;
[0030] The determination module is further used to determine a target prediction sub-mode from a plurality of prediction sub-modes according to the chrominance prediction distortion results corresponding to each prediction sub-mode, and the target prediction sub-mode is used to perform decoding processing on the current decoding block.
[0031] On the other hand, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the above-mentioned method for determining the chroma decoding mode are implemented.
[0032] On the other hand, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-mentioned method for determining the chroma decoding mode when executed by a processor.
[0033] On the other hand, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for determining the chroma decoding mode are implemented.
[0034] The above-mentioned method, device, computer equipment, storage medium and computer program product for determining the chrominance decoding mode, after receiving the video to be decoded transmitted by the encoding end, determines the encoding mode corresponding to the current decoding block by extracting the encoding information and extracting the identification information. When the identification information indicates that the encoding mode corresponding to the current decoding block is a cross-component linear prediction mode, the final target prediction sub-mode is determined by performing chrominance prediction on various prediction sub-modes, so as to use the target prediction sub-mode to perform decoding processing on the current decoding block. By sharing the preset identification information in each prediction sub-mode of the cross-component linear prediction mode, the number of bits required to be carried by the encoding end in the video transmitted to the decoding end is greatly reduced, thereby improving the transmission efficiency between the encoding end and the decoding end. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A diagram showing an application environment of a method for selecting a chroma coding mode in one embodiment;
[0036] Figure 2 is a flow chart of a method for selecting a chroma coding mode in one embodiment;
[0037] Figure 3 A schematic diagram of a flow chart of steps for determining a predicted chrominance value corresponding to a sub-prediction mode in one embodiment;
[0038] Figure 4A is a schematic diagram of a selection range of surrounding pixels in one embodiment;
[0039] Figure 4B is a schematic diagram of a method for selecting surrounding pixels in one embodiment;
[0040] Figure 4C is a schematic diagram of a method for selecting surrounding pixels in another embodiment;
[0041] Figure 4D is a schematic diagram of a method for selecting surrounding pixels in yet another embodiment;
[0042] Figure 5 A schematic flow chart of the steps of determining a target prediction sub-mode in one embodiment;
[0043] Figure 6 A schematic flow chart of the steps of calculating a chrominance prediction distortion result in one embodiment;
[0044] Figure 7 is a structural block diagram of a device for selecting a chroma coding mode in one embodiment;
[0045] Figure 8 is a structural block diagram of a device for determining a chroma decoding mode in one embodiment;
[0046] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] The method for selecting the chroma coding mode provided in the embodiment of the present application can be applied to the following examples: Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. Among them, the terminal 102 or the server 104 can be both an encoding end that performs chromatic encoding on the video and a decoding end that performs chromatic decoding on the video. In one embodiment, after the terminal 102 as the encoding end encodes the video, it sends the encoded video to the server 104, and the server 104 sends the encoded video to the terminal as the decoding end, so that the terminal as the decoding end performs decoding processing. In one embodiment, the server 104 encodes the video as the encoding end, and sends the encoded video to the terminal 102, and the terminal 102 performs decoding processing as the decoding end.
[0049] The terminal 102 may be, but is not limited to, one or more of various desktop computers, laptop computers, smart phones, tablet computers, intelligent voice interaction devices, smart home appliances, smart vehicle-mounted devices, or aircraft, etc. Smart home appliances may be one or more of smart speakers, smart TVs, or smart air conditioners, etc. Smart vehicle-mounted devices may be vehicle-mounted terminals, etc. Intelligent voice interaction devices may be one or more of smart watches, smart bracelets, or head-mounted devices, etc.
[0050] Among them, server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), or big data and artificial intelligence platforms.
[0051] In some embodiments, the terminal may be loaded with an APP (Application) application, or an application with video decoding, or an application with video playback function, etc., including traditional applications that need to be installed separately, or small program applications that can be used without downloading and installing, etc. The terminal can perform one or more functions such as video decoding or playback through the application.
[0052] The embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, or assisted driving, etc. In one embodiment, the server sends the encoded video to the vehicle terminal, and the vehicle terminal decodes the encoded video and plays the video through a display device (such as a display screen).
[0053] In one embodiment, Figure 2 As shown, a method for selecting a chroma coding mode is provided, which can be executed by a terminal or a server, or by a terminal and a server in collaboration. The following is an example of the method being applied to a computer device. The method comprises the following steps:
[0054] Step S202: determining a plurality of preset coding modes, wherein the plurality of preset coding modes include a cross-component linear prediction mode and at least one candidate coding mode, and the cross-component linear prediction mode includes a plurality of prediction sub-modes.
[0055] Among them, the VVC standard provides a variety of preset coding modes, one of which is the CCLM (Cross-component linear model) prediction mode, that is, the cross-component linear prediction mode, hereinafter referred to as the "CCLM prediction mode". Among them, the CCLM prediction mode includes three prediction sub-modes, namely CCLM prediction sub-mode, CCLM_A prediction sub-mode, and CCLM_L prediction sub-mode.
[0056] In the embodiment of the present application, the preset coding modes in the VVC standard other than the cross-component linear prediction mode are referred to as candidate coding modes. In one embodiment, the candidate coding modes include but are not limited to one or more of PLANAR mode (planar mode), VER mode (vertical mode), HOR mode (horizontal mode), or DC mode (mean mode).
[0057] In one embodiment, determining a plurality of preset coding modes includes: the computer device determines various preset coding modes provided by it, and determines a cross-component linear prediction mode therein, and uses other preset coding modes as candidate coding modes.
[0058] Step S204 , based on the multiple prediction sub-modes, chrominance prediction is performed on the surrounding pixels of the current coding block in the to-be-coded video frame respectively, to obtain chrominance prediction distortion results corresponding to the prediction sub-modes respectively.
[0059] Among them, encoding the video means encoding the video frames that constitute the video. When encoding each video frame, it is necessary to divide the video frame to be encoded into multiple coding blocks (Coding block, CU), and use the coding block as the basic unit for deciding the intra-frame chrominance coding mode, and process them one by one in a certain coding order. Among them, the surrounding pixels are the pixels adjacent to the current coding block in the encoded coding blocks around the current coding block. Usually, according to the coding order, the coding blocks above and to the left of the current coding block are encoded coding blocks, so the pixels above and to the left of the current coding block are used as surrounding pixels for use in subsequent mode selection.
[0060] In the embodiment of the present application, the video frame to be encoded adopts the format of YUV or YCbCr (color encoding method). Among them, in the YUV color space, Y represents brightness, U and V represent chrominance, which is used to specify the color of the pixel. The YCbCr color space is similar to the YUV color space, where Y represents brightness, Cb represents the difference between the blue part of the RGB input signal and the signal brightness value, and Cr represents the difference between the red part of the RGB input signal and the signal brightness value. In the encoding and decoding process, the encoding and decoding processes corresponding to the two formats of YUV or YCbCr are similar.
[0061] Correspondingly, the encoding information corresponding to each encoding block includes a luminance (Luma) encoding block and two chrominance (Chroma) encoding blocks, and the two chrominance encoding blocks correspond to the chrominance encoding block of the Cb channel and the chrominance encoding block of the Cr channel respectively.
[0062] Since the visual system is more sensitive to brightness than chrominance, the sampling rate of chrominance can be lower than the sampling rate of brightness when sampling video frames, that is, several adjacent pixels can share the same chrominance value, thereby achieving the purpose of data compression. Therefore, the size of the brightness coding block is usually multiple times larger than the size of the chrominance coding block. Exemplarily, the size of the chrominance coding block is 4×4, and the size of the brightness coding block is 8×8. In one embodiment, a sampling rate of 4:4:4 can be used for video frames in YUV format, in which case the size of the brightness coding block is the same as the size of the chrominance coding block.
[0063] In one embodiment, based on multiple prediction sub-modes, chroma prediction is performed on the surrounding pixels of the current coding block in the video frame to be coded, and chroma prediction distortion results corresponding to each prediction sub-mode are obtained, including: for the current coding block, the computer device determines the surrounding pixels around the current coding block under the current prediction sub-mode for each prediction sub-mode in the CCLM prediction mode, and performs chroma prediction on the current prediction sub-mode based on the reconstructed luminance value and reconstructed chroma value of the surrounding pixels, thereby obtaining chroma prediction distortion results corresponding to each prediction sub-mode. The chroma prediction distortion results are used to measure the performance between each prediction sub-mode.
[0064] Step S206 , determining a target prediction sub-mode from a plurality of prediction sub-modes according to the chrominance prediction distortion results corresponding to each prediction sub-mode.
[0065] The chroma prediction distortion result is calculated for each prediction sub-mode, and the obtained chroma prediction distortion result is used as a basis for selecting a target prediction sub-mode. In one embodiment, the target prediction sub-mode is determined from a plurality of prediction sub-modes according to the chroma prediction distortion result corresponding to each prediction sub-mode, including: based on the chroma prediction distortion result corresponding to each prediction sub-mode, the computer device selects a result representing the minimum chroma prediction distortion from each chroma prediction distortion result, and selects the prediction sub-mode corresponding to the result as the target prediction sub-mode.
[0066] Step S208: determining a target coding mode from at least one candidate coding mode and a target prediction sub-mode, where the target coding mode is used to perform coding processing on the current coding block.
[0067] After determining the target prediction sub-mode, it is necessary to further compare the target prediction sub-mode with other candidate coding modes to determine the final coding mode, namely the target coding mode. After determining the target coding mode, the computer device uses the target coding mode to encode the current coding block.
[0068] In one embodiment, a target coding mode is determined from at least one candidate coding mode and a target prediction sub-mode, including: a computer device calculates the performance value of each candidate coding mode and target prediction sub-mode corresponding to the performance evaluation indicator using the same performance evaluation indicator, and selects the target coding mode from them based on the performance values.
[0069] The performance evaluation index includes, but is not limited to, one or more of encoding duration, encoding time complexity, encoding bit consumption, or encoding quality loss, etc. Accordingly, the performance value corresponding to each performance evaluation index may be, but is not limited to, one or more of duration, bit number, or distortion value, etc.
[0070] Step S210: adding identification information corresponding to the target coding mode to the coding information of the current coding block, wherein a plurality of prediction sub-modes in the cross-component linear prediction mode correspond to the same identification information.
[0071] Each coding mode corresponds to its own identification information, and the identification information is used to indicate the specific coding mode used to encode the coding block. The identification information is usually represented by binary. For example, the identification information corresponding to the DM mode is 00, the identification information corresponding to the Planar mode is 0100, the identification information corresponding to the vertical mode is 0101, the identification information corresponding to the horizontal mode is 0110, and the identification information corresponding to the DC mode is 0111. For the CCLM prediction mode, usually its sub-modes also correspond to one identification information respectively. For example, the identification information corresponding to the CCLM prediction sub-mode is 10, the identification information corresponding to the CCLM_L prediction sub-mode is 110, and the identification information corresponding to the CCLM_A prediction sub-mode is 111.
[0072] In the embodiment of the present application, each prediction sub-mode in the CCLM prediction mode is set to correspond to the same identification information. For example, no matter what kind of prediction sub-mode it is, the corresponding identification information is 1.
[0073] After determining the target coding mode, the computer device adds the identification information corresponding to the selected target coding mode to the coding information corresponding to the current coding block. When the decoding end performs decoding later, the selected coding mode is determined by parsing the coding information.
[0074] In the above-mentioned method for selecting the chroma coding mode, the target prediction sub-mode is determined in the cross-component linear prediction mode by means of chroma prediction, and then the target prediction sub-mode is compared with the candidate coding mode to select the final target coding mode, and the identification information corresponding to the target coding mode is written into the coding information. Since various prediction sub-modes in the cross-component linear prediction mode share the same identification information, the bits required for encoding are greatly reduced, and the encoding performance and encoding efficiency are improved.
[0075] In one embodiment, based on multiple prediction sub-modes, chroma prediction is performed on the surrounding pixels of the current coding block in the to-be-coded video frame, respectively, to obtain chroma prediction distortion results corresponding to each prediction sub-mode, including: based on multiple prediction sub-modes, chroma prediction is performed on the surrounding pixels of the current coding block in the to-be-coded video frame, respectively, to obtain predicted chroma values corresponding to each prediction sub-mode; for each prediction sub-mode, the chroma prediction distortion result corresponding to the corresponding prediction sub-mode is determined based on the difference between the reconstructed chroma value and the predicted chroma value of the surrounding pixels of the current coding block.
[0076] Specifically, after determining the current coding block in the video frame to be encoded, the computer device uses the surrounding pixels of the current coding block to perform chrominance prediction for each prediction sub-mode, thereby obtaining the predicted chrominance values corresponding to each prediction sub-mode. Thus, for a prediction sub-mode, the computer device can determine the chrominance prediction distortion result corresponding to the corresponding prediction sub-mode by comparing the difference between the predicted chrominance value under the prediction sub-mode and the reconstructed chrominance value of the surrounding pixels. In one embodiment, the difference between the predicted chrominance value and the reconstructed chrominance value of the surrounding pixels can be directly used as the chrominance prediction distortion result, or the chrominance prediction distortion result can be obtained after the difference is numerically transformed.
[0077] Among them, the difference between the reconstructed chromaticity value of the surrounding pixels and the corresponding predicted chromaticity value can be the difference between the reconstructed chromaticity value and the predicted chromaticity value, such as the absolute difference, the sum of the absolute differences, or the sum of the squares of the differences, or it can be the ratio or product between the two, etc.
[0078] In the above embodiment, for the current coding block in the video frame to be encoded, the first surrounding pixels and the second surrounding pixels for subsequent prediction sub-mode selection are determined according to the surrounding pixels belonging to the encoded coding block, the known reconstructed chromaticity pixel values of the first surrounding pixels are used as a reference standard, the predicted chromaticity values of the first surrounding pixels are calculated according to the reconstructed luminance pixel values and the reconstructed chromaticity pixel values of the second surrounding pixels, and the predicted chromaticity values are compared with the reconstructed chromaticity pixel values serving as the reference standard, thereby determining the target prediction sub-mode according to the difference between the two, being able to quickly select the prediction sub-mode with the best performance from a variety of prediction sub-modes, thereby improving the coding performance and coding efficiency.
[0079] In one embodiment, Figure 3 As shown, based on multiple prediction sub-modes, chrominance prediction is performed on the surrounding pixels of the current coding block in the video frame to be coded, and the predicted chrominance values corresponding to each prediction sub-mode are obtained, including:
[0080] Step S302: determine a current coding block in the to-be-coded video frame and surrounding pixels corresponding to the current coding block.
[0081] Among them, the surrounding pixels are pixels adjacent to the current coding block in the encoded coding blocks around the current coding block. Usually according to the encoding order, the coding blocks above and to the left of the current coding block are encoded coding blocks, so the pixels above and to the left of the current coding block are used as surrounding pixels for use in subsequent mode selection. Of course, depending on the encoding order, the encoded coding blocks can be located above, to the left, to the right, or below the current coding block, and accordingly, the surrounding pixels can also be pixels located above and to the right, to the left and below, or to the right and below the current coding block, etc. In one embodiment, as Figure 4A As shown, assuming that the size of the current coding block A is W×H, the surrounding pixels may be pixels within a range consisting of W+H pixels located above the coding block and H+W pixels located to the left of the coding block, where W and H may be equal or different.
[0082] In one embodiment, determining a current coding block in a video frame to be encoded and surrounding pixels corresponding to the current coding block includes: a computer device determines a coding block that has not been encoded among multiple coding blocks obtained by dividing the video frame to be encoded, determines the current coding block among the coding blocks that have not been encoded, and obtains surrounding pixels of the current coding block for subsequent determination of a coding mode.
[0083] It should be noted that, when the current coding block is the first coding block to be encoded, since there are no encoded coding blocks around the coding block, the computer device directly sets the pixel value for the current coding block according to a preset rule. For example, the computer device directly sets the brightness pixel value to 100 and the chrominance pixel value to 255.
[0084] Step S304 , determining first reconstructed pixel values corresponding to first surrounding pixels in the surrounding pixels, wherein the first reconstructed pixel values include reconstructed brightness values and reconstructed chrominance values.
[0085] Since the surrounding pixels are pixels in the encoded coding block, the computer device can directly obtain the reconstructed pixel values corresponding to the surrounding pixels according to the pixel values reconstructed from the encoded coding block, wherein the reconstructed pixel values include reconstructed brightness values and reconstructed chrominance values.
[0086] In one embodiment, determining the first reconstructed pixel value corresponding to each first surrounding pixel in the surrounding pixels includes: a computer device selects multiple surrounding pixels from the surrounding pixels as first surrounding pixels, and extracts the reconstructed luminance value and the reconstructed chrominance value corresponding to the first surrounding pixel by obtaining the encoding information of the encoded coding block to which the stored first surrounding pixels belong.
[0087] In one embodiment, for each prediction sub-mode, the computer device selects the first surrounding pixels in a different manner. Figure 4B As shown, for one of the prediction sub-modes, the computer device selects H+W pixels to the left from the surrounding pixels of the current coding block A as the first surrounding pixels.
[0088] For another example, for another prediction sub-pattern, such as Figure 4C As shown, the computer device selects W+H pixels above from the surrounding pixels of the current coding block A as the first surrounding pixels.
[0089] For another example, for another prediction sub-mode, such as Figure 4D As shown, the computer device selects W pixels above and H pixels to the left from the surrounding pixels of the current coding block A as the first surrounding pixels.
[0090] In one embodiment, when selecting the first surrounding pixel, multiple pixels at a preset position may be selected as the first surrounding pixel. For example, one surrounding pixel may be selected every several pixels from the surrounding pixels in the same direction as the first surrounding pixel, or multiple pixels may be randomly selected from the surrounding pixels as the first surrounding pixels, and so on.
[0091] In one embodiment, for one prediction sub-mode, the first surrounding pixel S may correspond to surrounding pixels at four positions: S[W' / 4, -1], S[3*W' / 4, -1], S[-1, H' / 4], and S[-1, 3*H' / 4].
[0092] For another prediction sub-mode, the first surrounding pixel S may correspond to surrounding pixels at four positions: S[W' / 8, -1], S[3*W' / 8, -1], S[5*W' / 8, -1], and S[7*W' / 8, -1].
[0093] For another prediction sub-mode, the first surrounding pixel S may correspond to surrounding pixels at four positions: S[-1,H' / 8], S[-1,3*H' / 8], S[-1,5*H' / 8], and S[-1,7*H' / 8].
[0094] By selecting surrounding pixels at a preset position as first surrounding pixels, the amount of calculation can be reduced and the processing efficiency can be improved.
[0095] Step S306: Determine second surrounding pixels that match each prediction sub-pattern based on the surrounding pixels.
[0096] Similar to the selection method of the first surrounding pixels, for each prediction sub-mode, the computer device selects multiple surrounding pixels from the surrounding pixels as the second surrounding pixels according to the selection method corresponding to each prediction sub-mode.
[0097] In one embodiment, based on surrounding pixels, second surrounding pixels that match each of a plurality of preset prediction sub-modes are determined, including: for each prediction sub-mode, a computer device selects a plurality of surrounding pixels from the surrounding pixels as second surrounding pixels, and stores encoding information of an encoded coding block to which the second surrounding pixels belong, and extracts a reconstructed luminance value and a reconstructed chrominance value corresponding to the first surrounding pixel.
[0098] In one embodiment, similar to the selection method of the first surrounding pixels, the computer device may select a plurality of pixels at a preset position as the second surrounding pixels, which will not be described in detail here.
[0099] It should be noted that the above-mentioned terms "first" and "second" are used to describe different surrounding pixels in this application, but these surrounding pixels should not be limited by these terms. These terms are only used to distinguish one surrounding pixel from another surrounding pixel. For example, the first surrounding pixel can be referred to as the second surrounding pixel, and similarly, the second surrounding pixel can be referred to as the first surrounding pixel without departing from the scope of the various described embodiments. However, unless the context clearly indicates otherwise, they are not the same surrounding pixel. Similar situations also include the first prediction sub-mode, the second prediction sub-mode, or the third prediction sub-mode mentioned below, and the first preset position, the second preset position, or the third preset position, etc.
[0100] In some embodiments, when selecting the second surrounding pixel, the computer device may select the surrounding pixel at the same position as the first surrounding pixel. In other words, the first surrounding pixel and the second surrounding pixel are the same surrounding pixels. In this case, the computer device does not need to repeatedly extract the reconstructed pixel values of the surrounding pixels, which reduces the amount of calculation and the consumption of storage space, and further improves the processing efficiency.
[0101] Step S308: for each prediction sub-mode, a predicted chrominance value is determined according to the reconstructed luminance value of the first surrounding pixel and the second reconstructed pixel value of the second surrounding pixel matching the corresponding prediction sub-mode.
[0102] For each prediction sub-mode, since the selected second surrounding pixels are different, the computer device predicts the chrominance pixel value according to the reconstructed luminance value of the acquired first surrounding pixels.
[0103] In one embodiment, for each prediction sub-mode, the predicted chrominance value is determined according to the reconstructed luminance value of the first surrounding pixel and the second reconstructed pixel value of the second surrounding pixel matching the corresponding prediction sub-mode, including: for one of the prediction sub-modes, the computer device obtains the second reconstructed pixel value corresponding to the second surrounding pixel based on the second surrounding pixel selected in the prediction sub-mode. The second reconstructed pixel value includes a reconstructed luminance value and a reconstructed chrominance value. Based on the reconstructed luminance value of the first surrounding pixel selected in the prediction sub-mode and the second reconstructed pixel value of the second surrounding pixel selected in the prediction sub-mode, the computer device predicts the reconstructed chrominance value of the first surrounding pixel to obtain the predicted chrominance value corresponding to the first surrounding pixel.
[0104] For example, by referring to the numerical relationship between the reconstructed brightness value and the reconstructed chromaticity value of the second surrounding pixel, the computer device determines the numerical relationship between the reconstructed brightness value and the reconstructed chromaticity value of the first surrounding pixel. Thus, when the reconstructed brightness value of the first surrounding pixel is known, the computer device can calculate the predicted chromaticity value corresponding to the first surrounding pixel based on the numerical relationship.
[0105] For various prediction sub-modes, the computer device performs the above processing to obtain the predicted chromaticity value corresponding to each prediction sub-mode.
[0106] In one embodiment, determining a current coding block in a video frame to be encoded and surrounding pixels corresponding to the current coding block includes: determining a current coding block in a video frame to be encoded; taking pixels adjacent to the current coding block and above the current coding block as surrounding pixels; taking pixels adjacent to the current coding block and to the left of the current coding block as surrounding pixels.
[0107] Specifically, the computer device determines a coding block that has not been encoded among multiple coding blocks obtained by dividing the video frame to be encoded, determines the current coding block among the coding blocks that have not been encoded, and obtains surrounding pixels of the current coding block for subsequent determination of the encoding mode.
[0108] According to different coding orders, the coded coding block can be located above, to the left, to the right, or below the current coding block, and accordingly, the surrounding pixels can also be pixels located above and to the right, to the left and below, or to the right and below, etc. of the current coding block. Therefore, the computer device uses the pixels adjacent to the current coding block and above the current coding block, and the pixels adjacent to the current coding block and to the left of the current coding block as the surrounding pixels of the current coding block.
[0109] In the above embodiment, by taking the pixels adjacent to the current coding block in the encoded coding blocks located around the current coding block as surrounding pixels, calculation can be performed based on the reconstructed luminance value and the reconstructed chrominance value obtained from the encoded coding blocks, thereby improving the accuracy of the calculation and being able to accurately determine the optimal prediction sub-mode among the preset multiple prediction sub-modes.
[0110] As mentioned above, different chroma coding modes correspond to different ways of selecting surrounding pixels. Among them, the prediction sub-modes included in the cross-component linear prediction mode include a first prediction sub-mode, a second prediction sub-mode, and a third prediction sub-mode. In one embodiment, based on the surrounding pixels, second surrounding pixels that match each prediction sub-mode in a plurality of prediction sub-modes are determined, including: according to the selection method of the surrounding pixels determined by each prediction sub-mode, the surrounding pixels that meet the preset position are selected from the surrounding pixels as the second surrounding pixels.
[0111] The preset position may be a specified fixed position, such as the Xth, Yth, etc. in the same direction. Alternatively, the preset position may be the position of several surrounding pixels determined according to the size of the coding block. Of course, the preset position may also refer to all pixels in the same direction, such as selecting all surrounding pixels above the current coding block, that is, W+H pixels.
[0112] In one embodiment, according to the selected prediction sub-mode, the method of selecting surrounding pixels in this prediction sub-mode includes but is not limited to selecting surrounding pixels located above and to the left of the current coding block, selecting surrounding pixels located above the current coding block, or selecting one or more of surrounding pixels located to the left of the current coding block, etc.
[0113] In one embodiment, for the first prediction sub-mode, the computer device selects surrounding pixels that meet the first preset position from surrounding pixels respectively located above and to the left of the current coding block as second surrounding pixels matching the first prediction sub-mode.
[0114] In another embodiment, for the second prediction sub-mode, the computer device selects surrounding pixels that meet a second preset position from surrounding pixels located above the current coding block as second surrounding pixels matching the second prediction sub-mode.
[0115] In yet another embodiment, for the third prediction sub-mode, the computer device selects surrounding pixels that meet a third preset position among surrounding pixels located to the left of the current coding block as second surrounding pixels that match the third prediction sub-mode.
[0116] When the prediction sub-mode is the CCLM prediction sub-mode and the neighboring pixels above and to the left of the current coding block are available, the computer device selects four surrounding pixels with first preset positions of S[W' / 4,-1], S[3*W' / 4,-1], S[-1,H' / 4], and S[-1,3*H' / 4] from the surrounding pixels respectively located above and to the left of the current coding block as the second surrounding pixels matching the CCLM prediction sub-mode.
[0117] When the prediction sub-mode is the CCLM_A prediction sub-mode, or the adjacent pixels to the left of the current coding block are unavailable, the computer device selects four surrounding pixels with first preset positions of S[W' / 8,-1], S[3*W' / 8,-1], S[5*W' / 8,-1], and S[7*W' / 8,-1] from the surrounding pixels above the current coding block as the second surrounding pixels matching the CCLM_A prediction sub-mode.
[0118] When the prediction sub-mode is the CCLM_L prediction sub-mode, or the adjacent pixels above the current coding block are unavailable, the computer device selects four surrounding pixels with first preset positions of S[-1,H' / 8], S[-1,3*H' / 8], S[-1,5*H' / 8], and S[-1,7*H' / 8] from the surrounding pixels to the left of the current coding block as the second surrounding pixels matching the CCLM_L prediction sub-mode.
[0119] In the above embodiment, by selecting the surrounding pixels of the preset position as the second surrounding pixels, the amount of calculation is greatly reduced, thereby improving the processing efficiency.
[0120] In the VVC standard, the idea of the cross-component linear prediction mode is that for a coding block, the reconstructed luminance value of the pixel in the coding block is used to predict the chrominance value of the pixel in the coding block. For example, the chrominance value can be predicted by the following linear transformation function:
[0121] pred_C(i,j)=α·rec_L'(i,j)+β
[0122] Where pred_C(i,j) is the predicted chrominance value corresponding to the pixel in the i-th row and j-th column of the current coding block, and rec_L'(i,j) is the reconstructed luminance value of the pixel in the i-th row and j-th column of the current coding block after downsampling. α and β are chrominance coding parameters.
[0123] In the embodiment of the present application, the chrominance encoding parameters are used to predict the chrominance values of the surrounding pixels, and the predicted chrominance values are compared with the actual reconstructed chrominance values, and a prediction sub-mode is selected according to the difference between the two. Accordingly, in one embodiment, for each prediction sub-mode, the predicted chrominance value is determined according to the reconstructed brightness value of the first surrounding pixels and the second reconstructed pixel value of the second surrounding pixels matching the corresponding prediction sub-mode, including: for each prediction sub-mode, the chrominance encoding parameters matching the corresponding prediction sub-mode are determined according to the second reconstructed pixel value of the second surrounding pixels matching the corresponding prediction sub-mode. For each prediction sub-mode, the predicted chrominance value corresponding to the corresponding prediction sub-mode is determined based on the chrominance encoding parameters matching the corresponding prediction sub-mode and the reconstructed brightness value of the first surrounding pixels.
[0124] For each prediction sub-mode, the computer device extracts the second reconstructed pixel value of the second surrounding pixel selected in the prediction sub-mode, including the reconstructed luminance value and the reconstructed chrominance value. Based on the reconstructed luminance value and the reconstructed chrominance value, the computer device calculates the chrominance coding parameter corresponding to the prediction sub-mode according to the numerical relationship between the two, so as to determine the numerical relationship between the reconstructed luminance value and the predicted chrominance value applicable to the first surrounding pixel by using the chrominance coding parameter, and then calculates the corresponding predicted chrominance value according to the known reconstructed luminance value.
[0125] In one embodiment, for the selected second surrounding pixels, the computer device compares the reconstructed brightness values corresponding to the second surrounding pixels to obtain two larger values X of the reconstructed brightness values. 0 A and X 1 A , and two smaller values X 0 B and X 1 B The computer equipment obtains two larger values X 0 A and X 1 A The reconstructed chromaticity value Y of the corresponding second surrounding pixel 0 A and Y 1 A , and two smaller values X 0 B and X 1 B The reconstructed chromaticity value Y of the corresponding second surrounding pixel 0 B and Y 1 B .
[0126] According to the two larger values X of the reconstructed brightness value 0 A and X 1 A , computer equipment calculation X 0 A and X 1 A The mean Xa, and the corresponding reconstructed chrominance value Y 0 A and Y 1 A The mean value Ya; according to the two smaller values X of the reconstructed brightness value 0 B and X 1 B , computer equipment calculation X 0 B and X1 B The mean value Xb, and the corresponding reconstructed chrominance value Y 0 B and Y 1 B The mean value Yb. Therefore, the chrominance coding parameter can be calculated according to the following formula:
[0127] α=(Ya-Yb) / (Xa-Xb)
[0128] β=Yb-α*Xb
[0129] Of course, the above formula is only an example, and the computer device can also calculate the chrominance coding parameters α and β using other applicable formulas.
[0130] In the above embodiment, the chromaticity pixel value of the first surrounding pixel is predicted based on the numerical relationship between the reconstructed luminance value and the reconstructed chromaticity value of the second surrounding pixel. The more accurate the numerical relationship between the second pixel values of the second surrounding pixel is, the more accurate the predicted chromaticity value of the first surrounding pixel is. The numerical relationship can be obtained based on estimating the second surrounding pixel and calculating and determining the chromaticity encoding parameter. The more accurate the chromaticity encoding parameter is, the more accurate the predicted chromaticity value is, and thus the best chromaticity encoding mode can be accurately selected from the preset multiple chromaticity encoding modes.
[0131] As mentioned above, for the YUV or YCbCr format, the chrominance value corresponds to two chrominance channels, corresponding to the Cb chrominance channel and the Cr chrominance channel respectively. It is similar for any other format with multiple chrominance channels. Therefore, in one embodiment, for each chrominance channel, the computer device calculates the chrominance encoding parameter corresponding to the chrominance channel. That is, the chrominance encoding parameter of each prediction sub-mode includes multiple chrominance encoding parameters, and each chrominance encoding parameter corresponds to a chrominance channel.
[0132] Accordingly, in one embodiment, for each prediction sub-mode, the chrominance coding parameters matching the corresponding prediction sub-mode are determined based on the second reconstructed pixel values of the second surrounding pixels matching the corresponding prediction sub-mode, including: for each prediction sub-mode, determining the reconstructed luminance values of the second surrounding pixels matching the corresponding prediction sub-mode, and the reconstructed chrominance values respectively corresponding in different chrominance channels; determining the target luminance pixel value based on the reconstructed luminance value of the second surrounding pixels, and determining the target chrominance pixel values corresponding to the different chrominance channels based on the reconstructed chrominance values respectively corresponding in the different chrominance channels; determining the chrominance coding parameters matching the corresponding prediction sub-mode and corresponding to each chrominance channel based on the target luminance pixel value and the target chrominance pixel values corresponding to the different chrominance channels.
[0133] For each prediction sub-mode, the computer device extracts the second reconstructed pixel value of each second surrounding pixel according to the second surrounding pixels selected in the prediction sub-mode, and obtains the reconstructed brightness value and reconstructed chromaticity value of the second surrounding pixel. Since it corresponds to multiple chromaticity channels, the reconstructed chromaticity value of the second surrounding pixel is the reconstructed chromaticity value in each chromaticity channel. For example, the reconstructed chromaticity value under the Cr chromaticity channel and the reconstructed chromaticity value under the Cb chromaticity channel, etc.
[0134] Since the size of the luminance coding block may be the same as or different from the size of the chrominance coding block, in order to establish a mapping relationship between the luminance pixel value and the chrominance pixel value, the computer device determines the target luminance pixel value based on the reconstructed luminance value in the second reconstructed pixel value. In one embodiment, the size of the luminance coding block is the same as the size of the chrominance coding block, and the computer device uses the reconstructed luminance value in the second reconstructed pixel value as the target luminance pixel value. In another embodiment, the size of the luminance coding block is larger than the size of the chrominance coding block, and the computer device obtains the value obtained by downsampling the reconstructed luminance value in the second reconstructed pixel value as the target luminance pixel value.
[0135] Similarly, the computer device determines the target chromaticity pixel values corresponding to different chromaticity channels based on the reconstructed chromaticity values corresponding to the second surrounding pixels in different chromaticity channels. In one embodiment, for a chromaticity channel, the computer device uses the reconstructed chromaticity value of the second surrounding pixels in the chromaticity channel as the target chromaticity pixel value corresponding to the chromaticity channel.
[0136] Thus, for a chroma channel, the computer device determines the chroma coding parameters matching the current prediction sub-mode in the chroma channel based on the target luminance pixel value of the second surrounding pixel and the target chroma pixel value of the second surrounding pixel in the chroma channel. For each prediction sub-mode and each chroma channel under each prediction sub-mode, the computer device performs the above calculations to obtain the chroma coding parameters corresponding to each chroma channel under each prediction sub-mode.
[0137] In the above embodiment, by calculating each chrominance channel, the obtained chrominance encoding parameters can be more closely matched to the relationship between the original brightness information and chrominance information of the video frame, and the accuracy is higher.
[0138] After determining the chrominance coding parameters, the computer device can calculate the predicted chrominance values corresponding to the first surrounding pixels according to the reconstructed brightness values obtained by extracting the selected first surrounding pixels. In one embodiment, for each prediction sub-mode, based on the chrominance coding parameters matching the corresponding prediction sub-mode and the reconstructed brightness values of the first surrounding pixels, the predicted chrominance values corresponding to the corresponding prediction sub-mode are determined, including: for each prediction sub-mode, based on the chrominance coding parameters of each chrominance channel matching the corresponding prediction sub-mode and the reconstructed brightness values of the first surrounding pixels, the predicted chrominance values of the corresponding prediction sub-mode under each chrominance channel are determined.
[0139] For one prediction sub-mode, the computer device constructs a numerical relationship between the reconstructed luminance value and the predicted chrominance value of the first surrounding pixel based on the calculated chrominance coding parameters of each chrominance channel in the prediction sub-mode. Thus, the computer device obtains the target luminance pixel value based on the known reconstructed luminance value of the first surrounding pixel, and can calculate the predicted chrominance value of the first surrounding pixel based on the target luminance pixel value and the numerical relationship.
[0140] Exemplarily, for one of the chroma channels of the current prediction sub-mode, after calculating the chroma coding parameters, the computer device establishes a numerical relationship between the reconstructed luminance value and the predicted chroma value of the first surrounding pixel based on the relationship between the luminance pixel value and the chroma pixel value:
[0141] pred_C(p,t)=α0*rec_L'(p,t)+β0
[0142] Where pred_C(p,t) is the predicted chrominance value corresponding to the first surrounding pixel at position (p,t), and rec_L'(p,t) is the reconstructed luminance value after downsampling corresponding to the first surrounding pixel at position (p,t). Parameters α0 and β0 are calculated based on the reconstructed chrominance value and the reconstructed luminance value after downsampling of the second surrounding pixel.
[0143] In the above embodiment, by using the reconstructed chromaticity values of the first surrounding pixels as a reference standard, the corresponding predicted chromaticity values are calculated and compared, thereby more accurately determining the performance advantages and disadvantages of each prediction sub-mode and avoiding large differences between the coding blocks.
[0144] In the case where the size of the luma coding block is larger than the size of the chroma coding block, in order to match the reconstructed luma value with the reconstructed chroma value, in one embodiment, for each prediction sub-mode, the predicted chroma value is determined according to the reconstructed luma value of the first surrounding pixel and the second reconstructed pixel value of the second surrounding pixel matching the corresponding prediction sub-mode, including: performing downsampling processing based on multiple reconstructed luma values of the first surrounding pixel to obtain the sampled luma pixel value of the first surrounding pixel. For each prediction sub-mode, the predicted chroma value corresponding to the corresponding prediction sub-mode is determined according to the sampled luma pixel value of the first surrounding pixel and the second reconstructed pixel value of the second surrounding pixel matching the corresponding prediction sub-mode.
[0145] For each prediction sub-mode, the computer device obtains the corresponding reconstructed brightness value according to the selected first surrounding pixel, and performs downsampling processing to obtain a sampled brightness pixel value corresponding to the first surrounding pixel. The downsampling processing includes but is not limited to performing average processing on multiple reconstructed brightness values corresponding to the first surrounding pixel.
[0146] The computer device extracts the second reconstructed pixel value of the second surrounding pixel according to the second surrounding pixel selected in the prediction sub-mode, and the second reconstructed pixel value includes a reconstructed brightness value and a reconstructed chrominance value. Similarly, the computer device can obtain the target brightness pixel value obtained by downsampling the reconstructed brightness value of the second surrounding pixel. Based on the reconstructed brightness value and the reconstructed chrominance value of the second surrounding pixel, the computer device can calculate the chrominance coding parameter under the prediction sub-mode. For example, the computer device calculates the chrominance coding parameter according to the formula mentioned in the above embodiment based on the target brightness pixel value obtained by downsampling the reconstructed brightness value of the second surrounding pixel and the reconstructed chrominance value. For two or more chrominance channels, the chrominance coding parameters calculated by each chrominance channel are all chrominance coding parameters under the prediction sub-mode. Therefore, by downsampling the reconstructed brightness value, there is a one-to-one correspondence between the reconstructed brightness value and the reconstructed chrominance value, avoiding the brightness pixel value and the chrominance pixel value not corresponding to affect the accuracy.
[0147] For one of the prediction sub-modes, the computer device can calculate and determine the predicted chromaticity value of the first surrounding pixel based on the sampled luminance pixel value of the first surrounding pixel and the chromaticity coding parameter under the prediction sub-mode. For two or more chromaticity channels, the computer device can calculate the predicted chromaticity value corresponding to each chromaticity channel accordingly. In other words, there are also multiple predicted chromaticity values, each of which corresponds to a chromaticity channel.
[0148] Taking two chrominance channels as an example, in one embodiment, the predicted chrominance value includes a predicted chrominance value corresponding to the first chrominance channel and a predicted chrominance value corresponding to the second chrominance channel. Accordingly, for each prediction sub-mode, the chrominance prediction distortion result corresponding to the corresponding prediction sub-mode is determined based on the difference between the reconstructed chrominance value and the predicted chrominance value of the surrounding pixels of the current coding block, including: for each prediction sub-mode, according to the reconstructed chrominance value of the first surrounding pixel in the first chrominance channel and the predicted chrominance value corresponding to the first chrominance channel, determine the first distortion degree; according to the reconstructed chrominance value of the first surrounding pixel in the second chrominance channel and the predicted chrominance value corresponding to the second chrominance channel, determine the second distortion degree; based on the first distortion degree and the second distortion degree, determine the chrominance prediction distortion result corresponding to the corresponding prediction sub-mode.
[0149] The distortion degree may be measured by the difference between the reconstructed chrominance value and the predicted chrominance value of the first surrounding pixel, the sum of the absolute differences, or the sum of the squares of the differences.
[0150] Specifically, for each prediction sub-mode, the computer device extracts the reconstructed chromaticity value of the first surrounding pixel selected under the prediction sub-mode in the first chromaticity channel, and uses the chromaticity encoding parameters corresponding to the first chromaticity channel to calculate the predicted chromaticity value of the first surrounding pixel in the first chromaticity channel. Thus, the computer device can calculate the first distortion degree between the reconstructed chromaticity value and the predicted chromaticity value of the first surrounding pixel in the first chromaticity channel.
[0151] Similarly, the computer device extracts the reconstructed chromaticity value of the first surrounding pixel selected in this prediction sub-mode in the second chromaticity channel, and uses the chromaticity coding parameters corresponding to the second chromaticity channel to calculate the predicted chromaticity value of the first surrounding pixel in the second chromaticity channel. Thus, the computer device can calculate the second distortion between the reconstructed chromaticity value and the predicted chromaticity value of the first surrounding pixel in the second chromaticity channel.
[0152] Thus, the computer device can determine the distortion between the reconstructed chroma value and the predicted chroma value under the prediction sub-mode, i.e., the chroma prediction distortion result corresponding to the prediction sub-mode, based on the first distortion and the second distortion corresponding to the two chroma channels under the prediction sub-mode. The distortion between the reconstructed chroma value and the predicted chroma value corresponding to the prediction sub-mode can be the absolute difference, the sum of the absolute differences, or the sum of the squares of the differences between the first distortion and the second distortion corresponding to the two chroma channels, or the ratio or product between the two.
[0153] Exemplarily, for one of the prediction sub-modes, the computer device extracts the reconstructed chromaticity value of the first surrounding pixel selected in the prediction sub-mode, and calculates its predicted chromaticity value. Based on the distortion between the reconstructed chromaticity value and the predicted chromaticity value, the computer device determines the prediction sub-mode corresponding to the minimum distortion as the target prediction sub-mode. Exemplarily, for the first surrounding pixel (p, t), the computer device extracts the reconstructed chromaticity value rec_L'(p, t) of the second surrounding pixel (p, t), calculates its predicted chromaticity value pred_C(p, t), calculates the difference between the reconstructed chromaticity value rec_L'(p, t) and the predicted chromaticity value pred_C(p, t), and obtains the distortion between the two. For the selected multiple first surrounding pixels, the computer device calculates the distortion corresponding to each first surrounding pixel, and uses the total distortion obtained by combining the distortions as the distortion corresponding to the current prediction sub-mode. Among them, the method of comprehensively obtaining the total distortion degree by combining the distortion degrees corresponding to each first surrounding pixel can be, but is not limited to, taking one or more of the mean, standard deviation, sum of absolute differences, or sum of squared differences of the distortion degrees corresponding to each first surrounding pixel.
[0154] For each prediction sub-mode, the computer device performs the above calculations to obtain the distortion corresponding to each prediction sub-mode among the preset multiple prediction sub-modes. Thus, the computer device compares the distortions corresponding to each prediction sub-mode and uses the prediction sub-mode corresponding to the minimum distortion as the target prediction sub-mode.
[0155] In the above embodiment, by calculating the distortion corresponding to each prediction sub-mode, and taking the prediction sub-mode corresponding to the minimum distortion as the target prediction sub-mode, the optimal prediction sub-mode can be quickly selected from the preset multiple prediction sub-modes, thereby improving the encoding performance and efficiency. For multiple chroma channels, the distortion corresponding to each chroma channel is combined to finally determine the distortion corresponding to each prediction sub-mode, thereby improving the accuracy of selecting the prediction sub-mode.
[0156] Thus, based on the chrominance prediction distortion results corresponding to each prediction sub-mode, the computer device can select a target prediction sub-mode therefrom. After determining the target prediction sub-mode, the computer device compares the target prediction sub-mode with other candidate coding modes to determine the final coding mode, i.e., the target coding mode. To this end, in one embodiment, the target coding mode is determined from at least one candidate coding mode and the target prediction sub-mode, including: for each coding mode in at least one candidate coding mode and the target prediction sub-mode, the coding chrominance cost values corresponding to each coding mode are calculated; and the coding mode with the smallest coding chrominance cost value is used as the target coding mode.
[0157] The coding chromaticity cost value is used to measure the performance of each coding mode. The coding chromaticity cost value can be represented by the number of bits consumed by coding and the quality loss under the coding mode used, for example, it can be a weighted sum of the number of bits consumed by coding and the quality loss.
[0158] Specifically, the computer device calculates the encoding chrominance cost values corresponding to the target prediction submode and various candidate coding modes, respectively, and finally determines the target coding mode based on the encoding chrominance cost values. For example, after the computer device determines that the target prediction submode is the CCLM_A prediction submode, it compares the selected CCLM_A prediction submode with other multiple candidate coding modes to select the target coding mode.
[0159] In one embodiment, the computer device determines a minimum value among the encoded chrominance cost values, and uses the encoding mode corresponding to the minimum value as the target encoding mode.
[0160] In the above embodiment, by calculating the coding chromaticity cost values of various coding modes, the coding mode with the best performance can be selected. In addition, since the target prediction sub-mode has been selected in the CCLM prediction mode before, when calculating the coding chromaticity cost value, it is not necessary to calculate each prediction sub-mode in the CCLM prediction mode, but only the selected target prediction sub-mode needs to be calculated. As a result, the amount of calculation and complexity are greatly reduced, and the coding performance and coding efficiency are improved.
[0161] For the video to be transmitted, the computer device selects the encoding mode and performs encoding processing for each video frame and each encoding block in each video frame, thereby obtaining the video after encoding processing. In one embodiment, the above method also includes: sending the encoded video after the encoding processing is completed and carrying the encoding information to the decoding end, so that the decoding end determines the target encoding mode based on the received encoded video according to the identification information, and decodes the encoded video based on the target encoding mode.
[0162] Specifically, after the computer device as the decoding end completes the encoding process of the video, it sends the encoded video to the computer device as the decoding end. After receiving the encoded video, the computer device as the decoding end obtains the encoding information corresponding to the encoded video and determines the encoding information corresponding to each video frame. The encoding information corresponding to each video frame includes the identification information corresponding to each encoding block.
[0163] For the identification information corresponding to each coding block, the computer device determines the target coding mode indicated by the identification information. When the target coding mode is any mode among the candidate coding modes, the computer device uses the target coding mode to perform decoding processing on the corresponding coding block.
[0164] Since the multiple prediction sub-modes in the cross-component linear prediction mode all correspond to the same identification information, when the target coding mode indicated by the identification information is the cross-component linear prediction mode, the computer device as the decoding end further performs calculations to determine which prediction sub-mode the coding mode corresponding to the current coding block is. For example, the computer device as the decoding end performs steps similar to those of determining the target coding method in the above embodiment, thereby calculating and determining a specific target prediction sub-mode among the preset multiple prediction sub-modes. Since the various prediction sub-modes share the same identification information, the bit consumption is greatly reduced for each coding block, each video frame, and the coding information corresponding to the video.
[0165] Exemplarily, 8 modes are set in the VVC standard, each of which corresponds to a mode number, which is represented in binary during transmission, as shown in the following Table 1.
[0166]
[0167]
[0168] Table 1
[0169] When encoding, the encoder writes the identification information into the encoding information. For example, after selecting the CCLM_L prediction sub-mode, the identification information 110 is written into the encoding information. However, in the VVC standard, each sub-mode of the CCLM prediction mode corresponds to an identification information, and a large number of bits are consumed for each coding block, a video frame containing multiple coding blocks, and a video containing multiple video frames.
[0170] In the embodiment of the present application, the three sub-modes of the CCLM prediction mode all share one identification information, as shown in Table 2 below.
[0171] Encoding Mode Identification Information DM Mode 00 Planar Mode 0100 Vertical Mode 0101 Horizontal Mode 0110 DC Mode 0111 CCLM forecasting model 1
[0172] Table 2
[0173] Therefore, based on the method provided in the embodiment of the present application, the encoder only needs to indicate whether to select the CCLM prediction mode through one bit, and the decoder then performs the same steps as the process of determining the target encoding mode by the encoder to determine which sub-mode of the CCLM prediction mode the target encoding mode is. For videos with a large number of video frames, especially for large data files (such as video files in gigabytes), it can greatly reduce the bit consumption of encoding, greatly reduce the transmission consumption, improve the performance of the encoding and decoding process, and improve the efficiency of encoding and decoding.
[0174] The present application also provides an application scenario, which applies the above-mentioned method for selecting a chroma coding mode. Specifically, the application of the method for selecting a chroma coding mode in this application scenario is as follows: the server encodes each video frame in the video to be transmitted, and before each video frame is encoded, the server divides each video frame into coding blocks based on the VVC standard, and sequentially determines each coding block in the video frame and the surrounding pixels of each coding block. According to the three sub-modes in the CCLM prediction mode preset in VVC, the server determines the first surrounding pixels and the second surrounding pixels corresponding to each sub-mode respectively, and calculates the distortion corresponding to each sub-mode based on the first surrounding pixels and the second surrounding pixels, thereby determining which sub-mode the target prediction sub-mode is, that is, the CCLM prediction sub-mode, the CCLM_A prediction sub-mode, or the CCLM_L prediction sub-mode.
[0175] After determining the target prediction sub-mode, the server compares the target prediction sub-mode with other candidate intra-frame prediction sub-modes according to the decision strategy, and determines the video encoding method. Thus, the server encodes the coding blocks in the video frame based on the video encoding method, thereby achieving compression of the video data. Then the server responds to the video acquisition request of the terminal and transmits the encoded video to the terminal. For the received encoded video, the terminal determines the prediction sub-mode according to the identification information carried by the video frame, and decodes the video frame based on the determined prediction sub-mode. Therefore, when facing the scenario of video transmission, the method provided in the embodiment of the present application can greatly reduce the bit transmission consumption of encoding and decoding and improve transmission efficiency.
[0176] Of course, it is not limited to this. The chroma coding mode selection method provided in the present application can also be applied to other application scenarios, such as video playback on video websites, real-time live broadcast, online conferences, online classes, car navigation, or image transmission.
[0177] In a specific example, the method for selecting a chroma coding mode provided in an embodiment of the present application includes the following steps: a computer device as an encoding end determines a current coding block in a video frame to be encoded, and determines surrounding pixels corresponding to the current coding block. The computer device uses pixels adjacent to the current coding block and above the current coding block, and pixels adjacent to the current coding block and to the left of the current coding block as surrounding pixels.
[0178] For each prediction sub-mode, the computer device selects a first surrounding pixel and a second surrounding pixel from the surrounding pixels. Assuming that the prediction sub-mode includes a first prediction sub-mode, a second prediction sub-mode, and a third prediction sub-mode, for the first prediction sub-mode, the computer device selects surrounding pixels that meet the first preset position from the surrounding pixels located above and to the left of the current coding block, respectively, as the second surrounding pixels that match the first prediction sub-mode. For the second prediction sub-mode, the computer device selects surrounding pixels that meet the second preset position from the surrounding pixels located above the current coding block, as the second surrounding pixels that match the second prediction sub-mode. For the third prediction sub-mode, the computer device selects surrounding pixels that meet the third preset position from the surrounding pixels located to the left of the current coding block, as the second surrounding pixels that match the third prediction sub-mode. The selection method of the first surrounding pixels is similar. In one embodiment, the first surrounding pixels and the second surrounding pixels can select surrounding pixels at the same position, thereby reducing the resource consumption of the computer device.
[0179] After determining the first surrounding pixels and the second surrounding pixels, for each prediction sub-mode, the computer device determines the chrominance coding parameters that match the corresponding prediction sub-mode according to the second reconstructed pixel values of the second surrounding pixels that match the corresponding prediction sub-mode. When the chrominance pixel value corresponds to multiple chrominance channels, for each prediction sub-mode, the computer device determines the reconstructed luminance value in the corresponding second reconstructed pixel value and the reconstructed chrominance values that correspond to different chrominance channels according to the second surrounding pixels that match the corresponding prediction sub-mode. The computer device then determines the target luminance pixel value based on the reconstructed luminance value in the second reconstructed pixel value, and determines the target chrominance pixel values corresponding to different chrominance channels based on the reconstructed chrominance values that correspond to different chrominance channels. Thus, the computer device determines the chrominance coding parameters that match the corresponding prediction sub-mode and correspond to each chrominance channel based on the target luminance pixel value and the target chrominance pixel values that correspond to different chrominance channels.
[0180] After determining the chrominance encoding parameters corresponding to each prediction sub-mode, the computer device determines the predicted chrominance value corresponding to the corresponding prediction sub-mode based on the chrominance encoding parameters matching the corresponding prediction sub-mode and the reconstructed luminance value of the first surrounding pixel. Similarly, when the chrominance pixel value corresponds to multiple chrominance channels, for each prediction sub-mode, the computer device determines the predicted chrominance value of the corresponding prediction sub-mode under each chrominance channel based on the chrominance encoding parameters of each chrominance channel matching the corresponding prediction sub-mode and the reconstructed luminance value of the first surrounding pixel.
[0181] Thus, the computer device determines the prediction sub-mode corresponding to the minimum distortion as the target prediction sub-mode according to the distortion between the reconstructed chromaticity value and the predicted chromaticity value corresponding to the first surrounding pixel in each prediction sub-mode. In the above manner, the prediction sub-mode with the best performance can be quickly selected from the preset multiple prediction sub-modes, thereby improving the encoding performance. After selecting the target prediction sub-mode, the computer device calculates the encoding chromaticity cost values corresponding to the target prediction sub-mode and other candidate encoding modes respectively, and uses the encoding mode with the smallest encoding chromaticity cost value as the target encoding mode.
[0182] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0183] Based on the same inventive concept, in one embodiment, Figure 5 As shown, the embodiment of the present application also provides a method for determining a chroma decoding mode, which is described by taking the method applied to a computer device as an example. The computer device may be a terminal or a server. The method comprises the following steps:
[0184] Step S502: determining identification information corresponding to the current decoding block according to the encoding information corresponding to the video to be decoded.
[0185] Specifically, the computer device obtains the coding information corresponding to the received video to be decoded, and extracts the coding information corresponding to each decoding block, wherein the coding information includes coding information corresponding to each video frame, and the coding information corresponding to each video frame includes identification information corresponding to each decoding block.
[0186] For the currently processed decoding block (ie, the current decoding block), the computer device extracts corresponding identification information from the encoding information corresponding to the current decoding block to determine the encoding mode applied to the current decoding block.
[0187] Step S504: when the identification information is preset identification information, determine that the encoding mode corresponding to the current decoding block is a cross-component linear prediction mode, and the cross-component linear prediction mode includes multiple prediction sub-modes.
[0188] Specifically, when the identification information indicates that the target encoding mode is any one of the candidate encoding modes, the computer device uses the target encoding mode to perform decoding processing on the corresponding decoding block.
[0189] Since each prediction sub-mode in the CCLM prediction mode shares the same identification information, the identification information is called preset identification information. Accordingly, when the identification information is preset identification information, it indicates that the corresponding chrominance coding method is a prediction sub-mode in the CCLM prediction mode, and thus the computer device can further determine the target prediction sub-mode and use the target prediction sub-mode to perform decoding processing on the current decoding block.
[0190] Step S506 : for each prediction sub-mode, chrominance prediction is performed on the surrounding pixels of the current decoding block in the to-be-decoded video frame, respectively, to obtain chrominance prediction distortion results corresponding to each prediction sub-mode.
[0191] Specifically, for the current decoding block, the computer device determines the surrounding pixels around the current decoding block in the current prediction sub-mode for each prediction sub-mode in the CCLM prediction mode, and performs chrominance prediction on the current prediction sub-mode based on the reconstructed luminance value and reconstructed chrominance value of the surrounding pixels, thereby obtaining the chrominance prediction distortion results corresponding to each prediction sub-mode. The chrominance prediction distortion results are used to measure the performance between each prediction sub-mode.
[0192] Step S508 , determining a target prediction sub-mode from a plurality of prediction sub-modes according to the chrominance prediction distortion results corresponding to each prediction sub-mode, and the target prediction sub-mode is used to perform decoding processing on the current decoding block.
[0193] The chroma prediction distortion result is calculated for each prediction sub-mode, and the obtained chroma prediction distortion result is used as a basis for selecting a target prediction sub-mode. In one embodiment, the target prediction sub-mode is determined from a plurality of prediction sub-modes according to the chroma prediction distortion result corresponding to each prediction sub-mode, including: based on the chroma prediction distortion result corresponding to each prediction sub-mode, the computer device selects a result representing the minimum chroma prediction distortion from each chroma prediction distortion result, and selects the prediction sub-mode corresponding to the result as the target prediction sub-mode.
[0194] Therefore, after determining the target prediction sub-mode, the computer device can perform decoding processing on the current decoding block according to the target prediction sub-mode.
[0195] The above-mentioned method for determining the chrominance decoding mode, after receiving the video to be decoded transmitted by the encoding end, determines the encoding mode corresponding to the current decoding block by extracting the encoding information and extracting the identification information. When the identification information indicates that the encoding mode corresponding to the current decoding block is a cross-component linear prediction mode, the final target prediction sub-mode is determined by performing chrominance prediction on various prediction sub-modes, so as to use the target prediction sub-mode to perform decoding processing on the current decoding block. By sharing the preset identification information in each prediction sub-mode of the cross-component linear prediction mode, the number of bits that the encoding end needs to carry in the video transmitted to the decoding end is greatly reduced, thereby improving the transmission efficiency between the encoding end and the decoding end.
[0196] In one embodiment, Figure 6 As shown, for each prediction sub-mode, chrominance prediction is performed on the surrounding pixels of the current decoding block in the video frame to be decoded, and the chrominance prediction distortion results corresponding to each prediction sub-mode are obtained, including:
[0197] Step S602: determine surrounding pixels adjacent to the current decoding block.
[0198] Step S604 , determining first reconstructed pixel values corresponding to first surrounding pixels in the surrounding pixels, wherein the first reconstructed pixel values include reconstructed brightness values and reconstructed chrominance values.
[0199] Step S606: Determine second surrounding pixels that match each prediction sub-pattern based on the surrounding pixels.
[0200] Step S608: for each prediction sub-mode, determine a chrominance prediction distortion result according to the reconstructed luminance value of the first surrounding pixels and the second reconstructed pixel value of the second surrounding pixels matching the corresponding prediction sub-mode.
[0201] Specifically, after receiving the video to be decoded, the computer device as the decoding end determines the encoding information carried by the currently processed video frame to be decoded, and extracts the identification information therein. When the identification information corresponding to the current decoding block is the preset identification information, the computer device determines that the target prediction sub-mode is one of the preset multiple prediction sub-modes. Then, the computer device executes the above steps S602 to S608, thereby determining which prediction sub-mode is used as the target prediction sub-mode among the preset multiple prediction sub-modes, and performs decoding processing on the current decoding block according to the determined target prediction sub-mode. Among them, the contents of the above steps S602 to S608 can refer to the aforementioned embodiments and will not be repeated here.
[0202] In the above embodiment, for the current coding block in the video frame to be decoded, the first surrounding pixels and the second surrounding pixels for subsequent prediction sub-mode selection are determined according to the surrounding pixels belonging to the encoded coding block, the known reconstructed chromaticity values of the first surrounding pixels are used as a reference standard, the predicted chromaticity values of the first surrounding pixels are calculated according to the reconstructed brightness values and reconstructed chromaticity values of the second surrounding pixels, and the predicted chromaticity values are compared with the reconstructed chromaticity values used as the reference standard, thereby determining the target prediction sub-mode according to the difference between the two, thereby being able to determine which of the preset multiple prediction sub-modes the target prediction sub-mode selected by the encoding end when encoding is performed, and the bit information that the encoding end needs to carry when transmitting the video to the decoding end is greatly reduced, thereby improving the transmission efficiency between the encoding end and the decoding end.
[0203] Based on the same inventive concept, the embodiment of the present application also provides a chroma coding mode selection device for implementing the chroma coding mode selection method involved in the above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more chroma coding mode selection device embodiments provided below can refer to the limitations of the chroma coding mode selection method above, and will not be repeated here.
[0204] In one embodiment, Figure 7 As shown, the embodiment of the present application further provides a chroma coding mode selection device 700, comprising: a determination module 701, a prediction module 702 and a coding module 703, wherein:
[0205] The determination module 701 is used to determine a plurality of preset coding modes, where the plurality of preset coding modes include a cross-component linear prediction mode and at least one candidate coding mode, and the cross-component linear prediction mode includes a plurality of prediction sub-modes.
[0206] The prediction module 702 is used to perform chrominance prediction on the surrounding pixels of the current coding block in the to-be-coded video frame based on multiple prediction sub-modes, and obtain chrominance prediction distortion results corresponding to each prediction sub-mode.
[0207] The determination module 701 is further configured to determine a target prediction sub-mode from among the plurality of prediction sub-modes according to the chrominance prediction distortion results corresponding to the respective prediction sub-modes.
[0208] The determination module 701 is further configured to determine a target coding mode from at least one candidate coding mode and a target prediction sub-mode, where the target coding mode is used to perform coding processing on the current coding block.
[0209] The encoding module 703 is configured to add identification information corresponding to the target encoding mode to the encoding information of the current encoding block, wherein multiple prediction sub-modes in the cross-component linear prediction mode correspond to the same identification information.
[0210] In one embodiment, the prediction module is also used to perform chrominance prediction on the surrounding pixels of the current coding block in the to-be-coded video frame based on the multiple prediction sub-modes, and obtain the predicted chrominance values corresponding to each prediction sub-mode; for each prediction sub-mode, the chrominance prediction distortion result corresponding to the corresponding prediction sub-mode is determined based on the difference between the reconstructed chrominance value of the surrounding pixels of the current coding block and the predicted chrominance value.
[0211] In one embodiment, the prediction module is also used to determine the current coding block in the video frame to be encoded, and the surrounding pixels corresponding to the current coding block; determine the first reconstructed pixel values corresponding to each first surrounding pixel in the surrounding pixels, wherein the first reconstructed pixel value includes a reconstructed brightness value and a reconstructed chrominance value; based on the surrounding pixels, determine the second surrounding pixels that match each prediction sub-mode respectively; for each prediction sub-mode, determine the predicted chrominance value according to the reconstructed brightness value of the first surrounding pixels and the second reconstructed pixel value of the second surrounding pixels that matches the corresponding prediction sub-mode.
[0212] In one embodiment, the prediction module is further used to determine a current coding block in a video frame to be encoded; use pixels adjacent to and above the current coding block as surrounding pixels; and use pixels adjacent to and to the left of the current coding block as surrounding pixels.
[0213] In one embodiment, the prediction module is also used to select surrounding pixels that meet a preset position as second surrounding pixels from the surrounding pixels according to the selection method of surrounding pixels determined by each prediction sub-mode; wherein the cross-component linear prediction mode includes at least one of the first prediction sub-mode, the second prediction sub-mode, or the third prediction sub-mode, and the selection method of surrounding pixels corresponding to the prediction sub-mode includes at least one of the following: for the first prediction sub-mode, among the surrounding pixels respectively located above and to the left of the current coding block, the surrounding pixels that meet the first preset position are selected as the second surrounding pixels matching the first prediction sub-mode; for the second prediction sub-mode, among the surrounding pixels located above the current coding block, the surrounding pixels that meet the second preset position are selected as the second surrounding pixels matching the second prediction sub-mode; for the third prediction sub-mode, among the surrounding pixels located to the left of the current coding block, the surrounding pixels that meet the third preset position are selected as the second surrounding pixels matching the third prediction sub-mode.
[0214] In one embodiment, the prediction module is also used to determine, for each prediction sub-mode, a chrominance coding parameter matching the corresponding prediction sub-mode based on the second reconstructed pixel value of the second surrounding pixels matching the corresponding prediction sub-mode; for each prediction sub-mode, determine a predicted chrominance value corresponding to the corresponding prediction sub-mode based on the chrominance coding parameter matching the corresponding prediction sub-mode and the reconstructed luminance value of the first surrounding pixels.
[0215] In one embodiment, the chrominance encoding parameters of each prediction sub-mode include multiple chrominance encoding parameters, each of which corresponds to a chrominance channel. The prediction module is also used to determine, for each prediction sub-mode, the reconstructed luminance value of the second surrounding pixels matching the corresponding prediction sub-mode and the reconstructed chrominance values corresponding to different chrominance channels; determine the target luminance pixel value based on the reconstructed luminance value of the second surrounding pixels, and determine the target chrominance pixel values corresponding to different chrominance channels based on the reconstructed chrominance values corresponding to different chrominance channels; determine the chrominance encoding parameters matching the corresponding prediction sub-mode and corresponding to each chrominance channel based on the target luminance pixel value and the target chrominance pixel values corresponding to different chrominance channels.
[0216] In one embodiment, the prediction module is also used to determine, for each prediction sub-mode, the predicted chrominance value of the corresponding prediction sub-mode in each chrominance channel based on the chrominance coding parameters of each chrominance channel matching the corresponding prediction sub-mode and the reconstructed luminance value of the first surrounding pixels.
[0217] In one embodiment, the predicted chrominance value includes a predicted chrominance value corresponding to a first chrominance channel and a predicted chrominance value corresponding to a second chrominance channel. The prediction module is also used to determine, for each prediction sub-mode, a first distortion degree according to the reconstructed chrominance value of the first surrounding pixel in the first chrominance channel and the predicted chrominance value corresponding to the first chrominance channel; determine a second distortion degree according to the reconstructed chrominance value of the first surrounding pixel in the second chrominance channel and the predicted chrominance value corresponding to the second chrominance channel; and determine the chrominance prediction distortion result corresponding to the corresponding prediction sub-mode based on the first distortion degree and the second distortion degree.
[0218] In one embodiment, the determination module is also used to calculate the coding chrominance cost value corresponding to each coding mode for each coding mode in the at least one candidate coding mode and the target prediction sub-mode; and take the coding mode with the smallest coding chrominance cost value as the target coding mode.
[0219] In one embodiment, the above-mentioned device also includes a transmission module, which is used to send the encoded video that has completed the encoding process and carries the encoding information to the decoding end, so that the decoding end can determine the target encoding mode based on the received encoded video according to the identification information, and decode the encoded video based on the target encoding mode.
[0220] Each module in the above-mentioned chroma coding mode selection device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0221] Based on the same inventive concept, the embodiment of the present application also provides a device for determining a chroma decoding mode for implementing the above-mentioned method for determining a chroma decoding mode. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiments of one or more chroma decoding mode determination devices provided below can refer to the limitations of the chroma decoding mode determination method in the above text, and will not be repeated here.
[0222] In one embodiment, Figure 8 As shown, the embodiment of the present application further provides a device 800 for determining a chroma decoding mode, comprising: a parsing module 801, a determining module 802 and a predicting module 803. Among them:
[0223] The parsing module 801 is used to determine identification information corresponding to the current decoding block according to the encoding information corresponding to the video to be decoded.
[0224] The determination module 802 is further configured to determine, when the identification information is preset identification information, that the encoding mode corresponding to the current decoding block is a cross-component linear prediction mode, where the cross-component linear prediction mode includes multiple prediction sub-modes.
[0225] The prediction module 803 is used to perform chrominance prediction on the surrounding pixels of the current decoding block in the to-be-decoded video frame for each prediction sub-mode, and obtain the chrominance prediction distortion results corresponding to each prediction sub-mode.
[0226] The determination module 802 is further configured to determine a target prediction sub-mode from a plurality of prediction sub-modes according to the chrominance prediction distortion results corresponding to each prediction sub-mode, and the target prediction sub-mode is used to perform decoding processing on the current decoding block.
[0227] In one embodiment, the prediction module is also used to determine surrounding pixels adjacent to the current decoding block; determine first reconstructed pixel values corresponding to each first surrounding pixel in the surrounding pixels, wherein the first reconstructed pixel values include a reconstructed luminance value and a reconstructed chrominance value; based on the surrounding pixels, determine second surrounding pixels that match each prediction sub-mode respectively; for each prediction sub-mode, determine a chrominance prediction distortion result according to the reconstructed luminance value of the first surrounding pixels and the second reconstructed pixel value of the second surrounding pixels that matches the corresponding prediction sub-mode.
[0228] In one embodiment, a computer device is provided, which may be a server or a terminal. Taking the computer device as a server as an example, its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store video frame data and identification information corresponding to each mode. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for selecting a chroma encoding mode is implemented, or when the computer program is executed by the processor, a method for determining a chroma decoding mode is implemented.
[0229] Those skilled in the art will understand that Fig. 9The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0230] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0231] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0232] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0233] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.
[0234] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0235] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for selecting a chroma coding mode, characterized in that: The method comprises: Determining a plurality of preset coding modes, the plurality of preset coding modes comprising a cross-component linear prediction mode and at least one candidate coding mode, the cross-component linear prediction mode comprising a plurality of prediction sub-modes; Based on the multiple prediction sub-modes, chrominance prediction is performed on the surrounding pixels of the current coding block in the video frame to be coded, respectively, to obtain chrominance prediction distortion results corresponding to the prediction sub-modes respectively; Determining a target prediction sub-mode from the plurality of prediction sub-modes according to the chrominance prediction distortion results corresponding to the respective prediction sub-modes; Determine a target coding mode from the at least one candidate coding mode and the target prediction sub-mode, wherein the target coding mode is used to perform coding processing on the current coding block; Adding identification information corresponding to the target coding mode to the coding information of the current coding block, wherein a plurality of prediction sub-modes in the cross-component linear prediction mode correspond to the same identification information.
2. The method according to claim 1, characterized in that The method of performing chrominance prediction on surrounding pixels of a current coding block in a video frame to be coded based on the multiple prediction sub-modes to obtain chrominance prediction distortion results corresponding to the prediction sub-modes includes: Based on the multiple prediction sub-modes, chrominance prediction is performed on surrounding pixels of the current coding block in the video frame to be coded, respectively, to obtain predicted chrominance values corresponding to the prediction sub-modes; For each prediction sub-mode, a chrominance prediction distortion result corresponding to the corresponding prediction sub-mode is determined based on the difference between the reconstructed chrominance value of the surrounding pixels of the current coding block and the predicted chrominance value.
3. The method according to claim 2, characterized in that The method of performing chrominance prediction on surrounding pixels of the current coding block in the video frame to be coded based on the multiple prediction sub-modes to obtain predicted chrominance values corresponding to the prediction sub-modes includes: Determine a current coding block in a to-be-coded video frame, and surrounding pixels corresponding to the current coding block; Determine first reconstructed pixel values respectively corresponding to first surrounding pixels in the surrounding pixels, where the first reconstructed pixel values include a reconstructed brightness value and a reconstructed chrominance value; Based on the surrounding pixels, determining second surrounding pixels respectively matching each prediction sub-pattern; For each prediction sub-mode, a predicted chrominance value is determined based on the reconstructed luminance value of the first surrounding pixels and the second reconstructed pixel value of the second surrounding pixels matching the corresponding prediction sub-mode.
4. The method according to claim 3, characterized in that The determining of a current coding block in a to-be-coded video frame and surrounding pixels corresponding to the current coding block comprises: Determining a current coding block in a video frame to be encoded; Taking pixels adjacent to the current coding block and above the current coding block as surrounding pixels; Pixels adjacent to the current coding block and to the left of the current coding block are regarded as surrounding pixels.
5. The method according to claim 3, characterized in that: The determining, based on the surrounding pixels, second surrounding pixels respectively matching each prediction sub-pattern comprises: According to the selection method of the surrounding pixels determined by each prediction sub-mode, the surrounding pixels that meet the preset position are selected from the surrounding pixels as the second surrounding pixels; The cross-component linear prediction mode includes at least one of a first prediction sub-mode, a second prediction sub-mode, or a third prediction sub-mode, and a method for selecting surrounding pixels corresponding to the prediction sub-mode includes at least one of the following: For the first prediction sub-mode, among the surrounding pixels respectively located above and to the left of the current coding block, selecting surrounding pixels that meet the first preset position as second surrounding pixels matching the first prediction sub-mode; For the second prediction sub-mode, selecting surrounding pixels that meet a second preset position from surrounding pixels located above the current coding block as second surrounding pixels that match the second prediction sub-mode; For the third prediction sub-mode, among the surrounding pixels located to the left of the current coding block, surrounding pixels that meet a third preset position are selected as second surrounding pixels matching the third prediction sub-mode.
6. The method according to claim 3, characterized in that The step of determining the predicted chrominance value for each prediction sub-mode according to the reconstructed luminance value of the first surrounding pixel and the second reconstructed pixel value of the second surrounding pixel matching the corresponding prediction sub-mode comprises: For each prediction sub-mode, determining a chrominance coding parameter matching the corresponding prediction sub-mode according to a second reconstructed pixel value of a second surrounding pixel matching the corresponding prediction sub-mode; For each prediction sub-mode, a predicted chrominance value corresponding to the corresponding prediction sub-mode is determined based on the chrominance coding parameters matching the corresponding prediction sub-mode and the reconstructed luminance values of the first surrounding pixels.
7. The method according to claim 6, characterized in that The chrominance coding parameters of each prediction sub-mode include a plurality of chrominance coding parameters, each chrominance coding parameter corresponds to a chrominance channel; The step of determining, for each prediction sub-mode, a chroma coding parameter matching the corresponding prediction sub-mode according to the second reconstructed pixel value of the second surrounding pixel matching the corresponding prediction sub-mode comprises: For each prediction sub-pattern, determining a reconstructed luminance value of a second surrounding pixel matching the corresponding prediction sub-pattern and corresponding reconstructed chrominance values in different chrominance channels; Determine a target brightness pixel value based on the reconstructed brightness value of the second surrounding pixel, and determine target chrominance pixel values corresponding to different chrominance channels based on the reconstructed chrominance values respectively corresponding to the different chrominance channels; Based on the target luminance pixel value and the target chrominance pixel values corresponding to different chrominance channels, a chrominance coding parameter that matches the corresponding prediction sub-mode and corresponds to each chrominance channel is determined.
8. The method according to claim 7, characterized in that The step of determining, for each prediction sub-mode, a predicted chrominance value corresponding to the corresponding prediction sub-mode based on a chrominance coding parameter matched with the corresponding prediction sub-mode and a reconstructed luminance value of the first surrounding pixel, comprises: For each prediction sub-mode, based on the chrominance coding parameters of each chrominance channel matching the corresponding prediction sub-mode and the reconstructed luminance values of the first surrounding pixels, the predicted chrominance values of the corresponding prediction sub-mode in each chrominance channel are determined.
9. The method according to claim 8, characterized in that The predicted chrominance values include predicted chrominance values corresponding to the first chrominance channel and predicted chrominance values corresponding to the second chrominance channel; For each prediction sub-mode, determining the chrominance prediction distortion result corresponding to the corresponding prediction sub-mode based on the difference between the reconstructed chrominance value of the surrounding pixels of the current coding block and the predicted chrominance value includes: For each prediction sub-mode, determining a first distortion degree according to a reconstructed chrominance value of a first surrounding pixel in a first chrominance channel and a predicted chrominance value corresponding to the first chrominance channel; Determine a second distortion degree according to a reconstructed chrominance value of the first surrounding pixel in the second chrominance channel and a predicted chrominance value corresponding to the second chrominance channel; Based on the first distortion degree and the second distortion degree, a chrominance prediction distortion result corresponding to a corresponding prediction sub-mode is determined.
10. The method according to claim 1, characterized in that The step of determining a target coding mode from the at least one candidate coding mode and the target prediction sub-mode comprises: For each coding mode in the at least one candidate coding mode and the target prediction sub-mode, calculating the coding chrominance cost value corresponding to each coding mode; The coding mode with the smallest coding chrominance cost is taken as the target coding mode.
11. The method according to any one of claims 1 to 10, characterized in that The method further comprises: The encoded video after the encoding process is completed and carrying the encoding information is sent to the decoding end, so that the decoding end determines the target encoding mode based on the received encoded video according to the identification information, and decodes the encoded video based on the target encoding mode.
12. A method for determining a chroma decoding mode, characterized in that: The method comprises: Determining identification information corresponding to a current decoding block according to encoding information corresponding to the video to be decoded; In a case where the identification information is preset identification information, determining that the encoding mode corresponding to the current decoding block is a cross-component linear prediction mode, wherein the cross-component linear prediction mode includes multiple prediction sub-modes; For each prediction sub-mode, chrominance prediction is performed on surrounding pixels of a current decoding block in a to-be-decoded video frame to obtain chrominance prediction distortion results corresponding to each prediction sub-mode; A target prediction sub-mode is determined from a plurality of prediction sub-modes according to the chrominance prediction distortion results corresponding to each prediction sub-mode, and the target prediction sub-mode is used to perform decoding processing on the current decoding block.
13. The method according to claim 12, characterized in that For each prediction sub-mode, chroma prediction is performed on the surrounding pixels of the current decoding block in the to-be-decoded video frame to obtain the chroma prediction distortion results corresponding to each prediction sub-mode, including: Determining surrounding pixels adjacent to the current decoding block; Determine first reconstructed pixel values respectively corresponding to first surrounding pixels in the surrounding pixels, where the first reconstructed pixel values include a reconstructed brightness value and a reconstructed chrominance value; Based on the surrounding pixels, determining second surrounding pixels respectively matching each prediction sub-pattern; For each prediction sub-mode, a chrominance prediction distortion result is determined according to the reconstructed luminance value of the first surrounding pixels and the second reconstructed pixel value of the second surrounding pixels matching the corresponding prediction sub-mode.
14. A device for selecting a chroma coding mode, characterized in that: The device comprises: A determination module, configured to determine a plurality of preset coding modes, wherein the plurality of preset coding modes include a cross-component linear prediction mode and at least one candidate coding mode, wherein the cross-component linear prediction mode includes a plurality of prediction sub-modes; A prediction module, configured to perform chrominance prediction on surrounding pixels of a current coding block in a to-be-coded video frame based on the multiple prediction sub-modes, respectively, to obtain chrominance prediction distortion results corresponding to the prediction sub-modes; The determination module is further used to determine a target prediction sub-mode from the plurality of prediction sub-modes according to the chrominance prediction distortion results corresponding to each prediction sub-mode; The determination module is further used to determine a target coding mode from the at least one candidate coding mode and the target prediction sub-mode, wherein the target coding mode is used to perform coding processing on the current coding block; The encoding module is used to add identification information corresponding to the target encoding mode to the encoding information of the current encoding block, wherein multiple prediction sub-modes in the cross-component linear prediction mode correspond to the same identification information.
15. A device for determining a chroma decoding mode, characterized in that: The device comprises: A parsing module, used to determine identification information corresponding to a current decoding block according to encoding information corresponding to a video to be decoded; The determination module is further configured to determine, when the identification information is preset identification information, that the encoding mode corresponding to the current decoding block is a cross-component linear prediction mode, wherein the cross-component linear prediction mode includes a plurality of prediction sub-modes; A prediction module, configured to perform chrominance prediction on surrounding pixels of a current decoding block in a to-be-decoded video frame for each prediction sub-mode, and obtain chrominance prediction distortion results corresponding to each prediction sub-mode; The determination module is further used to determine a target prediction sub-mode from a plurality of prediction sub-modes according to the chrominance prediction distortion results corresponding to each prediction sub-mode, and the target prediction sub-mode is used to perform decoding processing on the current decoding block.
16. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 13 are implemented.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 13 are implemented.
18. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 13 are implemented.
Citation Information
Patent Citations
Intra-frame chroma prediction mode selection method, image processing device and storage device
CN110087083A
Intra-frame prediction mode selection method and device, equipment and storage medium
CN111741299A
Decoding method and device
WO2020182169A1
