Video encoding method and apparatus, video decoding method and apparatus, device, system, and storage medium

By setting the prediction value limit range of chroma blocks in cross-component intra-frame prediction mode, the problem of inaccurate chroma prediction is solved, and the prediction accuracy and performance of video encoding and decoding are improved.

WO2024243739A9PCT designated stage expired Publication Date: 2026-01-22GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/096641
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-05-26
Publication Date
2026-01-22

AI Technical Summary

Technical Problem

In existing technologies, chroma prediction based on cross-component intra-frame prediction mode suffers from inaccurate prediction, which affects video encoding and decoding efficiency.

Method used

When the prediction mode of the current chroma block is determined to be the cross-component intra-frame prediction mode, a range of prediction values ​​is set, including maximum and minimum limits, to determine the first prediction value of the current chroma block, and a second prediction value is determined based on the range.

Benefits of technology

It improves the prediction accuracy of chroma blocks and enhances video encoding and decoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023096641_22012026_PF_FP_ABST
    Figure CN2023096641_22012026_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a video encoding method and apparatus, a video decoding method and apparatus, a device, a system, and a storage medium. The method comprises: during prediction of a current chroma block, determining a prediction mode of the current chroma block; if the prediction mode is a cross-component intra-frame prediction mode, determining a limited range of a predicted value of the current chroma block, the limited range comprising at least one of a maximum limit value and a minimum limit value of the predicted value; then determining a first predicted value of the current chroma block on the basis of the cross-component intra-frame prediction mode; and determining a second predicted value of the current chroma block on the basis of the first predicted value and the limited range. That is to say, in the present application, if the current chroma block adopts the cross-component intra-frame prediction mode, the first predicted value determined by the cross-component intra-frame prediction mode is limited, so that the predicted value of the current chroma block is prevented from being too large or too small, the prediction accuracy of the current chroma block is further improved, and the video encoding and decoding performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Video encoding and decoding methods, devices, equipment, systems, and storage media Technical Field

[0001] This application relates to the field of video encoding and decoding technology, and in particular to a video encoding and decoding method, apparatus, device, system, and storage medium. Background Technology

[0002] Digital video technology can be integrated into various video devices, such as digital televisions, smartphones, computers, e-readers, and video players. With the development of video technology, the amount of data contained in video data has become increasingly large. To facilitate the transmission of video data, video devices implement video compression technology to enable more efficient transmission or storage of video data.

[0003] Because videos contain temporal or spatial redundancy, prediction can eliminate or reduce this redundancy, thus improving compression efficiency. However, current chroma prediction based on cross-component intra-frame prediction methods suffers from inaccurate predictions.

[0004] Summary of the Invention

[0005] This application provides a video encoding / decoding method, apparatus, device, system, and storage medium that can improve the prediction effect of the current chroma block and enhance encoding / decoding performance.

[0006] In a first aspect, this application provides a video decoding method applied to a decoder, comprising:

[0007] Determine the prediction mode for the current chroma block;

[0008] If the prediction mode is a cross-component intra-frame prediction mode, then based on the chromaticity values ​​of the reconstructed regions surrounding the current chromaticity block, a limited range of the predicted value of the current chromaticity block is determined, and the limited range includes at least one of the maximum and minimum limited values ​​of the predicted value.

[0009] Based on the cross-component intra-frame prediction mode, the first prediction value of the current chroma block is determined;

[0010] Based on the first predicted value and the defined range, a second predicted value for the current chroma block is determined.

[0011] Secondly, embodiments of this application provide a video encoding method applied to an encoder, comprising:

[0012] Determine the prediction mode for the current chroma block;

[0013] If the prediction mode is a cross-component intra-frame prediction mode, then based on the chromaticity values ​​of the reconstructed regions surrounding the current chromaticity block, a limited range of the predicted value of the current chromaticity block is determined, and the limited range includes at least one of the maximum and minimum limited values ​​of the predicted value.

[0014] Based on the cross-component intra-frame prediction mode, the first prediction value of the current chroma block is determined;

[0015] Based on the first predicted value and the defined range, a second predicted value for the current chroma block is determined.

[0016] Thirdly, this application provides a video decoding apparatus for performing the methods described in the first aspect or its various implementations. Specifically, the apparatus includes functional units for performing the methods described in the first aspect or its various implementations.

[0017] Fourthly, this application provides a video encoding apparatus for performing the methods described in the second aspect or its various implementations. Specifically, the apparatus includes functional units for performing the methods described in the second aspect or its various implementations.

[0018] Fifthly, this application provides a video decoder, including a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to perform the methods in the first aspect or its various implementations described above.

[0019] Sixthly, this application provides a video encoder, including a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to perform the methods in the second aspect or its implementations described above.

[0020] In a seventh aspect, this application provides a video encoding and decoding system, including a video encoder and a video decoder. The video decoder is used to execute the methods in the first aspect or its implementations described above, and the video encoder is used to execute the methods in the second aspect or its implementations described above.

[0021] Eighthly, this application provides a chip for implementing the methods of any one of the first to second aspects or their respective implementations. Specifically, the chip includes a processor for calling and running a computer program from a memory, causing a device equipped with the chip to perform the methods of any one of the first to second aspects or their respective implementations.

[0022] Ninthly, this application provides a computer-readable storage medium for storing a computer program that causes a computer to perform the methods of any one of the first to second aspects or their respective implementations.

[0023] In a tenth aspect, this application provides a computer program product, including computer program instructions that cause a computer to perform the methods in any one of the first to second aspects or their respective implementations.

[0024] In one aspect, this application provides a computer program that, when run on a computer, causes the computer to perform the methods of any one of the first to second aspects or their respective implementations.

[0025] Based on the above technical solution, when predicting the current chroma block, the prediction mode of the current chroma block is determined. If the prediction mode is a cross-component intra-frame prediction mode, a limited range of the predicted value of the current chroma block is determined. This limited range includes at least one of a maximum limited value and a minimum limited value of the predicted value. Then, based on the cross-component intra-frame prediction mode, a first predicted value of the current chroma block is determined. Based on the first predicted value and the limited range, a second predicted value of the current chroma block is determined. That is, in this embodiment, if the current chroma block adopts the cross-component intra-frame prediction mode, the first predicted value determined by the cross-component intra-frame prediction mode is limited to avoid the predicted value of the current chroma block being too large or too small, thereby improving the prediction accuracy of the current chroma block and enhancing video encoding and decoding performance. Attached Figure Description

[0026] Figure 1 is a schematic block diagram of a video encoding and decoding system according to an embodiment of this application;

[0027] Figure 2 is a schematic block diagram of a video encoder involved in an embodiment of this application;

[0028] Figure 3 is a schematic block diagram of a video decoder involved in an embodiment of this application;

[0029] Figure 4A is a schematic diagram of intra-frame prediction;

[0030] Figure 4B is a schematic diagram of intra-frame prediction;

[0031] Figures 5A-5I are schematic diagrams of intra-frame prediction;

[0032] Figure 6A is a schematic diagram of CCLM prediction;

[0033] Figure 6B is a schematic diagram of the spatial positional relationship of the input of the cross-convolution filter in CCCM;

[0034] Figure 6C is a schematic diagram of the reconstructed region for determining the filter coefficients;

[0035] Figure 6D is a schematic diagram of the four Sobel operators used to obtain gradients in GLM;

[0036] Figure 6E is a schematic diagram of the adjacent positions of the current chroma block;

[0037] Figure 7 is a schematic flowchart of a video decoding method provided in an embodiment of this application;

[0038] Figures 8A and 8B are schematic diagrams of a reconstructed region;

[0039] Figures 9A to 9C are schematic diagrams of several reconstruction regions used in CCCM to determine model parameters;

[0040] Figures 10A to 10C are schematic diagrams of the first surrounding reconstructed area corresponding to Figures 9A to 9C;

[0041] Figures 11A to 11E are schematic diagrams of several first-surrounded reconstructed areas;

[0042] Figure 12 is a schematic diagram of the prediction method provided in an embodiment of this application;

[0043] Figure 13 is a schematic block diagram of a video decoding device provided in an embodiment of this application;

[0044] Figure 14 is a schematic block diagram of a video encoding apparatus provided in an embodiment of this application;

[0045] Figure 15 is a schematic block diagram of an electronic device provided in an embodiment of this application;

[0046] Figure 16 is a schematic block diagram of a video encoding and decoding system provided in an embodiment of this application. Detailed Implementation

[0047] This application can be applied to the fields of image encoding and decoding, video encoding and decoding, hardware video encoding and decoding, dedicated circuit video encoding and decoding, and real-time video encoding and decoding. For example, the solution of this application can be combined with audio video coding standards (AVS), such as H.264 / Audio Video Coding (AVC) standard, H.265 / High Efficiency Video Coding (HEVC) standard, and H.266 / Versatile Video Coding (VVC) standard. Alternatively, the solution of this application can be combined with other proprietary or industry standards, including ITU-TH.261, ISO / IEC MPEG-1 Visual, ITU-TH.262 or ISO / IEC MPEG-2 Visual, ITU-TH.263, ISO / IEC MPEG-4 Visual, ITU-TH.264 (also known as ISO / IEC MPEG-4 AVC), which include Scalable Video Coding (SVC) and Multi-View Video Coding (MVC) extensions. It should be understood that the technology in this application is not limited to any particular codec standard or technology.

[0048] For ease of understanding, the video encoding and decoding system involved in the embodiments of this application will be introduced first with reference to Figure 1.

[0049] Figure 1 is a schematic block diagram of a video encoding and decoding system according to an embodiment of this application. It should be noted that Figure 1 is only an example, and the video encoding and decoding system of this application includes, but is not limited to, the one shown in Figure 1. As shown in Figure 1, the video encoding and decoding system 100 includes an encoding device 110 and a decoding device 120. The encoding device is used to encode (can be understood as compressing) video data to generate a bitstream, and transmits the bitstream to the decoding device. The decoding device decodes the bitstream generated by the encoding device to obtain decoded video data.

[0050] The encoding device 110 in this application embodiment can be understood as a device with video encoding function, and the decoding device 120 can be understood as a device with video decoding function. That is, the encoding device 110 and the decoding device 120 in this application embodiment include a wider range of devices, such as smartphones, desktop computers, mobile computing devices, laptops (e.g., laptop computers), tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, etc.

[0051] In some embodiments, encoding device 110 may transmit encoded video data (such as a bitstream) to decoding device 120 via channel 130. Channel 130 may include one or more media and / or means capable of transmitting encoded video data from encoding device 110 to decoding device 120.

[0052] In one example, channel 130 includes one or more communication media that enable encoding device 110 to transmit encoded video data directly to decoding device 120 in real time. In this example, encoding device 110 can modulate the encoded video data according to a communication standard and transmit the modulated video data to decoding device 120. The communication media includes wireless communication media, such as radio frequency spectrum; optionally, the communication media may also include wired communication media, such as one or more physical transmission lines.

[0053] In another example, channel 130 includes a storage medium that can store video data encoded by encoding device 110. The storage medium includes various local access data storage media, such as optical discs, DVDs, flash memory, etc. In this example, decoding device 120 can retrieve the encoded video data from the storage medium.

[0054] In another example, channel 130 may include a storage server that can store the video data encoded by encoding device 110. In this example, decoding device 120 can download the stored encoded video data from the storage server. Optionally, the storage server can store and transmit the encoded video data to decoding device 120, such as a web server (e.g., for a website), a file transfer protocol (FTP) server, etc.

[0055] In some embodiments, the encoding device 110 includes a video encoder 112 and an output interface 113. The output interface 113 may include a modulator / demodulator (modem) and / or a transmitter.

[0056] In some embodiments, the encoding device 110 may include a video source 111 in addition to the video encoder 112 and the input interface 113.

[0057] The video source 111 may include at least one of a video capture device (e.g., a video camera), a video archive, a video input interface, and a computer graphics system, wherein the video input interface is used to receive video data from a video content provider, and the computer graphics system is used to generate video data.

[0058] Video encoder 112 encodes video data from video source 111 to generate a bitstream. The video data may include one or more pictures or a sequence of pictures. The bitstream contains the encoding information of the pictures or picture sequences in the form of a bitstream. The encoding information may include encoded picture data and associated data. The associated data may include a sequence parameter set (SPS), a picture parameter set (PPS), and other syntax structures. The SPS may contain parameters applied to one or more sequences. The PPS may contain parameters applied to one or more pictures. A syntax structure refers to a set of zero or more syntax elements arranged in a specified order within the bitstream.

[0059] The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113. The encoded video data can also be stored on a storage medium or a storage server for subsequent retrieval by the decoding device 120.

[0060] In some embodiments, the decoding device 120 includes an input interface 121 and a video decoder 122.

[0061] In some embodiments, in addition to the input interface 121 and the video decoder 122, the decoding device 120 may also include a display device 123.

[0062] The input interface 121 includes a receiver and / or a modem. The input interface 121 can receive encoded video data through channel 130.

[0063] The video decoder 122 is used to decode the encoded video data to obtain the decoded video data, and transmit the decoded video data to the display device 123.

[0064] Display device 123 displays the decoded video data. Display device 123 may be integrated with decoding device 120 or external to decoding device 120. Display device 123 may include various display devices, such as liquid crystal display (LCD), plasma display, organic light-emitting diode (OLED) display, or other types of display devices.

[0065] Furthermore, Figure 1 is merely an example, and the technical solutions of this application are not limited to Figure 1. For example, the technology of this application can also be applied to one-sided video encoding or one-sided video decoding.

[0066] The video coding framework involved in the embodiments of this application is described below.

[0067] Figure 2 is a schematic block diagram of a video encoder according to an embodiment of this application. It should be understood that the video encoder 200 can be used for lossy compression of images or lossless compression of images. The lossless compression can be visually lossless compression or mathematically lossless compression.

[0068] This video encoder 200 can be applied to image data in luminance / chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents luminance (Luma), Cb (U) represents blue chrominance, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) used to describe color and saturation. For example, in color format, 4:2:0 means that there are 4 luminance components and 2 chrominance components (YYYYCbCr) per 4 pixels; 4:2:2 means that there are 4 luminance components and 4 chrominance components (YYYYCbCrCbCr) per 4 pixels; and 4:4:4 means full pixel display (YYYYCbCrCbCrCbCrCbCr).

[0069] For example, the video encoder 200 reads video data and divides each frame into several coding tree units (CTUs). In some examples, CTUs may be called "tree blocks," "largest coding unit" (LCU), or "coding tree block" (CTB). Each CTU can be associated with a pixel block of equal size within the image. Each pixel can correspond to one luminance (luma) sample and two chrominance (chroma) samples. Therefore, each CTU can be associated with one luminance sample block and two chrominance sample blocks. The size of a CTU is, for example, 128×128, 64×64, 32×32, etc. A CTU can be further divided into several coding units (CUs) for encoding. CUs can be rectangular or square blocks. The CU can be further divided into prediction units (PUs) and transform units (TUs), thus separating encoding, prediction, and transformation for more flexible processing. In one example, the CTU is divided into CUs using a quadtree structure, and the CUs are further divided into TUs and PUs using a quadtree structure.

[0070] The video encoder and decoder support various PU sizes. Assuming a specific CU size of 2N×2N, the video encoder and decoder can support PU sizes of 2N×2N or N×N for intra-frame prediction, and also support symmetric PUs of 2N×2N, 2N×N, N×2N, N×N, or similar sizes for inter-frame prediction. The video encoder and decoder can also support asymmetric PUs of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-frame prediction.

[0071] In some embodiments, as shown in FIG2, the video encoder 200 may include: a prediction unit 210, a residual unit 220, a transform / quantization unit 230, an inverse transform / quantization unit 240, a reconstruction unit 250, a loop filtering unit 260, a decoded image buffer 270, and an entropy coding unit 280. It should be noted that the video encoder 200 may include more, fewer, or different functional components.

[0072] Optionally, in this application, the current block can be referred to as the current coding unit (CU) or the current prediction unit (PU), etc. The prediction block can also be referred to as the predicted image block or the image prediction block, and the reconstructed image block can also be referred to as the reconstruction block or the image reconstruction block.

[0073] In some embodiments, the prediction unit 210 includes an inter-frame prediction unit 211 and an intra-frame prediction unit 212. Because there is a strong correlation between adjacent pixels in a frame of a video, intra-frame prediction is used in video encoding and decoding techniques to eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent frames in a video, inter-frame prediction is used in video encoding and decoding techniques to eliminate temporal redundancy between adjacent frames, thereby improving coding efficiency.

[0074] Inter-frame prediction unit 211 can be used for inter-frame prediction, which can include motion estimation and motion compensation. It can reference image information from different frames. Inter-frame prediction uses motion information to find a reference block from the reference frame and generates a prediction block based on the reference block to eliminate temporal redundancy. The frames used for inter-frame prediction can be P-frames and / or B-frames, where P-frames refer to forward prediction frames and B-frames refer to bidirectional prediction frames. The motion information includes a list of reference frames, the reference frame index, and motion vectors. Motion vectors can be integer-pixel or fractional-pixel. If the motion vector is fractional-pixel, interpolation filtering needs to be used in the reference frame to create the required fractional-pixel blocks. Here, the integer-pixel or fractional-pixel blocks in the reference frame found based on the motion vectors are called reference blocks. Some techniques directly use the reference block as the prediction block, while others process the reference block further to generate the prediction block. Processing the reference block further to generate the prediction block can also be understood as using the reference block as the prediction block and then processing it to generate a new prediction block.

[0075] Intra-prediction unit 212 refers only to information from the same frame image to predict pixel information within the current code image block, thereby eliminating spatial redundancy. The frame used for intra-prediction can be an I-frame.

[0076] Intra-frame prediction has multiple prediction modes. Taking the international digital video coding standards H-series as an example, the H.264 / AVC standard has 8 angular prediction modes and 1 non-angular prediction mode, while H.265 / HEVC extends this to 33 angular prediction modes and 2 non-angular prediction modes. HEVC uses Planar, DC, and 33 angular modes for a total of 35 intra-frame prediction modes. VVC uses Planar, DC, and 65 angular modes for a total of 67 intra-frame prediction modes.

[0077] It should be noted that with the increase in angle modes, intra-frame prediction will be more accurate and better meet the needs of the development of high-definition and ultra-high-definition digital video.

[0078] The residual unit 220 can generate a residual block of the CU based on the pixel block of the CU and the prediction block of the PU of the CU. For example, the residual unit 220 can generate a residual block of the CU such that each sample in the residual block has a value equal to the difference between the sample in the pixel block of the CU and the corresponding sample in the prediction block of the PU of the CU.

[0079] Transform / quantization unit 230 can quantize transform coefficients. Transform / quantization unit 230 can quantize transform coefficients associated with the TU of the CU based on the quantization parameter (QP) value associated with the CU. Video encoder 200 can adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU.

[0080] The inverse transform / quantization unit 240 can apply inverse quantization and inverse transform to the quantized transform coefficients to reconstruct the residual block from the quantized transform coefficients.

[0081] The reconstruction unit 250 can add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by the prediction unit 210 to produce a reconstructed image block associated with the TU. By reconstructing the sampled blocks of each TU of the CU in this way, the video encoder 200 can reconstruct the pixel blocks of the CU.

[0082] The loop filtering unit 260 is used to process the pixels after inverse transformation and inverse quantization to compensate for the distortion information and provide a better reference for subsequent encoded pixels. For example, it can perform deblocking filtering to reduce the block effect of pixel blocks associated with the CU.

[0083] In some embodiments, the loop filtering unit 260 includes a deblocking filtering unit and a sample adaptive compensation / adaptive loop filtering (SAO / ALF) unit, wherein the deblocking filtering unit is used to remove block effects and the SAO / ALF unit is used to remove ringing effects.

[0084] The decoded image buffer 270 can store reconstructed pixel blocks. The inter-frame prediction unit 211 can use a reference image containing the reconstructed pixel blocks to perform inter-frame prediction on PUs of other images. In addition, the intra-frame prediction unit 212 can use the reconstructed pixel blocks in the decoded image buffer 270 to perform intra-frame prediction on other PUs in the same image as the CU.

[0085] Entropy coding unit 280 can receive quantized transform coefficients from transform / quantization unit 230. Entropy coding unit 280 can perform one or more entropy coding operations on the quantized transform coefficients to produce entropy-coded data.

[0086] Figure 3 is a schematic block diagram of the video decoder involved in the embodiments of this application.

[0087] As shown in Figure 3, the video decoder 300 includes: an entropy decoding unit 310, a prediction unit 320, an inverse quantization / transformation unit 330, a reconstruction unit 340, a loop filtering unit 350, and a decoded image buffer 360. It should be noted that the video decoder 300 may contain more, fewer, or different functional components.

[0088] The video decoder 300 can receive a bitstream. The entropy decoding unit 310 can parse the bitstream to extract syntax elements from it. As part of parsing the bitstream, the entropy decoding unit 310 can parse the entropy-encoded syntax elements in the bitstream. The prediction unit 320, the dequantization / transform unit 330, the reconstruction unit 340, and the loop filtering unit 350 can decode the video data based on the syntax elements extracted from the bitstream, i.e., generate decoded video data.

[0089] In some embodiments, the prediction unit 320 includes an intra-frame prediction unit 322 and an inter-frame prediction unit 321.

[0090] Intra-prediction unit 322 can perform intra-prediction to generate prediction blocks for the PU. Intra-prediction unit 322 can use an intra-prediction mode to generate prediction blocks for the PU based on pixel blocks of spatially adjacent PUs. Intra-prediction unit 322 can also determine the intra-prediction mode of the PU based on one or more syntax elements parsed from the bitstream.

[0091] Inter-frame prediction unit 321 can construct a first reference image list (list 0) and a second reference image list (list 1) based on the syntax elements parsed from the bitstream. Furthermore, if the PU uses inter-frame prediction coding, the entropy decoding unit 310 can parse the motion information of the PU. Inter-frame prediction unit 321 can determine one or more reference blocks of the PU based on the motion information of the PU. Inter-frame prediction unit 321 can generate prediction blocks for the PU based on one or more reference blocks of the PU.

[0092] The dequantization / transformation unit 330 reversibly quantizes (i.e., dequantizes) the transform coefficients associated with the TU. The dequantization / transformation unit 330 can use the QP value associated with the CU of the TU to determine the degree of quantization.

[0093] After the inverse quantization transform coefficients, the inverse quantization / transformation unit 330 can apply one or more inverse transforms to the inverse quantization transform coefficients to generate a residual block associated with the TU.

[0094] The reconstruction unit 340 uses the residual block associated with the TU of the CU and the prediction block of the PU of the CU to reconstruct the pixel block of the CU. For example, the reconstruction unit 340 can add the sample of the residual block to the corresponding sample of the prediction block to reconstruct the pixel block of the CU, thereby obtaining the reconstructed image block.

[0095] The loop filter unit 350 can perform deblocking filtering operations to reduce the block effect of pixel blocks associated with the CU.

[0096] The video decoder 300 can store the reconstructed image of the CU in the decoded image buffer 360. The video decoder 300 can use the reconstructed image in the decoded image buffer 360 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.

[0097] The basic process of video encoding and decoding is as follows: At the encoding end, a frame image is divided into blocks. For the current block, the prediction unit 210 uses intra-frame prediction or inter-frame prediction to generate a prediction block for the current block. The residual unit 220 can calculate a residual block based on the prediction block and the original block of the current block, that is, the difference between the prediction block and the original block of the current block. This residual block can also be called residual information. This residual block is transformed and quantized by the transform / quantization unit 230, which can remove information that is not sensitive to the human eye to eliminate visual redundancy. Optionally, the residual block before transformation and quantization by the transform / quantization unit 230 can be called a temporal residual block, and the temporal residual block after transformation and quantization by the transform / quantization unit 230 can be called a frequency residual block or a frequency domain residual block. The entropy coding unit 280 receives the quantized change coefficients output by the change quantization unit 230, and can perform entropy coding on the quantized change coefficients to output a bitstream. For example, the entropy coding unit 280 can eliminate character redundancy based on the target context model and the probability information of the binary bitstream.

[0098] At the decoding end, the entropy decoding unit 310 can parse the bitstream to obtain the prediction information and quantization coefficient matrix of the current block. The prediction unit 320 uses intra-frame prediction or inter-frame prediction to generate the prediction block of the current block based on the prediction information. The dequantization / transform unit 330 uses the quantization coefficient matrix obtained from the bitstream to perform dequantization and inverse transform on the quantization coefficient matrix to obtain the residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain the reconstructed block. The reconstructed blocks form the reconstructed image. The loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or based on the blocks to obtain the decoded image. The encoding end also needs similar operations to the decoding end to obtain the decoded image. This decoded image can also be called the reconstructed image, which can be used as a reference frame for inter-frame prediction in subsequent frames.

[0099] It should be noted that the block partitioning information determined at the encoding end, as well as mode information or parameter information such as prediction, transform, quantization, entropy coding, and loop filtering, are carried in the bitstream when necessary. The decoding end determines the same block partitioning information, prediction, transform, quantization, entropy coding, and loop filtering mode information or parameter information as the encoding end by parsing the bitstream and analyzing existing information, thereby ensuring that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end.

[0100] The above describes the basic flow of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of this framework or flow may be optimized. This application is applicable to the basic flow of the video codec under this block-based hybrid coding framework, but is not limited to this framework and flow.

[0101] In this application embodiment, the current block can be the current coding unit (CU) or the current prediction unit (PU), etc. Due to the need for parallel processing, an image can be divided into slices, etc. Slices within the same image can be processed in parallel, meaning they have no data dependency. A "frame" is a commonly used term, generally understood as one image. In this application, "frame" can also be replaced with "image" or "slice," etc.

[0102] Intra-frame prediction typically uses angular and non-angular modes to predict the current coded block to obtain a prediction block. Based on the rate-distortion information calculated from the prediction block and the original block, the optimal prediction mode for the current coding unit is selected, and then this prediction mode is transmitted to the decoder via the bitstream. The decoder parses the prediction mode, predicts the prediction image of the current decoded block, and superimposes it with the residual pixels transmitted from the bitstream to obtain the reconstructed image. The intra-frame prediction method uses the already encoded and decoded reconstructed pixels around the current block as reference pixels to predict the current block. Figure 4A is a schematic diagram of intra-frame prediction. As shown in Figure 4A, the size of the current block is 4x4. The pixels in the left row and the top column of the current block are the reference pixels of the current block. Intra-frame prediction uses these reference pixels to predict the current block. These reference pixels may all be available, i.e., all have been encoded and decoded. Some may not be available. For example, if the current block is the leftmost part of the entire frame, then the reference pixels on the left side of the current block are unavailable. Or, when encoding and decoding the current block, the lower left part of the current block has not yet been encoded and decoded, then the lower left reference pixels are also unavailable. If a reference pixel is unavailable, it can be filled using an available reference pixel, some value, or some method, or no filling can be performed.

[0103] Figure 4B is a schematic diagram of intra-frame prediction. As shown in Figure 4B, the Multiple Reference Line (MRL) intra-frame prediction method can use more reference pixels to improve encoding and decoding efficiency. For example, four reference rows / columns can be used as reference pixels for the current block.

[0104] Furthermore, intra-frame prediction has multiple prediction modes. Figures 5A-5I illustrate intra-frame prediction. As shown in Figures 5A-5I, intra-frame prediction of a 4x4 block in H.264 mainly includes nine modes. Among them, Mode 0, as shown in Figure 5A, copies the pixels above the current block vertically to the current block as the prediction value. Mode 1, as shown in Figure 5B, copies the reference pixel on the left horizontally to the current block as the prediction value. Mode 2, as shown in Figure 5C (DC), uses the average value of points A-D and I-L as the prediction value for all points. Modes 3-8, as shown in Figures 5D-5I, copy the reference pixel to the corresponding position in the current block at a certain angle. Because some positions in the current block cannot correspond exactly to the reference pixel, it may be necessary to use the weighted average value of the reference pixels, or the interpolated reference pixel sub-pixels.

[0105] In the field of video coding, "component" is a technical term. It generally refers to three components: Y, Cb, and Cr (or Y, U, and V), where Y represents luminance information, and Cb and Cr represent chrominance information.

[0106] In H.266, the luma component has already been encoded and its reconstructed value obtained before the chroma component of the CU is predicted and encoded. To remove redundancy between different color channels, a cross-component intra-frame prediction mode was proposed. Its idea is to use the already reconstructed luma block to predict the current chroma block to be predicted. During prediction, a linear or non-linear relationship between luma and chroma needs to be constructed based on the reconstructed luma and chroma pixel values.

[0107] In some embodiments, cross-component intra-frame prediction modes include, but are not limited to, the following: Cross Component Linear Model (CCLM), Convolutional Cross Component Model (CCCM), Gradient Linear Model (GLM), and Cross Component Merge Mode (CCMerge).

[0108] CCLM refers to calculating the predicted chromaticity pixel value based on the luminance reconstruction value of the pixel to be predicted, using the linear relationship between the luminance reconstruction value and the chromaticity reconstruction value of a reference pixel. For example, as shown in Figure 6A, for the YUV420 format, the luminance component needs to maintain consistent spatial resolution with the chromaticity component through downsampling. Then, linear model parameters are calculated based on the luminance and chromaticity of the reference pixel, and the predicted chromaticity value is calculated using the luminance reconstruction value.

[0109] For example, a linear model can be slope-intercepted:

[0110] C(x,y)=αXL(x,y)+β(1)

[0111] Where C and L are the chroma pixel value and the luminance pixel value, respectively, and α and β are two model parameters that can be obtained by the least squares method.

[0112] CCCM is similar in concept to CCLM, also predicting chroma pixels by reconstructing pixels from luminance components. However, CCCM derives not simple α and β, but a set of convolutional filter coefficients. CCCM also supports deriving two sets of convolutional filter coefficients from a single block; similarly, which set of convolutional filter coefficients is used is controlled by the Threshold.

[0113] In one example, the convolutional filter used by CCCM is a 7-tap filter, which consists of a 5-tap cross-shaped filter, one nonlinear term, and one bias term. As shown in Figure 6B, the input of the 5-tap cross-shaped filter consists of the center (C) luminance sample (the downsampled luminance sample corresponding to the current chromaticity prediction position), the upper (Above / North, N) luminance sample, the lower (Below / South, S) luminance sample, the left (Left / West, W) luminance sample, and the right (Right / East, E) luminance sample.

[0114] The nonlinear term P is determined by the bit precision (bitDepth) of the brightness input sample C at the middle position and the pixel value of the current prediction block. For example, the nonlinear term P is determined by the following formula (2): P = (C × C + (1 << (bitDepth - 1))) >> bitDepth (2)

[0115] Where C is the brightness input sample at the middle position in Figure 6B.

[0116] For example, if the bit precision (bitDepth) of the pixel value of the current prediction block is equal to 10 bits, then the nonlinear term P is determined by the following formula (3): P = (C × C + 512) >> 10 (3)

[0117] The bias term B is set to (1 << (bitDepth-1)) in CCCM. For example, if the pixel precision of the current prediction block is 10 bits, B = 512.

[0118] In CCCM, the predicted value is determined by the adaptively acquired 7-tap filter coefficients {c0,…,c6} and the input sample. For example, the predicted value can be determined according to the following formula (4): predChromaVal=c0C+c1N+c2S+c3E+c4W+c5P+c6B (4)

[0119] Where predChromaVal represents the chromaticity prediction value of the current prediction block, CNSEW is the luminance input sample of the cross filter shown in Figure 6B, P is the nonlinear term, and B is the bias term.

[0120] The filter coefficients {c0,…,c6} mentioned above are calculated by minimizing the mean square error (MSE) between the total predicted chromaticity values ​​and the reconstructed values ​​in the reconstructed region.

[0121] For example, the filter coefficients {c0,…,c6} are calculated using the following formula (5):

[0122] Where predC is the chromaticity prediction value, recC is the chromaticity reconstruction value, and refL is the luminance reconstruction value.

[0123] In one example, as shown in Figure 6C, the reconstructed region of the current chroma block consists of 6 rows and 6 columns of reconstructed pixel values ​​surrounding the current chroma block. When there are unreconstructed positions in the reconstructed region, the values ​​at those positions are filled with the values ​​of the already reconstructed pixels. The reference region shown in Figure 6C extends to the right by the width of the current chroma block and downwards by the height of the current chroma block. The extended gray area in Figure 6C is used to support the side sampling of the square spatial filter, and the values ​​in the gray area are obtained by copying adjacent reconstructed pixels.

[0124] The calculation process for minimizing the mean square error is as follows:

[0125] Step 1: Obtain the autocorrelation matrix of the luminance input sample and the cross-correlation vector between the luminance input sample and the chrominance output sample;

[0126] Step 2: The autocorrelation matrix is ​​decomposed using LDL, and the final filter coefficients are obtained by backband calculation.

[0127] For example, the filter coefficients {c0,…,c6} are determined using the following formula (6):

[0128] in, The autocorrelation matrix of the brightness input sample. This is the cross-correlation vector between the luminance input sample and the chrominance output sample.

[0129] In the calculation of the autocorrelation matrix, since the values ​​of the luminance input samples used are relatively large, a high precision is required when calculating the convolution filter coefficients. Therefore, in CCCM, both the input luminance sample and the output chrominance sample need to be subtracted by the corresponding bias values ​​offsetLuma, offsetCb, and offsetCr. The luminance reconstruction value and chrominance prediction value outside the upper left corner of the current prediction block are used as biases. Thus, the CCCM input becomes as follows: C'=C–offsetLuma N'=N–offsetLuma S'=S–offsetLuma E'=E–offsetLuma W'=W–offsetLuma P'=nonLinear(C') B=midValue=1<<(bitDepth-1)

[0130] The predicted chromaticity value is calculated using the following formula (7): predChromaVal=c0C'+c1N'+c2S'+c3E'+c4W'+c5P'+c6B+offsetChroma (7)

[0131] Where offsetChroma represents the offset of the Cb and Cr components, respectively.

[0132] CCCM also supports having two sets of filter coefficients in a block, similar to MMLM, for example, controlling the use of a certain set of coefficients based on Threshold.

[0133] Since the CCCM filter coefficients c0, ... c6, as well as the possible Threshold and the second set of parameters, are derived, they do not need to be parsed from the bitstream.

[0134] GLM is an intra-frame chroma cross-component prediction tool used in the YUV4:2:0 format. In the ECM (reference software based on VTM-10.0 reference software, integrating various new tools to further explore the encoding and decoding performance) reference software, GLM includes two-parameter and three-parameter models.

[0135] Compared to CCLM, GLM uses the gradient values ​​of luminance reconstructed samples and chrominance reconstructed samples to derive a linear model.

[0136] For example, for a two-parameter GLM model, the chromaticity prediction value C is calculated by the following formula (8): C=α·G+β (8)

[0137] Where G is the gradient value of the brightness sample at the current location. α and β are calculated in the same way as CCLM.

[0138] For example, for a three-parameter GLM model, the chromaticity prediction value C is calculated by the gradient values ​​of the luminance sample corresponding to the current position and the luminance sample corresponding to the current position, using the following formula (9): C=α0·G+α1·L+α2·β (9)

[0139] The calculation methods for α0, α1, and α2 are the same as those for CCCM.

[0140] For example, β = (1 << (bitDepth-1)), such as β = 512 for a predicted block pixel precision of 10 bits.

[0141] In one example, the gradient of the GLM is obtained by one of the four Sobel operators shown in Figure 6D. The specific Sobel operator used to obtain the gradient value is determined by the flag bit parsed from the bitstream.

[0142] Since the parameters of GLM are also exported, they do not need to be parsed from the bitstream.

[0143] CCMerge inherits the cross-component prediction models from adjacent or non-adjacent chroma blocks and applies them to the prediction of the current block. CCMerge constructs a list of length N (N=6) containing unique cross-component models inherited from surrounding blocks. These models can be one or more of CCLM, MMLM, CCCM, and GLM. When the surrounding models are insufficient to fill the CCMerge list, the default model is used to fill the remaining space.

[0144] When CCMerge obtains the cross-component model of the surrounding adjacent locations, it sequentially visits the positions B1→A1→B0→A0→B2 as shown in Figure 6E.

[0145] CCMerge can also further obtain cross-component models at non-adjacent locations. The concept of non-adjacent locations has also been used in inter-frame merge. These locations include some non-adjacent locations above, to the upper left, to the upper right, to the left, and to the lower left of the current chroma block.

[0146] When the number of cross-component models obtained from adjacent and non-adjacent positions is less than N, the remaining list is filled with CCLM models using the default slope. The default slope α is {0, 1 / 8, -1 / 8, 2 / 8, -2 / 8, 3 / 8}, and β is calculated as described in the CCLM section.

[0147] A block-level flag will be encoded and decoded to indicate whether the CCMerge mode is selected. If CCMerge is selected, it is necessary to continue decoding to determine which model in the CCMerge list is selected. The model index uses truncated unary codes for encoding and decoding.

[0148] As described above, in this embodiment of the application, a cross-component intra-frame prediction mode can be used to obtain the predicted value of the current chroma block. However, the predicted value of the chroma block determined by the current cross-component intra-frame prediction mode may be inaccurate.

[0149] In this embodiment, the predicted value of the current chroma block is limited. Specifically, the prediction mode of the current chroma block is determined. If the prediction mode is a cross-component intra-frame prediction mode, a limited range of the predicted value of the current chroma block is determined. This limited range includes at least one of a maximum and a minimum predicted value. Then, based on the cross-component intra-frame prediction mode, a first predicted value of the current chroma block is determined. Based on the first predicted value and the limited range, a second predicted value of the current chroma block is determined. In other words, in this embodiment, if the current chroma block adopts the cross-component intra-frame prediction mode, the first predicted value determined by the cross-component intra-frame prediction mode is limited to avoid the predicted value of the current chroma block being too large or too small, thereby improving the prediction accuracy of the current chroma block and enhancing video encoding and decoding performance.

[0150] The video decoding method provided in this application embodiment will be described below with reference to Figure 7, taking the decoding end as an example.

[0151] Figure 7 is a schematic flowchart of a video decoding method according to an embodiment of this application. This embodiment is applied to the video decoders shown in Figures 1 and 3. As shown in Figure 7, the method of this embodiment includes:

[0152] S101. Determine the prediction mode for the current chroma block.

[0153] In this embodiment, when the decoding end decodes the current block, it first performs predictive decoding on the luminance component of the current block to obtain the luminance reconstruction value of the current block. Then, it performs predictive decoding on the chrominance component of the current block.

[0154] In this embodiment of the application, the chromaticity component of the current block is denoted as the current chromaticity block.

[0155] Before performing predictive decoding on the current chroma block, the prediction mode for the current chroma block is first determined.

[0156] The embodiments of this application do not limit the specific method for determining the prediction mode of the current chroma block.

[0157] In one example, the default prediction mode is determined as the prediction mode for the current chroma block. That is, in this embodiment of the application, both the encoding and decoding ends use the default prediction mode to predict the current chroma block.

[0158] In one example, the encoder determines the prediction mode with the lowest cost from multiple candidate prediction modes as the prediction mode for the current chroma block. Simultaneously, the encoder encodes the indication information of this prediction mode into the bitstream, for example, by encoding the prediction mode's mode index into the bitstream. In this case, S101 includes the following steps:

[0159] S101-A: The decoding end obtains the prediction mode of the current chroma block through the decoded bitstream.

[0160] As described above, cross-component intra-frame prediction modes include CCLM, CCCM, GLM, and CCMerge modes. In CCMerge mode, the prediction mode of the current chroma block is determined by constructing a list. Therefore, in some cases, the decoder cannot directly determine the prediction mode of the current chroma block from the decoded bitstream. For example, if the decoded bitstream yields the CCMerge mode, the decoder still needs to construct a cross-component prediction mode list and determine the prediction value of the current chroma block from this list. Therefore, in this embodiment, for ease of description, the prediction mode obtained from the decoded bitstream is denoted as the first prediction mode. In this case, S101-A includes the following steps:

[0161] S101-A1, decode the bitstream to obtain the first prediction mode;

[0162] S101-A2, Based on the first prediction mode, determine the prediction mode of the current chroma block.

[0163] In this embodiment, the prediction mode written into the bitstream by the encoding end is denoted as the first prediction mode. Thus, the decoding end can directly obtain the first prediction mode by decoding the bitstream. For example, the decoding end decodes the bitstream to obtain a prediction mode index, and determines the first prediction mode based on this index. Alternatively, the decoding end decodes the bitstream to obtain an enable flag for at least one prediction mode, and then determines the first prediction mode based on this enable flag. For example, if the decoding end decodes the bitstream and finds that the enable flag for the CCCM mode is equal to 1, it indicates that the CCCM mode is being used, and the first prediction mode is determined to be the CCCM mode. Or, if the decoding end decodes the bitstream and finds that the enable flag for the CCMerge mode is equal to 1, it indicates that the CCMerge mode is being used, and the first prediction mode is determined to be the CCMerge mode.

[0164] After obtaining the first prediction mode by decoding the bitstream, the decoding end determines the prediction mode of the current chroma block based on the first prediction mode.

[0165] Based on this first prediction mode, the prediction mode for the current chroma block is determined to include at least the following two cases:

[0166] Case 1: If the first prediction mode is CCCM mode or GLM mode, the decoder will directly determine CCCM mode or GLM mode as the prediction mode of the current chroma block.

[0167] Case 2: If the first prediction mode is a cross-component merging mode, then S101-A2 above includes the following steps:

[0168] S101-A21. Construct a cross-component prediction mode list by inheriting the cross-component intra-prediction modes of the surrounding chroma blocks that are adjacent to and / or not adjacent to the current chroma block.

[0169] S101-A22. Determine the prediction mode of the current chroma block based on the cross-component prediction mode list.

[0170] In case 2, if the first prediction mode obtained by the decoder is the CCMerge mode, the decoder will construct a cross-component prediction mode list of length N.

[0171] For example, the process of constructing a list of cross-component prediction modes at the decoder end may include:

[0172] First, the decoder obtains the cross-component intra-prediction modes of the chroma blocks in the surrounding adjacent positions of the current chroma block. For example, as shown in Figure 6E, the decoder sequentially accesses positions B1→A1→B0→A0→B2. If at least one chroma block in these positions uses a cross-component intra-prediction mode, then the cross-component intra-prediction mode of this at least one chroma block is stored in the cross-component prediction mode list. For example, the order in which the cross-component intra-prediction modes are stored in the cross-component prediction mode list can be consistent with the access order of the positions described above.

[0173] In some embodiments, if the length of the cross-component prediction mode list does not meet a preset length, i.e., N, the decoder can further obtain the cross-component intra-frame prediction modes of chroma blocks at non-adjacent positions of the current chroma block. Non-adjacent positions include some non-adjacent positions above, above left, above right, to the left, and below left of the current chroma block.

[0174] In some embodiments, if the length of the cross-component prediction mode list does not meet the preset length, i.e., N, that is, when the number of cross-component intra-frame prediction modes obtained from the adjacent and non-adjacent positions of the current chroma block is less than N, the CCLM mode with the default slope is used to fill the remaining list.

[0175] Based on the above steps, the decoding end constructs a cross-component prediction mode list and then determines the prediction mode of the current chroma block based on this cross-component prediction mode list.

[0176] This application does not limit the specific method by which the prediction mode of the current chroma block is determined based on the cross-component prediction mode list.

[0177] In one example, the decoding and encoding ends sample in the same way to construct the aforementioned cross-component prediction mode list, and one of the cross-component intra-frame prediction modes in the list is defaulted to the prediction mode of the current chroma block. For example, the first cross-component intra-frame prediction mode in the list is defaulted to the prediction mode of the current chroma block, or the second cross-component intra-frame prediction mode in the list is defaulted to the prediction mode of the current chroma block.

[0178] In one example, both the decoder and encoder construct the aforementioned cross-component prediction mode list in the same way. Simultaneously, the encoder writes the mode index of the intra-frame prediction mode selected by the chroma block in this cross-component prediction mode list into the bitstream. The decoder then decodes the bitstream to obtain the mode index, and based on this mode index, determines the prediction mode of the current chroma block from the cross-component prediction mode list. For example, the mode index corresponding to each mode in the cross-component prediction mode list can be determined by the mode's sorting order in the list. Thus, the decoder determines the mode corresponding to that mode index in the cross-component prediction mode list as the prediction mode of the current chroma block.

[0179] Based on the above steps, after determining the prediction mode of the current chroma block, the decoding end executes the following step S102.

[0180] S102. If the prediction mode is cross-component intra-frame prediction mode, then determine the limited range of the prediction value of the current chroma block.

[0181] The defined range includes at least one of the maximum and minimum defined values ​​of the predicted value.

[0182] In this embodiment of the application, in order to further improve the prediction accuracy of the cross-component intra-prediction mode, when the current chroma block adopts the cross-component intra-prediction mode, the limited range of the prediction value of the current chroma block is determined so as to limit the prediction value of the current chroma block within the limited range, and prevent the prediction value of the current chroma block from being too large and / or too small due to prediction error. This can further improve the prediction accuracy of the chroma components.

[0183] It should be noted that, in this embodiment, the range of predicted values ​​for the chromaticity component is limited. In some embodiments, the range of predicted values ​​for the luminance component, etc., may also be limited.

[0184] In some embodiments, limiting the predicted value of the current chroma block can be achieved by limiting the maximum predicted value of the current chroma block, and this limit is denoted as the maximum limit value of the predicted value. That is, the predicted value of the current chroma block is limited to not exceeding this maximum limit value.

[0185] In some embodiments, limiting the predicted value of the current chroma block can be achieved by limiting the minimum predicted value of the current chroma block, and this limiting value is denoted as the minimum limiting value of the predicted value. That is, the predicted value of the current chroma block is limited to not being less than this minimum limiting value.

[0186] In some embodiments, limiting the predicted value of the current chroma block can be achieved by limiting both the maximum and minimum values ​​of the predicted value of the current chroma block. That is, the predicted value of the current chroma block is limited to not being less than the minimum limit value, and the predicted value of the current chroma block is limited to not exceeding the maximum limit value.

[0187] In some embodiments, a flag (i.e., a first flag) is used to indicate whether the decoder limits the predicted value of the current chroma block. In this case, before determining the range of the predicted value for the current chroma block, the decoder first needs to determine the first flag corresponding to the current chroma block, which indicates whether the predicted value of the current chroma block should be limited. Thus, based on this first flag, the decoder decides whether to limit the range of values ​​for the predicted value of the current chroma block.

[0188] For example, if the first flag indicates that the predicted value of the current chroma block is not limited, the decoder skips the step of determining the limited range of the predicted value of the current chroma block.

[0189] For example, if the first flag indicates that the predicted value of the current chroma block is limited, the decoder performs the step of determining the limited range of the predicted value of the current chroma block.

[0190] This application does not limit the specific method by which the decoding end determines the first flag corresponding to the current chroma block.

[0191] In some embodiments, if the decoding end decodes the bitstream and obtains a first prediction mode of CCMerge mode, the decoding end determines the cross-component intra-prediction mode of the current chroma block by inheriting the cross-component intra-prediction modes of the surrounding and adjacent and / or non-adjacent chroma blocks. For example, referring to the above embodiment, if the decoding end inherits the cross-component intra-prediction mode of chroma block 1, in this embodiment, the decoding end may also inherit the first flag of chroma block 1. That is, if the first prediction mode is CCMerge mode, the decoding end determines the chroma block corresponding to the prediction mode inherited by the current chroma block and determines the first flag corresponding to that chroma block as the first flag corresponding to the current chroma block.

[0192] In some embodiments, the decoding end can obtain the first flag by decoding the bitstream. That is, in this implementation, the encoding end writes the first flag corresponding to the current chroma block into the bitstream, and the decoding end can obtain the first flag corresponding to the current chroma block by decoding the bitstream.

[0193] The embodiments of this application do not limit the specific form of the first mark, and can be understood as any information that can indicate whether the predicted value of the current chroma block is limited.

[0194] In one example, the first flag mentioned above can be represented as `cross_component_clip_flag`. By assigning different values ​​to `cross_component_clip_flag`, it indicates whether the predicted value of the current chroma block is constrained. For example, if the value of `cross_component_clip_flag` is the first value, it indicates that the predicted value of the current chroma block is constrained; if the value of `cross_component_clip_flag` is the second value, it indicates that the predicted value of the current chroma block is not constrained.

[0195] The embodiments of this application do not impose restrictions on the specific values ​​of the first and second numerical values.

[0196] For example, the first value is 1.

[0197] For example, the second value is 0.

[0198] In this embodiment, the decoding end determines the prediction mode of the current chroma block based on the above steps. If the prediction mode of the current chroma block is determined to be a cross-component intra-frame prediction mode (e.g., CCCM mode or GLM mode), then a first flag corresponding to the current chroma block is determined. Based on this first flag, it is then determined whether to limit the prediction value of the current chroma block. Specifically, if the first flag is a first value, it indicates that the prediction value of the current chroma block should be limited, thus the decoding end determines the limited range of the prediction value of the current chroma block. If the first flag is a second value, it indicates that the prediction value of the current chroma block should not be limited. In this case, the decoding end skips determining the limited range of the prediction value of the current chroma block and directly uses the prediction value obtained from the cross-component intra-frame prediction mode as the prediction value of the current chroma block.

[0199] In some embodiments, if the decoding end fails to decode the first flag while decoding the bitstream, that is, the first flag does not exist in the bitstream, the first flag is defaulted to the second value, that is, the predicted value of the current chroma block is not limited by default.

[0200] For example, the syntax elements included in the bitstream are shown in Table 1:

[0201] Table 1

[0202] The cross-component intra-prediction modes shown in Table 1 above are CCCM or GLM modes. However, the cross-component intra-prediction modes in this application embodiment include other cross-component intra-prediction modes besides CCCM and GLM modes, and this application embodiment does not limit these modes. Wherein, pu.cccmFlag represents a flag indicating whether the current chroma block uses CCCM mode, and pu.glmFlag represents a flag indicating whether the current chroma block uses GLM mode. cross_component_clip_flag is the first flag.

[0203] As shown in Table 1 above, the decoder first decodes the bitstream to obtain information such as the size and bit depth of the current chroma block. Next, it decodes the prediction mode-related syntax elements pu.cccmFlag||pu.glmFlag. If the current chroma block uses CCCM or GLM mode, i.e., the current chroma block uses cross-component intra-frame prediction mode, the bitstream is further parsed to obtain the first flag cross_component_clip_flag. This cross_component_clip_flag is a binary identifier. When the flag is at the first value (e.g., 1), it indicates that the range of predicted values ​​for the current chroma block needs to be limited; when the flag is at the second value (e.g., 0), it indicates that the range of predicted values ​​for the current chroma block does not need to be limited.

[0204] In some embodiments, the decoding end is instructed whether to limit the predicted value of the current chroma block by determining whether the current chroma block meets a preset condition. That is, in this embodiment, the range of predicted values ​​for some chroma blocks is limited, while the range of predicted values ​​for some chroma blocks is not limited. In this case, before determining the limited range of the predicted value of the current chroma block, the decoding end first needs to determine whether the current chroma block meets the preset condition.

[0205] For example, if the current chroma block does not meet the preset conditions, the decoder skips the step of determining the limited range of the predicted value of the current chroma block.

[0206] For example, if the current chroma block meets the preset conditions, the decoding end performs the step of determining the limited range of the predicted value of the current chroma block.

[0207] This application embodiment does not impose restrictions on the above-mentioned preset conditions, which can be set according to actual needs.

[0208] In some embodiments, the above-mentioned preset conditions include at least one of the following:

[0209] The current chroma block is not the first row of chroma blocks in the current CTU;

[0210] The current chroma block size meets the preset size;

[0211] The shape of the current chroma block satisfies the preset shape.

[0212] In other words, the preset conditions of the embodiments of this application may include only one of the above three conditions, or any two of the above three conditions, or all three conditions.

[0213] In one example, CCCM and GLM require reconstructed pixel values ​​from multiple rows and columns to derive model parameters. In the ECM reference software, to reduce the storage of row caches between CTUs spanning multiple rows, the use of CCCM and GLM is restricted for blocks located at the upper boundary of a CTU. Correspondingly, the method for determining the limited range of the predicted value of the current chroma value in this embodiment should also be limited. That is, if the current chroma block is the first row chroma block of the current CTU, the step of determining the limited range of the predicted value of the current chroma value is skipped.

[0214] In one example, the size of the current chroma block satisfies a preset size, which can be achieved by at least one of the current chroma block's length and width satisfying a preset value. For example, the length of the current chroma block is less than or equal to the preset length, and the width is less than or equal to the preset width. Another example is that the length of the current chroma block is less than or equal to the preset length. Yet another example is that the width of the current chroma block is less than or equal to the preset width.

[0215] In one example, the size of the current chroma block meets a preset size, which could be that the number of pixels included in the current chroma block meets a preset number.

[0216] In one example, the shape of the current chroma block satisfies a preset shape, which could be that the aspect ratio and / or width-to-length ratio of the current chroma block meets a preset proportion. For example, the aspect ratio of the current chroma block is less than or equal to a first ratio, and the width-to-length ratio is less than or equal to a second ratio. Another example is that the aspect ratio of the current chroma block is less than or equal to the first ratio. Yet another example is that the width-to-length ratio is less than or equal to the second ratio.

[0217] As can be seen from the above, in the embodiments of this application, the methods for determining whether to limit the predicted value of the current chroma block include at least the following examples:

[0218] Example 1: The decoder limits the predicted value of the current chroma block by default. That is, when the decoder determines that the prediction mode of the current chroma block is the cross-component intra-frame prediction mode, it determines the limited range of the predicted value of the current chroma block.

[0219] Example 2 uses a first flag to indicate whether the predicted value of the current chroma block is limited. In this case, when the decoder determines that the prediction mode of the current chroma block is cross-component intra-frame prediction mode, it also needs to determine the first flag corresponding to the current chroma block, and then determine whether to limit the predicted value of the current chroma block based on the first flag. For example, if the first flag indicates that the predicted value of the current chroma block is limited, the decoder determines the limited range of the predicted value of the current chroma block. As another example, if the first flag indicates that the predicted value of the current chroma block is not limited, the decoder skips the step of determining the limited range of the predicted value of the current chroma block.

[0220] Example 3: The determination of whether to limit the predicted value of the current chroma block is made by checking whether the current chroma block meets preset conditions. That is, when the decoder determines that the prediction mode of the current chroma block is cross-component intra-frame prediction mode, it checks whether the current chroma block meets the preset conditions. If the current chroma block meets the preset conditions, the decoder determines the limited range of the predicted value of the current chroma block. Conversely, if the current chroma block does not meet the preset conditions, the decoder skips the step of determining the limited range of the predicted value of the current chroma block.

[0221] Example 4 uses a first flag and preset conditions to determine whether to limit the predicted value of the current chroma block. That is, in Example 4, if the first flag of the current chroma block indicates that the predicted value of the current chroma block is limited, and the current chroma block meets the preset conditions, then the decoder determines the limited range of the predicted value of the current chroma block. If the first flag of the current chroma block indicates that the predicted value of the current chroma block is not limited, and / or the current chroma block does not meet the preset conditions, then the decoder skips the step of determining the limited range of the predicted value of the current chroma block. In Example 4, the decoder can first determine whether the current chroma block meets the preset conditions. If the current chroma block does not meet the preset conditions, the decoder will not decode the first flag, but will directly skip the step of determining the limited range of the predicted value of the current chroma block. This avoids decoding unnecessary information and thus saves decoding resources. If the decoding end determines that the current chroma block meets the preset conditions, it continues to decode the bitstream and obtains the first flag. If the first flag indicates that the predicted value of the current chroma block is limited, the decoding end determines the limited range of the predicted value of the current chroma block. If the first flag indicates that the predicted value of the current chroma block is not limited, the decoding end skips the step of determining the limited range of the predicted value of the current chroma block.

[0222] The following describes the specific process by which the decoder determines the range of predicted values ​​for the current chroma block.

[0223] In this application embodiment, the decoding end determines the limited range of the predicted value of the current chroma block in at least the following ways:

[0224] In Method 1, the predicted value of the current chroma block is limited to a preset range. That is, the maximum and / or minimum predicted value of the current chroma block is a preset value. This preset value can be an empirical or experimental value, and this embodiment does not impose any restrictions on it.

[0225] Method 2: If the decoding end decodes the bitstream and obtains the first prediction mode as CCMerge mode, then the decoding end inherits the cross-component intra-frame prediction modes of the surrounding and adjacent and / or non-adjacent chroma blocks of the current chroma block. For example, referring to the above embodiment, the decoding end inherits the cross-component intra-frame prediction mode of chroma block 1. In this embodiment, the decoding end can also inherit the limited range of prediction values ​​of chroma block 1. That is, if the first prediction mode is CCMerge mode, the decoding end determines the chroma block corresponding to the prediction mode inherited by the current chroma block, and determines the limited range of prediction values ​​of that chroma block as the limited range of prediction values ​​of the current chroma block.

[0226] Method 3: Since the chromaticity value of the current chromaticity block is correlated with the chromaticity blocks in the surrounding area, based on this, S102 above includes the following step S102-A:

[0227] S102-A: Based on the chromaticity values ​​of the surrounding reconstructed regions of the current chromaticity block, determine the limited range of the predicted values ​​for the current chromaticity block.

[0228] In this embodiment, the chromaticity components include a first chromaticity component and a second chromaticity component, wherein the first chromaticity component can be a U component or a Cb component, and the second chromaticity component can be a V component or a Cr component. Thus, the decoding end can determine the defined range of predicted values ​​for the first and second chromaticity components of the current chromaticity block based on the chromaticity values ​​of the first and second chromaticity components of the surrounding reconstructed region.

[0229] This application embodiment does not limit the specific method by which the decoding end determines the range of predicted values ​​of the first and second chromaticity components of the current chromaticity block based on the chromaticity values ​​of the first and second chromaticity components of the surrounding reconstructed region.

[0230] In some embodiments, the decoder determines a maximum limit and / or a minimum limit for the predicted value of the current chroma block based on the chroma values ​​of the surrounding reconstructed regions. That is, the predicted value of the current chroma block in both the first and second chroma components is limited to not exceeding the maximum limit, and / or the predicted value of the current chroma block in both the first and second chroma components is limited to not being less than the minimum limit. For example, the maximum chroma value of the surrounding reconstructed regions can be used as the maximum limit for the predicted value of the current chroma block; in this case, the maximum chroma value is the maximum value among the chroma values ​​in the first and second chroma components. As another example, the minimum chroma value of the surrounding reconstructed regions can be used as the minimum limit for the predicted value of the current chroma block; in this case, the minimum chroma value is the minimum value among the chroma values ​​in the surrounding reconstructed regions in both the first and second chroma components.

[0231] In some embodiments, since the chromaticity values ​​of every pixel in the reconstructed region surrounding the current chromaticity block have been reconstructed, the decoding end can find the pixel 1 with the largest chromaticity value of either the first or second chromaticity component in the reconstructed region surrounding the current chromaticity block, and then determine the chromaticity value of pixel 1 as the limited range of the predicted value of the current chromaticity block, that is, determine the chromaticity value of the first chromaticity component of pixel 1 as the maximum limited value of the first chromaticity component of the current chromaticity value, and determine the chromaticity value of the second chromaticity component of pixel 1 as the maximum limited value of the second chromaticity component of the current chromaticity value. Alternatively, in the reconstructed region surrounding the current chromaticity block, find the pixel 2 with the smallest chromaticity value of either the first or second chromaticity component, and then determine the chromaticity value of pixel 2 as the limited range of the predicted value of the current chromaticity block, that is, determine the chromaticity value of the first chromaticity component of pixel 2 as the minimum limited value of the first chromaticity component of the current chromaticity value, and determine the chromaticity value of the second chromaticity component of pixel 2 as the minimum limited value of the second chromaticity component of the current chromaticity value. At this point, the first chromaticity component and the second chromaticity component each correspond to a defined range.

[0232] In some embodiments, the decoding end determines the predicted values ​​of the first and second chroma components of the current chroma block separately when determining the predicted value of the current chroma block. Correspondingly, the defined ranges for the predicted values ​​of the first and second chroma components of the current chroma block are also determined separately. The specific processes for determining the defined ranges for the predicted values ​​of the first and second chroma components are essentially the same. For ease of description, the defined range for the predicted value of the i-th chroma component of the current chroma block is used as an example. This i-th chroma component can be the first chroma component U or Cb, or the second chroma component V or Cr. Based on this, S102-A includes the following step S102-A1:

[0233] S102-A1: Based on the chromaticity values ​​of the surrounding reconstructed regions under the i-th chromaticity component, determine the limited range of the predicted values ​​of the current chromaticity block under the i-th chromaticity component.

[0234] In this embodiment, the decoding end determines the limited range of the predicted value of the current chroma block under the i-th chroma component based on the chroma values ​​of the surrounding reconstructed regions under the i-th chroma component. For example, the maximum value of the chroma values ​​of the surrounding reconstructed regions under the i-th chroma component is used as the maximum limited value of the predicted value of the current chroma block under the i-th chroma component. As another example, the minimum value of the chroma values ​​of the surrounding reconstructed regions under the i-th chroma component is used as the minimum limited value of the predicted value of the current chroma block under the i-th chroma component.

[0235] In this embodiment, the reconstructed surrounding region of the current chroma block under the first chroma component and the reconstructed surrounding region under the second chroma component can be the same or different. Therefore, before determining the chroma value of the reconstructed surrounding region based on the i-th chroma component and determining the limited range of the predicted value of the current chroma block under the i-th chroma component, the decoding end first determines the reconstructed surrounding region of the current chroma block under the i-th component and records this reconstructed surrounding region as the first reconstructed surrounding region.

[0236] In the embodiments of this application, the specific methods for determining the first surrounding reconstructed region of the current chroma block under the i-th component include, but are not limited to, the following:

[0237] Method 1: A default reconstructed region is defined as the first surrounding reconstructed region of the current chroma block in the i-th component. For example, the reconstructed regions above, to the upper left, and to the upper right of the current chroma block are defaulted to being the first surrounding reconstructed region of the current chroma block in the i-th component. Another example: the reconstructed regions above, to the upper left, to the upper right, to the left, and to the lower left of the current chroma block are defaulted to being the first surrounding reconstructed region of the current chroma block in the i-th component, and so on.

[0238] For example, the first surrounding reconstructed region of the current chromaticity block under the Cb chromaticity component is shown in Figure 8A.

[0239] For example, the first surrounding reconstructed region of the current chromaticity block under the Cr chromaticity component is shown in Figure 8B.

[0240] Method 2: If the prediction mode of the current chroma block is the convolutional cross-component model mode, then determine the second surrounding reconstructed region corresponding to the convolutional cross-component model mode; based on the second surrounding reconstructed region, determine it as the first surrounding reconstructed region.

[0241] In this second method, the decoding end determines the prediction mode of the current chroma block based on the above steps. If the prediction mode of the current chroma block is the convolutional cross-component model mode in the cross-component intra-prediction mode, as mentioned above, in the convolutional cross-component model mode, it is necessary to determine the filter coefficients based on the surrounding reconstructed region of the current chroma block. In this embodiment, for ease of description, the surrounding reconstructed region of the current chroma block used to determine the filter coefficients in the convolutional cross-component model mode is denoted as the second surrounding reconstructed region. Thus, if the prediction mode of the current chroma block is the convolutional cross-component model mode, the decoding end determines the second surrounding reconstructed region corresponding to the convolutional cross-component model mode, and determines the aforementioned first surrounding reconstructed region based on the second surrounding reconstructed region.

[0242] The embodiments of this application do not limit the specific shape of the second reconstructed region surrounding the current chroma block.

[0243] In some embodiments, the second surrounding reconstructed area includes any one of the first type of reconstructed area, the second type of reconstructed area, and the third type of reconstructed area.

[0244] For example, as shown in Figure 9A, the first type of reconstruction region includes the areas above, upper left, upper right, left, and lower left of the current chroma block. In this case, the CCCM model parameters are derived from the areas surrounding the current chroma component and the corresponding luma block.

[0245] For example, as shown in Figure 9B, the second type of reconstruction region includes the area above, the upper left, and the upper right of the current chroma block. In this case, the model parameters of CCCM are derived from the area above, the upper left, and the upper right of the current chroma block, as well as the area above, the upper left, and the upper right of the corresponding luma block.

[0246] For example, as shown in Figure 9C, the third type of estimation region includes the left, upper left, and lower left regions of the current chroma block. In this case, the CCCM model parameters are derived from the left, upper left, and lower left regions of the current chroma block and the corresponding left, upper left, and lower left regions of the luma block.

[0247] It should be noted that, in addition to the first type of reconstruction area, the second type of reconstruction area and the third type of reconstruction area in the embodiments of this application, the second surrounding reconstructed area can also be other types of reconstruction areas, and the embodiments of this application do not limit this.

[0248] In some embodiments, if the decoding end determines that the prediction mode of the current chroma block is the convolutional cross-component model mode, it can determine the type of the second surrounding reconstruction region by decoding the relevant syntax elements, that is, determine which reconstruction region of the current chroma block to use, and thus determine the model parameters of CCCM.

[0249] The decoding end determines the second surrounding reconstructed region corresponding to the convolution cross-component model mode, and determines the first surrounding reconstructed region based on the second surrounding reconstructed region.

[0250] This application embodiment does not limit the specific method by which the decoding end determines the first surrounding reconstructed area based on the second surrounding reconstructed area.

[0251] In some embodiments, the shape of the first surrounding reconstructed region is the same as the shape of the second surrounding reconstructed region.

[0252] Example 1: If the second surrounding reconstructed region is a first-type reconstructed region, then the first surrounding reconstructed region is also determined to be a first-type reconstructed region. For example, as shown in Figure 9A, the second surrounding reconstructed region includes the upper, upper left, upper right, left, and lower left regions of the current chroma block. The first surrounding reconstructed region has the same shape as the second surrounding reconstructed region. Specifically, as shown in Figure 10A, the reconstructed regions corresponding to the Cb and Cr components of the current chroma block (i.e., the first surrounding reconstructed region) include the upper, upper left, upper right, left, and lower left regions of the current chroma block. Optionally, the number of rows and the list included in the first surrounding reconstructed region can be the same as, different from, or partially the same and partially different (e.g., the same number of rows but different number of columns, or the same number of columns but different number of rows). This embodiment does not impose any restrictions on this.

[0253] Example 2: If the second surrounding reconstructed region is a second type of reconstructed region, then the first surrounding reconstructed region is determined to be a second type of reconstructed region. For example, if the second surrounding reconstructed region, as shown in Figure 9B, includes the upper, upper left, and upper right regions of the current chroma block, then the first surrounding reconstructed region has the same shape as the second surrounding reconstructed region. Specifically, as shown in Figure 10B, the reconstructed regions corresponding to the Cb and Cr components of the current chroma block (i.e., the first surrounding reconstructed region) include the upper, upper left, and upper right regions of the current chroma block. Optionally, the number of rows included in the first surrounding reconstructed region can be the same as or different from the number of rows included in the second surrounding reconstructed region; this embodiment does not impose any restrictions on this.

[0254] Example 3: If the second surrounding reconstructed region is a third-type reconstructed region, then the first surrounding reconstructed region is determined to be a third-type reconstructed region. For example, if the second surrounding reconstructed region, as shown in Figure 9C, includes the left, upper left, and lower left regions of the current chroma block, then the first surrounding reconstructed region has the same shape as the second surrounding reconstructed region. Specifically, as shown in Figure 10C, the reconstructed regions corresponding to the Cb and Cr components of the current chroma block (i.e., the first surrounding reconstructed region) include the left, upper left, and lower left regions of the current chroma block. Optionally, the number of rows included in the first surrounding reconstructed region can be the same as or different from the number of rows included in the second surrounding reconstructed region; this embodiment does not impose any restrictions on this.

[0255] In one example, when the decoder uses the second reconstructed surrounding region to determine the model parameters of the CCCM, it can also use the same second reconstructed surrounding region to determine the defined range of the predicted value of the current chroma block in the i-th chroma component. In this case, the first reconstructed surrounding region is the same as the second reconstructed surrounding region.

[0256] Method 3: The first surrounding reconstructed area mentioned above includes at least one of the preset N types of reconstructed areas, where N is a positive integer.

[0257] The embodiments of this application do not limit the specific shape of the N types of reconstructed regions.

[0258] In some embodiments, the aforementioned preset N types of reconstruction regions include 5 types of reconstruction regions.

[0259] For example, the first type of reconstruction region among these five types includes the areas above, upper left, and left of the current chromaticity block. As shown in Figure 11A, the first type of reconstruction region for the current chromaticity block under the Cb chromaticity component includes the areas above, upper left, and left of the current chromaticity block under the Cb chromaticity component. The first type of reconstruction region for the current chromaticity block under the Cr chromaticity component includes the areas above, upper left, and left of the current chromaticity block under the Cr chromaticity component.

[0260] For example, the second type of reconstruction region among these five types includes the area above and to the upper right of the current chromaticity block. As shown in Figure 11B, the second type of reconstruction region for the current chromaticity block under the Cb chromaticity component includes the area above and to the upper right of the current chromaticity block under the Cb chromaticity component. The second type of reconstruction region for the current chromaticity block under the Cr chromaticity component also includes the area above and to the upper right of the current chromaticity block under the Cr chromaticity component.

[0261] For example, the third type of reconstruction region among these five types includes the region above the current chromaticity block. As shown in Figure 11C, the third type of reconstruction region for the current chromaticity block under the Cb chromaticity component includes the region above the current chromaticity block under the Cb chromaticity component. The third type of reconstruction region for the current chromaticity block under the Cr chromaticity component also includes the region above the current chromaticity block under the Cr chromaticity component.

[0262] For example, the fourth type of reconstruction region among these five types includes the upper-left and left-side regions of the current chromaticity block. As shown in Figure 11D, the fourth type of reconstruction region of the current chromaticity block under the Cb chromaticity component includes the upper-left and left-side regions of the current chromaticity block under the Cb chromaticity component. The fourth type of reconstruction region of the current chromaticity block under the Cr chromaticity component includes the upper-left and left-side regions of the current chromaticity block under the Cr chromaticity component.

[0263] For example, the fifth type of reconstruction region among these five types includes the left-hand region of the current chromaticity block. As shown in Figure 11E, the fifth type of reconstruction region of the current chromaticity block under the Cb chromaticity component includes the left-hand region of the current chromaticity block under the Cb chromaticity component. The fifth type of reconstruction region of the current chromaticity block under the Cr chromaticity component also includes the left-hand region of the current chromaticity block under the Cr chromaticity component.

[0264] In other words, in this method three, the decoding end can use any one or more of the above N types of reconstructed regions as the first surrounding reconstructed region.

[0265] For example, each of the above N types of reconstructed regions includes at least one row and / or at least a list of reconstructed pixel values. Optionally, the same 6 rows and / or 6 columns of reconstructed pixel values ​​used in CCCM and GLM modes can be used.

[0266] Based on the above method, the decoding end determines the first surrounding reconstructed region of the current chroma block under the i-th component, and then determines the limited range of the predicted value of the current chroma block under the i-th chroma component based on the first surrounding reconstructed region.

[0267] This application does not limit the specific method by which the decoding end determines the range of the predicted value of the current chromaticity block under the i-th chromaticity component based on the first surrounding reconstructed region.

[0268] For example, if the range of the predicted value of the current chroma block under the i-th chroma component includes the maximum predicted value of the current chroma block under the i-th chroma component, then the decoder will determine the maximum chroma value of the surrounding reconstructed area under the i-th chroma component as the maximum predicted value of the current chroma block under the i-th chroma component.

[0269] For example, if the range of the predicted value of the current chroma block under the i-th chroma component includes the minimum predicted value of the current chroma block under the i-th chroma component, then the decoder will determine the minimum chroma value of the surrounding reconstructed area under the i-th chroma component as the minimum predicted value of the current chroma block under the i-th chroma component.

[0270] For example, if the range of the predicted value of the current chroma block under the i-th chroma component includes the maximum and minimum predicted values ​​of the current chroma block under the i-th chroma component, then the decoder determines the maximum chroma value of the surrounding reconstructed area under the i-th chroma component as the maximum predicted value of the current chroma block under the i-th chroma component, and determines the minimum chroma value of the surrounding reconstructed area under the i-th chroma component as the minimum predicted value of the current chroma block under the i-th chroma component.

[0271] For example, if the range of the predicted value of the current chroma block under the i-th chroma component includes the maximum predicted value of the current chroma block under the i-th chroma component, then the decoder will determine the average of several maximum chroma values ​​of the surrounding reconstructed region under the i-th chroma component as the maximum predicted value of the current chroma block under the i-th chroma component.

[0272] For example, if the range of the predicted value of the current chroma block under the i-th chroma component includes the minimum predicted value of the current chroma block under the i-th chroma component, then the decoder will determine the average of several minimum chroma values ​​of the surrounding reconstructed area under the i-th chroma component as the minimum predicted value of the current chroma block under the i-th chroma component.

[0273] For example, if the range of the predicted value of the current chroma block under the i-th chroma component includes the maximum and minimum predicted values ​​of the current chroma block under the i-th chroma component, then the decoder determines the average of several maximum chroma values ​​in the surrounding reconstructed region under the i-th chroma component as the maximum predicted value of the current chroma block under the i-th chroma component, and determines the average of several minimum chroma values ​​in the surrounding reconstructed region under the i-th chroma component as the minimum predicted value of the current chroma block under the i-th chroma component.

[0274] The above embodiments describe the specific process by which the decoding end determines the limited range of the predicted value of the current chroma block.

[0275] S103. Based on the cross-component intra-frame prediction mode, determine the first prediction value of the current chroma block.

[0276] It should be noted that the steps of determining the range of the predicted value of the current chroma block in S103 and S102 are not strictly ordered during execution. That is, if the decoding end determines that the prediction mode of the current chroma block is cross-component intra-frame prediction mode, it can first execute S103 to determine the first predicted value of the current chroma block, and then execute S102 to determine the range of the predicted value of the current chroma block. Alternatively, it can first execute S102 to determine the range of the predicted value of the current chroma block, and then execute S103 to determine the first predicted value of the current chroma block based on the cross-component intra-frame prediction mode. It can also simultaneously execute both steps: S103 to determine the first predicted value of the current chroma block based on the cross-component intra-frame prediction mode, and S102 to determine the range of the predicted value of the current chroma block. The specific order depends on the actual situation, and this embodiment does not impose any restrictions.

[0277] In the embodiments of this application, for ease of description, the predicted value of the current chroma block obtained based on the cross-component intra-frame prediction mode is denoted as the first predicted value of the current chroma block.

[0278] In the embodiments of this application, when the cross-component intra-prediction mode adopted by the current chroma block is different, the specific method for determining the first prediction value of the current chroma block is also different.

[0279] In some embodiments, if the cross-component intra-prediction mode adopted by the current chroma block is CCCM mode, the decoder determines the first preset value of the current chroma block based on the above formula (7).

[0280] In some embodiments, if the cross-component intra-prediction mode used by the current chroma block is GLM mode, the decoder determines the first preset value of the current chroma block based on the above formula (8) or formula (9).

[0281] In some embodiments, the decoding end determines a first prediction value for each of the two chroma components of the current chroma block. That is, for the i-th chroma component of the current chroma block, the decoding end determines the first prediction value of the current chroma block in the i-th chroma component based on the cross-component intra-frame prediction mode. For example, the decoding end determines the first prediction value of the current chroma block in the first chroma component (Cb or U component) based on the cross-component intra-frame prediction mode, and the decoding end determines the first prediction value of the current chroma block in the second chroma component (Cr or V component) based on the cross-component intra-frame prediction mode.

[0282] The decoding end determines the limited range of the predicted value of the current chroma block based on S102 above, and determines the first predicted value of the current chroma block based on S103 above. Then, the following S104 is executed.

[0283] S104. Based on the first predicted value and the defined range, determine the second predicted value of the current chroma block.

[0284] In this embodiment, if the prediction mode of the current chroma block is the cross-component intra-frame prediction mode, a limited range of the predicted value of the current chroma block is determined in order to improve prediction performance. Then, based on this limited range, the first predicted value determined based on the cross-component intra-frame prediction mode is limited to prevent the first predicted value obtained based on the cross-component intra-frame prediction mode from being too large or too small, thereby improving the prediction accuracy of the current chroma block and enhancing decoding performance.

[0285] The embodiments of this application do not limit the specific method by which the decoding end determines the second prediction value of the current chroma block based on the first prediction value and the limited range.

[0286] In some embodiments, if the predicted values ​​of the first chromaticity component and the second chromaticity component correspond to a defined range, for example, if the first chromaticity component and the second chromaticity component correspond to a maximum defined value 'a', then the maximum defined value 'a' is used to define the first predicted value of the current chromaticity block under the first chromaticity component and the first predicted value under the second chromaticity component. If the first chromaticity component and the second chromaticity component correspond to a minimum defined value 'b', then the minimum defined value 'b' is used to define the first predicted value of the current chromaticity block under the first chromaticity component and the first predicted value under the second chromaticity component.

[0287] For example, if the first predicted value of the current chroma block in the first chroma component is less than the maximum limit value 'a', then the first predicted value of the current chroma block in the first chroma component is determined as the second predicted value of the current chroma block in the first chroma component. If the first predicted value of the current chroma block in the first chroma component is greater than the maximum limit value 'a', then the maximum limit value 'a' is determined as the second predicted value of the current chroma block in the first chroma component. If the first predicted value of the current chroma block in the second chroma component is less than the maximum limit value 'a', then the first predicted value of the current chroma block in the second chroma component is determined as the second predicted value of the current chroma block in the second chroma component. If the first predicted value of the current chroma block in the second chroma component is greater than the maximum limit value 'a', then the maximum limit value 'a' is determined as the second predicted value of the current chroma block in the second chroma component.

[0288] For example, if the first predicted value of the current chroma block in the first chroma component is greater than the minimum threshold value b, then the first predicted value of the current chroma block in the first chroma component is determined as the second predicted value of the current chroma block in the first chroma component. If the first predicted value of the current chroma block in the first chroma component is less than the minimum threshold value b, then the minimum threshold value b is determined as the second predicted value of the current chroma block in the first chroma component. If the first predicted value of the current chroma block in the second chroma component is greater than the minimum threshold value b, then the first predicted value of the current chroma block in the second chroma component is determined as the second predicted value of the current chroma block in the second chroma component. If the first predicted value of the current chroma block in the second chroma component is less than the minimum threshold value a, then the minimum threshold value b is determined as the second predicted value of the current chroma block in the second chroma component.

[0289] In some embodiments, the predicted values ​​of the first chromaticity component and the second chromaticity component each correspond to a defined range. Taking the i-th chromaticity component as an example, the decoder can determine the second predicted value of the current chromaticity block under the i-th chromaticity component based on the first predicted value under the i-th chromaticity component and the defined range under the i-th chromaticity component.

[0290] In one example, if the bounded range under the i-th chromaticity component includes the maximum bounded value, then the maximum bounded value under the i-th chromaticity component is used to bound the first predicted value of the current chromaticity block under the i-th chromaticity component.

[0291] For example, if the first predicted value of the current chromaticity block under the i-th chromaticity component is less than or equal to the maximum limit value under the i-th chromaticity component, then the first predicted value of the current chromaticity block under the i-th chromaticity component is determined as the second predicted value of the current chromaticity block under the i-th chromaticity component.

[0292] For example, if the first predicted value of the current chroma block under the i-th chroma component is greater than the maximum limit value under the i-th chroma component, then the maximum limit value under the i-th chroma component is determined as the second predicted value of the current chroma block under the i-th chroma component.

[0293] In one example, if the bounded range under the i-th chromaticity component includes a minimum bounded value, then the minimum bounded value under the i-th chromaticity component is used to bound the first predicted value of the current chromaticity block under the i-th chromaticity component.

[0294] For example, if the first predicted value of the current chromaticity block under the i-th chromaticity component is greater than or equal to the minimum limit value under the i-th chromaticity component, then the first predicted value of the current chromaticity block under the i-th chromaticity component is determined as the second predicted value of the current chromaticity block under the i-th chromaticity component.

[0295] For example, if the first predicted value of the current chroma block under the i-th chroma component is less than the minimum limit value under the i-th chroma component, then the minimum limit value under the i-th chroma component is determined as the second predicted value of the current chroma block under the i-th chroma component.

[0296] In one example, if the bounded range under the i-th chromaticity component includes a maximum bounded value and a minimum bounded value, then the maximum bounded value and the minimum bounded value under the i-th chromaticity component are used to bind the first predicted value of the current chromaticity block under the i-th chromaticity component.

[0297] For example, if the first predicted value of the current chroma block under the i-th chroma component is less than or equal to the maximum limit value under the i-th chroma component, and greater than or equal to the minimum limit value under the i-th chroma component, then the first predicted value of the current chroma block under the i-th chroma component is determined as the second predicted value of the current chroma block under the i-th chroma component.

[0298] For example, if the first predicted value of the current chroma block under the i-th chroma component is greater than the maximum limit value under the i-th chroma component, then the maximum limit value under the i-th chroma component is determined as the second predicted value of the current chroma block under the i-th chroma component.

[0299] For example, if the first predicted value of the current chroma block under the i-th chroma component is less than the minimum limit value under the i-th chroma component, then the minimum limit value under the i-th chroma component is determined as the second predicted value of the current chroma block under the i-th chroma component.

[0300] In this embodiment, the prediction value of the current chroma block is determined pixel-by-pixel. That is, the decoder predicts the value of each pixel in the current chroma block to obtain a first prediction value for each pixel, and then limits the first prediction value of each pixel to obtain a second prediction value. The process of limiting the first prediction value of each pixel in the current chroma block to obtain the second prediction value is consistent. Here, the current position (x, y) in the current chroma block is used as an example for explanation.

[0301] For example, the process of limiting the predicted Cb and Cr values ​​for the current position (x, y) in the current chroma block is shown in Table 2:

[0302] Table 2

[0303] In Table 2, height represents the height of the current chroma block, and width represents the width of the current chroma block. PredCb (x,y) This is the predicted value (i.e., the first predicted value) of the Cb component of the pixel at position (x, y) in the current chroma block. cb This is the maximum limit value corresponding to the Cb component of the current chroma block. cb This is the minimum limit value corresponding to the Cb component of the current chromaticity block. PredCr (x,y) This is the predicted value (i.e., the first predicted value) of the Cr component of the pixel at position (x, y) in the current chroma block. cr This is the maximum limit value corresponding to the Cr component of the current chromaticity block. cr This is the minimum limit value corresponding to the Cr component of the current chromaticity block.

[0304] From Table 2 above, if the Cb prediction value (i.e., the first prediction value under the Cb component) of the current position (x, y) in the current chroma block determined based on the cross-component intra-frame prediction mode is greater than the maximum limit value max of the Cb component, then... cb When, then the max cb The predicted Cb value (i.e., the second predicted value) for the current position (x, y) is determined. If the predicted Cb value for the current position (x, y) determined based on the cross-component intra-frame prediction mode (i.e., the first predicted value under the Cb component) is less than the minimum limit value min of the Cb component, then... cb When, then the min cb The predicted Cb value (i.e., the second predicted value) for the current position (x, y) is determined. Similarly, if the predicted Cr value (i.e., the first predicted value under the Cr component) for the current position (x, y) in the current chroma block determined based on the cross-component intra-frame prediction mode is greater than the maximum limit value max of the Cr component, then the predicted Cr value is determined. crWhen, then the max cr The predicted Cr value (i.e., the second predicted value) for the current position (x, y) is determined. If the predicted Cr value for the current position (x, y) determined based on the cross-component intra-frame prediction mode (i.e., the first predicted value under the Cr component) is less than the minimum limit value min of the Cr component, then... cr When, then the min cr The predicted value of Cr (i.e., the second predicted value) is determined for the current position (x, y).

[0305] Based on the above steps, the decoding end can determine the second prediction value of the current chroma block, and then decode the current chroma block based on the second prediction value to obtain the reconstructed value of the current chroma block.

[0306] The video decoding method provided in this application, when predicting the current chroma block, determines the prediction mode of the current chroma block. If the prediction mode is a cross-component intra-frame prediction mode, it determines a limited range of the predicted value of the current chroma block. This limited range includes at least one of a maximum limited value and a minimum limited value of the predicted value. Then, based on the cross-component intra-frame prediction mode, it determines a first predicted value of the current chroma block. Based on the first predicted value and the limited range, it determines a second predicted value of the current chroma block. In other words, in this application embodiment, if the current chroma block adopts the cross-component intra-frame prediction mode, the first predicted value determined by the cross-component intra-frame prediction mode is limited to avoid the predicted value of the current chroma block being too large or too small, thereby improving the prediction accuracy of the current chroma block and enhancing video encoding and decoding performance.

[0307] The above section uses the decoding end as an example to introduce the prediction method of this application. The following section uses the encoding end as an example to illustrate it.

[0308] Figure 12 is a schematic flowchart of a prediction method provided in an embodiment of this application. This embodiment is applied to the video encoders shown in Figures 1 and 2. As shown in Figure 12, the method of this embodiment includes:

[0309] S201. Determine the prediction mode for the current chroma block.

[0310] In this embodiment, when the encoding end encodes the current block, it first performs predictive encoding on the luminance component of the current block to obtain the luminance reconstruction value of the current block. Then, it performs predictive encoding on the chrominance component of the current block.

[0311] In this embodiment of the application, the chromaticity component of the current block is denoted as the current chromaticity block.

[0312] Before predictive encoding of the current chroma block, the prediction mode of the current chroma block is first determined.

[0313] The embodiments of this application do not limit the specific method for determining the prediction mode of the current chroma block.

[0314] In some embodiments, the default prediction mode is determined as the prediction mode for the current chroma block. That is, in the embodiments of this application, both the encoding end and the decoding end use the default prediction mode to predict the current chroma block.

[0315] In some embodiments, the encoder determines the prediction mode with the lowest cost from multiple candidate prediction modes as the prediction mode for the current chroma block. Optionally, the encoder encodes the indication information of the prediction mode into the bitstream, for example, by encoding the bitstream with the mode index of the prediction mode.

[0316] In some embodiments, S201 above includes the following steps:

[0317] S201-A1, Determine the first prediction mode;

[0318] S201-A2, Based on the first prediction mode, determine the prediction mode of the current chroma block.

[0319] As mentioned above, cross-component intra-frame prediction modes include CCLM, CCCM, GLM, and CCMerge. In CCMerge mode, the prediction mode for the current chroma block is determined by constructing a list.

[0320] In some embodiments, the first prediction mode can be a default mode, for example, the default first prediction mode for both the encoder and decoder is the CCMerge mode.

[0321] In some embodiments, the encoder can determine the first prediction mode based on the enable flag of the prediction mode. For example, if the enable flag of the CCCM mode is equal to 1, it indicates that the CCCM mode is being used, and the first prediction mode is determined to be the CCCM mode. Alternatively, if the enable flag of the CCMerge mode is equal to 1, it indicates that the CCMerge mode is being used, and the first prediction mode is determined to be the CCMerge mode.

[0322] After the encoding end determines the first prediction mode, it determines the prediction mode of the current chroma block based on the first prediction mode.

[0323] Based on this first prediction mode, the prediction mode for the current chroma block is determined to include at least the following two cases:

[0324] Case 1: If the first prediction mode is CCCM mode or GLM mode, the encoder will directly determine CCCM mode or GLM mode as the prediction mode of the current chroma block.

[0325] Case 2: If the first prediction mode is a cross-component merging mode, then S201-A2 above includes the following steps:

[0326] S201-A21. Construct a cross-component prediction mode list by inheriting the cross-component intra-prediction modes of the surrounding chroma blocks that are adjacent to and / or not adjacent to the current chroma block.

[0327] S201-A22. Determine the prediction mode of the current chroma block based on the cross-component prediction mode list.

[0328] In case 2, if the first prediction mode is the CCMerge mode, the encoder constructs a cross-component prediction mode list of length N.

[0329] For example, the process of constructing a list of cross-component prediction modes at the encoding end may include:

[0330] First, the encoder obtains the cross-component intra-prediction modes of the chroma blocks in the surrounding adjacent positions of the current chroma block. For example, as shown in Figure 6E, the encoder sequentially accesses positions B1→A1→B0→A0→B2. If at least one chroma block in these positions uses a cross-component intra-prediction mode, then the cross-component intra-prediction mode of this at least one chroma block is stored in the cross-component prediction mode list. For example, the order in which the cross-component intra-prediction modes are stored in the cross-component prediction mode list can be consistent with the access order of the aforementioned positions.

[0331] In some embodiments, if the length of the cross-component prediction mode list does not meet a preset length, i.e., N, the encoder can further obtain the cross-component intra-frame prediction modes of chroma blocks at non-adjacent positions of the current chroma block. Non-adjacent positions include some non-adjacent positions above, above left, above right, to the left, and below left of the current chroma block.

[0332] In some embodiments, if the length of the cross-component prediction mode list does not meet the preset length, i.e., N, that is, when the number of cross-component intra-frame prediction modes obtained from the adjacent and non-adjacent positions of the current chroma block is less than N, the CCLM mode with the default slope is used to fill the remaining list.

[0333] After constructing a cross-component prediction mode list based on the above steps, the encoding end determines the prediction mode of the current chroma block based on this cross-component prediction mode list.

[0334] This application does not limit the specific method by which the prediction mode of the current chroma block is determined based on the cross-component prediction mode list.

[0335] In one example, the encoder defaults to one of the cross-component intra-prediction modes in the cross-component prediction mode list as the prediction mode for the current chroma block. For instance, the first cross-component intra-prediction mode in the cross-component prediction mode list is defaulted to the prediction mode for the current chroma block, or the second cross-component intra-prediction mode in the cross-component prediction mode list is defaulted to the prediction mode for the current chroma block.

[0336] In one example, the encoder selects the least expensive mode from the list of cross-component prediction modes as the prediction mode for the current chroma block.

[0337] In one example, after the encoder determines the prediction mode of the current chroma block, it writes the mode index of the current chroma block's prediction mode in the cross-component prediction mode list into the bitstream. In this way, the decoder can obtain the mode index by decoding the bitstream, and then determine the prediction mode of the current chroma block based on that mode index in the cross-component prediction mode list.

[0338] In some embodiments, after determining the prediction mode of the current chroma block based on the above steps, the encoding end writes the prediction mode into the bitstream so that the decoding end can obtain the prediction mode of the current chroma block through the decoded bitstream.

[0339] S202. If the prediction mode is cross-component intra-frame prediction mode, then determine the limited range of the prediction value of the current chroma block.

[0340] The defined range includes at least one of the maximum and minimum defined values ​​of the predicted value.

[0341] In this embodiment of the application, in order to further improve the prediction accuracy of the cross-component intra-prediction mode, when the current chroma block adopts the cross-component intra-prediction mode, the limited range of the prediction value of the current chroma block is determined so as to limit the prediction value of the current chroma block within the limited range, and prevent the prediction value of the current chroma block from being too large and / or too small due to prediction error. This can further improve the prediction accuracy of the chroma components.

[0342] It should be noted that, in this embodiment, the range of predicted values ​​for the chromaticity component is limited. In some embodiments, the range of predicted values ​​for the luminance component, etc., may also be limited.

[0343] In some embodiments, limiting the predicted value of the current chroma block can be achieved by limiting the maximum predicted value of the current chroma block, and this limit is denoted as the maximum limit value of the predicted value. That is, the predicted value of the current chroma block is limited to not exceeding this maximum limit value.

[0344] In some embodiments, limiting the predicted value of the current chroma block can be achieved by limiting the minimum predicted value of the current chroma block, and this limiting value is denoted as the minimum limiting value of the predicted value. That is, the predicted value of the current chroma block is limited to not being less than this minimum limiting value.

[0345] In some embodiments, limiting the predicted value of the current chroma block can be achieved by limiting both the maximum and minimum values ​​of the predicted value of the current chroma block. That is, the predicted value of the current chroma block is limited to not being less than the minimum limit value, and the predicted value of the current chroma block is limited to not exceeding the maximum limit value.

[0346] In some embodiments, a flag (i.e., a first flag) is used to indicate whether the encoder limits the predicted value of the current chroma block. In this case, before determining the limiting range of the predicted value of the current chroma block, the encoder first needs to determine the first flag corresponding to the current chroma block, which indicates whether the predicted value of the current chroma block should be limited. Thus, based on this first flag, the encoder decides whether to limit the range of values ​​for the predicted value of the current chroma block.

[0347] For example, if the first flag indicates that the predicted value of the current chroma block is not limited, the encoder skips the step of determining the limited range of the predicted value of the current chroma block.

[0348] For example, if the first flag indicates that the predicted value of the current chroma block is limited, the encoding end performs the step of determining the limited range of the predicted value of the current chroma block.

[0349] This application does not limit the specific method by which the encoding end determines the first flag corresponding to the current chroma block.

[0350] In some embodiments, if the encoder determines that the first prediction mode is the CCMerge mode, the encoder determines the cross-component intra-prediction mode of the current chroma block by inheriting the cross-component intra-prediction modes of the surrounding and adjacent and / or non-adjacent chroma blocks. For example, referring to the above embodiment, if the encoder inherits the cross-component intra-prediction mode of chroma block 1, in this embodiment, the encoder may also inherit the first flag of chroma block 1. That is, if the first prediction mode is the CCMerge mode, the encoder determines the chroma block corresponding to the prediction mode inherited by the current chroma block and determines the first flag corresponding to that chroma block as the first flag corresponding to the current chroma block.

[0351] In some embodiments, the encoder may obtain the first flag from the high-level semantics.

[0352] The embodiments of this application do not limit the specific form of the first mark, and can be understood as any information that can indicate whether the predicted value of the current chroma block is limited.

[0353] In one example, the first flag mentioned above can be represented as `cross_component_clip_flag`. By assigning different values ​​to `cross_component_clip_flag`, it indicates whether the predicted value of the current chroma block is constrained. For example, if the value of `cross_component_clip_flag` is the first value, it indicates that the predicted value of the current chroma block is constrained; if the value of `cross_component_clip_flag` is the second value, it indicates that the predicted value of the current chroma block is not constrained.

[0354] The embodiments of this application do not impose restrictions on the specific values ​​of the first and second numerical values.

[0355] For example, the first value is 1.

[0356] For example, the second value is 0.

[0357] In this embodiment, the encoder determines the prediction mode of the current chroma block based on the above steps. If the prediction mode of the current chroma block is determined to be a cross-component intra-prediction mode (e.g., CCCM mode or GLM mode), then a first flag corresponding to the current chroma block is determined. Based on this first flag, it is then determined whether to limit the prediction value of the current chroma block. Specifically, if the first flag is a first value, it indicates that the prediction value of the current chroma block should be limited, thus the encoder determines the limited range of the prediction value of the current chroma block. If the first flag is a second value, it indicates that the prediction value of the current chroma block should not be limited. In this case, the encoder skips determining the limited range of the prediction value of the current chroma block and directly uses the prediction value obtained from the cross-component intra-prediction mode as the prediction value of the current chroma block.

[0358] In some embodiments, if the encoder does not obtain the first flag in the high-level semantics, the first flag is assumed to be a second value, that is, the predicted value of the current chroma block is not limited by default.

[0359] In some embodiments, the encoding end may also write the first flag into the bitstream so that the decoding end can obtain the first flag corresponding to the current chroma block through decoding the bitstream.

[0360] For example, the syntax elements included in the bitstream are shown in Table 1.

[0361] In some embodiments, the encoding end is instructed whether to limit the predicted value of the current chroma block by determining whether the current chroma block meets a preset condition. That is, in this embodiment, the range of predicted values ​​for some chroma blocks is limited, while the range of predicted values ​​for some chroma blocks is not limited. In this case, before determining the limited range of the predicted value of the current chroma block, the encoding end first needs to determine whether the current chroma block meets the preset condition.

[0362] For example, if the current chroma block does not meet the preset conditions, the encoder skips the step of determining the limited range of the predicted value of the current chroma block.

[0363] For example, if the current chroma block meets the preset conditions, the encoding end performs the step of determining the limited range of the predicted value of the current chroma block.

[0364] This application embodiment does not impose restrictions on the above-mentioned preset conditions, which can be set according to actual needs.

[0365] In some embodiments, the above-mentioned preset conditions include at least one of the following:

[0366] The current chroma block is not the first row of chroma blocks in the current CTU;

[0367] The current chroma block size meets the preset size;

[0368] The shape of the current chroma block satisfies the preset shape.

[0369] In other words, the preset conditions of the embodiments of this application may include only one of the above three conditions, or any two of the above three conditions, or all three conditions.

[0370] In one example, CCCM and GLM require reconstructed pixel values ​​from multiple rows and columns to derive model parameters. In the ECM reference software, to reduce the storage of row caches between CTUs spanning multiple rows, the use of CCCM and GLM is restricted for blocks located at the upper boundary of a CTU. Correspondingly, the method for determining the limited range of the predicted value of the current chroma value in this embodiment should also be limited. That is, if the current chroma block is the first row chroma block of the current CTU, the step of determining the limited range of the predicted value of the current chroma value is skipped.

[0371] In one example, the size of the current chroma block satisfies a preset size, which can be achieved by at least one of the length and width of the current chroma block satisfying a preset value. For example, the length of the current chroma block is less than or equal to the preset length, and the width is less than or equal to the preset width. Another example is that the length of the current chroma block is less than or equal to the preset length. Yet another example is that the width of the current chroma block is less than or equal to the preset width.

[0372] In one example, the size of the current chroma block meets a preset size, which could be that the number of pixels included in the current chroma block meets a preset number.

[0373] In one example, the shape of the current chroma block satisfies a preset shape, which could be that the aspect ratio and / or width-to-length ratio of the current chroma block meets a preset proportion. For example, the aspect ratio of the current chroma block is less than or equal to a first ratio, and the width-to-length ratio is less than or equal to a second ratio. Another example is that the aspect ratio of the current chroma block is less than or equal to the first ratio. Yet another example is that the width-to-length ratio is less than or equal to the second ratio.

[0374] As can be seen from the above, in the embodiments of this application, the methods for determining whether to limit the predicted value of the current chroma block include at least the following examples:

[0375] Example 1: The encoder limits the predicted value of the current chroma block by default. That is, when the encoder determines that the prediction mode of the current chroma block is the cross-component intra-frame prediction mode, it determines the limited range of the predicted value of the current chroma block.

[0376] Example 2 uses a first flag to indicate whether the predicted value of the current chroma block should be limited. In this case, when the encoder determines that the prediction mode of the current chroma block is cross-component intra-frame prediction mode, it also needs to determine the first flag corresponding to the current chroma block, and then determine whether to limit the predicted value of the current chroma block based on the first flag. For example, if the first flag indicates that the predicted value of the current chroma block should be limited, the encoder determines the limited range of the predicted value of the current chroma block. As another example, if the first flag indicates that the predicted value of the current chroma block should not be limited, the encoder skips the step of determining the limited range of the predicted value of the current chroma block.

[0377] Example 3: Whether to limit the predicted value of the current chroma block is determined by whether it meets preset conditions. That is, when the encoder determines that the prediction mode of the current chroma block is cross-component intra-frame prediction mode, it checks whether the current chroma block meets the preset conditions. If the current chroma block meets the preset conditions, the encoder determines the limited range of the predicted value of the current chroma block. Alternatively, if the current chroma block does not meet the preset conditions, the encoder skips the step of determining the limited range of the predicted value of the current chroma block.

[0378] Example 4 uses a first flag and preset conditions to determine whether to limit the predicted value of the current chroma block. That is, in Example 4, if the first flag of the current chroma block indicates that the predicted value of the current chroma block is limited, and the current chroma block meets the preset conditions, then the encoder determines the limited range of the predicted value of the current chroma block. If the first flag of the current chroma block indicates that the predicted value of the current chroma block is not limited, and / or the current chroma block does not meet the preset conditions, then the encoder skips the step of determining the limited range of the predicted value of the current chroma block. In Example 4, the encoder can first determine whether the current chroma block meets the preset conditions. If the current chroma block does not meet the preset conditions, the encoder will not determine the first flag again, but will directly skip the step of determining the limited range of the predicted value of the current chroma block. If the encoder determines that the current chroma block meets the preset conditions, it continues to determine the first flag corresponding to the current chroma block. If the first flag indicates that the predicted value of the current chroma block is limited, the encoder determines the limited range of the predicted value of the current chroma block. If the first flag indicates that the predicted value of the current chroma block is not limited, the encoder skips the step of determining the limited range of the predicted value of the current chroma block.

[0379] The following describes the specific process by which the encoder determines the range of predicted values ​​for the current chroma block.

[0380] In the embodiments of this application, the encoding end determines the limited range of the predicted value of the current chroma block in at least the following ways:

[0381] In Method 1, the predicted value of the current chroma block is limited to a preset range. That is, the maximum and / or minimum predicted value of the current chroma block is a preset value. This preset value can be an empirical or experimental value, and this embodiment does not impose any restrictions on it.

[0382] Method 2: If the encoder determines that the first prediction mode is the CCMerge mode, the encoder inherits the cross-component intra-prediction modes of the surrounding and adjacent and / or non-adjacent chroma blocks of the current chroma block. For example, referring to the above embodiment, the encoder inherits the cross-component intra-prediction mode of chroma block 1. In this embodiment, the encoder may also inherit the limited range of the prediction values ​​of chroma block 1. That is, if the first prediction mode is the CCMerge mode, the encoder determines the chroma block corresponding to the prediction mode inherited by the current chroma block, and determines the limited range of the prediction values ​​of that chroma block as the limited range of the prediction values ​​of the current chroma block.

[0383] Method 3: Since the chromaticity value of the current chromaticity block is correlated with the chromaticity blocks in the surrounding area, based on this, the above S202 includes the following step S202-A:

[0384] S202-A: Determine the range of predicted values ​​for the current chromaticity block based on the chromaticity values ​​of the reconstructed regions surrounding the current chromaticity block.

[0385] In this embodiment, the chromaticity components include a first chromaticity component and a second chromaticity component, wherein the first chromaticity component can be a U component or a Cb component, and the second chromaticity component can be a V component or a Cr component. Thus, the encoder can determine the defined range of predicted values ​​for the first and second chromaticity components of the current chromaticity block based on the chromaticity values ​​of the first and second chromaticity components of the surrounding reconstructed region.

[0386] This application does not limit the specific method by which the encoding end determines the range of predicted values ​​of the first and second chromaticity components of the current chromaticity block based on the chromaticity values ​​of the first and second chromaticity components of the surrounding reconstructed region.

[0387] In some embodiments, the encoder determines a maximum limit and / or a minimum limit for the predicted value of the current chroma block based on the chroma values ​​of the surrounding reconstructed regions. That is, the predicted value of the current chroma block in both the first and second chroma components is limited to not exceeding the maximum limit, and / or the predicted value of the current chroma block in both the first and second chroma components is limited to not being less than the minimum limit. For example, the maximum chroma value of the surrounding reconstructed regions can be used as the maximum limit for the predicted value of the current chroma block; in this case, the maximum chroma value is the maximum of the chroma values ​​in the first and second chroma components. As another example, the minimum chroma value of the surrounding reconstructed regions can be used as the minimum limit for the predicted value of the current chroma block; in this case, the minimum chroma value is the minimum of the chroma values ​​in the surrounding reconstructed regions in both the first and second chroma components.

[0388] In some embodiments, since the chromaticity values ​​of every pixel in the reconstructed region surrounding the current chromaticity block have been reconstructed, the encoder can find the pixel 1 with the largest chromaticity value of either the first or second chromaticity component in the reconstructed region surrounding the current chromaticity block, and then determine the chromaticity value of pixel 1 as the defined range of the predicted value of the current chromaticity block. That is, the chromaticity value of the first chromaticity component of pixel 1 is determined as the maximum defined value of the first chromaticity component of the current chromaticity value, and the chromaticity value of the second chromaticity component of pixel 1 is determined as the maximum defined value of the second chromaticity component of the current chromaticity value. Alternatively, in the reconstructed region surrounding the current chromaticity block, find the pixel 2 with the smallest chromaticity value of either the first or second chromaticity component, and then determine the chromaticity value of pixel 2 as the defined range of the predicted value of the current chromaticity block. That is, the chromaticity value of the first chromaticity component of pixel 2 is determined as the minimum defined value of the first chromaticity component of the current chromaticity value, and the chromaticity value of the second chromaticity component of pixel 2 is determined as the minimum defined value of the second chromaticity component of the current chromaticity value. At this point, the first chromaticity component and the second chromaticity component each correspond to a defined range.

[0389] In some embodiments, the encoding end determines the predicted values ​​of the first and second chromaticity components of the current chromaticity block separately when determining the predicted value of the current chromaticity block. Correspondingly, the defined ranges for the predicted values ​​of the first and second chromaticity components of the current chromaticity block are also determined separately. The specific processes for determining the defined ranges for the predicted values ​​of the first and second chromaticity components are essentially the same. For ease of description, the defined range for the predicted value of the i-th chromaticity component of the current chromaticity block is used as an example. This i-th chromaticity component can be the first chromaticity component U or Cb, or the second chromaticity component V or Cr. Based on this, S202-A includes the following step S202-A1:

[0390] S202-A1. Based on the chromaticity values ​​of the surrounding reconstructed regions under the i-th chromaticity component, determine the limited range of the predicted values ​​of the current chromaticity block under the i-th chromaticity component.

[0391] In this embodiment, the encoder determines the range of predicted values ​​for the current chroma block under the i-th chroma component based on the chroma values ​​of the surrounding reconstructed regions under the i-th chroma component. For example, the maximum value of the chroma values ​​of the surrounding reconstructed regions under the i-th chroma component is used as the maximum limit of the predicted value for the current chroma block under the i-th chroma component. As another example, the minimum value of the chroma values ​​of the surrounding reconstructed regions under the i-th chroma component is used as the minimum limit of the predicted value for the current chroma block under the i-th chroma component.

[0392] In this embodiment, the reconstructed surrounding region of the current chroma block under the first chroma component and the reconstructed surrounding region under the second chroma component can be the same or different. Therefore, before determining the limited range of the predicted value of the current chroma block under the i-th chroma component based on the chroma value of the reconstructed surrounding region, the encoder first determines the reconstructed surrounding region of the current chroma block under the i-th component and records this reconstructed surrounding region as the first reconstructed surrounding region.

[0393] In the embodiments of this application, the specific methods for determining the first surrounding reconstructed region of the current chroma block under the i-th component include, but are not limited to, the following:

[0394] Method 1: A default reconstructed region is defined as the first surrounding reconstructed region of the current chroma block in the i-th component. For example, the reconstructed regions above, to the upper left, and to the upper right of the current chroma block are defaulted to being the first surrounding reconstructed region of the current chroma block in the i-th component. Another example: the reconstructed regions above, to the upper left, to the upper right, to the left, and to the lower left of the current chroma block are defaulted to being the first surrounding reconstructed region of the current chroma block in the i-th component, and so on.

[0395] For example, the first surrounding reconstructed region of the current chromaticity block under the Cb chromaticity component is shown in Figure 8A.

[0396] For example, the first surrounding reconstructed region of the current chromaticity block under the Cr chromaticity component is shown in Figure 8B.

[0397] Method 2: If the prediction mode of the current chroma block is the convolutional cross-component model mode, then determine the second surrounding reconstructed region corresponding to the convolutional cross-component model mode; based on the second surrounding reconstructed region, determine it as the first surrounding reconstructed region.

[0398] In this second method, the encoder determines the prediction mode of the current chroma block based on the above steps. If the prediction mode of the current chroma block is the convolutional cross-component model mode in the cross-component intra-prediction mode, as mentioned above, in the convolutional cross-component model mode, it is necessary to determine the filter coefficients based on the surrounding reconstructed region of the current chroma block. In this embodiment, for ease of description, the surrounding reconstructed region of the current chroma block used to determine the filter coefficients in the convolutional cross-component model mode is denoted as the second surrounding reconstructed region. Thus, if the prediction mode of the current chroma block is the convolutional cross-component model mode, the encoder determines the second surrounding reconstructed region corresponding to the convolutional cross-component model mode, and determines the first surrounding reconstructed region based on the second surrounding reconstructed region.

[0399] The embodiments of this application do not limit the specific shape of the second reconstructed region surrounding the current chroma block.

[0400] In some embodiments, the second surrounding reconstructed area includes any one of the first type of reconstructed area, the second type of reconstructed area, and the third type of reconstructed area.

[0401] For example, as shown in Figure 9A, the first type of reconstruction region includes the areas above, upper left, upper right, left, and lower left of the current chroma block. In this case, the CCCM model parameters are derived from the areas surrounding the current chroma component and the corresponding luma block.

[0402] For example, as shown in Figure 9B, the second type of reconstruction region includes the area above, the upper left, and the upper right of the current chroma block. In this case, the model parameters of CCCM are derived from the area above, the upper left, and the upper right of the current chroma block, as well as the area above, the upper left, and the upper right of the corresponding luma block.

[0403] For example, as shown in Figure 9C, the third type of estimation region includes the left, upper left, and lower left regions of the current chroma block. In this case, the CCCM model parameters are derived from the left, upper left, and lower left regions of the current chroma block and the corresponding left, upper left, and lower left regions of the luma block.

[0404] It should be noted that, in addition to the first type of reconstruction area, the second type of reconstruction area and the third type of reconstruction area in the embodiments of this application, the second surrounding reconstructed area can also be other types of reconstruction areas, and the embodiments of this application do not limit this.

[0405] In some embodiments, if the encoder determines that the prediction mode of the current chroma block is the convolutional cross-component model mode, it can determine the type of the second surrounding reconstruction region by encoding the relevant syntax elements, that is, determine which reconstruction region of the current chroma block to use, and thus determine the model parameters of CCCM.

[0406] The encoder determines the second surrounding reconstructed region corresponding to the convolution cross-component model pattern, and determines the first surrounding reconstructed region based on the second surrounding reconstructed region.

[0407] This application embodiment does not limit the specific method by which the encoding end determines the first surrounding reconstructed region based on the second surrounding reconstructed region.

[0408] In some embodiments, the shape of the first surrounding reconstructed region is the same as the shape of the second surrounding reconstructed region.

[0409] Example 1: If the second surrounding reconstructed area is a first-type reconstructed area, then the first surrounding reconstructed area is also determined to be a first-type reconstructed area. For example, as shown in Figure 9A, the second surrounding reconstructed area includes the area above, upper left, upper right, left, and lower left of the current chroma block. The first surrounding reconstructed area has the same shape as the second surrounding reconstructed area, and as shown in Figure 10A, it can also include the area above, upper left, upper right, left, and lower left of the current chroma block. Optionally, the number of rows and the list included in the first surrounding reconstructed area can be the same as, different from, or partially the same and partially different (e.g., the same number of rows but different number of columns, or the same number of columns but different number of rows). This embodiment does not impose any restrictions on this.

[0410] Example 2: If the second surrounding reconstructed region is a second type of reconstructed region, then the first surrounding reconstructed region is determined to be a second type of reconstructed region. For example, if the second surrounding reconstructed region includes the upper, upper left, and upper right regions of the current chroma block as shown in Figure 9B, then the first surrounding reconstructed region has the same shape as the second surrounding reconstructed region, and can also include the upper, upper left, and upper right regions of the current chroma block as shown in Figure 10B. Optionally, the number of rows included in the first surrounding reconstructed region can be the same as or different from the number of rows included in the second surrounding reconstructed region; this embodiment does not impose any restrictions on this.

[0411] Example 3: If the second surrounding reconstructed area is a third-type reconstructed area, then the first surrounding reconstructed area is determined to be a third-type reconstructed area. For example, if the second surrounding reconstructed area includes the left, upper left, and lower left regions of the current chroma block as shown in Figure 9C, then the first surrounding reconstructed area has the same shape as the second surrounding reconstructed area, and may also include the left, upper left, and lower left regions of the current chroma block as shown in Figure 10C. Optionally, the number of rows included in the first surrounding reconstructed area may be the same as or different from the number of rows included in the second surrounding reconstructed area; this embodiment does not impose any restrictions on this.

[0412] In one example, when the encoder uses the second reconstructed surrounding region to determine the model parameters of the CCCM, it can also use the second reconstructed surrounding region to determine the bounded range of the predicted value of the current chromaticity block under the i-th chromaticity component. In this case, the first reconstructed surrounding region is the same as the second reconstructed surrounding region.

[0413] Method 3: The first surrounding reconstructed area mentioned above includes at least one of the preset N types of reconstructed areas, where N is a positive integer.

[0414] The embodiments of this application do not limit the specific shape of the N types of reconstructed regions.

[0415] In some embodiments, the aforementioned preset N types of reconstruction regions include 5 types of reconstruction regions.

[0416] For example, the first type of reconstruction region among these five types includes the areas above, upper left, and left of the current chromaticity block. As shown in Figure 11A, the first type of reconstruction region for the current chromaticity block under the Cb chromaticity component includes the areas above, upper left, and left of the current chromaticity block under the Cb chromaticity component. The first type of reconstruction region for the current chromaticity block under the Cr chromaticity component includes the areas above, upper left, and left of the current chromaticity block under the Cr chromaticity component.

[0417] For example, the second type of reconstruction region among these five types includes the area above and to the upper right of the current chromaticity block. As shown in Figure 11B, the second type of reconstruction region for the current chromaticity block under the Cb chromaticity component includes the area above and to the upper right of the current chromaticity block under the Cb chromaticity component. The second type of reconstruction region for the current chromaticity block under the Cr chromaticity component also includes the area above and to the upper right of the current chromaticity block under the Cr chromaticity component.

[0418] For example, the third type of reconstruction region among these five types includes the region above the current chromaticity block. As shown in Figure 11C, the third type of reconstruction region for the current chromaticity block under the Cb chromaticity component includes the region above the current chromaticity block under the Cb chromaticity component. The third type of reconstruction region for the current chromaticity block under the Cr chromaticity component also includes the region above the current chromaticity block under the Cr chromaticity component.

[0419] For example, the fourth type of reconstruction region among these five types includes the upper-left and left-side regions of the current chromaticity block. As shown in Figure 11D, the fourth type of reconstruction region of the current chromaticity block under the Cb chromaticity component includes the upper-left and left-side regions of the current chromaticity block under the Cb chromaticity component. The fourth type of reconstruction region of the current chromaticity block under the Cr chromaticity component includes the upper-left and left-side regions of the current chromaticity block under the Cr chromaticity component.

[0420] For example, the fifth type of reconstruction region among these five types includes the left-hand region of the current chromaticity block. As shown in Figure 11E, the fifth type of reconstruction region of the current chromaticity block under the Cb chromaticity component includes the left-hand region of the current chromaticity block under the Cb chromaticity component. The fifth type of reconstruction region of the current chromaticity block under the Cr chromaticity component also includes the left-hand region of the current chromaticity block under the Cr chromaticity component.

[0421] In other words, in this method three, the encoding end can use any one or more of the above N types of reconstructed regions as the first surrounding reconstructed region.

[0422] For example, each of the above N types of reconstructed regions includes at least one row and / or at least a list of reconstructed pixel values. Optionally, the same 6 rows and / or 6 columns of reconstructed pixel values ​​used in CCCM and GLM modes can be used.

[0423] Based on the above method, the encoding end determines the first surrounding reconstructed region of the current chroma block under the i-th component, and then determines the limited range of the predicted value of the current chroma block under the i-th chroma component based on the first surrounding reconstructed region.

[0424] This application does not limit the specific method by which the encoding end determines the range of predicted values ​​of the current chromaticity block under the i-th chromaticity component based on the first surrounding reconstructed region.

[0425] For example, if the range of the predicted value of the current chroma block under the i-th chroma component includes the maximum predicted value of the current chroma block under the i-th chroma component, then the encoder will determine the maximum chroma value of the surrounding reconstructed area under the i-th chroma component as the maximum predicted value of the current chroma block under the i-th chroma component.

[0426] For example, if the range of the predicted value of the current chroma block under the i-th chroma component includes the minimum predicted value of the current chroma block under the i-th chroma component, then the encoder will determine the minimum chroma value of the surrounding reconstructed region under the i-th chroma component as the minimum predicted value of the current chroma block under the i-th chroma component.

[0427] For example, if the range of the predicted value of the current chroma block under the i-th chroma component includes the maximum and minimum predicted values ​​of the current chroma block under the i-th chroma component, then the encoder determines the maximum chroma value of the surrounding reconstructed region under the i-th chroma component as the maximum predicted value of the current chroma block under the i-th chroma component, and determines the minimum chroma value of the surrounding reconstructed region under the i-th chroma component as the minimum predicted value of the current chroma block under the i-th chroma component.

[0428] For example, if the range of the predicted value of the current chroma block under the i-th chroma component includes the maximum predicted value of the current chroma block under the i-th chroma component, then the encoder will determine the average of several maximum chroma values ​​of the surrounding reconstructed region under the i-th chroma component as the maximum predicted value of the current chroma block under the i-th chroma component.

[0429] For example, if the range of the predicted value of the current chroma block under the i-th chroma component includes the minimum predicted value of the current chroma block under the i-th chroma component, then the encoder will determine the average of several minimum chroma values ​​of the surrounding reconstructed region under the i-th chroma component as the minimum predicted value of the current chroma block under the i-th chroma component.

[0430] For example, if the range of the predicted value of the current chroma block under the i-th chroma component includes the maximum and minimum predicted values ​​of the current chroma block under the i-th chroma component, then the encoder determines the average of several maximum chroma values ​​in the surrounding reconstructed region under the i-th chroma component as the maximum predicted value of the current chroma block under the i-th chroma component, and determines the average of several minimum chroma values ​​in the surrounding reconstructed region under the i-th chroma component as the minimum predicted value of the current chroma block under the i-th chroma component.

[0431] The above embodiments describe the specific process by which the encoding end determines the limited range of the predicted value of the current chroma block.

[0432] S203. Based on the cross-component intra-frame prediction mode, determine the first prediction value of the current chroma block.

[0433] It should be noted that the steps of determining the range of the predicted value of the current chroma block in S203 and S202 are not strictly ordered during execution. That is, if the encoding end determines that the prediction mode of the current chroma block is cross-component intra-frame prediction mode, it can first execute S203 to determine the first predicted value of the current chroma block, and then execute S202 to determine the range of the predicted value of the current chroma block. Alternatively, it can first execute S202 to determine the range of the predicted value of the current chroma block, and then execute S203 to determine the first predicted value of the current chroma block based on the cross-component intra-frame prediction mode. It can also simultaneously execute both steps: S203 to determine the first predicted value of the current chroma block based on the cross-component intra-frame prediction mode, and S202 to determine the range of the predicted value of the current chroma block. The specific order depends on the actual situation, and this embodiment does not impose any restrictions.

[0434] In the embodiments of this application, for ease of description, the predicted value of the current chroma block obtained based on the cross-component intra-frame prediction mode is denoted as the first predicted value of the current chroma block.

[0435] In the embodiments of this application, when the cross-component intra-prediction mode adopted by the current chroma block is different, the specific method for determining the first prediction value of the current chroma block is also different.

[0436] In some embodiments, if the cross-component intra-prediction mode adopted by the current chroma block is CCCM mode, the encoder determines the first preset value of the current chroma block based on the above formula (7).

[0437] In some embodiments, if the cross-component intra-prediction mode adopted by the current chroma block is GLM mode, the encoder determines the first preset value of the current chroma block based on the above formula (8) or formula (9).

[0438] In some embodiments, the encoder determines a first prediction value for each of the two chroma components of the current chroma block. That is, for the i-th chroma component of the current chroma block, the encoder determines the first prediction value of the current chroma block in the i-th chroma component based on a cross-component intra-frame prediction mode. For example, the encoder determines the first prediction value of the current chroma block in the first chroma component (Cb or U component) based on the cross-component intra-frame prediction mode, and the encoder determines the first prediction value of the current chroma block in the second chroma component (Cr or V component) based on the cross-component intra-frame prediction mode.

[0439] The encoding end determines the limited range of the predicted value of the current chroma block based on S202 above, and determines the first predicted value of the current chroma block based on S203 above. Then, the following S204 is executed.

[0440] S204. Based on the first predicted value and the defined range, determine the second predicted value of the current chroma block.

[0441] In this embodiment, if the prediction mode of the current chroma block is the cross-component intra-frame prediction mode, a limited range of the predicted value of the current chroma block is determined in order to improve prediction performance. Then, based on this limited range, the first predicted value determined based on the cross-component intra-frame prediction mode is limited to prevent the first predicted value obtained based on the cross-component intra-frame prediction mode from being too large or too small, thereby improving the prediction accuracy of the current chroma block and enhancing coding performance.

[0442] The embodiments of this application do not limit the specific method by which the encoding end determines the second predicted value of the current chroma block based on the first predicted value and the limited range.

[0443] In some embodiments, if the predicted values ​​of the first chromaticity component and the second chromaticity component correspond to a defined range, for example, if the first chromaticity component and the second chromaticity component correspond to a maximum defined value 'a', then the maximum defined value 'a' is used to define the first predicted value of the current chromaticity block under the first chromaticity component and the first predicted value under the second chromaticity component. If the first chromaticity component and the second chromaticity component correspond to a minimum defined value 'b', then the minimum defined value 'b' is used to define the first predicted value of the current chromaticity block under the first chromaticity component and the first predicted value under the second chromaticity component.

[0444] For example, if the first predicted value of the current chroma block in the first chroma component is less than the maximum limit value 'a', then the first predicted value of the current chroma block in the first chroma component is determined as the second predicted value of the current chroma block in the first chroma component. If the first predicted value of the current chroma block in the first chroma component is greater than the maximum limit value 'a', then the maximum limit value 'a' is determined as the second predicted value of the current chroma block in the first chroma component. If the first predicted value of the current chroma block in the second chroma component is less than the maximum limit value 'a', then the first predicted value of the current chroma block in the second chroma component is determined as the second predicted value of the current chroma block in the second chroma component. If the first predicted value of the current chroma block in the second chroma component is greater than the maximum limit value 'a', then the maximum limit value 'a' is determined as the second predicted value of the current chroma block in the second chroma component.

[0445] For example, if the first predicted value of the current chroma block in the first chroma component is greater than the minimum threshold value b, then the first predicted value of the current chroma block in the first chroma component is determined as the second predicted value of the current chroma block in the first chroma component. If the first predicted value of the current chroma block in the first chroma component is less than the minimum threshold value b, then the minimum threshold value b is determined as the second predicted value of the current chroma block in the first chroma component. If the first predicted value of the current chroma block in the second chroma component is greater than the minimum threshold value b, then the first predicted value of the current chroma block in the second chroma component is determined as the second predicted value of the current chroma block in the second chroma component. If the first predicted value of the current chroma block in the second chroma component is less than the minimum threshold value a, then the minimum threshold value b is determined as the second predicted value of the current chroma block in the second chroma component.

[0446] In some embodiments, the predicted values ​​of the first chromaticity component and the second chromaticity component each correspond to a defined range. Taking the i-th chromaticity component as an example, the encoder can determine the second predicted value of the current chromaticity block under the i-th chromaticity component based on the first predicted value under the i-th chromaticity component and the defined range under the i-th chromaticity component.

[0447] In one example, if the bounded range under the i-th chromaticity component includes the maximum bounded value, then the maximum bounded value under the i-th chromaticity component is used to bound the first predicted value of the current chromaticity block under the i-th chromaticity component.

[0448] For example, if the first predicted value of the current chromaticity block under the i-th chromaticity component is less than or equal to the maximum limit value under the i-th chromaticity component, then the first predicted value of the current chromaticity block under the i-th chromaticity component is determined as the second predicted value of the current chromaticity block under the i-th chromaticity component.

[0449] For example, if the first predicted value of the current chroma block under the i-th chroma component is greater than the maximum limit value under the i-th chroma component, then the maximum limit value under the i-th chroma component is determined as the second predicted value of the current chroma block under the i-th chroma component.

[0450] In one example, if the bounded range under the i-th chromaticity component includes a minimum bounded value, then the minimum bounded value under the i-th chromaticity component is used to bound the first predicted value of the current chromaticity block under the i-th chromaticity component.

[0451] For example, if the first predicted value of the current chromaticity block under the i-th chromaticity component is greater than or equal to the minimum limit value under the i-th chromaticity component, then the first predicted value of the current chromaticity block under the i-th chromaticity component is determined as the second predicted value of the current chromaticity block under the i-th chromaticity component.

[0452] For example, if the first predicted value of the current chroma block under the i-th chroma component is less than the minimum limit value under the i-th chroma component, then the minimum limit value under the i-th chroma component is determined as the second predicted value of the current chroma block under the i-th chroma component.

[0453] In one example, if the bounded range under the i-th chromaticity component includes a maximum bounded value and a minimum bounded value, then the maximum bounded value and the minimum bounded value under the i-th chromaticity component are used to bind the first predicted value of the current chromaticity block under the i-th chromaticity component.

[0454] For example, if the first predicted value of the current chroma block under the i-th chroma component is less than or equal to the maximum limit value under the i-th chroma component, and greater than or equal to the minimum limit value under the i-th chroma component, then the first predicted value of the current chroma block under the i-th chroma component is determined as the second predicted value of the current chroma block under the i-th chroma component.

[0455] For example, if the first predicted value of the current chroma block under the i-th chroma component is greater than the maximum limit value under the i-th chroma component, then the maximum limit value under the i-th chroma component is determined as the second predicted value of the current chroma block under the i-th chroma component.

[0456] For example, if the first predicted value of the current chroma block under the i-th chroma component is less than the minimum limit value under the i-th chroma component, then the minimum limit value under the i-th chroma component is determined as the second predicted value of the current chroma block under the i-th chroma component.

[0457] In this embodiment, the prediction value of the current chroma block is determined pixel-by-pixel. That is, the encoder predicts the value of each pixel in the current chroma block to obtain a first predicted value for each pixel, and then limits the first predicted value to obtain a second predicted value for each pixel. The process of limiting the first predicted value of each pixel in the current chroma block to obtain the second predicted value is consistent. Here, the current position (x, y) in the current chroma block is used as an example for explanation.

[0458] For example, the process of limiting the predicted Cb and Cr values ​​for the current position (x, y) in the current chroma block is shown in Table 2.

[0459] From Table 2 above, if the Cb prediction value (i.e., the first prediction value under the Cb component) of the current position (x, y) in the current chroma block determined based on the cross-component intra-frame prediction mode is greater than the maximum limit value max of the Cb component, then... cb When, then the max cb The predicted Cb value (i.e., the second predicted value) for the current position (x, y) is determined. If the predicted Cb value for the current position (x, y) determined based on the cross-component intra-frame prediction mode (i.e., the first predicted value under the Cb component) is less than the minimum limit value min of the Cb component, then... cb When, then the min cb The predicted Cb value (i.e., the second predicted value) for the current position (x, y) is determined. Similarly, if the predicted Cr value (i.e., the first predicted value under the Cr component) for the current position (x, y) in the current chroma block determined based on the cross-component intra-frame prediction mode is greater than the maximum limit value max of the Cr component, then the predicted Cr value is determined. cr When, then the max cr The predicted Cr value (i.e., the second predicted value) for the current position (x, y) is determined. If the predicted Cr value for the current position (x, y) determined based on the cross-component intra-frame prediction mode (i.e., the first predicted value under the Cr component) is less than the minimum limit value min of the Cr component, then... cr When, then the min cr The predicted value of Cr (i.e., the second predicted value) is determined for the current position (x, y).

[0460] The encoding end can determine the second prediction value of the current chroma block based on the above steps, and then encode the current chroma block based on the second prediction value to obtain the bit stream.

[0461] The video coding method provided in this application, when predicting the current chroma block, determines the prediction mode of the current chroma block. If the prediction mode is a cross-component intra-frame prediction mode, it determines a limited range of the predicted value of the current chroma block. This limited range includes at least one of a maximum limited value and a minimum limited value of the predicted value. Then, based on the cross-component intra-frame prediction mode, it determines a first predicted value of the current chroma block. Based on the first predicted value and the limited range, it determines a second predicted value of the current chroma block. In other words, in this application embodiment, if the current chroma block adopts the cross-component intra-frame prediction mode, the first predicted value determined by the cross-component intra-frame prediction mode is limited to avoid the predicted value of the current chroma block being too large or too small, thereby improving the prediction accuracy of the current chroma block and enhancing video coding performance.

[0462] It should be understood that Figures 7 to 12 are merely examples of this application and should not be construed as limiting this application.

[0463] The preferred embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this application, various simple modifications can be made to the technical solutions of this application, and these simple modifications all fall within the protection scope of this application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this application will not describe the various possible combinations separately. Furthermore, various different embodiments of this application can also be arbitrarily combined, as long as they do not violate the spirit of this application, they should also be considered as the content disclosed in this application.

[0464] It should also be understood that, in the various method embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. Furthermore, in the embodiments of this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. Specifically, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, in this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0465] The method embodiments of this application have been described in detail above with reference to Figures 7 to 12, and the device embodiments of this application have been described in detail below with reference to Figures 13 to 15.

[0466] Figure 13 is a schematic block diagram of a video decoding device 10 provided in an embodiment of this application, which is applied to the video decoder described above.

[0467] As shown in Figure 13, the video decoding device 10 includes:

[0468] Prediction mode determination unit 11 is used to determine the prediction mode of the current chroma block;

[0469] The limiting range determination unit 12 is used to determine the limiting range of the predicted value of the current chroma block based on the chroma values ​​of the reconstructed regions surrounding the current chroma block when the prediction mode is a cross-component intra-frame prediction mode. The limiting range includes at least one of the maximum limiting value and the minimum limiting value of the predicted value.

[0470] Prediction unit 13 is used to determine a first prediction value of the current chroma block based on the cross-component intra-frame prediction mode;

[0471] The limiting unit 14 is used to determine a second predicted value for the current chroma block based on the first predicted value and the limiting range.

[0472] In some embodiments, the prediction mode determination unit 11 is specifically used to decode the bitstream to obtain the prediction mode of the current chroma block.

[0473] In some embodiments, the prediction mode determination unit 11 is specifically used to decode the bitstream to obtain a first prediction mode; and to determine the prediction mode of the current chroma block based on the first prediction mode.

[0474] In some embodiments, the prediction mode determination unit 11 is specifically used to determine the convolutional cross-component model mode or the gradient linear model mode as the prediction mode of the current chroma block if the first prediction mode is a convolutional cross-component model mode or a gradient linear model mode.

[0475] In some embodiments, the prediction mode determination unit 11 is specifically configured to, if the first prediction mode is a cross-component merging mode, construct a cross-component prediction mode list by inheriting the cross-component intra-frame prediction modes of the surrounding chroma blocks that are adjacent to and / or not adjacent to the current chroma block; and determine the prediction mode of the current chroma block based on the cross-component prediction mode list.

[0476] In some embodiments, the prediction mode determination unit 11 is specifically used to decode the bitstream to obtain a mode index; based on the mode index, the prediction mode of the current chroma block is determined in the cross-component prediction mode list.

[0477] In some embodiments, before determining the limiting range of the predicted value of the current chroma block, the limiting range determining unit 12 is further configured to determine a first flag corresponding to the current chroma block, the first flag being used to indicate whether the predicted value of the current chroma block is limited; if the first flag indicates that the predicted value of the current chroma block is limited, then the limiting range of the predicted value of the current chroma block is determined.

[0478] In some embodiments, the limiting range determining unit 12 is specifically used to determine the chroma block corresponding to the prediction mode inherited by the current chroma block when the first prediction mode obtained by decoding the bitstream is a cross-component merging mode; and to determine the first flag corresponding to the chroma block as the first flag corresponding to the current chroma block.

[0479] In some embodiments, the range determination unit 12 is specifically used to decode the bitstream to obtain the first flag corresponding to the current chroma block.

[0480] In some embodiments, before determining the limited range of the predicted value of the current chroma block, the limited range determination unit 12 is further configured to determine whether the current chroma block meets a preset condition; if the current chroma block meets the preset condition, then the limited range of the predicted value of the current chroma block is determined.

[0481] In some embodiments, the preset conditions include at least one of the following:

[0482] The current chroma block is not the first row chroma block of the current CTU;

[0483] The size of the current chroma block meets the preset size;

[0484] The shape of the current chroma block satisfies the preset shape.

[0485] In some embodiments, the limiting range determining unit 12 is specifically used to determine the chroma block corresponding to the prediction mode inherited by the current chroma block; and to determine the limiting range of the prediction value of the chroma block as the limiting range of the prediction value of the current chroma block.

[0486] In some embodiments, the limiting range determining unit 12 is specifically used to determine the limiting range of the predicted value of the current chroma block based on the chroma values ​​of the reconstructed area surrounding the current chroma block.

[0487] In some embodiments, the range determination unit 12 is specifically used to determine the range of the predicted value of the current chromaticity block under the i-th chromaticity component based on the chromaticity value of the surrounding reconstructed region under the i-th chromaticity component, where i is a positive integer;

[0488] Prediction unit 13 is specifically used to determine the first prediction value of the current chroma block under the i-th chroma component based on the cross-component intra-frame prediction mode;

[0489] The limiting unit 14 is specifically used to determine the second predicted value of the current chromaticity block under the i-th chromaticity component based on the first predicted value under the i-th chromaticity component and the limiting range under the i-th chromaticity component.

[0490] In some embodiments, before determining the range of the predicted value of the current chromaticity block under the i-th chromaticity component based on the chromaticity value of the surrounding reconstructed region under the i-th chromaticity component, the range determination unit 12 is further configured to determine a first surrounding reconstructed region of the current chromaticity block under the i-th chromaticity component; and determine the range of the predicted value of the current chromaticity block under the i-th chromaticity component based on the first surrounding reconstructed region.

[0491] In some embodiments, the range determination unit 12 is specifically configured to determine the second surrounding reconstructed region corresponding to the convolutional cross-component model mode if the prediction mode of the current chroma block is the convolutional cross-component model mode; and determine the first surrounding reconstructed region based on the second surrounding reconstructed region.

[0492] In some embodiments, the second surrounding reconstructed region includes any one of a first type of reconstructed region, a second type of reconstructed region, and a third type of reconstructed region. The first type of reconstructed region includes the area above, upper left, upper right, left, and lower left of the current chroma block. The second type of reconstructed region includes the area above, upper left, and upper right of the current chroma block. The third type of reconstructed region includes the area to the left, upper left, and lower left of the current chroma block.

[0493] In some embodiments, the range determination unit 12 is specifically configured to determine the first surrounding reconstructed area as the second type of reconstructed area if the second surrounding reconstructed area is the second type of reconstructed area; or, if the second surrounding reconstructed area is the third type of reconstructed area, determine the first surrounding reconstructed area as the third type of reconstructed area.

[0494] In some embodiments, the first surrounding reconstructed region includes at least one of N preset types of reconstructed regions, where N is a positive integer.

[0495] In some embodiments, the N types of reconstruction regions include five types of reconstruction regions: the first type of reconstruction region includes the area above, the upper left, and the left side of the current chroma block; the second type of reconstruction region includes the area above and the upper right of the current chroma block; the third type of reconstruction region includes the area above the current chroma block; the fourth type of reconstruction region includes the area above and the left side of the current chroma block; and the fifth type of reconstruction region includes the area to the left of the current chroma block.

[0496] In some embodiments, the range determination unit 12 is specifically configured to determine the maximum chromaticity value of the surrounding reconstructed area under the i-th chromaticity component as the maximum limit value of the predicted value of the current chromaticity block under the i-th chromaticity component; and / or, determine the minimum chromaticity value of the surrounding reconstructed area under the i-th chromaticity component as the minimum limit value of the predicted value of the current chromaticity block under the i-th chromaticity component.

[0497] In some embodiments, the limiting range includes the maximum limiting value, and the limiting unit 14 is configured to determine the first predicted value as the second predicted value if the first predicted value is less than or equal to the maximum limiting value; and to determine the maximum limiting value as the second predicted value if the first predicted value is greater than the maximum limiting value.

[0498] In some embodiments, the defined range includes the minimum defined value, and the defining unit 14 is configured to determine the first predicted value as the second predicted value if the first predicted value is greater than the minimum defined value; and to determine the minimum defined value as the second predicted value if the first predicted value is less than the minimum defined value.

[0499] In some embodiments, the defined range includes the minimum defined value and the maximum defined value. The defining unit 14 is configured to determine the first predicted value as the second predicted value if the first predicted value is less than or equal to the maximum defined value and greater than or equal to the minimum defined value; determine the maximum defined value as the second predicted value if the first predicted value is greater than the maximum defined value; and determine the minimum defined value as the second predicted value if the first predicted value is less than the minimum defined value.

[0500] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, they will not be repeated here. Specifically, the device 10 shown in FIG13 can execute the decoding method of the decoding end of the present application embodiment, and the foregoing and other operations and / or functions of each unit in the device 10 are respectively to implement the corresponding processes in the decoding method of the above-mentioned decoding end and other methods. For the sake of brevity, they will not be repeated here.

[0501] Figure 14 is a schematic block diagram of a video encoding device provided in an embodiment of this application, which is applied to the encoder described above.

[0502] As shown in Figure 14, the video encoding device 20 may include:

[0503] Prediction mode determination unit 21 is used to determine the prediction mode of the current chroma block;

[0504] The limiting range determination unit 22 is used to determine the limiting range of the predicted value of the current chroma block based on the chroma values ​​of the reconstructed regions surrounding the current chroma block when the prediction mode is a cross-component intra-frame prediction mode. The limiting range includes at least one of the maximum limiting value and the minimum limiting value of the predicted value.

[0505] Prediction unit 23 is used to determine the first prediction value of the current chroma block based on the cross-component intra-frame prediction mode;

[0506] The limiting unit 24 is used to determine a second predicted value for the current chroma block based on the first predicted value and the limiting range.

[0507] In some embodiments, the prediction mode determination unit 21 is specifically used to determine a first prediction mode; and based on the first prediction mode, to determine the prediction mode of the current chroma block.

[0508] In some embodiments, the prediction mode determination unit 21 is specifically used to determine the convolutional cross-component model mode or the gradient linear model mode as the prediction mode of the current chroma block if the first prediction mode is a convolutional cross-component model mode or a gradient linear model mode.

[0509] In some embodiments, the prediction mode determination unit 21 is specifically configured to, if the first prediction mode is a cross-component merging mode, construct a cross-component prediction mode list by inheriting the cross-component intra-frame prediction modes of the surrounding chroma blocks that are adjacent to and / or not adjacent to the current chroma block; and determine the prediction mode of the current chroma block based on the cross-component prediction mode list.

[0510] In some embodiments, the prediction mode determination unit 21 is further configured to write the prediction mode of the current chroma block into the mode index of the cross-component prediction mode list and write it into the bitstream.

[0511] In some embodiments, the prediction mode determination unit 21 is further configured to write the prediction mode of the current chroma block into the bitstream.

[0512] In some embodiments, before determining the limiting range of the predicted value of the current chroma block, the limiting range determining unit 22 is further configured to determine a first flag corresponding to the current chroma block, the first flag being used to indicate whether the predicted value of the current chroma block is limited; if the first flag indicates that the predicted value of the current chroma block is limited, then the limiting range of the predicted value of the current chroma block is determined.

[0513] In some embodiments, the range determination unit 22 is specifically used to determine a first prediction mode; if the first prediction mode is a cross-component merging mode, then determine the chroma block corresponding to the prediction mode inherited by the current chroma block; and determine the first flag corresponding to the chroma block as the first flag corresponding to the current chroma block.

[0514] In some embodiments, the range determination unit 22 is further configured to write the first flag corresponding to the current chroma block into the bitstream.

[0515] In some embodiments, the limiting range determining unit 22 is further configured to determine whether the current chroma block meets a preset condition before determining the limiting range of the predicted value of the current chroma block; if the current chroma block meets the preset condition, then the limiting range of the predicted value of the current chroma block is determined.

[0516] In some embodiments, the preset conditions include at least one of the following:

[0517] The current chroma block is not the first row chroma block of the current CTU;

[0518] The size of the current chroma block meets the preset size;

[0519] The shape of the current chroma block satisfies the preset shape.

[0520] In some embodiments, the limiting range determining unit 22 is specifically used to determine the chroma block corresponding to the prediction mode inherited by the current chroma block; and to determine the limiting range of the prediction value of the chroma block as the limiting range of the prediction value of the current chroma block.

[0521] In some embodiments, the range determination unit 22 is specifically used to determine the range of the predicted value of the current chroma block based on the chroma values ​​of the reconstructed regions surrounding the current chroma block.

[0522] In some embodiments, the range determination unit 22 is specifically used to determine the range of the predicted value of the current chromaticity block under the i-th chromaticity component based on the chromaticity value of the surrounding reconstructed region under the i-th chromaticity component, where i is a positive integer;

[0523] Prediction unit 23 is specifically used to determine the first prediction value of the current chroma block under the i-th chroma component based on the cross-component intra-frame prediction mode;

[0524] The limiting unit 24 is specifically used to determine the second predicted value of the current chromaticity block under the i-th chromaticity component based on the first predicted value under the i-th chromaticity component and the limiting range under the i-th chromaticity component.

[0525] In some embodiments, the range determination unit 22 is further configured to determine a first surrounding reconstructed region of the current chromaticity block under the i-th chromaticity component before determining the range of the predicted value of the current chromaticity block under the i-th chromaticity component based on the chromaticity value of the surrounding reconstructed region under the i-th chromaticity component; and to determine the range of the predicted value of the current chromaticity block under the i-th chromaticity component based on the first surrounding reconstructed region.

[0526] In some embodiments, the range determination unit 22 is specifically configured to determine the second surrounding reconstructed region corresponding to the convolutional cross-component model mode if the prediction mode of the current chroma block is the convolutional cross-component model mode; and determine the first surrounding reconstructed region based on the second surrounding reconstructed region.

[0527] In some embodiments, the second surrounding reconstructed region includes any one of a first type of reconstructed region, a second type of reconstructed region, and a third type of reconstructed region. The first type of reconstructed region includes the area above, upper left, upper right, left, and lower left of the current chroma block. The second type of reconstructed region includes the area above, upper left, and upper right of the current chroma block. The third type of reconstructed region includes the area to the left, upper left, and lower left of the current chroma block.

[0528] In some embodiments, the range determination unit 22 is specifically configured to determine the first surrounding reconstructed area as the second type of reconstructed area if the second surrounding reconstructed area is the second type of reconstructed area; or, if the second surrounding reconstructed area is the third type of reconstructed area, determine the first surrounding reconstructed area as the third type of reconstructed area.

[0529] In some embodiments, the first surrounding reconstructed region includes at least one of N preset types of reconstructed regions, where N is a positive integer.

[0530] In some embodiments, the N types of reconstruction regions include five types of reconstruction regions: the first type of reconstruction region includes the area above, the upper left, and the left side of the current chroma block; the second type of reconstruction region includes the area above and the upper right of the current chroma block; the third type of reconstruction region includes the area above the current chroma block; the fourth type of reconstruction region includes the area above and the left side of the current chroma block; and the fifth type of reconstruction region includes the area to the left of the current chroma block.

[0531] In some embodiments, the range determination unit 22 is specifically configured to determine the maximum chromaticity value of the surrounding reconstructed area under the i-th chromaticity component as the maximum limit value of the predicted value of the current chromaticity block under the i-th chromaticity component; and / or, determine the minimum chromaticity value of the surrounding reconstructed area under the i-th chromaticity component as the minimum limit value of the predicted value of the current chromaticity block under the i-th chromaticity component.

[0532] In some embodiments, the limiting range includes the maximum limiting value. The limiting unit 24 is specifically configured to determine the first predicted value as the second predicted value if the first predicted value is less than or equal to the maximum limiting value; and to determine the maximum limiting value as the second predicted value if the first predicted value is greater than the maximum limiting value.

[0533] In some embodiments, the defined range includes the minimum defined value. The defining unit 24 is specifically configured to determine the first predicted value as the second predicted value if the first predicted value is greater than the minimum defined value, and to determine the minimum defined value as the second predicted value if the first predicted value is less than the minimum defined value.

[0534] In some embodiments, the defined range includes the minimum defined value and the maximum defined value. The defining unit 24 is specifically configured to: if the first predicted value is less than or equal to the maximum defined value and greater than or equal to the minimum defined value, then determine the first predicted value as the second predicted value; if the first predicted value is greater than the maximum defined value, then determine the maximum defined value as the second predicted value; if the first predicted value is less than the minimum defined value, then determine the minimum defined value as the second predicted value.

[0535] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, they will not be repeated here. Specifically, the device 20 shown in FIG14 can correspond to the corresponding subject in the encoding method of the encoding end of the embodiments of this application, and the foregoing and other operations and / or functions of each unit in the device 20 are respectively for implementing the corresponding processes in the encoding method of the encoding end and other methods. For the sake of brevity, they will not be repeated here.

[0536] The apparatus and system of the embodiments of this application have been described above from the perspective of functional units in conjunction with the accompanying drawings. It should be understood that these functional units can be implemented in hardware, in software instructions, or in a combination of hardware and software units. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the methods disclosed in the embodiments of this application can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software units in the decoding processor. Optionally, the software unit can be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.

[0537] Figure 15 is a schematic block diagram of an electronic device provided in an embodiment of this application.

[0538] As shown in Figure 15, the electronic device 30 can be the video encoder or video decoder described in the embodiments of this application. The electronic device 30 may include:

[0539] The system includes a memory 33 for storing a computer program 34 and a processor 32 for transferring the program code 34 to the processor 32. In other words, the processor 32 can retrieve and run the computer program 34 from the memory 33 to implement the methods described in the embodiments of this application.

[0540] For example, the processor 32 can be used to execute the steps in the method 200 described above according to the instructions in the computer program 34.

[0541] In some embodiments of this application, the processor 32 may include, but is not limited to:

[0542] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0543] In some embodiments of this application, the memory 33 includes, but is not limited to:

[0544] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

[0545] In some embodiments of this application, the computer program 34 may be divided into one or more units, which are stored in the memory 33 and executed by the processor 32 to perform the method provided in this application. The one or more units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 34 in the electronic device 30.

[0546] As shown in Figure 15, the electronic device 30 may further include:

[0547] Transceiver 33, which can be connected to processor 32 or memory 33.

[0548] The processor 32 can control the transceiver 33 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 33 may include a transmitter and a receiver. The transceiver 33 may further include antennas, and the number of antennas may be one or more.

[0549] It should be understood that the various components in the electronic device 30 are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.

[0550] Figure 16 is a schematic block diagram of a video encoding and decoding system provided in an embodiment of this application.

[0551] As shown in Figure 16, the video encoding and decoding system 40 may include a video encoder 41 and a video decoder 42, wherein the video encoder 41 is used to execute the video encoding method involved in the embodiments of this application, and the video decoder 42 is used to execute the video decoding method involved in the embodiments of this application.

[0552] This application also provides a computer storage medium storing a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.

[0553] This application also provides a bitstream generated according to the above encoding method.

[0554] When implemented using software, it can be implemented entirely or partially as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0555] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0556] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0557] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional units in the various embodiments of this application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0558] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method of video decoding, the method comprising: The method comprises the following steps: determining a prediction mode of a current chroma block; if the prediction mode is a cross-component intra prediction mode, determining a limited range of a prediction value of the current chroma block based on chroma values of a surrounding reconstructed area of the current chroma block, the limited range comprising at least one of a maximum limited value and a minimum limited value of the prediction value; determining a first prediction value of the current chroma block based on the cross-component intra prediction mode; determining a second prediction value of the current chroma block based on the first prediction value and the limited range.

2. The method of claim 1, wherein, The step of determining the prediction mode of the current chroma block comprises the following steps: decoding a code stream to obtain the prediction mode of the current chroma block.

3. The method of claim 2, wherein, The step of decoding the code stream to obtain the prediction mode of the current chroma block comprises the following steps: decoding the code stream to obtain a first prediction mode; determining the prediction mode of the current chroma block based on the first prediction mode.

4. The method of claim 3, wherein, The step of determining the prediction mode of the current chroma block based on the first prediction mode comprises the following steps: if the first prediction mode is a convolution cross-component model mode or a gradient linear model mode, determining the convolution cross-component model mode or the gradient linear model mode as the prediction mode of the current chroma block.

5. The method of claim 3, wherein, The step of determining the prediction mode of the current chroma block based on the first prediction mode comprises the following steps: if the first prediction mode is a cross-component merge mode, constructing a cross-component prediction mode list by inheriting cross-component intra prediction modes of chroma blocks surrounding and / or adjacent to the current chroma block; determining the prediction mode of the current chroma block based on the cross-component prediction mode list.

6. The method of claim 5, wherein, The step of determining the prediction mode of the current chroma block based on the cross-component prediction mode list comprises the following steps: decoding the code stream to obtain a mode index; determining the prediction mode of the current chroma block in the cross-component prediction mode list based on the mode index.

7. The method of claim 1, wherein, Before the step of determining the limited range of the prediction value of the current chroma block, the method further comprises the following steps: determining a first flag corresponding to the current chroma block, the first flag being used to indicate whether the prediction value of the current chroma block is limited; The step of determining the limited range of the prediction value of the current chroma block comprises the following steps: if the first flag indicates that the prediction value of the current chroma block is limited, determining the limited range of the prediction value of the current chroma block.

8. The method of claim 7, wherein, The step of determining the first flag corresponding to the current chroma block comprises the following steps: if the first prediction mode obtained by decoding the code stream is a cross-component merge mode, determining a chroma block corresponding to a prediction mode inherited by the current chroma block; determining the first flag corresponding to the chroma block as the first flag corresponding to the current chroma block.

9. The method of claim 7, wherein, The step of determining the first flag corresponding to the current chroma block comprises the following steps: decoding the code stream to obtain the first flag corresponding to the current chroma block.

10. The method of claim 1, wherein, Before the step of determining the limited range of the prediction value of the current chroma block, the method further comprises the following steps: determining whether the current chroma block meets a preset condition; The step of determining the limited range of the prediction value of the current chroma block comprises the following steps: If the preset condition is met, a limit range of a prediction value of the current chroma block is determined.

11. The method of claim 10, wherein, The preset condition comprises at least one of: The current chroma block is not a first row chroma block of a current CTU; A size of the current chroma block meets a preset size; A shape of the current chroma block meets a preset shape.

12. The method of claim 5, wherein, The determination of the limit range of the prediction value of the current chroma block comprises: A chroma block corresponding to a prediction mode inherited by the current chroma block is determined; The limit range of the prediction value of the chroma block is determined as the limit range of the prediction value of the current chroma block.

13. The method according to any one of claims 1 to 11, characterized in that, The determination of the limit range of the prediction value of the current chroma block comprises: The limit range of the prediction value of the current chroma block is determined based on chroma values of surrounding reconstructed regions of the current chroma block.

14. The method of claim 13, wherein, The determination of the limit range of the prediction value of the current chroma block based on the chroma values of the surrounding reconstructed regions of the current chroma block comprises: the limit range of the prediction value of the current chroma block in the i-th chroma component is determined based on the chroma values of the surrounding reconstructed regions in the i-th chroma component, where i is a positive integer. The determination of the first prediction value of the current chroma block based on the cross-component intra prediction mode comprises: the first prediction value of the current chroma block in the i-th chroma component is determined based on the cross-component intra prediction mode. The determination of the second prediction value of the current chroma block based on the first prediction value and the limit range comprises: the second prediction value of the current chroma block in the i-th chroma component is determined based on the first prediction value in the i-th chroma component and the limit range in the i-th chroma component.

15. The method of claim 14, wherein, Before the determination of the limit range of the prediction value of the current chroma block in the i-th chroma component based on the chroma values of the surrounding reconstructed regions in the i-th chroma component, the method further comprises: A first surrounding reconstructed region of the current chroma block in the i-th component is determined. The determination of the limit range of the prediction value of the current chroma block in the i-th chroma component based on the chroma values of the surrounding reconstructed regions in the i-th chroma component comprises: The limit range of the prediction value of the current chroma block in the i-th chroma component is determined based on the first surrounding reconstructed region.

16. The method of claim 15, wherein, The determination of the first surrounding reconstructed region of the current chroma block in the i-th component comprises: If a prediction mode of the current chroma block is a convolution cross-component model mode, a second surrounding reconstructed region corresponding to the convolution cross-component model mode is determined; The first surrounding reconstructed region is determined based on the second surrounding reconstructed region.

17. The method of claim 16, wherein, The second surrounding reconstructed region comprises any one of a first type of reconstructed region, a second type of reconstructed region and a third type of reconstructed region, the first type of reconstructed region comprises an upper region, an upper-left region, an upper-right region, a left region and a lower-left region of the current chroma block, the second type of reconstructed region comprises the upper region, the upper-left region and the upper-right region of the current chroma block, and the third type of reconstructed region comprises the left region, the upper-left region and the lower-left region of the current chroma block.

18. The method of claim 17, wherein, The determining the first surrounding reconstructed region based on the second surrounding reconstructed region comprises: if the second surrounding reconstructed region is the second type of reconstructed region, determining the first surrounding reconstructed region as the second type of reconstructed region; or if the second surrounding reconstructed region is the third type of reconstructed region, determining the first surrounding reconstructed region as the third type of reconstructed region.

19. The method of claim 15, wherein, The first surrounding reconstructed region comprises at least one of N types of preset reconstructed regions, and N is a positive integer.

20. The method of claim 19, wherein, The N types of reconstructed regions comprise five types of reconstructed regions, the first type of reconstructed region comprises the upper, upper-left and left regions of the current chroma block, the second type of reconstructed region comprises the upper and upper-right regions of the current chroma block, the third type of reconstructed region comprises the upper region of the current chroma block, the fourth type of reconstructed region comprises the upper-left and left regions of the current chroma block, and the fifth type of reconstructed region comprises the left region of the current chroma block.

21. The method of claim 14, wherein, The determining the limited range of the prediction value of the current chroma block in the i-th chroma component based on the chroma value of the surrounding reconstructed region in the i-th chroma component comprises: determining the maximum chroma value of the surrounding reconstructed region in the i-th chroma component as the maximum limited value of the prediction value of the current chroma block in the i-th chroma component; and / or determining the minimum chroma value of the surrounding reconstructed region in the i-th chroma component as the minimum limited value of the prediction value of the current chroma block in the i-th chroma component.

22. The method of claim 14, wherein, The limited range comprises the maximum limited value, and the determining the second prediction value of the current chroma block in the i-th chroma component based on the first prediction value in the i-th chroma component and the limited range in the i-th chroma component comprises: if the first prediction value is less than or equal to the maximum limited value, determining the first prediction value as the second prediction value; or if the first prediction value is greater than the maximum limited value, determining the maximum limited value as the second prediction value.

23. The method of claim 14, wherein, The limited range comprises the minimum limited value, and the determining the second prediction value of the current chroma block in the i-th chroma component based on the first prediction value in the i-th chroma component and the limited range in the i-th chroma component comprises: if the first prediction value is greater than the minimum limited value, determining the first prediction value as the second prediction value; or if the first prediction value is less than the minimum limited value, determining the minimum limited value as the second prediction value.

24. The method of claim 14, wherein, The limited range comprises the minimum limited value and the maximum limited value, and the determining the second prediction value of the current chroma block in the i-th chroma component based on the first prediction value in the i-th chroma component and the limited range in the i-th chroma component comprises: if the first prediction value is less than or equal to the maximum limited value and greater than or equal to the minimum limited value, determining the first prediction value as the second prediction value; or if the first prediction value is greater than the maximum limited value or less than the minimum limited value, determining the second prediction value as the limited value. if the first prediction value is greater than the maximum limit value, determining the maximum limit value as the second prediction value; if the first prediction value is less than the minimum limit value, determining the minimum limit value as the second prediction value.

25. A method of video coding, the method comprising: The method comprises: determining a prediction mode of a current chroma block; if the prediction mode is a cross-component intra prediction mode, determining a limit range of a prediction value of the current chroma block based on chroma values of a surrounding already reconstructed area of the current chroma block, the limit range comprising at least one of a maximum limit value and a minimum limit value of the prediction value; determining a first prediction value of the current chroma block based on the cross-component intra prediction mode; determining a second prediction value of the current chroma block based on the first prediction value and the limit range.

26. The method of claim 25, wherein, The determining of the prediction mode of the current chroma block comprises: determining a first prediction mode; determining the prediction mode of the current chroma block based on the first prediction mode.

27. The method of claim 26, wherein, The determining of the prediction mode of the current chroma block based on the first prediction mode comprises: if the first prediction mode is a convolution cross-component model mode or a gradient linear model mode, determining the convolution cross-component model mode or the gradient linear model mode as the prediction mode of the current chroma block.

28. The method of claim 26, wherein, The determining of the prediction mode of the current chroma block based on the first prediction mode comprises: if the first prediction mode is a cross-component merge mode, constructing a cross-component prediction mode list by inheriting cross-component intra prediction modes of surrounding chroma blocks of the current chroma block which are adjacent and / or non-adjacent to the current chroma block; determining the prediction mode of the current chroma block based on the cross-component prediction mode list.

29. The method of claim 28, wherein, The method further comprises: writing a mode index of the prediction mode of the current chroma block in the cross-component prediction mode list into a bitstream.

30. The method of claim 25, wherein, The method further comprises: writing the prediction mode of the current chroma block into a bitstream.

31. The method of claim 25, wherein, Before the determining of the limit range of the prediction value of the current chroma block, the method further comprises: determining a first flag corresponding to the current chroma block, the first flag being used to indicate whether the prediction value of the current chroma block is limited or not; The determining of the limit range of the prediction value of the current chroma block comprises: if the first flag indicates that the prediction value of the current chroma block is limited, determining the limit range of the prediction value of the current chroma block.

32. The method of claim 31, wherein, The determining of the first flag corresponding to the current chroma block comprises: determining a first prediction mode; if the first prediction mode is a cross-component merge mode, determining a chroma block corresponding to a prediction mode inherited by the current chroma block; determining the first flag corresponding to the chroma block as the first flag corresponding to the current chroma block.

33. The method of claim 31, wherein, The method further comprises: writing the first flag corresponding to the current chroma block into a bitstream.

34. The method of claim 25, wherein, Before the determining of the limit range of the prediction value of the current chroma block, the method further comprises: determining whether the current chroma block satisfies a preset condition or not; The determining of the limit range of the prediction value of the current chroma block comprises: If the preset condition is met, a limit range of a prediction value of the current chroma block is determined.

35. The method of claim 34, wherein, The preset condition comprises at least one of: The current chroma block is not a first row chroma block of a current CTU; A size of the current chroma block meets a preset size; A shape of the current chroma block meets a preset shape.

36. The method of claim 28, wherein, The determination of the limit range of the prediction value of the current chroma block comprises: A chroma block corresponding to a prediction mode inherited by the current chroma block is determined; The limit range of the prediction value of the chroma block is determined as the limit range of the prediction value of the current chroma block.

37. The method of any one of claims 25-35, wherein, The determination of the limit range of the prediction value of the current chroma block comprises: The limit range of the prediction value of the current chroma block is determined based on chroma values of surrounding reconstructed regions of the current chroma block.

38. The method of claim 37, wherein, The determination of the limit range of the prediction value of the current chroma block based on the chroma values of the surrounding reconstructed regions of the current chroma block comprises: the limit range of the prediction value of the current chroma block in the i-th chroma component is determined based on the chroma values of the surrounding reconstructed regions in the i-th chroma component, where i is a positive integer. The determination of the first prediction value of the current chroma block based on the cross-component intra prediction mode comprises: the first prediction value of the current chroma block in the i-th chroma component is determined based on the cross-component intra prediction mode. The determination of the second prediction value of the current chroma block based on the first prediction value and the limit range comprises: the second prediction value of the current chroma block in the i-th chroma component is determined based on the first prediction value in the i-th chroma component and the limit range in the i-th chroma component.

39. The method of claim 38, wherein, Before the determination of the limit range of the prediction value of the current chroma block in the i-th chroma component based on the chroma values of the surrounding reconstructed regions in the i-th chroma component, the method further comprises: A first surrounding reconstructed region of the current chroma block in the i-th component is determined. The determination of the limit range of the prediction value of the current chroma block in the i-th chroma component based on the chroma values of the surrounding reconstructed regions in the i-th chroma component comprises: The limit range of the prediction value of the current chroma block in the i-th chroma component is determined based on the first surrounding reconstructed region.

40. The method of claim 39, wherein, The determination of the first surrounding reconstructed region of the current chroma block in the i-th component comprises: If a prediction mode of the current chroma block is a convolution cross-component model mode, a second surrounding reconstructed region corresponding to the convolution cross-component model mode is determined; The first surrounding reconstructed region is determined based on the second surrounding reconstructed region.

41. The method of claim 40, wherein, The second surrounding reconstructed region comprises any one of a first type of reconstructed region, a second type of reconstructed region and a third type of reconstructed region, the first type of reconstructed region comprises an upper region, an upper-left region, an upper-right region, a left region and a lower-left region of the current chroma block, the second type of reconstructed region comprises the upper region, the upper-left region and the upper-right region of the current chroma block, and the third type of reconstructed region comprises the left region, the upper-left region and the lower-left region of the current chroma block.

42. The method of claim 41, wherein, The determining the first surrounding reconstructed region based on the second surrounding reconstructed region comprises: if the second surrounding reconstructed region is the second type of reconstructed region, determining the first surrounding reconstructed region as the second type of reconstructed region; or if the second surrounding reconstructed region is the third type of reconstructed region, determining the first surrounding reconstructed region as the third type of reconstructed region.

43. The method of claim 39, wherein, The first surrounding reconstructed region comprises at least one of N types of preset reconstructed regions, and N is a positive integer.

44. The method of claim 43, wherein, The N types of reconstructed regions comprise five types of reconstructed regions, the first type of reconstructed region comprises the upper, upper-left and left regions of the current chroma block, the second type of reconstructed region comprises the upper and upper-right regions of the current chroma block, the third type of reconstructed region comprises the upper region of the current chroma block, the fourth type of reconstructed region comprises the upper-left and left regions of the current chroma block, and the fifth type of reconstructed region comprises the left region of the current chroma block.

45. The method of claim 38, wherein, The determining the limited range of the prediction value of the current chroma block in the i-th chroma component based on the chroma value of the surrounding reconstructed region in the i-th chroma component comprises: determining the maximum chroma value of the surrounding reconstructed region in the i-th chroma component as the maximum limited value of the prediction value of the current chroma block in the i-th chroma component; and / or determining the minimum chroma value of the surrounding reconstructed region in the i-th chroma component as the minimum limited value of the prediction value of the current chroma block in the i-th chroma component.

46. The method of claim 38, wherein, The limited range comprises the maximum limited value, and the determining the second prediction value of the current chroma block in the i-th chroma component based on the first prediction value in the i-th chroma component and the limited range in the i-th chroma component comprises: if the first prediction value is less than or equal to the maximum limited value, determining the first prediction value as the second prediction value; or if the first prediction value is greater than the maximum limited value, determining the maximum limited value as the second prediction value.

47. The method of claim 38, wherein, The limited range comprises the minimum limited value, and the determining the second prediction value of the current chroma block in the i-th chroma component based on the first prediction value in the i-th chroma component and the limited range in the i-th chroma component comprises: if the first prediction value is greater than the minimum limited value, determining the first prediction value as the second prediction value; or if the first prediction value is less than the minimum limited value, determining the minimum limited value as the second prediction value.

48. The method of claim 38, wherein, The limited range comprises the minimum limited value and the maximum limited value, and the determining the second prediction value of the current chroma block in the i-th chroma component based on the first prediction value in the i-th chroma component and the limited range in the i-th chroma component comprises: if the first prediction value is less than or equal to the maximum limited value and greater than or equal to the minimum limited value, determining the first prediction value as the second prediction value; or if the first prediction value is greater than the maximum limited value or less than the minimum limited value, determining the second prediction value as the limited value. if the first prediction value is greater than the maximum limit value, determining the maximum limit value as the second prediction value; if the first prediction value is less than the minimum limit value, determining the minimum limit value as the second prediction value.

49. An apparatus for video decoding, the apparatus comprising: The method comprises: determining a prediction mode of a current chroma block; if the prediction mode is a cross-component intra prediction mode, determining a limit range of a prediction value of the current chroma block based on chroma values of surrounding reconstructed areas of the current chroma block, the limit range comprising at least one of a maximum limit value and a minimum limit value of the prediction value; determining a first prediction value of the current chroma block based on the cross-component intra prediction mode; determining a second prediction value of the current chroma block based on the first prediction value and the limit range.

50. A video encoding device, comprising: The method comprises: determining a prediction mode of a current chroma block; if the prediction mode is a cross-component intra prediction mode, determining a limit range of a prediction value of the current chroma block based on chroma values of surrounding reconstructed areas of the current chroma block, the limit range comprising at least one of a maximum limit value and a minimum limit value of the prediction value; determining a first prediction value of the current chroma block based on the cross-component intra prediction mode; determining a second prediction value of the current chroma block based on the first prediction value and the limit range.

51. An electronic device, comprising: The method comprises: a processor and a memory; the memory is configured to store a computer program; 52. A video coding system, comprising: the processor is configured to invoke and run the computer program stored in the memory, so as to implement the method of any one of claims 1-24 or 25-48. The method comprises: a video encoder and a video decoder; the video decoder is configured to implement the method of any one of claims 1-24; 53. A computer-readable storage medium, comprising: the video encoder is configured to implement the method of any one of claims 25-48. The computer program is configured to enable a computer to perform the method of any one of claims 1-24 or 25-48.