Video encoding method and apparatus, video decoding method and apparatus, device, system, and storage medium
By limiting the predicted values of chroma blocks in the cross-component intra-frame prediction mode, the problem of inaccurate chroma prediction is solved, and the performance of video encoding and decoding is improved.
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
- 2024-12-05
AI Technical Summary
The existing technology for chroma prediction based on cross-component intra-frame prediction mode has accuracy problems, which leads to a decrease in video encoding and decoding performance.
When the prediction mode of the current chroma block is determined to be the cross-component intra-prediction mode, the range of its prediction values is limited, including the maximum and minimum limits. The first prediction value is determined by the cross-component intra-prediction mode, and the second prediction value is determined based on the limited range, so as to avoid the prediction value being too large or too small.
It improves the prediction accuracy of chroma blocks and enhances video encoding and decoding performance.
Smart Images

Figure CN2023096641_05122024_PF_FP_ABST
Abstract
Description
Video encoding and decoding method, device, equipment, system, and storage medium Technical Field
[0001] The present application relates to the field of video coding and decoding technology, and in particular to a video coding and decoding method, apparatus, device, system, and storage medium. Background Art
[0002] Digital video technology can be incorporated into a variety of video devices, such as digital televisions, smartphones, computers, e-readers, or video players. With the development of video technology, the amount of video data included has increased. To facilitate the transmission of video data, video devices implement video compression technology to enable more efficient transmission or storage of video data.
[0003] Since there is temporal or spatial redundancy in the video, prediction can eliminate or reduce the redundancy in the video and improve the compression efficiency. Currently, the chrominance prediction based on the cross-component intra-frame prediction mode has the problem of inaccurate prediction.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide a video encoding and decoding method, apparatus, device, system, and storage medium, which can improve the prediction effect of the current chroma block and improve the encoding and decoding performance.
[0006] In a first aspect, the present application provides a video decoding method, applied to a decoder, comprising:
[0007] Determine the prediction mode of the current chroma block;
[0008] If the prediction mode is an inter-component intra prediction mode, determining a limited range of a prediction value of the current chroma block based on chroma values of a reconstructed area surrounding the current chroma block, the limited range including at least one of a maximum limited value and a minimum limited value of the prediction value;
[0009] determining a first prediction value for the current chroma block based on the cross-component intra prediction mode;
[0010] Based on the first prediction value and the limited range, a second prediction value of the current chroma block is determined.
[0011] In a second aspect, an embodiment of the present application provides a video encoding method, applied to an encoder, comprising:
[0012] Determine the prediction mode of the current chroma block;
[0013] If the prediction mode is an inter-component intra prediction mode, determining a limited range of a prediction value of the current chroma block based on chroma values of a reconstructed area surrounding the current chroma block, the limited range including at least one of a maximum limited value and a minimum limited value of the prediction value;
[0014] determining a first prediction value for the current chroma block based on the cross-component intra prediction mode;
[0015] Based on the first prediction value and the limited range, a second prediction value of the current chroma block is determined.
[0016] In a third aspect, the present application provides a video decoding device for executing the method of the first aspect or its respective implementations. Specifically, the device includes a functional unit for executing the method of the first aspect or its respective implementations.
[0017] In a fourth aspect, the present application provides a video encoding device for executing the method of the second aspect or its respective implementations. Specifically, the device includes a functional unit for executing the method of the second aspect or its respective implementations.
[0018] In a fifth aspect, the present application provides a video decoder comprising a processor and a memory, wherein the memory is configured to store a computer program, and the processor is configured to call and execute the computer program stored in the memory to perform the method of the first aspect or its respective implementations.
[0019] In a sixth aspect, the present application provides a video encoder comprising a processor and a memory, wherein the memory is configured to store a computer program, and the processor is configured to call and execute the computer program stored in the memory to perform the method of the second aspect or its respective implementations.
[0020] In a seventh aspect, the present application provides a video encoding and decoding system, comprising a video encoder and a video decoder. The video decoder is configured to execute the method of the first aspect or its respective implementations, and the video encoder is configured to execute the method of the second aspect or its respective implementations.
[0021] In an eighth aspect, the present application provides a chip for implementing the method of any one of the first and second aspects above, or their respective implementations. Specifically, the chip includes: a processor for calling and executing a computer program from a memory, so that a device equipped with the chip executes the method of any one of the first and second aspects above, or their respective implementations.
[0022] In a ninth aspect, the present application provides a computer-readable storage medium for storing a computer program, which enables a computer to execute the method of any one of the first to second aspects above or any of their implementations.
[0023] In a tenth aspect, the present application provides a computer program product, comprising computer program instructions, which enable a computer to execute the method of any one of the above-mentioned first to second aspects or their respective implementations.
[0024] In an eleventh aspect, the present application provides a computer program which, when executed on a computer, enables the computer to execute the method in 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 prediction value of the current chroma block is determined, and the limited range includes at least one of a maximum limited value and a minimum limited value of the prediction value; then, based on the cross-component intra-frame prediction mode, a first prediction value of the current chroma block is determined; based on the first prediction value and the limited range, a second prediction value of the current chroma block is determined. That is, in an embodiment of the present application, if the current chroma block adopts a cross-component intra-frame prediction mode, the first prediction value determined by the cross-component intra-frame prediction mode is limited to avoid the prediction value of the current chroma block being too large or too small, thereby improving the prediction accuracy of the current chroma block and improving video encoding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] FIG1 is a schematic block diagram of a video encoding and decoding system according to an embodiment of the present application;
[0027] FIG2 is a schematic block diagram of a video encoder according to an embodiment of the present application;
[0028] FIG3 is a schematic block diagram of a video decoder according to an embodiment of the present application;
[0029] FIG4A is a schematic diagram of intra-frame prediction;
[0030] FIG4B is a schematic diagram of intra-frame prediction;
[0031] 5A-5I are schematic diagrams of intra-frame prediction;
[0032] Figure 6A is a schematic diagram of CCLM prediction;
[0033] FIG6B is a schematic diagram showing the spatial position relationship of the cross convolution filter input in CCCM;
[0034] FIG6C is a schematic diagram of a reconstruction area for determining filter coefficients;
[0035] FIG6D is a schematic diagram of four Sobel operators used to obtain gradients in GLM;
[0036] FIG6E is a schematic diagram of adjacent positions of the current chroma block;
[0037] FIG7 is a flow chart of a video decoding method according to an embodiment of the present application;
[0038] 8A and 8B are schematic diagrams of a reconstruction area;
[0039] 9A to 9C are schematic diagrams of several reconstruction regions for determining model parameters in CCCM;
[0040] 10A to 10C are schematic diagrams of a first surrounding reconstructed area corresponding to FIG. 9A to FIG. 9C ;
[0041] 11A to 11E are schematic diagrams of several first peripheral reconstructed areas;
[0042] FIG12 is a flow chart of a prediction method according to an embodiment of the present application;
[0043] FIG13 is a schematic block diagram of a video decoding device provided in an embodiment of the present application;
[0044] FIG14 is a schematic block diagram of a video encoding apparatus according to an embodiment of the present application;
[0045] FIG15 is a schematic block diagram of an electronic device provided in an embodiment of the present application;
[0046] FIG16 is a schematic block diagram of a video encoding and decoding system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The present application can be applied to the field of image coding and decoding, the field of video coding and decoding, the field of hardware video coding and decoding, the field of dedicated circuit video coding and decoding, the field of real-time video coding and decoding, etc. For example, the solution of the present application can be combined with an audio and video coding standard (AVS), such as the H.264 / audio and video coding (AVC) standard, the H.265 / high efficiency video coding (HEVC) standard, and the H.266 / versatile video coding (VVC) standard. Alternatively, the solution of the present application can be combined with other proprietary or industry standards and operated, and the standards include 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), including scalable video coding (SVC) and multi-view video coding (MVC) extensions. It should be understood that the technology of this application is not limited to any specific coding standard or technology.
[0048] For ease of understanding, the video encoding and decoding system involved in the embodiment of the present application is first introduced with reference to FIG1 .
[0049] FIG1 is a schematic block diagram of a video encoding and decoding system involved in an embodiment of the present application. It should be noted that FIG1 is only an example, and the video encoding and decoding system of the embodiment of the present application includes but is not limited to that shown in FIG1. As shown in FIG1, the video encoding and decoding system 100 includes an encoding device 110 and a decoding device 120. The encoding device is used to encode (which can be understood as compressing) the video data to generate a code stream, and transmit the code stream to the decoding device. The decoding device decodes the code stream generated by the encoding device to obtain decoded video data.
[0050] The encoding device 110 of the embodiment of the present application can be understood as a device with a video encoding function, and the decoding device 120 can be understood as a device with a video decoding function, that is, the embodiment of the present application includes a wider range of devices for the encoding device 110 and the decoding device 120, such as smartphones, desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, car computers, etc.
[0051] In some embodiments, the encoding device 110 may transmit the encoded video data (eg, a code stream) to the decoding device 120 via a channel 130. The channel 130 may include one or more media and / or devices capable of transmitting the encoded video data from the encoding device 110 to the decoding device 120.
[0052] In one example, the channel 130 includes one or more communication media that enable the encoding device 110 to transmit the encoded video data directly to the decoding device 120 in real time. In this example, the encoding device 110 can modulate the encoded video data according to a communication standard and transmit the modulated video data to the 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 the video data encoded by encoding device 110. The storage medium includes various locally accessible data storage media, such as optical disks, DVDs, and flash memories. In this example, decoding device 120 can retrieve the encoded video data from the storage medium.
[0054] In another example, the channel 130 may include a storage server that can store the video data encoded by the encoding device 110. In this example, the decoding device 120 can download the stored encoded video data from the storage server. Alternatively, the storage server can store the encoded video data and transmit the encoded video data to the 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 further 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 acquisition device (eg, 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] The video encoder 112 encodes the video data from the 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 coding information of the picture or picture sequence in the form of a bitstream. The coding information may include the coded 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 that apply to one or more sequences. The PPS may contain parameters that apply to one or more pictures. The syntax structure refers to a set of zero or more syntax elements arranged in a specified order in 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 may also be stored in a storage medium or a storage server for subsequent reading 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, the decoding device 120 may further include a display device 123 in addition to the input interface 121 and the video decoder 122 .
[0062] The input interface 121 includes a receiver and / or a modem and can receive the encoded video data via the channel 130 .
[0063] The video decoder 122 is configured to decode the encoded video data to obtain decoded video data, and transmit the decoded video data to the display device 123 .
[0064] The decoded video data is displayed on the display device 123. The display device 123 may be integrated with the decoding device 120 or external to the decoding device 120. The display device 123 may include various display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.
[0065] In addition, Figure 1 is only an example, and the technical solution of the embodiment of the present application is not limited to Figure 1. For example, the technology of the present application can also be applied to unilateral video encoding or unilateral video decoding.
[0066] The following is an introduction to the video encoding framework involved in the embodiments of the present application.
[0067] FIG2 is a schematic block diagram of a video encoder according to an embodiment of the present application. It should be understood that the video encoder 200 can be used to perform lossy compression or lossless compression on an image. The lossless compression can be visually lossless or mathematically lossless.
[0068] The video encoder 200 can be applied to image data in a luminance and chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents brightness (Luma), Cb (U) represents blue chrominance, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) for describing color and saturation. For example, in terms of color format, 4:2:0 means that every 4 pixels have 4 luminance components and 2 chrominance components (YYYYCbCr), 4:2:2 means that every 4 pixels have 4 luminance components and 4 chrominance components (YYYYCbCrCbCr), and 4:4:4 represents full pixel display (YYYYCbCrCbCrCbCrCbCr).
[0069] For example, the video encoder 200 reads video data, and for each frame of the video data, divides the frame into a number of coding tree units (CTUs). In some examples, CTB may be referred to as a "tree block", "largest coding unit" (LCU) or "coding tree block" (CTB). Each CTU may be associated with a pixel block of equal size within the image. Each pixel may correspond to a luminance (luminance or luma) sample and two chrominance (chroma) samples. Therefore, each CTU may be associated with a luminance sample block and two chroma sample blocks. The size of a CTU is, for example, 128×128, 64×64, 32×32, etc. A CTU can be further divided into a number of coding units (CUs) for encoding. The CU may be a rectangular block or a square block. A CU can be further divided into prediction units (PUs) and transform units (TUs), allowing for separation of coding, prediction, and transform, and greater flexibility in processing. In one example, a CTU is divided into CUs using a quadtree, and a CU is divided into TUs and PUs using a quadtree.
[0070] The video encoder and video decoder can support various PU sizes. Assuming that the size of a particular CU is 2N×2N, the video encoder and video decoder can support PU sizes of 2N×2N or N×N for intra-frame prediction, and support symmetric PUs of 2N×2N, 2N×N, N×2N, N×N, or similar sizes for inter-frame prediction. The video encoder and video 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 filter 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 may be referred to as the current coding unit (CU) or the current prediction unit (PU), etc. The prediction block may also be referred to as a predicted image block or an image prediction block, and the reconstructed image block may also be referred to as a reconstructed block or an image reconstructed image 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 video frame, intra-frame prediction is used in video coding and decoding technologies 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 coding and decoding technologies to eliminate temporal redundancy between adjacent frames, thereby improving coding efficiency.
[0074] The inter-frame prediction unit 211 is used for inter-frame prediction. Inter-frame prediction includes motion estimation and motion compensation. It can refer to image information from different frames. Inter-frame prediction uses motion information to find a reference block from a 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. P-frames refer to forward-predicted frames, while B-frames refer to bidirectionally predicted frames. Inter-frame prediction uses motion information to find a reference block from a reference frame and generates a prediction block based on the reference block. Motion information includes the reference frame list in which the reference frame is located, the reference frame index, and the motion vector. The motion vector can be integer pixel or fractional pixel. If the motion vector is fractional pixel, interpolation filtering is required to generate the required fractional pixel block in the reference frame. Here, the integer pixel or fractional pixel block in the reference frame found based on the motion vector is called a reference block. Some technologies directly use the reference block as the prediction block, while others further process the reference block to generate a prediction block. Reprocessing the reference block to generate a prediction block can also be understood as using the reference block as the prediction block and then processing the prediction block to generate a new prediction block.
[0075] The intra-frame prediction unit 212 only refers to the information of the same frame image to predict the pixel information in the current code image block to eliminate spatial redundancy. The frame used for intra-frame prediction can be an I frame.
[0076] Intra-frame prediction has multiple prediction modes. For example, the H-series international digital video coding standard H.264 / AVC has eight angular prediction modes and one non-angular prediction mode. H.265 / HEVC expands this to 33 angular prediction modes and two 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 of angle modes, intra-frame prediction will be more accurate and more in line with the needs of the development of high-definition and ultra-high-definition digital videos.
[0078] The residual unit 220 may generate a residual block for the CU based on the pixel blocks of the CU and the prediction blocks of the PUs of the CU. For example, the residual unit 220 may generate the residual block for the CU such that each sample in the residual block has a value equal to the difference between the sample in the pixel blocks of the CU and the corresponding sample in the prediction blocks of the PUs of the CU.
[0079] The transform / quantization unit 230 may quantize the transform coefficients. The transform / quantization unit 230 may quantize the transform coefficients associated with the TUs of a CU based on a quantization parameter (QP) value associated with the CU. The video encoder 200 may 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 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficients to reconstruct a residual block from the quantized transform coefficients.
[0081] Reconstruction unit 250 may add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by prediction unit 210 to generate a reconstructed image block associated with the TU. By reconstructing the sample blocks of each TU of a CU in this manner, video encoder 200 can reconstruct the pixel blocks of the CU.
[0082] The loop filter unit 260 is used to process the inverse transformed and inverse quantized pixels to compensate for distortion information and provide a better reference for subsequent coded pixels. For example, it can perform a deblocking filtering operation to reduce the blocking 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 offset / adaptive loop filtering (SAO / ALF) unit, wherein the deblocking filtering unit is used to remove blocking effects, and the SAO / ALF unit is used to remove ringing effects.
[0084] The decoded image buffer 270 may store the reconstructed pixel blocks. The inter-prediction unit 211 may use a reference image containing the reconstructed pixel blocks to perform inter-prediction on PUs of other images. In addition, the intra-prediction unit 212 may use the reconstructed pixel blocks in the decoded image buffer 270 to perform intra-prediction on other PUs in the same image as the CU.
[0085] The entropy coding unit 280 may receive the quantized transform coefficients from the transform / quantization unit 230. The entropy coding unit 280 may perform one or more entropy coding operations on the quantized transform coefficients to generate entropy-coded data.
[0086] FIG3 is a schematic block diagram of a video decoder according to an embodiment of the present application.
[0087] 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 filter unit 350, and a decoded picture buffer 360. It should be noted that the video decoder 300 may include more, fewer, or different functional components.
[0088] The video decoder 300 may receive a bitstream. The entropy decoding unit 310 may parse the bitstream to extract syntax elements from the bitstream. As part of parsing the bitstream, the entropy decoding unit 310 may parse the entropy-encoded syntax elements in the bitstream. The prediction unit 320, the inverse quantization / transform unit 330, the reconstruction unit 340, and the loop filter unit 350 may decode the video data based on the syntax elements extracted from the bitstream, thereby generating 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] The intra-prediction unit 322 may perform intra-prediction to generate a prediction block for the PU. The intra-prediction unit 322 may use an intra-prediction mode to generate a prediction block for the PU based on pixel blocks of spatially neighboring PUs. The intra-prediction unit 322 may also determine the intra-prediction mode for the PU based on one or more syntax elements parsed from the codestream.
[0091] The inter-frame prediction unit 321 may construct a first reference picture list (List 0) and a second reference picture list (List 1) based on syntax elements parsed from the codestream. In addition, if a PU is encoded using inter-frame prediction, the entropy decoding unit 310 may parse the motion information of the PU. The inter-frame prediction unit 321 may determine one or more reference blocks for the PU based on the motion information of the PU. The inter-frame prediction unit 321 may generate a prediction block for the PU based on the one or more reference blocks of the PU.
[0092] The inverse quantization / transform unit 330 may inversely quantize (ie, dequantize) the transform coefficients associated with the TU. The inverse quantization / transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization.
[0093] After inverse quantizing the transform coefficients, the inverse quantization / transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients in order 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 samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU to obtain a reconstructed image block.
[0095] The loop filtering unit 350 may perform a deblocking filtering operation to reduce blocking artifacts of pixel blocks associated with a CU.
[0096] The video decoder 300 may store the reconstructed image of the CU in the decoded image buffer 360. The video decoder 300 may 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 encoder end, a frame of 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 calculates a residual block based on the predicted block and the original block of the current block. This residual block is the difference between the predicted block and the original block of the current block. This residual block is also called residual information. This residual block undergoes transformation and quantization by the transform / quantization unit 230, removing information that is insensitive to the human eye and eliminating visual redundancy. Optionally, the residual block before transformation and quantization by the transform / quantization unit 230 is called a time-domain residual block, and the time-domain residual block after transformation and quantization by the transform / quantization unit 230 is 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 performs entropy coding on these 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 probability information of the binary bitstream.
[0098] At the decoding end, the entropy decoding unit 310 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block. The prediction unit 320 uses intra-frame prediction or inter-frame prediction for the current block based on the prediction information to generate a prediction block for the current block. The inverse quantization / transformation unit 330 uses the quantization coefficient matrix obtained from the code stream to inverse quantize and inverse transform the quantization coefficient matrix to obtain a residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed blocks constitute a reconstructed image, and the loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or block to obtain a decoded image. The encoding end also requires similar operations as the decoding end to obtain a decoded image. The decoded image can also be called a reconstructed image, and the reconstructed image can be used as a reference frame for inter-frame prediction for subsequent frames.
[0099] It should be noted that the block division information determined by the encoder, as well as mode information or parameter information such as prediction, transform, quantization, entropy coding, and loop filtering, etc., are carried in the bitstream when necessary. The decoder parses the bitstream and analyzes the existing information to determine the same block division information, prediction, transform, quantization, entropy coding, loop filtering, etc. mode information or parameter information as the encoder, thereby ensuring that the decoded image obtained by the encoder and the decoder are identical.
[0100] The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. This application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to the framework and process.
[0101] In the embodiments of the present application, the current block can be the current coding unit (CU) or the current prediction unit (PU). Due to the need for parallel processing, an image can be divided into slices, and slices within the same image can be processed in parallel, meaning that there is no data dependency between them. "Frame" is a commonly used term, generally understood to mean that a frame is an image. In the application, the term "frame" can also be replaced with "image" or "slice."
[0102] Intra-frame prediction typically uses both angular and non-angular modes to predict the current coding block to obtain a predicted block. Based on the rate-distortion information calculated between the predicted block and the original block, the optimal prediction mode for the current coding unit is selected and transmitted to the decoder via the bitstream. The decoder parses the prediction mode, generates a predicted image for the current decoding block, and superimposes it with the residual pixels transmitted via the bitstream to obtain a reconstructed image. Intra-frame prediction uses the already coded and decoded reconstructed pixels surrounding the current block as reference pixels to predict the current block. Figure 4A illustrates intra-frame prediction. As shown in Figure 4A, the current block is 4x4 in size. The pixels in the row to the left and the column above the current block serve as reference pixels for the current block. Intra-frame prediction uses these reference pixels to predict the current block. These reference pixels may all be available, meaning they have already been coded and decoded. However, some may not be available. For example, if the current block is at the leftmost edge of the frame, the reference pixels to the left of the current block may not be available. Alternatively, when encoding and decoding the current block, the lower left portion of the current block has not yet been coded and decoded, making the reference pixels to the lower left unavailable. In the case where reference pixels are unavailable, available reference pixels or certain values or methods may be used for filling, or no filling may be performed.
[0103] FIG4B is a schematic diagram of intra prediction. As shown in FIG4B , the multiple reference line (MRL) intra prediction method can use more reference pixels to improve encoding and decoding efficiency. For example, four reference rows / columns are used as reference pixels of the current block.
[0104] Furthermore, intra-frame prediction has multiple prediction modes. Figures 5A-5I are schematic diagrams of intra-frame prediction. As shown in Figures 5A-5I, intra-frame prediction for 4x4 blocks in H.264 mainly includes nine modes. Among them, mode 0, shown in Figure 5A, copies the pixels above the current block vertically to the current block as the prediction value. Mode 1, shown in Figure 5B, copies the reference pixels to the left of the current block horizontally as the prediction value. Mode 2 (DC), shown in Figure 5C, uses the average of the eight points A to D and I to L as the prediction value for all points. Modes 3 to 8, shown in Figures 5D-5I, copy the reference pixels to the corresponding positions in the current block at a specific angle. Because some positions in the current block cannot correspond exactly to the reference pixels, it may be necessary to use a weighted average of the reference pixels, or interpolated sub-pixels of the reference pixels.
[0105] In the field of video coding, component is a professional term, generally referring to the three components Y, Cb, and Cr (or Y, U, and V), where Y represents brightness information and Cb and Cr represent chrominance information.
[0106] In H.266, the luma component is already encoded and its reconstructed value is obtained before the chroma components of the CU are predictively encoded. To remove redundancy between different color channels, the cross-component intra prediction mode is proposed. Its concept is to use the reconstructed luma block to predict the current chroma block to be predicted. The prediction process requires constructing a linear or nonlinear relationship between luma and chroma based on the reconstructed luma and chroma pixel values.
[0107] In some embodiments, cross-component intra prediction modes include but are not limited to the following: cross-component linear model prediction (Cross Component Linear Model, CCLM for short), convolutional cross component model (Convolutional cross component model, CCCM for short), gradient linear model (Gradient linear model, GLM for short), and cross-component merge mode (Cross component merge mode, CCMerge for short).
[0108] CCLM refers to the linear relationship between the luminance reconstruction value and the chrominance reconstruction value of the reference pixel, and calculates the chrominance prediction pixel value based on the luminance reconstruction value of the pixel to be predicted. For example, as shown in Figure 6A, for the YUV420 format, the luminance component needs to be downsampled to maintain the same spatial resolution as the chrominance components. Then, the linear model parameters are calculated based on the luminance and chrominance of the reference pixel, and the chrominance prediction value is then calculated using the luminance reconstruction value.
[0109] For example, the linear model can be of slope-intercept form:
[0110] C(x,y)=αXL(x,y)+β(1)
[0111] Among them, C and L are the chrominance pixel value and 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, in that it also predicts chrominance pixels from reconstructed luminance pixels. However, CCCM no longer derives simple alpha and beta coefficients, but rather a set of convolution filter coefficients. CCCM also supports deriving two sets of convolution filter coefficients per block, with the use of a threshold controlling which set is used.
[0113] In one example, the convolution filter used by CCCM is a 7-tap filter, which consists of a 5-tap cross filter, a nonlinear term, and a bias term. As shown in Figure 6B, the input of the 5-tap cross filter consists of the center (Center, C) luma sample (the downsampled luma sample at the position corresponding to the current chroma prediction position), the above (Above / North, N) luma sample, the below (Below / South, S) luma sample, the left (Left / West, W) luma sample, and the right (Right / East, E) luma sample.
[0114] The nonlinear term P is determined by the bit depth of the pixel value of the current prediction block and the luminance input sample C at the middle position. For example, the nonlinear term P is determined by the following formula (2): P = (C × C + (1 < < (bitDepth-1))) >> bitDepth (2)
[0115] Wherein, C is the brightness input sample at the middle position in FIG6B .
[0116] For example, if the bit depth of the pixel value of the current prediction block is equal to 10 bits, the nonlinear term P is determined by the following formula (3): P = (C × C + 512) >> 10 (3)
[0117] The offset 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 prediction value is determined by the adaptively acquired 7-tap filter coefficients {c0, ..., c6} and the input samples. For example, the prediction value can be determined according to the following formula (4): predChromaVal = c0C + c1N + c2S + c3E + c4W + c5P + c6B (4)
[0119] Wherein, predChromaVal represents the chroma prediction value of the current prediction block, CNSEW is the luminance input sample of the cross filter shown in FIG6B , P is a nonlinear term, and B is a bias term.
[0120] The above filter coefficients {c0,…,c6} are calculated by minimizing the mean square error (MSE) between the total chrominance prediction value and the reconstructed value of the reconstructed area.
[0121] Exemplarily, the filter coefficients {c0, ..., c6} are calculated by the following formula (5):
[0122] Among them, predC is the chroma prediction value, recC is the chroma reconstruction value, and refL is the luminance reconstruction value.
[0123] In one example, as shown in Figure 6C , the reconstruction area of the current chroma block consists of the reconstructed pixel values of the six rows and six columns surrounding the current chroma block. When unreconstructed locations appear in the reconstruction area, the values at those locations are filled with the values of completed reconstruction. The reference area shown in Figure 6C extends rightward by the width of the current chroma block and downward by the height of the current chroma block. The extended gray area in Figure 6C is used to support edge sampling of the square spatial filter. The values in the gray area are obtained by copying adjacent reconstructed pixels.
[0124] The calculation process of minimizing the mean square error is:
[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 by LDL, and the final filter coefficients are obtained by back-banding.
[0127] Exemplarily, the filter coefficients {c0, ..., c6} are determined by the following formula (6):
[0128] in, is the autocorrelation matrix of the luminance input samples, is the cross-correlation vector between luma input samples and chroma output samples.
[0129] In the calculation of the autocorrelation matrix, since the values of the luminance input samples used are relatively large, a higher precision is required when calculating the convolution filter coefficients. Therefore, in CCCM, the input luminance samples and the output chrominance samples need to be subtracted from the corresponding offset 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 offsets. Therefore, 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 chroma prediction value is calculated by the following formula (7): predChromaVal = c0C' + c1N' + c2S' + c3E' + c4W' + c5P' + c6B + offsetChroma (7)
[0131] Among them, offsetChroma is the offset of Cb and Cr components respectively.
[0132] CCCM also supports two sets of filter coefficients for a block, similar to MMLM, for example, using a certain set of coefficients based on Threshold control.
[0133] Since the CCCM filter coefficients c0, ... c6, and possible Threshold and second set of parameters are derived, they do not need to be parsed from the bitstream.
[0134] GLM is a tool for intra-frame chroma cross-component prediction in the YUV4:2:0 format. In the ECM reference software (based on the VTM-10.0 reference software, integrating various new tools to further explore codec performance), GLM includes a two-parameter model and a three-parameter model.
[0135] Compared with CCLM, GLM uses the gradient values of the luminance reconstruction samples and the chrominance reconstruction samples to derive a linear model.
[0136] For example, for the 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 corresponding to the current position. The calculation method of α and β is the same as CCLM.
[0138] For example, for the three-parameter GLM model, the chromaticity prediction value C is calculated by the gradient value of the luminance sample corresponding to the current position and the luminance sample corresponding to , using the following formula (9): C = α0·G + α1·L + α2·β (9)
[0139] The calculation method of α0, α1, and α2 is the same as that of CCCM.
[0140] Exemplarily, β=(1<<(bitDepth-1)). For example, for content with a prediction block pixel precision of 10 bits, β=512.
[0141] In one example, the gradient of the GLM is obtained by one of the four Sobel operators shown in FIG6D . The specific Sobel operator used to obtain the gradient value is determined by a flag bit parsed from the bitstream.
[0142] Since GLM parameters are also exported, they do not need to be parsed from the bitstream.
[0143] CCMerge inherits the cross-component prediction models of the 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 non-repeated cross-component models inherited from the surrounding blocks. These cross-component 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 will be used to fill the remaining list.
[0144] When obtaining the cross-component model of the surrounding adjacent positions, CCMerge sequentially visits the positions B1 → A1 → B0 → A0 → B2 as shown in FIG6E .
[0145] CCMerge can also further obtain cross-component models at non-adjacent positions. The concept of non-adjacent positions has also been used in inter-frame merge. These positions include some non-adjacent positions above, upper left, upper right, left, and 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 CCLM model with the default slope is used to fill the remaining list. 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 is used by the codec to indicate whether CCMerge mode is selected. If CCMerge is selected, it is necessary to decode which model in the CCMerge list is selected. The model index is encoded and decoded using a truncated unary code.
[0148] As can be seen from the above, in the embodiment of the present application, the cross-component intra prediction mode can be used to obtain the prediction value of the current chrominance block. However, the prediction value of the chrominance block determined by the current cross-component intra prediction mode may be inaccurate.
[0149] In an embodiment of the present application, the prediction 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 prediction value of the current chroma block is determined, and the limited range includes at least one of a maximum limited value and a minimum limited value of the prediction value; then, based on the cross-component intra-frame prediction mode, a first prediction value of the current chroma block is determined; based on the first prediction value and the limited range, a second prediction value of the current chroma block is determined. That is, in an embodiment of the present application, if the current chroma block adopts a cross-component intra-frame prediction mode, the first prediction value determined by the cross-component intra-frame prediction mode is limited to avoid the prediction value of the current chroma block being too large or too small, thereby improving the prediction accuracy of the current chroma block and improving video encoding and decoding performance.
[0150] 7 , the video decoding method provided in the embodiment of the present application is introduced by taking the decoding end as an example.
[0151] FIG7 is a flow chart of a video decoding method according to an embodiment of the present application, which is applied to the video decoders shown in FIG1 and FIG3. As shown in FIG7, the method according to the embodiment of the present application includes:
[0152] S101: Determine a prediction mode for a current chroma block.
[0153] In the embodiment of the present application, when decoding the current block, the decoding end first performs predictive decoding on the luminance component of the current block to obtain a luminance reconstruction value of the current block, and then performs predictive decoding on the chrominance component of the current block.
[0154] In the embodiment of the present application, the chroma component of the current block is recorded as the current chroma block.
[0155] Before predictive decoding is performed on the current chroma block, the prediction mode of the current chroma block is first determined.
[0156] The embodiment of the present application does not limit the specific method of 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 the embodiment of the present application, both the encoding end and the decoding end use the default prediction mode to predict the current chroma block.
[0158] In one example, the encoder determines a prediction mode with the lowest cost from multiple candidate prediction modes as the prediction mode for the current chroma block. At the same time, the encoder encodes the indication information of the prediction mode into the bitstream, for example, by encoding the mode index of the prediction mode 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 by decoding the code stream.
[0160] As can be seen from the above, the cross-component intra-frame prediction modes include CCLM, CCCM, GLM, CCMerge and other modes. Among them, in the CCMerge mode, the prediction mode of the current chroma block is determined by constructing a list. Based on this, in some cases, the decoding end cannot directly determine the prediction mode of the current chroma block by decoding the code stream. For example, if the decoded code stream obtains the CCMerge mode, the decoding end also needs to construct a cross-component prediction mode list and determine the prediction value of the current chroma block from the list. Therefore, in the embodiment of the present application, for the convenience of description, the prediction mode obtained by decoding the code stream is recorded as the first prediction mode. At this time, the above S101-A includes the following steps:
[0161] S101-A1, decoding the bit stream to obtain a first prediction mode;
[0162] S101-A2: Determine a prediction mode for a current chroma block based on the first prediction mode.
[0163] In an embodiment of the present application, the prediction mode written into the code stream by the encoding end is recorded as the first prediction mode. In this way, the decoding end can directly obtain the first prediction mode by decoding the code stream. For example, the decoding end decodes the code stream to obtain a prediction mode index, and determines the first prediction mode based on the prediction mode index. Alternatively, the decoding end decodes the code stream to obtain an enable flag of at least one prediction mode, and then determines the first prediction mode based on the enable flag of the at least one prediction mode. For example, when the decoding end decodes the code stream and obtains an enable flag of the CCCM mode equal to 1, it indicates that the CCCM mode is used, and at this time, the first prediction mode is determined to be the CCCM mode. Alternatively, when the decoding end decodes the code stream and obtains an enable flag of the CCMerge mode equal to 1, it indicates that the CCMerge mode is used, and at this time, the first prediction mode is determined to be the CCMerge mode.
[0164] After obtaining the first prediction mode by decoding the code stream, the decoding end determines the prediction mode of the current chroma block based on the first prediction mode.
[0165] Wherein, based on the first prediction mode, determining the prediction mode of the current chroma block includes at least the following two cases:
[0166] In case 1, if the first prediction mode is the CCCM mode or the GLM mode, the decoding end directly determines the CCCM mode or the GLM mode as the prediction mode of the current chroma block.
[0167] Case 2: If the first prediction mode is the cross-component merging mode, then the above S101-A2 includes the following steps:
[0168] S101-A21, constructing a cross-component prediction mode list by inheriting the cross-component intra prediction modes of chroma blocks adjacent to and / or non-adjacent to the current chroma block around the current chroma block;
[0169] S101-A22. Determine a prediction mode for a current chroma block based on the cross-component prediction mode list.
[0170] In case 2, if the decoding end decodes the code stream and the first prediction mode obtained is the CCMerge mode, the decoding end constructs a cross-component prediction mode list with a length of N.
[0171] Exemplarily, the process of constructing the cross-component prediction mode list at the decoding end may include:
[0172] First, the decoder obtains the cross-component intra-frame prediction mode of the chroma blocks at the adjacent positions around the current chroma block. Exemplarily, as shown in Figure 6E, the decoder sequentially accesses positions B1→A1→B0→A0→B2. If at least one chroma block at these positions uses a cross-component intra-frame prediction mode, the cross-component intra-frame prediction mode of the at least one chroma block is stored in the cross-component prediction mode list. Exemplarily, the order in which the cross-component intra-frame prediction modes are stored in the cross-component prediction mode list can be consistent with the order in which the above positions are accessed.
[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 may further obtain a cross-component intra prediction mode for a chroma block at a non-adjacent position of the current chroma block. The non-adjacent position includes non-adjacent positions above, to the upper left, to the upper right, to the left, and to the lower left of the current chroma block.
[0174] In some embodiments, if the length of the above-mentioned cross-component prediction mode list does not meet the preset length, that is, N, that is, when the number of cross-component intra-frame prediction modes obtained from 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] After constructing the cross-component prediction mode list based on the above steps, the decoding end determines the prediction mode of the current chroma block based on the cross-component prediction mode list.
[0176] The embodiment of the present application does not limit the specific method of determining the prediction mode of the current chroma block based on the cross-component prediction mode list.
[0177] In one example, the decoding end and the encoding end construct the cross-component prediction mode list in the same sampling manner, and a cross-component intra prediction mode in the cross-component prediction mode list is used as the prediction mode of the current chroma block by default. For example, the first cross-component intra prediction mode in the cross-component prediction mode list is used as the prediction mode of the current chroma block by default, or the second cross-component intra prediction mode in the cross-component prediction mode list is used as the prediction mode of the current chroma block by default.
[0178] In one example, the decoding end and the encoding end use the same method to construct the above-mentioned cross-component prediction mode list. At the same time, the encoding end writes the mode index of the cross-component intra-frame prediction mode selected by the chroma block in the cross-component prediction mode list into the bitstream. At this time, the decoding end decodes the bitstream to obtain the mode index, and then based on the mode index, determines the prediction mode of the current chroma block in the cross-component prediction mode list. For example, a mode index corresponds to each mode in the cross-component prediction mode list, such as the sorting order of the mode in the list, is determined as the mode index of the mode. In this way, the decoding end determines the mode corresponding to the mode index in the cross-component prediction mode list as the prediction mode of the current chroma block.
[0179] After the decoding end determines the prediction mode of the current chroma block based on the above steps, it executes the following step S102.
[0180] S102: If the prediction mode is an inter-component intra prediction mode, determine a limited range of a prediction value of the current chroma block.
[0181] The limited range includes at least one of a maximum limited value and a minimum limited value of the predicted value.
[0182] In an embodiment of the present application, in order to further improve the prediction accuracy of the cross-component intra-frame prediction mode, when the current chroma block adopts the cross-component intra-frame prediction mode, the limited range of the prediction value of the current chroma block is determined to limit the prediction value of the current chroma block to the limited range, thereby preventing the predicted value of the current chroma block from being too large and / or too small due to the prediction error, thereby further improving the prediction accuracy of the chroma component.
[0183] It should be noted that, in the embodiment of the present application, the value range of the predicted value of the chrominance component is limited. In some embodiments, the value range of the predicted value of the luminance component, etc. may also be limited.
[0184] In some embodiments, limiting the predicted value of the current chroma block may be to limit the maximum value of the predicted value of the current chroma block, and the limited value is recorded as the maximum limited value of the predicted value. In other words, the predicted value of the current chroma block is limited to not exceed the maximum limited value.
[0185] In some embodiments, limiting the predicted value of the current chroma block may be to limit a minimum value of the predicted value of the current chroma block, and the limit value is recorded as the minimum limit value of the predicted value. In other words, the predicted value of the current chroma block is limited to not be less than the minimum limit value.
[0186] In some embodiments, limiting the predicted value of the current chroma block may include limiting both the maximum and minimum values of the predicted value of the current chroma block. In other words, limiting the predicted value of the current chroma block to not be less than the minimum limit value, and limiting the predicted value of the current chroma block to not exceed the maximum limit value.
[0187] In some embodiments, a flag (i.e., a first flag) is used to indicate to the decoder whether to limit the predicted value of the current chroma block. In this case, before determining the limited range of the predicted value of the current chroma block, the decoder first needs to determine the first flag corresponding to the current chroma block. The first flag is used to indicate whether the predicted value of the current chroma block is limited. Based on the first flag, the decoder then determines whether to limit the value range of the predicted value of the current chroma block.
[0188] For example, if the first flag indicates that the prediction value of the current chroma block is not limited, the decoding end skips the step of determining the limited range of the prediction value of the current chroma block.
[0189] For another example, if the first flag indicates that the prediction value of the current chroma block is limited, the decoding end performs the step of determining a limited range of the prediction value of the current chroma block.
[0190] The embodiment of the present 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 code stream and the first prediction mode obtained is the CCMerge mode, the decoding end determines the cross-component intra-frame prediction mode of the current chroma block by inheriting the cross-component intra-frame prediction mode of the chroma blocks around the current chroma block and the adjacent and / or non-adjacent chroma blocks. For example, referring to the above embodiment, if 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 first flag of chroma block 1. That is to say, if the above-mentioned first prediction mode is the 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 the 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 embodiment of the present application does not limit the specific form of the first flag, which can be understood as any information that can indicate whether the predicted value of the current chrominance block is limited.
[0194] In one example, the first flag may be represented as cross_component_clip_flag, and different values may be assigned to cross_component_clip_flag to indicate whether the prediction value of the current chroma block is limited. For example, if the value of cross_component_clip_flag is a first value, it indicates that the prediction value of the current chroma block is limited, and if the value of cross_component_clip_flag is a second value, it indicates that the prediction value of the current chroma block is not limited.
[0195] The embodiment of the present application does not limit the specific values of the first value and the second value.
[0196] Exemplarily, the first value is 1.
[0197] Exemplarily, 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 it is determined that the prediction mode of the current chroma block is a cross-component intra-frame prediction mode (for example, a CCCM mode or a GLM mode), the first flag corresponding to the current chroma block is determined, and then based on the first flag, it is determined whether to limit the prediction value of the current chroma block. Specifically, if the value of the first flag is a first numerical value, it indicates that the prediction value of the current chroma block is limited, so that the decoding end determines the limited range of the prediction value of the current chroma block. If the value of the first flag is a second numerical value, it indicates that the prediction value of the current chroma block is not limited. At this time, the decoding end skips determining the limited range of the prediction value of the current chroma block, and directly uses the prediction value obtained by the cross-component intra-frame prediction mode as the prediction value of the current chroma block.
[0199] In some embodiments, if the decoding end does not decode the first flag when decoding the bitstream, that is, the first flag does not exist in the bitstream, the value of 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 code stream are shown in Table 1:
[0201] Table 1
[0202] The cross-component intra prediction mode shown in Table 1 above is CCCM or GLM mode. However, the cross-component intra prediction mode in the embodiment of the present application includes not only CCCM and GLM modes but also other cross-component intra prediction modes, and the embodiment of the present application does not limit this. Among them, pu.cccmFlag indicates whether the current chroma block adopts the CCCM mode, and pu.glmFlag indicates whether the current chroma block adopts the GLM mode. cross_component_clip_flag is the first flag.
[0203] As shown in Table 1 above, the decoding end first decodes the bitstream to obtain relevant information such as the size and bit depth of the current chroma block. Then, the prediction mode-related syntax elements pu.cccmFlag||pu.glmFlag are decoded. If the current chroma block adopts CCCM or GLM mode, that is, when the current chroma block adopts the cross-component intra-frame prediction mode, the bitstream is continued to be parsed to obtain the first flag cross_component_clip_flag. The cross_component_clip_flag is a binary identifier. When the flag is the first value (for example, 1), it indicates that the range of the predicted value of the current chroma block needs to be restricted. When the flag is the second value (for example, 0), it indicates that the range of the predicted value of the current chroma block does not need to be restricted.
[0204] In some embodiments, determining whether the current chroma block satisfies a preset condition is used to indicate to the decoder whether to limit the predicted value of the current chroma block. That is, in embodiments of the present application, the range of the predicted value of some chroma blocks is limited, while the range of the predicted value of some chroma blocks is not limited. In this case, before determining the limited range of the predicted value of the current chroma block, the decoder must first determine whether the current chroma block satisfies the preset condition.
[0205] For example, if the current chroma block does not meet the preset condition, the decoding end skips the step of determining the limited range of the prediction value of the current chroma block.
[0206] For another example, if the current chroma block meets a preset condition, the decoding end performs a step of determining a limited range of a prediction value of the current chroma block.
[0207] The embodiments of the present application do not limit the above-mentioned preset conditions, and they can be set according to actual needs.
[0208] In some embodiments, the aforementioned 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 size of the current chroma block meets the preset size;
[0211] The shape of the current chroma block satisfies a preset shape.
[0212] That is to say, the preset conditions of the embodiment of the present application may include only any one of the above three conditions, or include any two of the above three conditions, or include all three of the above conditions.
[0213] In one example, because CCCM and GLM require multiple rows and columns of reconstructed pixel values to derive model parameters, in the ECM reference software, to reduce row cache storage between CTUs that span rows, the use of CCCM and GLM is restricted for blocks at the upper boundary of the CTU. Accordingly, the method for determining the limited range of the predicted value of the current chrominance value in the embodiments of the present application should also be restricted. That is, when the current chrominance block is the first row of chrominance blocks in the current CTU, the step of determining the limited range of the predicted value of the current chrominance value is skipped.
[0214] In one example, the size of the current chroma block satisfies a preset size, which may be that at least one of the length and width of the current chroma block satisfies 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. For another example, the length of the current chroma block is less than or equal to the preset length. For another example, the width of the current chroma block is less than or equal to the preset width.
[0215] In an example, the size of the current chroma block satisfies a preset size, which may be that the number of pixels included in the current chroma block satisfies a preset number.
[0216] In one example, the shape of the current chroma block satisfies a preset shape, which may be that the aspect ratio and / or width-to-length ratio of the current chroma block satisfies a preset ratio. 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. For another example, the aspect ratio of the current chroma block is less than or equal to the first ratio. For another example, the width-to-length ratio is less than or equal to the second ratio.
[0217] As can be seen from the above, in the embodiment of the present application, the manner of determining whether to limit the predicted value of the current chrominance block includes at least the following examples:
[0218] In Example 1, the decoder limits the prediction 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 inter-component intra prediction mode, it determines a limited range of the prediction value of the current chroma block.
[0219] Example 2, a first flag is used to indicate whether the prediction value of the current chroma block is limited. At this time, when the decoding end determines that the prediction mode of the current chroma block is the cross-component intra-frame prediction mode, it is also necessary to determine the first flag corresponding to the current chroma block, and then determine whether to limit the prediction value of the current chroma block based on the first flag. For example, if the first flag indicates that the prediction value of the current chroma block is limited, the decoding end determines the limited range of the prediction value of the current chroma block. For another example, if the first flag indicates that the prediction value of the current chroma block is not limited, the decoding end skips the step of determining the limited range of the prediction value of the current chroma block.
[0220] Example 3: Determining whether to limit the prediction value of the current chroma block is done by determining whether the current chroma block satisfies a preset condition. That is, upon determining that the prediction mode of the current chroma block is an inter-component intra prediction mode, the decoder determines whether the current chroma block satisfies the preset condition. If the current chroma block satisfies the preset condition, the decoder determines a limited range for the prediction value of the current chroma block. For another example, if the current chroma block does not satisfy the preset condition, the decoder skips the step of determining a limited range for the prediction value of the current chroma block.
[0221] Example 4, through the first flag and the preset condition, determines whether to limit the predicted value of the current chroma block. That is, in this 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 condition, the decoding end 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 condition, the decoding end skips the step of determining the limited range of the predicted value of the current chroma block. In this Example 4, the decoding end can first determine whether the current chroma block meets the preset condition. If the current chroma block does not meet the preset condition, the decoding end no longer decodes the first flag, but directly skips the step of determining the limited range of the predicted value of the current chroma block. This can avoid decoding unnecessary information and save decoding resources. If the decoding end determines that the current chroma block meets the preset conditions, it continues to decode the code stream to obtain 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 of determining the limited range of the prediction value of the current chrominance block at the decoding end.
[0223] In the embodiment of the present application, the decoding end determines the limited range of the prediction value of the current chroma block in at least the following ways:
[0224] In a first approach, the prediction value of the current chroma block is limited to a preset value. That is, the maximum limit value and / or the minimum limit value of the prediction value of the current chroma block are preset values. The preset values may be empirical values or experimental values, and are not limited in this embodiment of the present application.
[0225] Method 2: If the decoding end decodes the code stream and the first prediction mode obtained is the CCMerge mode, the decoding end inherits the cross-component intra-frame prediction mode of the chroma blocks around the current chroma block and the adjacent and / or non-adjacent chroma blocks. 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 the prediction value of chroma block 1. That is to say, if the above-mentioned first prediction mode is the 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 the prediction value of the chroma block as the limited range of the prediction value of the current chroma block.
[0226] Mode 3: Since the chroma value of the current chroma block is correlated with the chroma blocks in the surrounding area of the current chroma block, based on this, the above S102 includes the following step S102-A:
[0227] S102-A. Determine a limited range of a prediction value of the current chrominance block based on the chrominance values of the reconstructed area surrounding the current chrominance block.
[0228] In this embodiment of the present application, the chroma components include a first chroma component and a second chroma component, where the first chroma component can be a U component or a Cb component, and the second chroma component can be a V component or a Cr component. Thus, the decoder can determine a limited range of predicted values for the first chroma component and the second chroma component of the current chroma block based on the chroma values of the first chroma component and the second chroma component of the reconstructed area surrounding the current chroma block.
[0229] The embodiment of the present application does not limit the specific method by which the decoding end determines the limited range of the predicted values of the first chroma component and the second chroma component of the current chroma block based on the chroma values of the first chroma component and the second chroma component of the reconstructed area around the current chroma block.
[0230] In some embodiments, the decoding end determines a maximum limit value and / or a minimum limit value for the predicted value of the current chroma block based on the chroma values of the reconstructed area surrounding the current chroma block. That is, the predicted value of the current chroma block under the first chroma component and the second chroma component is limited to not greater than the maximum limit value, and / or the predicted value of the current chroma block under the first chroma component and the second chroma component is limited to not less than the minimum limit value. For example, the maximum chroma value of the reconstructed area surrounding the current chroma block is used as the maximum limit value for the predicted value of the current chroma block. In this case, the maximum chroma value is the maximum value of the chroma value under the first chroma component and the chroma value under the second chroma component. For another example, the minimum chroma value of the reconstructed area surrounding the current chroma block is used as the minimum limit value for the predicted value of the current chroma block. In this case, the minimum chroma value is the minimum value of the chroma value under the first chroma component and the chroma value under the second chroma component of the surrounding reconstructed area.
[0231] In some embodiments, since the chroma value of each pixel in the reconstructed area surrounding the current chroma block has been reconstructed, the decoding end can find a pixel 1 in the reconstructed area surrounding the current chroma block with the largest chroma value of the first chroma component or the second chroma component, and then determine the chroma value of the pixel 1 as the limited range of the predicted value of the current chroma block, that is, determine the chroma value of the first chroma component of the pixel 1 as the maximum limited value of the first chroma component of the current chroma value, and determine the chroma value of the second chroma component of the pixel 1 as the maximum limited value of the second chroma component of the current chroma value. Alternatively, find a pixel 2 in the reconstructed area surrounding the current chroma block with the smallest chroma value of the first chroma component or the second chroma component, and then determine the chroma value of the pixel 2 as the limited range of the predicted value of the current chroma block, that is, determine the chroma value of the first chroma component of the pixel 2 as the minimum limited value of the first chroma component of the current chroma value, and determine the chroma value of the second chroma component of the pixel 2 as the minimum limited value of the second chroma component of the current chroma value. At this time, the first chroma component and the second chroma component respectively correspond to a limited range.
[0232] In some embodiments, when determining the predicted value of the current chroma block, the decoding end separately determines the predicted values of the first chroma component and the second chroma component of the current chroma block. Correspondingly, the limited range of the predicted value of the first chroma component of the current chroma block and the limited range of the predicted value of the second chroma component of the current chroma block are also determined separately. Among them, the specific process of determining the limited range of the predicted value of the first chroma component and the limited range of the predicted value of the second chroma component are basically the same. For the sake of ease of description, the limited range of the predicted value of the i-th chroma component of the current chroma block is used as an example for explanation. The i-th chroma component can be the first chroma component U component or Cb component, or it can be the second chroma component V component or Cr component. Based on this, the above S102-A includes the following steps of S102-A1:
[0233] S102-A1. Determine a limited range of a prediction value of a current chroma block under the i-th chroma component based on the chroma values of surrounding reconstructed areas under the i-th chroma component.
[0234] In an embodiment of the present application, a decoding end determines a limited range of a predicted value for the current chroma block under the i-th chroma component based on the chroma values of the surrounding reconstructed areas under the i-th chroma component of the current chroma block. For example, the maximum value of the chroma values of the surrounding reconstructed areas under the i-th chroma component of the current chroma block is used as the maximum limited value of the predicted value for the current chroma block under the i-th chroma component. For another example, the minimum value of the chroma values of the surrounding reconstructed areas under the i-th chroma component of the current chroma block is used as the minimum limited value of the predicted value for the current chroma block under the i-th chroma component.
[0235] In the embodiment of the present application, the reconstructed surrounding area of the current chroma block under the first chroma component and the reconstructed surrounding area under the second chroma component may 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 area under the i-th chroma component, the decoder first determines the reconstructed surrounding area of the current chroma block under the i-th chroma component and records this reconstructed surrounding area as the first reconstructed surrounding area.
[0236] In the embodiment of the present application, specific methods for determining the first surrounding reconstructed area of the current chroma block under the i-th component include but are not limited to the following:
[0237] Method 1: A default reconstruction area is determined as the first surrounding reconstructed area of the current chroma block under the i-th component. For example, the reconstructed area above the current chroma block, the reconstructed area to the upper left of the current chroma block, and the reconstructed area to the upper right of the current chroma block are determined by default as the first surrounding reconstructed area of the current chroma block under the i-th component. For another example, the reconstructed area above the current chroma block, the reconstructed area to the upper left of the current chroma block, the reconstructed area to the upper right of the current chroma block, the reconstructed area to the left of the current chroma block, and the reconstructed area to the lower left of the current chroma block are determined by default as the first surrounding reconstructed area of the current chroma block under the i-th component, and so on.
[0238] Exemplarily, the first surrounding reconstructed area of the current chroma block under the Cb chroma component is shown in FIG8A .
[0239] Exemplarily, the first surrounding reconstructed area of the current chrominance block under the Cr chrominance component is shown in FIG8B .
[0240] Method 2: If the prediction mode of the current chroma block is the convolution cross-component model mode, the second surrounding reconstructed area corresponding to the convolution cross-component model mode is determined; based on the second surrounding reconstructed area, the first surrounding reconstructed area is determined.
[0241] In the 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 convolution cross-component model mode in the cross-component intra prediction mode, it can be seen from the above that in the convolution cross-component model mode, it is necessary to determine the filter coefficient based on the surrounding reconstructed area of the current chroma block. In the embodiment of the present application, for the convenience of description, the surrounding reconstructed area of the current chroma block used to determine the filter coefficient in the convolution cross-component model mode is recorded as the second surrounding reconstructed area. In this way, if the prediction mode of the current chroma block is the convolution cross-component model mode, the decoding end determines the second surrounding reconstructed area corresponding to the convolution cross-component model mode, and determines the above-mentioned first surrounding reconstructed area based on the second surrounding reconstructed area.
[0242] The embodiment of the present application does not limit the specific shape of the second surrounding reconstructed area of the current chroma block.
[0243] In some embodiments, the second surrounding reconstructed area includes any one of a first-type reconstructed area, a second-type reconstructed area, and a third-type reconstructed area.
[0244] 9A , the first type of reconstruction area includes the upper, upper left, upper right, left, and lower left areas of the current chrominance block. In this case, the CCCM model parameters are derived from the area surrounding the current chrominance component and the area surrounding the corresponding luminance block.
[0245] For example, as shown in FIG9B , the second type of reconstruction area includes the upper, upper left, and upper right areas of the current chrominance block. In this case, the CCCM model parameters are derived from the upper, upper left, and upper right areas of the current chrominance block and the upper, upper left, and upper right areas of the corresponding luminance block.
[0246] For example, as shown in FIG9C , the third type of estimated region includes the left, upper left, and lower left regions of the current chrominance block. In this case, the CCCM model parameters are derived from the left, upper left, and lower left regions of the current chrominance block and the left, upper left, and lower left regions of the corresponding luminance block.
[0247] It should be noted that the second surrounding reconstructed area in the embodiment of the present application may be other types of reconstructed areas in addition to the first type of reconstructed area, the second type of reconstructed area and the third type of reconstructed area, and the embodiment of the present application does not limit this.
[0248] In some embodiments, if the decoding end determines that the prediction mode of the current chroma block is a convolutional cross-component model mode, it can determine the type of the second surrounding reconstruction area by decoding relevant syntax elements, that is, determine which reconstruction area of the current chroma block to use to determine the model parameters of CCCM.
[0249] The decoding end determines a second surrounding reconstructed area corresponding to the convolution cross-component model mode, and determines the first surrounding reconstructed area based on the second surrounding reconstructed area.
[0250] The embodiment of the present application does not limit the specific manner in 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 area is a first-type reconstructed area, then the first surrounding reconstructed area is determined to be a first-type reconstructed area. For example, the second surrounding reconstructed area includes the upper, upper left, upper right, left and lower left areas of the current chroma block as shown in FIG9A , and the first surrounding reconstructed area has the same shape as the second surrounding reconstructed area. Specifically, as shown in FIG10A , the reconstructed area corresponding to the Cb component and the Cr component of the current chroma block (i.e., the first surrounding reconstructed area) includes the upper, upper left, upper right, left and lower left areas of the current chroma block. Optionally, the number of rows and lists included in the first surrounding reconstructed area may be the same as the number of rows and lists included in the second surrounding reconstructed area, or they may be different, or they may be partially the same and partially different (for example, the same number of rows and a different number of columns, or the same number of columns and a different number of rows). This embodiment of the present application does not impose any restrictions on this.
[0253] Example 2: If the second surrounding reconstructed area is a second type of reconstructed area, the first surrounding reconstructed area is determined to be a second type of reconstructed area. For example, if the second surrounding reconstructed area includes the upper, upper left and upper right areas of the current chroma block as shown in FIG9B , the first surrounding reconstructed area has the same shape as the second surrounding reconstructed area. Specifically, as shown in FIG10B , the reconstructed area corresponding to the Cb component and the Cr component of the current chroma block (i.e., the first surrounding reconstructed area) includes the upper, upper left and upper right areas of the current chroma block. 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, and this is not limited in this embodiment of the present application.
[0254] Example 3: If the second surrounding reconstructed area is a third type of reconstructed area, the first surrounding reconstructed area is determined to be a third type of reconstructed area. For example, if the second surrounding reconstructed area includes the left side, upper left and lower left areas of the current chroma block as shown in FIG9C , the first surrounding reconstructed area has the same shape as the second surrounding reconstructed area. Specifically, as shown in FIG10C , the reconstructed area corresponding to the Cb component and the Cr component of the current chroma block (i.e., the first surrounding reconstructed area) includes the left side, upper left and lower left areas of the current chroma block. 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, and this embodiment of the present application does not impose any restrictions on this.
[0255] In one example, when the decoder uses the second surrounding reconstructed area to determine the CCCM model parameters, the decoder may also use the second surrounding reconstructed area to determine a limited range of predicted values for the current chroma block under the i-th chroma component. In this case, the first surrounding reconstructed area and the second surrounding reconstructed area are the same.
[0256] In a third approach, the first surrounding reconstructed area includes at least one of N preset types of reconstructed areas, where N is a positive integer.
[0257] The embodiment of the present application does not limit the specific shapes of the N types of reconstruction areas.
[0258] In some embodiments, the aforementioned preset N types of reconstruction areas include 5 types of reconstruction areas.
[0259] Exemplarily, the first type of reconstruction area among the five types of reconstruction areas includes the area above, to the upper left, and to the left of the current chroma block. As shown in FIG11A , the first type of reconstruction area of the current chroma block under the Cb chroma component includes the area above, to the upper left, and to the left of the current chroma block under the Cb chroma component. The first type of reconstruction area of the current chroma block under the Cr chroma component includes the area above, to the upper left, and to the left of the current chroma block under the Cr chroma component.
[0260] Exemplarily, the second type of reconstruction area among the five types of reconstruction areas includes the area above and to the upper right of the current chroma block. As shown in FIG11B , the second type of reconstruction area for the current chroma block under the Cb chroma component includes the area above and to the upper right of the current chroma block under the Cb chroma component. The second type of reconstruction area for the current chroma block under the Cr chroma component includes the area above and to the upper right of the current chroma block under the Cr chroma component.
[0261] Illustratively, the third type of reconstruction area among these five types of reconstruction areas includes the area above the current chroma block. As shown in FIG11C , the third type of reconstruction area for the current chroma block in the Cb chroma component includes the area above the current chroma block in the Cb chroma component. The third type of reconstruction area for the current chroma block in the Cr chroma component includes the area above the current chroma block in the Cr chroma component.
[0262] Illustratively, the fourth type of reconstruction region among the five types of reconstruction regions includes the upper left and left regions of the current chroma block. As shown in FIG11D , the fourth type of reconstruction region for the current chroma block in the Cb chroma component includes the upper left and left regions of the current chroma block in the Cb chroma component. The fourth type of reconstruction region for the current chroma block in the Cr chroma component includes the upper left and left regions of the current chroma block in the Cr chroma component.
[0263] Illustratively, the fifth type of reconstruction region among the five types of reconstruction regions includes the left area of the current chroma block. As shown in FIG11E , the fifth type of reconstruction region for the current chroma block in the Cb chroma component includes the left area of the current chroma block in the Cb chroma component. The fifth type of reconstruction region for the current chroma block in the Cr chroma component includes the left area of the current chroma block in the Cr chroma component.
[0264] That is, in the third approach, the decoding end may use any one or several types of reconstructed areas among the N types of reconstructed areas as the first surrounding reconstructed area.
[0265] Exemplarily, each of the N types of reconstruction areas includes at least one row and / or at least one table of reconstructed pixel values. Optionally, the same six rows and / or six columns of reconstructed pixel values used in CCCM and GLM modes may be used.
[0266] Based on the above method, the decoding end determines the first surrounding reconstructed area 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 area.
[0267] The embodiment of the present application does not limit the specific manner in which 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 first surrounding reconstructed area.
[0268] For example, if the limited range of the predicted value of the current chroma block under the i-th chroma component includes the maximum limited value of the predicted value of the current chroma block under the i-th chroma component, the decoding end determines the maximum chroma value of the surrounding reconstructed area under the i-th chroma component as the maximum limited value of the predicted value of the current chroma block under the i-th chroma component.
[0269] For another example, if the limited range of the predicted value of the current chroma block under the i-th chroma component includes the minimum limited value of the predicted value of the current chroma block under the i-th chroma component, the decoding end determines the minimum chroma value of the surrounding reconstructed area under the i-th chroma component as the minimum limited value of the predicted value of the current chroma block under the i-th chroma component.
[0270] For another example, if the limited range of the predicted value of the current chroma block under the i-th chroma component includes the maximum limited value and the minimum limited value of the predicted value of the current chroma block under the i-th chroma component, the decoding end determines the maximum chroma value of the surrounding reconstructed area under the i-th chroma component as the maximum limited value of the 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 limited value of the predicted value of the current chroma block under the i-th chroma component.
[0271] For another example, if the limited range of the predicted value of the current chroma block under the i-th chroma component includes the maximum limited value of the predicted value of the current chroma block under the i-th chroma component, the decoding end determines the average value of several maximum chroma values of the surrounding reconstructed areas under the i-th chroma component as the maximum limited value of the predicted value of the current chroma block under the i-th chroma component.
[0272] For another example, if the limited range of the predicted value of the current chroma block under the i-th chroma component includes the minimum limited value of the predicted value of the current chroma block under the i-th chroma component, the decoding end determines the average value of several minimum chroma values of the surrounding reconstructed areas under the i-th chroma component as the minimum limited value of the predicted value of the current chroma block under the i-th chroma component.
[0273] For another example, if the limited range of the predicted value of the current chroma block under the i-th chroma component includes the maximum limited value and the minimum limited value of the predicted value of the current chroma block under the i-th chroma component, the decoding end determines the average value of several maximum chroma values of the surrounding reconstructed areas under the i-th chroma component as the maximum limited value of the predicted value of the current chroma block under the i-th chroma component, and determines the average value of several minimum chroma values of the surrounding reconstructed areas under the i-th chroma component as the minimum limited value of the predicted value of the current chroma block under the i-th chroma component.
[0274] The above embodiment introduces the specific process of determining the limited range of the prediction value of the current chrominance block at the decoding end.
[0275] S103 : Determine a first prediction value of the current chroma block based on the cross-component intra prediction mode.
[0276] It should be noted that there is no strict order in which the above-mentioned S103 and the step of determining the limited range of the prediction value of the current chroma block in the above-mentioned S102 are executed. That is to say, when the decoding end determines that the prediction mode of the current chroma block is the cross-component intra-frame prediction mode, it can first execute S103 to determine the first prediction value of the current chroma block, and then execute S102 to determine the limited range of the prediction value of the current chroma block. It is also possible to first execute S102 to determine the limited range of the prediction value of the current chroma block, and then execute S103 to determine the first prediction value of the current chroma block based on the cross-component intra-frame prediction mode. It is also possible to simultaneously execute the two steps of S103 determining the first prediction value of the current chroma block based on the cross-component intra-frame prediction mode and S102 determining the limited range of the prediction value of the current chroma block. The specific determination will be based on actual conditions, and the embodiments of the present application do not impose any restrictions on this.
[0277] In the embodiment of the present application, for the convenience of description, the predicted value of the current chroma block obtained based on the cross-component intra prediction mode is recorded as the first predicted value of the current chroma block.
[0278] In the embodiment of the present application, when the cross-component intra prediction mode adopted by the current chroma block is different, the specific method of 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 the CCCM mode, the decoding end 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 the GLM mode, the decoding end 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 the 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 under 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 under 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 under 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 prediction value of the current chroma block based on the above S102, and determines the first prediction value of the current chroma block based on the above S103. Then, the following S104 is executed.
[0283] S104: Determine a second prediction value of the current chroma block based on the first prediction value and a limited range.
[0284] In an embodiment of the present application, if the prediction mode of the current chroma block is the cross-component intra prediction mode, in order to improve prediction performance, a limited range of the prediction value of the current chroma block is determined. Then, based on the limited range, the first prediction value determined based on the cross-component intra prediction mode is limited to prevent the first prediction value obtained based on the cross-component intra 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 embodiment of the present application does not limit the specific manner in which the decoding end determines the second prediction value of the current chroma block based on the first prediction value and a limited range.
[0286] In some embodiments, if the predicted values of the first chroma component and the second chroma component correspond to a limited range, for example, if the first chroma component and the second chroma component correspond to a maximum limited value a, the maximum limited value a is used to limit the first predicted value of the current chroma block under the first chroma component and the first predicted value of the current chroma block under the second chroma component. If the first chroma component and the second chroma component correspond to a minimum limited value b, the minimum limited value b is used to limit the first predicted value of the current chroma block under the first chroma component and the first predicted value of the current chroma block under the second chroma component.
[0287] For example, if the first prediction value of the current chroma block under the first chroma component is less than the maximum limit value a, the first prediction value of the current chroma block under the first chroma component is determined as the second prediction value of the current chroma block under the first chroma component. If the first prediction value of the current chroma block under the first chroma component is greater than the maximum limit value a, the maximum limit value a is determined as the second prediction value of the current chroma block under the first chroma component. If the first prediction value of the current chroma block under the second chroma component is less than the maximum limit value a, the first prediction value of the current chroma block under the second chroma component is determined as the second prediction value of the current chroma block under the second chroma component. If the first prediction value of the current chroma block under the second chroma component is greater than the maximum limit value a, the maximum limit value a is determined as the second prediction value of the current chroma block under the second chroma component.
[0288] For another example, if the first prediction value of the current chroma block under the first chroma component is greater than the minimum limit value b, the first prediction value of the current chroma block under the first chroma component is determined as the second prediction value of the current chroma block under the first chroma component. If the first prediction value of the current chroma block under the first chroma component is less than the minimum limit value b, the minimum limit value b is determined as the second prediction value of the current chroma block under the first chroma component. If the first prediction value of the current chroma block under the second chroma component is greater than the minimum limit value b, the first prediction value of the current chroma block under the second chroma component is determined as the second prediction value of the current chroma block under the second chroma component. If the first prediction value of the current chroma block under the second chroma component is less than the minimum limit value a, the minimum limit value b is determined as the second prediction value of the current chroma block under the second chroma component.
[0289] In some embodiments, the predicted values of the first chroma component and the second chroma component each correspond to a limited range. Taking the i-th chroma component as an example, the decoder may determine the second predicted value of the current chroma block for the i-th chroma component based on the first predicted value for the i-th chroma component and the limited range for the i-th chroma component.
[0290] In one example, if the limited range under the i-th chroma component includes a maximum limited value, the maximum limited value under the i-th chroma component is used to limit the first prediction value of the current chroma block under the i-th chroma component.
[0291] For example, if the first prediction 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, the first prediction value of the current chroma block under the i-th chroma component is determined as the second prediction value of the current chroma block under the i-th chroma component.
[0292] For another 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, 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 limited range under the i-th chroma component includes a minimum limited value, the minimum limited value under the i-th chroma component is used to limit the first prediction value of the current chroma block under the i-th chroma component.
[0294] For example, if the first prediction value of the current chroma block under the i-th chroma component is greater than or equal to the minimum limit value under the i-th chroma component, the first prediction value of the current chroma block under the i-th chroma component is determined as the second prediction value of the current chroma block under the i-th chroma component.
[0295] For another 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, 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 limited range under the i-th chroma component includes a maximum limited value and a minimum limited value, the maximum limited value and the minimum limited value under the i-th chroma component are used to limit the first prediction value of the current chroma block under the i-th chroma component.
[0297] For example, if the first prediction 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 prediction value of the current chroma block under the i-th chroma component is determined as the second prediction value of the current chroma block under the i-th chroma component.
[0298] For another 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, 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 another 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, 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 the embodiment of the present application, when determining the predicted value of the current chroma block, prediction is performed pixel by pixel. That is, the decoder predicts the predicted 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 of each pixel to obtain a second predicted value for each pixel. The decoding end limits the first predicted value of each pixel in the current chroma block and obtains the second predicted value of each pixel in the same process. Here, the current position (x, y) in the current chroma block is used as an example for explanation.
[0301] Exemplarily, for the current position (x, y) in the current chroma block, the process of limiting the Cb prediction value and the Cr prediction value of the current position (x, y) 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. (x,y) 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 The maximum limit value corresponding to the Cb component of the current chroma block. cb The minimum limit value corresponding to the Cb component of the current chroma block. (x,y) is the predicted value (ie, the first predicted value) of the Cr component of the pixel at position (x, y) in the current chroma block. cr The maximum limit value corresponding to the Cr component of the current chroma block. min cr It is the minimum limit value corresponding to the Cr component of the current chroma block.
[0304] According to Table 2 above, if the Cb prediction value of the current position (x, y) in the current chroma block determined based on the cross-component intra prediction mode (i.e., the first prediction value under the Cb component) is greater than the maximum limit value max of the Cb component cb When the max cb Determine the Cb prediction value (i.e., the second prediction value) of the current position (x, y). If the Cb prediction value (i.e., the first prediction value under the Cb component) of the current position (x, y) determined based on the cross-component intra prediction mode is less than the minimum limit value min of the Cb component cb When the min cb Determine the Cb prediction value (i.e., the second prediction value) of the current position (x, y). Similarly, if the Cr prediction value (i.e., the first prediction value under the Cr component) of the current position (x, y) in the current chroma block determined based on the cross-component intra prediction mode is greater than the maximum limit value max of the Cr component crWhen the max cr Determine the Cr prediction value (i.e., the second prediction value) of the current position (x, y). If the Cr prediction value (i.e., the first prediction value under the Cr component) of the current position (x, y) determined based on the cross-component intra prediction mode is less than the minimum limit value min of the Cr component cr When the min cr Determine the Cr prediction value (ie, the second prediction value) of the current position (x, y).
[0305] The decoding end may determine the second prediction value of the current chroma block based on the above steps, and then decode the current chroma block based on the second prediction value to obtain a reconstructed value of the current chroma block.
[0306] The video decoding method provided in the embodiment of the present application determines the prediction mode of the current chroma block when predicting the current chroma block. If the prediction mode is a cross-component intra-frame prediction mode, a limited range of the prediction value of the current chroma block is determined, and the limited range includes at least one of the maximum limited value and the minimum limited value of the prediction value; then, based on the cross-component intra-frame prediction mode, a first prediction value of the current chroma block is determined; based on the first prediction value and the limited range, a second prediction value of the current chroma block is determined. That is, in the embodiment of the present application, if the current chroma block adopts the cross-component intra-frame prediction mode, the first prediction value determined by the cross-component intra-frame prediction mode is limited to avoid the prediction value of the current chroma block being too large or too small, thereby improving the prediction accuracy of the current chroma block and improving the video encoding and decoding performance.
[0307] The above describes the prediction method of the present application using the decoding end as an example, and the following describes it using the encoding end as an example.
[0308] FIG12 is a flow chart of a prediction method according to an embodiment of the present application, which is applied to the video encoders shown in FIG1 and FIG2. As shown in FIG12, the method according to the embodiment of the present application includes:
[0309] S201: Determine a prediction mode for a current chroma block.
[0310] In the embodiment of the present application, when encoding the current block, the encoding end first performs predictive encoding on the luminance component of the current block to obtain a luminance reconstruction value of the current block, and then performs predictive encoding on the chrominance component of the current block.
[0311] In the embodiment of the present application, the chroma component of the current block is recorded as the current chroma block.
[0312] Before predictive coding is performed on the current chroma block, a prediction mode of the current chroma block is first determined.
[0313] The embodiment of the present application does not limit the specific method of 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 the present 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 a 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, encoding the mode index of the prediction mode into the bitstream.
[0316] In some embodiments, the above S201 includes the following steps:
[0317] S201-A1, determining a first prediction mode;
[0318] S201-A2: Determine a prediction mode for the current chroma block based on the first prediction mode.
[0319] As can be seen from the above, the cross-component intra prediction modes include CCLM, CCCM, GLM, CCMerge, etc. In the CCMerge mode, the prediction mode of the current chroma block is determined by constructing a list.
[0320] In some embodiments, the first prediction mode may be a default mode. For example, the encoding end and the decoding end may set the first prediction mode to be the CCMerge mode by default.
[0321] In some embodiments, the encoder may determine the first prediction mode based on an enable flag of the prediction mode. For example, when the enable flag of the CCCM mode is 1, it indicates that the CCCM mode is used, and in this case, the first prediction mode is determined to be the CCCM mode. Alternatively, when the enable flag of the CCMerge mode is 1, it indicates that the CCMerge mode is used, and in this case, the first prediction mode is determined to be the CCMerge mode.
[0322] After determining the first prediction mode, the encoder determines a prediction mode for the current chroma block based on the first prediction mode.
[0323] Wherein, based on the first prediction mode, determining the prediction mode of the current chroma block includes at least the following two cases:
[0324] In case 1, if the first prediction mode is the CCCM mode or the GLM mode, the encoder directly determines the CCCM mode or the GLM mode as the prediction mode of the current chroma block.
[0325] Case 2: If the first prediction mode is the cross-component merging mode, then the above S201-A2 includes the following steps:
[0326] S201-A21, constructing a cross-component prediction mode list by inheriting the cross-component intra prediction modes of chroma blocks adjacent to and / or not adjacent to the current chroma block around the current chroma block;
[0327] S201-A22. Determine a prediction mode for 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] Exemplarily, the process of constructing the cross-component prediction mode list at the encoder may include:
[0330] First, the encoder obtains the cross-component intra-frame prediction mode of the chroma blocks at the adjacent positions around the current chroma block. Exemplarily, as shown in Figure 6E, the encoder sequentially accesses positions B1→A1→B0→A0→B2. If at least one chroma block at these positions uses a cross-component intra-frame prediction mode, the cross-component intra-frame prediction mode of the at least one chroma block is stored in the cross-component prediction mode list. Exemplarily, the order in which the cross-component intra-frame prediction modes are stored in the cross-component prediction mode list can be consistent with the order in which the above positions are accessed.
[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 may further obtain a cross-component intra prediction mode for a chroma block at a non-adjacent position of the current chroma block. The non-adjacent position includes non-adjacent positions above, to the upper left, to the upper right, to the left, and to the lower left of the current chroma block.
[0332] In some embodiments, if the length of the above-mentioned cross-component prediction mode list does not meet the preset length, that is, N, that is, when the number of cross-component intra-frame prediction modes obtained from 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 the cross-component prediction mode list based on the above steps, the encoder determines the prediction mode of the current chroma block based on the cross-component prediction mode list.
[0334] The embodiment of the present application does not limit the specific method of determining the prediction mode of the current chroma block based on the cross-component prediction mode list.
[0335] In one example, the encoder sets a cross-component intra prediction mode in the cross-component prediction mode list as the prediction mode for the current chroma block by default. For example, the first cross-component intra prediction mode in the cross-component prediction mode list is set as the prediction mode for the current chroma block by default, or the second cross-component intra prediction mode in the cross-component prediction mode list is set as the prediction mode for the current chroma block by default.
[0336] In one example, the encoder determines the mode with the lowest cost in the above cross-component prediction mode list as the prediction mode for the current chroma block.
[0337] In one example, after determining the prediction mode for the current chroma block, the encoder 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, based on the mode index, determine the prediction mode for the current chroma block 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 encoder writes the prediction mode into the bitstream, so that the decoder obtains the prediction mode of the current chroma block by decoding the bitstream.
[0339] S202: If the prediction mode is the inter-component intra prediction mode, determine a limited range of the prediction value of the current chroma block.
[0340] The limited range includes at least one of a maximum limited value and a minimum limited value of the predicted value.
[0341] In an embodiment of the present application, in order to further improve the prediction accuracy of the cross-component intra-frame prediction mode, when the current chroma block adopts the cross-component intra-frame prediction mode, the limited range of the prediction value of the current chroma block is determined to limit the prediction value of the current chroma block to the limited range, thereby preventing the predicted value of the current chroma block from being too large and / or too small due to the prediction error, thereby further improving the prediction accuracy of the chroma component.
[0342] It should be noted that, in the embodiment of the present application, the value range of the predicted value of the chrominance component is limited. In some embodiments, the value range of the predicted value of the luminance component, etc. may also be limited.
[0343] In some embodiments, limiting the predicted value of the current chroma block may be to limit the maximum value of the predicted value of the current chroma block, and the limited value is recorded as the maximum limited value of the predicted value. In other words, the predicted value of the current chroma block is limited to not exceed the maximum limited value.
[0344] In some embodiments, limiting the predicted value of the current chroma block may be to limit a minimum value of the predicted value of the current chroma block, and the limit value is recorded as the minimum limit value of the predicted value. In other words, the predicted value of the current chroma block is limited to not be less than the minimum limit value.
[0345] In some embodiments, limiting the predicted value of the current chroma block may include limiting both the maximum and minimum values of the predicted value of the current chroma block. In other words, limiting the predicted value of the current chroma block to not be less than the minimum limit value, and limiting the predicted value of the current chroma block to not exceed the maximum limit value.
[0346] In some embodiments, a flag (i.e., a first flag) is used to indicate to the encoder whether to limit the predicted value of the current chroma block. In this case, before determining the limited 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. The first flag is used to indicate whether to limit the predicted value of the current chroma block. Based on the first flag, the encoder determines whether to limit the value range of the predicted value of the current chroma block.
[0347] For example, if the first flag indicates that the prediction value of the current chroma block is not limited, the encoder skips the step of determining the limited range of the prediction value of the current chroma block.
[0348] For another example, if the first flag indicates that the prediction value of the current chroma block is limited, the encoder performs the step of determining a limited range of the prediction value of the current chroma block.
[0349] The embodiment of the present 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 encoding end determines that the above-mentioned first prediction mode is the CCMerge mode, the encoding end determines the cross-component intra-frame prediction mode of the current chroma block by inheriting the cross-component intra-frame prediction mode of the chroma blocks around and adjacent and / or non-adjacent to the current chroma block. For example, referring to the above embodiment, if the encoding end inherits the cross-component intra-frame prediction mode of chroma block 1. In this embodiment, the encoding end can also inherit the first flag of chroma block 1. That is to say, if the above-mentioned first prediction mode is the CCMerge mode, the encoding end determines the chroma block corresponding to the prediction mode inherited by the current chroma block, and determines the first flag corresponding to the chroma block as the first flag corresponding to the current chroma block.
[0351] In some embodiments, the encoding end may obtain the first flag from high-level semantics.
[0352] The embodiment of the present application does not limit the specific form of the first flag, which can be understood as any information that can indicate whether the predicted value of the current chrominance block is limited.
[0353] In one example, the first flag may be represented as cross_component_clip_flag, and different values may be assigned to cross_component_clip_flag to indicate whether the prediction value of the current chroma block is limited. For example, if the value of cross_component_clip_flag is a first value, it indicates that the prediction value of the current chroma block is limited, and if the value of cross_component_clip_flag is a second value, it indicates that the prediction value of the current chroma block is not limited.
[0354] The embodiment of the present application does not limit the specific values of the first value and the second value.
[0355] Exemplarily, the first value is 1.
[0356] Exemplarily, the second value is 0.
[0357] In this embodiment, the encoding end determines the prediction mode of the current chroma block based on the above steps. If it is determined that the prediction mode of the current chroma block is a cross-component intra-frame prediction mode (for example, a CCCM mode or a GLM mode), the first flag corresponding to the current chroma block is determined, and then based on the first flag, it is determined whether to limit the prediction value of the current chroma block. Specifically, if the value of the first flag is a first numerical value, it indicates that the prediction value of the current chroma block is limited, so the encoding end determines the limited range of the prediction value of the current chroma block. If the value of the first flag is a second numerical value, it indicates that the prediction value of the current chroma block is not limited. At this time, the encoding end skips determining the limited range of the prediction value of the current chroma block, and directly uses the prediction value obtained by the cross-component intra-frame prediction mode as the prediction value of the current chroma block.
[0358] In some embodiments, if the encoding end does not obtain the first flag in the high-level semantics, the value of the first flag is defaulted to the 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 further write the first flag into the bitstream, so that the decoding end may obtain the first flag corresponding to the current chroma block by decoding the bitstream.
[0360] Illustratively, the syntax elements included in the code stream are shown in Table 1.
[0361] In some embodiments, determining whether the current chroma block satisfies a preset condition indicates to the encoder whether to limit the predicted value of the current chroma block. That is, in embodiments of the present application, the range of the predicted value of some chroma blocks is limited, while the range of the predicted value of some chroma blocks is not limited. In this case, before determining the limited range of the predicted value of the current chroma block, the encoder first needs to determine whether the current chroma block satisfies the preset condition.
[0362] For example, if the current chroma block does not meet the preset condition, the encoder skips the step of determining a limited range of the prediction value of the current chroma block.
[0363] For another example, if the current chroma block meets a preset condition, the encoder performs a step of determining a limited range of a prediction value of the current chroma block.
[0364] The embodiments of the present application do not limit the above-mentioned preset conditions, and they can be set according to actual needs.
[0365] In some embodiments, the aforementioned 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 size of the current chroma block meets the preset size;
[0368] The shape of the current chroma block satisfies a preset shape.
[0369] That is to say, the preset conditions of the embodiment of the present application may include only any one of the above three conditions, or include any two of the above three conditions, or include all three of the above conditions.
[0370] In one example, because CCCM and GLM require multiple rows and columns of reconstructed pixel values to derive model parameters, in the ECM reference software, to reduce row cache storage between CTUs that span rows, the use of CCCM and GLM is restricted for blocks at the upper boundary of the CTU. Accordingly, the method for determining the limited range of the predicted value of the current chrominance value in the embodiments of the present application should also be restricted. That is, when the current chrominance block is the first row of chrominance blocks in the current CTU, the step of determining the limited range of the predicted value of the current chrominance value is skipped.
[0371] In one example, the size of the current chroma block satisfies a preset size, which may be that at least one of the length and width of the current chroma block satisfies 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. For another example, the length of the current chroma block is less than or equal to the preset length. For another example, the width of the current chroma block is less than or equal to the preset width.
[0372] In an example, the size of the current chroma block satisfies a preset size, which may be that the number of pixels included in the current chroma block satisfies a preset number.
[0373] In one example, the shape of the current chroma block satisfies a preset shape, which may be that the aspect ratio and / or width-to-length ratio of the current chroma block satisfies a preset ratio. 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. For another example, the aspect ratio of the current chroma block is less than or equal to the first ratio. For another example, the width-to-length ratio is less than or equal to the second ratio.
[0374] As can be seen from the above, in the embodiment of the present application, the manner of determining whether to limit the predicted value of the current chrominance block includes at least the following examples:
[0375] In Example 1, the encoder limits the prediction 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 inter-component intra prediction mode, it determines a limited range of the prediction value of the current chroma block.
[0376] Example 2, a first flag is used to indicate whether the prediction value of the current chroma block is limited. At this time, when the encoding end determines that the prediction mode of the current chroma block is the cross-component intra-frame prediction mode, it is also necessary to determine the first flag corresponding to the current chroma block, and then determine whether to limit the prediction value of the current chroma block based on the first flag. For example, if the first flag indicates that the prediction value of the current chroma block is limited, the encoding end determines the limited range of the prediction value of the current chroma block. For another example, if the first flag indicates that the prediction value of the current chroma block is not limited, the encoding end skips the step of determining the limited range of the prediction value of the current chroma block.
[0377] Example 3: Determining whether to limit the prediction value of the current chroma block by determining whether the current chroma block meets a preset condition. That is, when the encoder determines that the prediction mode of the current chroma block is an inter-component intra prediction mode, it determines whether the current chroma block meets the preset condition. If the current chroma block meets the preset condition, the encoder determines a limited range for the prediction value of the current chroma block. For another example, if the current chroma block does not meet the preset condition, the encoder skips the step of determining a limited range for the prediction value of the current chroma block.
[0378] Example 4, determines whether to limit the predicted value of the current chroma block through the first flag and the preset condition. That is, in this 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 condition, the encoding end 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 condition, the encoding end skips the step of determining the limited range of the predicted value of the current chroma block. In this Example 4, the encoding end can first determine whether the current chroma block meets the preset condition. If the current chroma block does not meet the preset condition, the encoding end no longer determines the first flag, but directly skips the step of determining the limited range of the predicted value of the current chroma block. If the encoding end 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 encoding 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 encoding end skips the step of determining the limited range of the predicted value of the current chroma block.
[0379] The following describes the specific process of determining the limited range of the prediction value of the current chrominance block at the encoder.
[0380] In the embodiment of the present application, the encoder determines the limited range of the prediction value of the current chroma block in at least the following ways:
[0381] In a first approach, the prediction value of the current chroma block is limited to a preset value. That is, the maximum limit value and / or the minimum limit value of the prediction value of the current chroma block are preset values. The preset values may be empirical values or experimental values, and are not limited in this embodiment of the present application.
[0382] Method 2: If the encoding end determines that the above-mentioned first prediction mode is the CCMerge mode, the encoding end inherits the cross-component intra-frame prediction mode of the chroma blocks around the current chroma block and the adjacent and / or non-adjacent chroma blocks. For example, referring to the above embodiment, the encoding end inherits the cross-component intra-frame prediction mode of chroma block 1. In this embodiment, the encoding end can also inherit the limited range of the prediction value of chroma block 1. That is, if the above-mentioned first prediction mode is the CCMerge mode, the encoding end determines the chroma block corresponding to the prediction mode inherited by the current chroma block, and determines the limited range of the prediction value of the chroma block as the limited range of the prediction value of the current chroma block.
[0383] Mode 3: Since the chroma value of the current chroma block is correlated with the chroma blocks in the surrounding area of the current chroma block, based on this, the above S202 includes the following step S202-A:
[0384] S202-A. Determine a limited range of a prediction value of the current chrominance block based on the chrominance values of the reconstructed area surrounding the current chrominance block.
[0385] In this embodiment of the present application, the chroma components include a first chroma component and a second chroma component, where the first chroma component can be a U component or a Cb component, and the second chroma component can be a V component or a Cr component. Thus, the encoder can determine a limited range of predicted values for the first chroma component and the second chroma component of the current chroma block based on the chroma values of the first chroma component and the second chroma component of the reconstructed area surrounding the current chroma block.
[0386] The embodiment of the present application does not limit the specific method by which the encoding end determines the limited range of the predicted values of the first chroma component and the second chroma component of the current chroma block based on the chroma values of the first chroma component and the second chroma component of the reconstructed area around the current chroma block.
[0387] In some embodiments, the encoding end determines a maximum limit value and / or a minimum limit value for the predicted value of the current chroma block based on the chroma values of the reconstructed area surrounding the current chroma block. That is, the predicted value of the current chroma block under the first chroma component and the second chroma component is limited to not greater than the maximum limit value, and / or the predicted value of the current chroma block under the first chroma component and the second chroma component is limited to not less than the minimum limit value. For example, the maximum chroma value of the reconstructed area surrounding the current chroma block is used as the maximum limit value for the predicted value of the current chroma block. In this case, the maximum chroma value is the maximum value of the chroma value under the first chroma component and the chroma value under the second chroma component. For another example, the minimum chroma value of the reconstructed area surrounding the current chroma block is used as the minimum limit value for the predicted value of the current chroma block. In this case, the minimum chroma value is the minimum value of the chroma value under the first chroma component and the chroma value under the second chroma component of the surrounding reconstructed area.
[0388] In some embodiments, since the chroma value of each pixel in the reconstructed area surrounding the current chroma block has been reconstructed, the encoder can find a pixel 1 in the reconstructed area surrounding the current chroma block with the largest chroma value of the first chroma component or the second chroma component, and then determine the chroma value of this pixel 1 as the limited range of the predicted value of the current chroma block, that is, determine the chroma value of the first chroma component of this pixel 1 as the maximum limited value of the first chroma component of the current chroma value, and determine the chroma value of the second chroma component of this pixel 1 as the maximum limited value of the second chroma component of the current chroma value. Alternatively, find a pixel 2 in the reconstructed area surrounding the current chroma block with the smallest chroma value of the first chroma component or the second chroma component, and then determine the chroma value of this pixel 2 as the limited range of the predicted value of the current chroma block, that is, determine the chroma value of the first chroma component of this pixel 2 as the minimum limited value of the first chroma component of the current chroma value, and determine the chroma value of the second chroma component of this pixel 2 as the minimum limited value of the second chroma component of the current chroma value. At this time, the first chroma component and the second chroma component respectively correspond to a limited range.
[0389] In some embodiments, when determining the predicted value of the current chroma block, the encoding end separately determines the predicted values of the first chroma component and the second chroma component of the current chroma block. Correspondingly, the limited range of the predicted value of the first chroma component of the current chroma block and the limited range of the predicted value of the second chroma component of the current chroma block are also determined separately. Among them, the specific process of determining the limited range of the predicted value of the first chroma component and the limited range of the predicted value of the second chroma component are basically the same. For the sake of ease of description, the limited range of the predicted value of the i-th chroma component of the current chroma block is used as an example for explanation. The i-th chroma component can be the first chroma component U component or Cb component, or it can be the second chroma component V component or Cr component. Based on this, the above S202-A includes the following steps of S202-A1:
[0390] S202-A1. Determine a limited range of a prediction value of the current chroma block under the i-th chroma component based on the chroma values of the surrounding reconstructed area under the i-th chroma component.
[0391] In an embodiment of the present application, the encoder determines a limited range of predicted values for the current chroma block under the i-th chroma component based on the chroma values of the surrounding reconstructed areas under the i-th chroma component of the current chroma block. For example, the maximum value of the chroma values of the surrounding reconstructed areas under the i-th chroma component of the current chroma block is used as the maximum limited value of the predicted value for the current chroma block under the i-th chroma component. For another example, the minimum value of the chroma values of the surrounding reconstructed areas under the i-th chroma component of the current chroma block is used as the minimum limited value of the predicted value for the current chroma block under the i-th chroma component.
[0392] In this embodiment of the present application, the reconstructed surrounding region of the current chroma block under the first chroma component and the reconstructed surrounding region under the second chroma component may 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 under the i-th chroma component, the encoder first determines the reconstructed surrounding region of the current chroma block under the i-th chroma component and records this reconstructed surrounding region as the first reconstructed surrounding region.
[0393] In the embodiment of the present application, specific methods for determining the first surrounding reconstructed area of the current chroma block under the i-th component include but are not limited to the following:
[0394] Method 1: A default reconstruction area is determined as the first surrounding reconstructed area of the current chroma block under the i-th component. For example, the reconstructed area above the current chroma block, the reconstructed area to the upper left of the current chroma block, and the reconstructed area to the upper right of the current chroma block are determined by default as the first surrounding reconstructed area of the current chroma block under the i-th component. For another example, the reconstructed area above the current chroma block, the reconstructed area to the upper left of the current chroma block, the reconstructed area to the upper right of the current chroma block, the reconstructed area to the left of the current chroma block, and the reconstructed area to the lower left of the current chroma block are determined by default as the first surrounding reconstructed area of the current chroma block under the i-th component, and so on.
[0395] Exemplarily, the first surrounding reconstructed area of the current chroma block under the Cb chroma component is shown in FIG8A .
[0396] Exemplarily, the first surrounding reconstructed area of the current chrominance block under the Cr chrominance component is shown in FIG8B .
[0397] Method 2: If the prediction mode of the current chroma block is the convolution cross-component model mode, the second surrounding reconstructed area corresponding to the convolution cross-component model mode is determined; based on the second surrounding reconstructed area, the first surrounding reconstructed area is determined.
[0398] In the second method, the encoding 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 convolution cross-component model mode in the cross-component intra prediction mode, it can be seen from the above that in the convolution cross-component model mode, it is necessary to determine the filter coefficient based on the surrounding reconstructed area of the current chroma block. In the embodiment of the present application, for the convenience of description, the surrounding reconstructed area of the current chroma block used to determine the filter coefficient in the convolution cross-component model mode is recorded as the second surrounding reconstructed area. In this way, if the prediction mode of the current chroma block is the convolution cross-component model mode, the encoding end determines the second surrounding reconstructed area corresponding to the convolution cross-component model mode, and determines the above-mentioned first surrounding reconstructed area based on the second surrounding reconstructed area.
[0399] The embodiment of the present application does not limit the specific shape of the second surrounding reconstructed area of the current chroma block.
[0400] In some embodiments, the second surrounding reconstructed area includes any one of a first-type reconstructed area, a second-type reconstructed area, and a third-type reconstructed area.
[0401] 9A , the first type of reconstruction area includes the upper, upper left, upper right, left, and lower left areas of the current chrominance block. In this case, the CCCM model parameters are derived from the area surrounding the current chrominance component and the area surrounding the corresponding luminance block.
[0402] For example, as shown in FIG9B , the second type of reconstruction area includes the upper, upper left, and upper right areas of the current chrominance block. In this case, the CCCM model parameters are derived from the upper, upper left, and upper right areas of the current chrominance block and the upper, upper left, and upper right areas of the corresponding luminance block.
[0403] For example, as shown in FIG9C , the third type of estimated region includes the left, upper left, and lower left regions of the current chrominance block. In this case, the CCCM model parameters are derived from the left, upper left, and lower left regions of the current chrominance block and the left, upper left, and lower left regions of the corresponding luminance block.
[0404] It should be noted that the second surrounding reconstructed area in the embodiment of the present application may be other types of reconstructed areas in addition to the first type of reconstructed area, the second type of reconstructed area and the third type of reconstructed area, and the embodiment of the present application does not limit this.
[0405] In some embodiments, if the encoding end determines that the prediction mode of the current chroma block is a convolutional cross-component model mode, it can determine the type of the second surrounding reconstruction area by encoding relevant syntax elements, that is, determine which reconstruction area of the current chroma block to use to determine the model parameters of CCCM.
[0406] The encoding end determines a second surrounding reconstructed area corresponding to the convolution cross-component model mode, and determines the first surrounding reconstructed area based on the second surrounding reconstructed area.
[0407] The embodiment of the present application does not limit the specific manner in which the encoder determines the first surrounding reconstructed area based on the second surrounding reconstructed area.
[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 determined to be a first-type reconstructed area. For example, the second surrounding reconstructed area includes the upper, upper left, upper right, left and lower left areas of the current chroma block as shown in FIG9A , then the first surrounding reconstructed area has the same shape as the second surrounding reconstructed area, and may also include the upper, upper left, upper right, left and lower left areas of the current chroma block as shown in FIG10A . Optionally, the number of rows and lists included in the first surrounding reconstructed area may be the same as the number of rows and lists included in the second surrounding reconstructed area, or they may be different, or they may be partially the same and partially different (for example, the same number of rows and a different number of columns, or the same number of columns and a different number of rows), and this embodiment of the present application does not impose any restrictions on this.
[0410] Example 2: If the second surrounding reconstructed area is a second type of reconstructed area, the first surrounding reconstructed area is determined to be a second type of reconstructed area. For example, if the second surrounding reconstructed area includes the upper, upper left, and upper right areas of the current chroma block as shown in FIG9B , then the first surrounding reconstructed area has the same shape as the second surrounding reconstructed area, and may also include the upper, upper left, and upper right areas of the current chroma block as shown in FIG10B . 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, and this is not limited in this embodiment of the present application.
[0411] Example 3: If the second surrounding reconstructed area is a third-category reconstructed area, the first surrounding reconstructed area is determined to be a third-category reconstructed area. For example, if the second surrounding reconstructed area includes the left, upper left, and lower left areas of the current chroma block as shown in FIG9C , 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 areas of the current chroma block as shown in FIG10C . 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, and this is not limited in this embodiment of the present application.
[0412] In one example, when the encoder uses the second surrounding reconstructed area to determine the CCCM model parameters, the encoder may also use the second surrounding reconstructed area to determine a limited range of predicted values for the i-th chroma component of the current chroma block. In this case, the first surrounding reconstructed area and the second surrounding reconstructed area are the same.
[0413] In a third approach, the first surrounding reconstructed area includes at least one of N preset types of reconstructed areas, where N is a positive integer.
[0414] The embodiment of the present application does not limit the specific shapes of the N types of reconstruction areas.
[0415] In some embodiments, the aforementioned preset N types of reconstruction areas include 5 types of reconstruction areas.
[0416] Exemplarily, the first type of reconstruction area among the five types of reconstruction areas includes the area above, to the upper left, and to the left of the current chroma block. As shown in FIG11A , the first type of reconstruction area of the current chroma block under the Cb chroma component includes the area above, to the upper left, and to the left of the current chroma block under the Cb chroma component. The first type of reconstruction area of the current chroma block under the Cr chroma component includes the area above, to the upper left, and to the left of the current chroma block under the Cr chroma component.
[0417] Exemplarily, the second type of reconstruction area among the five types of reconstruction areas includes the area above and to the upper right of the current chroma block. As shown in FIG11B , the second type of reconstruction area for the current chroma block under the Cb chroma component includes the area above and to the upper right of the current chroma block under the Cb chroma component. The second type of reconstruction area for the current chroma block under the Cr chroma component includes the area above and to the upper right of the current chroma block under the Cr chroma component.
[0418] Illustratively, the third type of reconstruction area among these five types of reconstruction areas includes the area above the current chroma block. As shown in FIG11C , the third type of reconstruction area for the current chroma block in the Cb chroma component includes the area above the current chroma block in the Cb chroma component. The third type of reconstruction area for the current chroma block in the Cr chroma component includes the area above the current chroma block in the Cr chroma component.
[0419] Illustratively, the fourth type of reconstruction region among the five types of reconstruction regions includes the upper left and left regions of the current chroma block. As shown in FIG11D , the fourth type of reconstruction region for the current chroma block in the Cb chroma component includes the upper left and left regions of the current chroma block in the Cb chroma component. The fourth type of reconstruction region for the current chroma block in the Cr chroma component includes the upper left and left regions of the current chroma block in the Cr chroma component.
[0420] Illustratively, the fifth type of reconstruction region among the five types of reconstruction regions includes the left area of the current chroma block. As shown in FIG11E , the fifth type of reconstruction region for the current chroma block in the Cb chroma component includes the left area of the current chroma block in the Cb chroma component. The fifth type of reconstruction region for the current chroma block in the Cr chroma component includes the left area of the current chroma block in the Cr chroma component.
[0421] That is, in the third approach, the encoder may use any one or several types of reconstructed areas among the N types of reconstructed areas as the first surrounding reconstructed area.
[0422] Exemplarily, each of the N types of reconstruction areas includes at least one row and / or at least one table of reconstructed pixel values. Optionally, the same six rows and / or six columns of reconstructed pixel values used in CCCM and GLM modes may be used.
[0423] Based on the above method, the encoder determines the first surrounding reconstructed area 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 area.
[0424] The embodiment of the present application does not limit the specific manner in which the encoder determines, based on the first surrounding reconstructed area, a limited range of predicted values of the current chroma block under the i-th chroma component.
[0425] For example, if the limited range of the predicted value of the current chroma block under the i-th chroma component includes the maximum limited value of the predicted value of the current chroma block under the i-th chroma component, the encoding end determines the maximum chroma value of the surrounding reconstructed area under the i-th chroma component as the maximum limited value of the predicted value of the current chroma block under the i-th chroma component.
[0426] For another example, if the limited range of the predicted value of the current chroma block under the i-th chroma component includes the minimum limited value of the predicted value of the current chroma block under the i-th chroma component, the encoding end will determine the minimum chroma value of the surrounding reconstructed area under the i-th chroma component as the minimum limited value of the predicted value of the current chroma block under the i-th chroma component.
[0427] For another example, if the limited range of the predicted value of the current chroma block under the i-th chroma component includes the maximum limited value and the minimum limited value of the predicted value of the current chroma block under the i-th chroma component, the encoding end determines the maximum chroma value of the surrounding reconstructed area under the i-th chroma component as the maximum limited value of the 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 limited value of the predicted value of the current chroma block under the i-th chroma component.
[0428] For another example, if the limited range of the predicted value of the current chroma block under the i-th chroma component includes the maximum limited value of the predicted value of the current chroma block under the i-th chroma component, the encoding end determines the average value of several maximum chroma values of the surrounding reconstructed areas under the i-th chroma component as the maximum limited value of the predicted value of the current chroma block under the i-th chroma component.
[0429] For another example, if the limited range of the predicted value of the current chroma block under the i-th chroma component includes the minimum limited value of the predicted value of the current chroma block under the i-th chroma component, the encoding end determines the average value of several minimum chroma values of the surrounding reconstructed areas under the i-th chroma component as the minimum limited value of the predicted value of the current chroma block under the i-th chroma component.
[0430] For another example, if the limited range of the predicted value of the current chroma block under the i-th chroma component includes the maximum limited value and the minimum limited value of the predicted value of the current chroma block under the i-th chroma component, the encoding end determines the average value of several maximum chroma values of the surrounding reconstructed areas under the i-th chroma component as the maximum limited value of the predicted value of the current chroma block under the i-th chroma component, and determines the average value of several minimum chroma values of the surrounding reconstructed areas under the i-th chroma component as the minimum limited value of the predicted value of the current chroma block under the i-th chroma component.
[0431] The above embodiment introduces the specific process of determining the limited range of the prediction value of the current chrominance block at the encoder.
[0432] S203 : Determine a first prediction value of the current chroma block based on the cross-component intra prediction mode.
[0433] It should be noted that there is no strict order in which the above-mentioned S203 and the step of determining the limited range of the prediction value of the current chroma block in the above-mentioned S202 are executed. That is to say, when the encoding end determines that the prediction mode of the current chroma block is the cross-component intra-frame prediction mode, it can first execute S203 to determine the first prediction value of the current chroma block, and then execute S202 to determine the limited range of the prediction value of the current chroma block. It is also possible to first execute S202 to determine the limited range of the prediction value of the current chroma block, and then execute S203 to determine the first prediction value of the current chroma block based on the cross-component intra-frame prediction mode. It is also possible to simultaneously execute the two steps of S203 determining the first prediction value of the current chroma block based on the cross-component intra-frame prediction mode and S202 determining the limited range of the prediction value of the current chroma block. The specific determination will be based on actual conditions, and the embodiments of the present application do not impose any restrictions on this.
[0434] In the embodiment of the present application, for the convenience of description, the predicted value of the current chroma block obtained based on the cross-component intra prediction mode is recorded as the first predicted value of the current chroma block.
[0435] In the embodiment of the present application, when the cross-component intra prediction mode adopted by the current chroma block is different, the specific method of 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 the 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 used by the current chroma block is the 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 encoding end determines first prediction values 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 encoding end determines a first prediction value for the i-th chroma component of the current chroma block based on a cross-component intra-frame prediction mode. For example, the encoding end determines a first prediction value for the first chroma component (Cb or U component) of the current chroma block based on a cross-component intra-frame prediction mode, and the encoding end determines a first prediction value for the second chroma component (Cr or V component) of the current chroma block based on a cross-component intra-frame prediction mode.
[0439] The encoder determines the limited range of the prediction value of the current chroma block based on the above S202, and determines the first prediction value of the current chroma block based on the above S203. Then, the following S204 is executed.
[0440] S204: Determine a second prediction value of the current chroma block based on the first prediction value and a limited range.
[0441] In an embodiment of the present application, if the prediction mode of the current chroma block is the cross-component intra prediction mode, in order to improve prediction performance, a limited range of the prediction value of the current chroma block is determined. Then, based on the limited range, the first prediction value determined based on the cross-component intra prediction mode is limited to prevent the first prediction value obtained based on the cross-component intra prediction mode from being too large or too small, thereby improving the prediction accuracy of the current chroma block and enhancing encoding performance.
[0442] The embodiment of the present application does not limit the specific manner in which the encoder determines the second prediction value of the current chroma block based on the first prediction value and a limited range.
[0443] In some embodiments, if the predicted values of the first chroma component and the second chroma component correspond to a limited range, for example, if the first chroma component and the second chroma component correspond to a maximum limited value a, the maximum limited value a is used to limit the first predicted value of the current chroma block under the first chroma component and the first predicted value of the current chroma block under the second chroma component. If the first chroma component and the second chroma component correspond to a minimum limited value b, the minimum limited value b is used to limit the first predicted value of the current chroma block under the first chroma component and the first predicted value of the current chroma block under the second chroma component.
[0444] For example, if the first prediction value of the current chroma block under the first chroma component is less than the maximum limit value a, the first prediction value of the current chroma block under the first chroma component is determined as the second prediction value of the current chroma block under the first chroma component. If the first prediction value of the current chroma block under the first chroma component is greater than the maximum limit value a, the maximum limit value a is determined as the second prediction value of the current chroma block under the first chroma component. If the first prediction value of the current chroma block under the second chroma component is less than the maximum limit value a, the first prediction value of the current chroma block under the second chroma component is determined as the second prediction value of the current chroma block under the second chroma component. If the first prediction value of the current chroma block under the second chroma component is greater than the maximum limit value a, the maximum limit value a is determined as the second prediction value of the current chroma block under the second chroma component.
[0445] For another example, if the first prediction value of the current chroma block under the first chroma component is greater than the minimum limit value b, the first prediction value of the current chroma block under the first chroma component is determined as the second prediction value of the current chroma block under the first chroma component. If the first prediction value of the current chroma block under the first chroma component is less than the minimum limit value b, the minimum limit value b is determined as the second prediction value of the current chroma block under the first chroma component. If the first prediction value of the current chroma block under the second chroma component is greater than the minimum limit value b, the first prediction value of the current chroma block under the second chroma component is determined as the second prediction value of the current chroma block under the second chroma component. If the first prediction value of the current chroma block under the second chroma component is less than the minimum limit value a, the minimum limit value b is determined as the second prediction value of the current chroma block under the second chroma component.
[0446] In some embodiments, the predicted values of the first chroma component and the second chroma component each correspond to a limited range. Taking the i-th chroma component as an example, the encoder may determine the second predicted value of the current chroma block for the i-th chroma component based on the first predicted value for the i-th chroma component and the limited range for the i-th chroma component.
[0447] In one example, if the limited range under the i-th chroma component includes a maximum limited value, the maximum limited value under the i-th chroma component is used to limit the first prediction value of the current chroma block under the i-th chroma component.
[0448] For example, if the first prediction 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, the first prediction value of the current chroma block under the i-th chroma component is determined as the second prediction value of the current chroma block under the i-th chroma component.
[0449] For another 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, 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 limited range under the i-th chroma component includes a minimum limited value, the minimum limited value under the i-th chroma component is used to limit the first prediction value of the current chroma block under the i-th chroma component.
[0451] For example, if the first prediction value of the current chroma block under the i-th chroma component is greater than or equal to the minimum limit value under the i-th chroma component, the first prediction value of the current chroma block under the i-th chroma component is determined as the second prediction value of the current chroma block under the i-th chroma component.
[0452] For another 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, 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 limited range under the i-th chroma component includes a maximum limited value and a minimum limited value, the maximum limited value and the minimum limited value under the i-th chroma component are used to limit the first prediction value of the current chroma block under the i-th chroma component.
[0454] For example, if the first prediction 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 prediction value of the current chroma block under the i-th chroma component is determined as the second prediction value of the current chroma block under the i-th chroma component.
[0455] For another 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, 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 another 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, 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 the embodiment of the present application, when determining the predicted value of the current chroma block, prediction is performed pixel by pixel. That is, the encoder predicts the predicted 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 of each pixel to obtain a second predicted value for each pixel. The encoder limits the first predicted value of each pixel in the current chroma block and obtains the second predicted value of each pixel in the same process. Here, the current position (x, y) in the current chroma block is used as an example for explanation.
[0458] Exemplarily, for the current position (x, y) in the current chroma block, the process of limiting the Cb prediction value and the Cr prediction value of the current position (x, y) is shown in Table 2.
[0459] According to Table 2 above, if the Cb prediction value of the current position (x, y) in the current chroma block determined based on the cross-component intra prediction mode (i.e., the first prediction value under the Cb component) is greater than the maximum limit value max of the Cb component cb When the max cb Determine the Cb prediction value (i.e., the second prediction value) of the current position (x, y). If the Cb prediction value (i.e., the first prediction value under the Cb component) of the current position (x, y) determined based on the cross-component intra prediction mode is less than the minimum limit value min of the Cb component cb When the min cb Determine the Cb prediction value (i.e., the second prediction value) of the current position (x, y). Similarly, if the Cr prediction value (i.e., the first prediction value under the Cr component) of the current position (x, y) in the current chroma block determined based on the cross-component intra prediction mode is greater than the maximum limit value max of the Cr component cr When the max cr Determine the Cr prediction value (i.e., the second prediction value) of the current position (x, y). If the Cr prediction value (i.e., the first prediction value under the Cr component) of the current position (x, y) determined based on the cross-component intra prediction mode is less than the minimum limit value min of the Cr component cr When the min cr Determine the Cr prediction value (ie, the second prediction value) of the current position (x, y).
[0460] The encoding end may 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 a bitstream.
[0461] The video encoding method provided in the embodiment of the present application determines the prediction mode of the current chroma block when predicting the current chroma block. If the prediction mode is a cross-component intra-frame prediction mode, a limited range of the prediction value of the current chroma block is determined, and the limited range includes at least one of the maximum limited value and the minimum limited value of the prediction value; then, based on the cross-component intra-frame prediction mode, a first prediction value of the current chroma block is determined; based on the first prediction value and the limited range, a second prediction value of the current chroma block is determined. That is, in the embodiment of the present application, if the current chroma block adopts the cross-component intra-frame prediction mode, the first prediction value determined by the cross-component intra-frame prediction mode is limited to avoid the prediction value of the current chroma block being too large or too small, thereby improving the prediction accuracy of the current chroma block and improving the video encoding performance.
[0462] It should be understood that Figures 7 to 12 are merely examples of the present application and should not be understood as limiting the present application.
[0463] The preferred embodiments of the present application are described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the specific details in the above embodiments. Within the technical concept of the present application, a variety of simple modifications can be made to the technical solution of the present application, and these simple modifications all fall within the scope of protection of the present application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner unless there is any contradiction. In order to avoid unnecessary repetition, the present application will not further explain various possible combinations. For another example, the various different embodiments of the present application can also be arbitrarily combined, and as long as they do not violate the ideas of the present application, they should also be regarded as the contents disclosed in the present application.
[0464] It should also be understood that in the various method embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the order of execution, and 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 the present application. In addition, in the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships can exist. Specifically, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the related objects before and after are in an "or" relationship.
[0465] The above describes in detail the method embodiment of the present application in conjunction with Figures 7 to 12, and the following describes in detail the device embodiment of the present application in conjunction with Figures 13 to 15.
[0466] FIG13 is a schematic block diagram of a video decoding device provided in an embodiment of the present application. The video decoding device 10 is applied to the above-mentioned video decoder.
[0467] As shown in FIG13 , the video decoding apparatus 10 includes:
[0468] A prediction mode determination unit 11, configured to determine a prediction mode for a current chroma block;
[0469] a limited range determining unit 12, configured to determine, if the prediction mode is an inter-component intra prediction mode, a limited range of a prediction value of the current chroma block based on chroma values of a reconstructed area surrounding the current chroma block, the limited range including at least one of a maximum limited value and a minimum limited value of the prediction value;
[0470] A prediction unit 13 is configured to determine a first prediction value of the current chroma block based on the cross-component intra prediction mode;
[0471] The limiting unit 14 is configured to determine a second prediction value of the current chroma block based on the first prediction value and the limited range.
[0472] In some embodiments, the prediction mode determination unit 11 is specifically configured 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 configured to decode the code stream to obtain a first prediction mode; and determine a prediction mode for 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 convolution 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 convolution cross-component model mode or a gradient linear model mode.
[0475] In some embodiments, the prediction mode determination unit 11 is specifically used to construct a cross-component prediction mode list by inheriting the cross-component intra-frame prediction modes of the chroma blocks adjacent to and / or non-adjacent to the current chroma block around the current chroma block if the first prediction mode is a cross-component merge mode; 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 configured to decode the code stream to obtain a mode index; and based on the mode index, determine the prediction mode of the current chroma block in the cross-component prediction mode list.
[0477] In some embodiments, before determining the limited range of the prediction value of the current chroma block, the limited range determination unit 12 is also used to determine a first flag corresponding to the current chroma block, and the first flag is used to indicate whether the prediction value of the current chroma block is limited; if the first flag indicates that the prediction value of the current chroma block is limited, the limited range of the prediction value of the current chroma block is determined.
[0478] In some embodiments, the limited range determination unit 12 is specifically used to determine the chroma block corresponding to the prediction mode inherited by the current chroma block if the first prediction mode obtained by decoding the code stream is the cross-component merge mode; and determine the first flag corresponding to the chroma block as the first flag corresponding to the current chroma block.
[0479] In some embodiments, the limited range determination unit 12 is specifically configured to decode the code stream to obtain a 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 also used to determine whether the current chroma block meets a preset condition; if the current chroma block meets the preset condition, the limited range of the predicted value of the current chroma block is determined.
[0481] In some embodiments, the preset condition includes at least one of the following:
[0482] The current chroma block is not the first row of chroma blocks 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 a preset shape.
[0485] In some embodiments, the limited range determination unit 12 is specifically used to determine the chroma block corresponding to the prediction mode inherited by the current chroma block; and determine the limited range of the prediction value of the chroma block as the limited range of the prediction value of the current chroma block.
[0486] In some embodiments, the limited range determining unit 12 is specifically configured to determine a limited range of the prediction 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 limited range determining unit 12 is specifically configured to determine a limited range of a predicted value of the current chroma block under the i-th chroma component based on the chroma value of the surrounding reconstructed area under the i-th chroma component, where i is a positive integer;
[0488] The prediction unit 13 is specifically configured to determine a first prediction value of the current chroma block under the i-th chroma component based on the cross-component intra prediction mode;
[0489] The limiting unit 14 is specifically configured to determine a second predicted value of the current chroma block under the i-th chroma component based on the first predicted value under the i-th chroma component and a limited range under the i-th chroma component.
[0490] In some embodiments, the limited range determination unit 12 is further used to determine a first surrounding reconstructed area of the current chroma block under the i-th component 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 surrounding reconstructed area under the i-th chroma component; and determine the limited range of the predicted value of the current chroma block under the i-th chroma component based on the first surrounding reconstructed area.
[0491] In some embodiments, the limited range determination unit 12 is specifically used to determine the second surrounding reconstructed area corresponding to the convolution cross-component model mode if the prediction mode of the current chroma block is the convolution cross-component model mode; and determine the first surrounding reconstructed area based on the second surrounding reconstructed area.
[0492] In some embodiments, the second surrounding reconstructed area includes any one of a first type of reconstruction area, a second type of reconstruction area and a third type of reconstruction area, the first type of reconstruction area includes the upper, upper left, upper right, left and lower left areas of the current chroma block, the second type of reconstruction area includes the upper, upper left and upper right areas of the current chroma block, and the third type of estimated area includes the left, upper left and lower left areas of the current chroma block.
[0493] In some embodiments, the limited range determination unit 12 is specifically used to determine that the first surrounding reconstructed area is the second type of reconstruction area if the second surrounding reconstructed area is the second type of reconstruction area; or, if the second surrounding reconstructed area is the third type of reconstruction area, determine that the first surrounding reconstructed area is the third type of reconstruction area.
[0494] In some embodiments, the first surrounding reconstructed area includes at least one of N preset types of reconstructed areas, where N is a positive integer.
[0495] In some embodiments, the N types of reconstruction areas include 5 types of reconstruction areas, the first type of reconstruction area includes the upper, upper left and left areas of the current chroma block, the second type of reconstruction area includes the upper and upper right areas of the current chroma block, the third type of reconstruction area includes the upper area of the current chroma block, the fourth type of reconstruction area includes the upper left and left areas of the current chroma block, and the fifth type of reconstruction area includes the left area of the current chroma block.
[0496] In some embodiments, the limited range determination unit 12 is specifically used to determine the maximum chroma value of the surrounding reconstructed area under the i-th chroma component as the maximum limited value of the predicted value of the current chroma block under the i-th chroma component; and / or, to determine the minimum chroma value of the surrounding reconstructed area under the i-th chroma component as the minimum limited value of the predicted value of the current chroma block under the i-th chroma component.
[0497] In some embodiments, the limited range includes the maximum limit 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 limit value; and to determine the maximum limit value as the second predicted value if the first predicted value is greater than the maximum limit value.
[0498] In some embodiments, the limited range includes the minimum 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 greater than the minimum limiting value; and to determine the minimum limiting value as the second predicted value if the first predicted value is less than the minimum limiting value.
[0499] In some embodiments, the limited range includes the minimum limit value and the maximum limit 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 limit value and greater than or equal to the minimum limit value; determine the maximum limit value as the second predicted value if the first predicted value is greater than the maximum limit value; and determine the minimum limit value as the second predicted value if the first predicted value is less than the minimum limit value.
[0500] It should be understood that the device embodiments and method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, no further description is given here. Specifically, the device 10 shown in FIG13 can perform the decoding method of the decoding end of the embodiment of the present application, and the aforementioned and other operations and / or functions of the various units in the device 10 are respectively for implementing the corresponding processes in each method such as the decoding method of the decoding end. For the sake of brevity, no further description is given here.
[0501] FIG14 is a schematic block diagram of a video encoding device provided in an embodiment of the present application, which is applied to the above-mentioned encoder.
[0502] As shown in FIG14 , the video encoding apparatus 20 may include:
[0503] A prediction mode determination unit 21, configured to determine a prediction mode for a current chroma block;
[0504] a limited range determining unit 22, configured to determine, if the prediction mode is an inter-component intra prediction mode, a limited range of a prediction value of the current chroma block based on chroma values of a reconstructed area surrounding the current chroma block, the limited range including at least one of a maximum limited value and a minimum limited value of the prediction value;
[0505] A prediction unit 23 is configured to determine a first prediction value of the current chroma block based on the cross-component intra prediction mode;
[0506] The limiting unit 24 is configured to determine a second prediction value of the current chroma block based on the first prediction value and the limited range.
[0507] In some embodiments, the prediction mode determining unit 21 is specifically configured to determine a first prediction mode; and determine a prediction mode for the current chroma block based on the first prediction mode.
[0508] In some embodiments, the prediction mode determination unit 21 is specifically used to determine the convolution 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 convolution cross-component model mode or a gradient linear model mode.
[0509] In some embodiments, the prediction mode determination unit 21 is specifically used to construct a cross-component prediction mode list by inheriting the cross-component intra-frame prediction modes of the chroma blocks adjacent to and / or non-adjacent to the current chroma block around the current chroma block if the first prediction mode is a cross-component merge mode; 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 mode index of the prediction mode of the current chroma block in the cross-component prediction mode list 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 limited range of the prediction value of the current chroma block, the limited range determination unit 22 is also used to determine a first flag corresponding to the current chroma block, where the first flag is used to indicate whether the prediction value of the current chroma block is limited; if the first flag indicates that the prediction value of the current chroma block is limited, the limited range of the prediction value of the current chroma block is determined.
[0513] In some embodiments, the limited range determination unit 22 is specifically used to determine a first prediction mode; if the first prediction mode is a cross-component merge mode, then the chroma block corresponding to the prediction mode inherited by the current chroma block is determined; and the first flag corresponding to the chroma block is determined as the first flag corresponding to the current chroma block.
[0514] In some embodiments, the limited range determination unit 22 is further configured to write a first flag corresponding to the current chroma block into the bitstream.
[0515] In some embodiments, the limited range determination unit 22 is further used to determine whether the current chroma block meets a preset condition before determining the limited range of the prediction value of the current chroma block; if the current chroma block meets the preset condition, the limited range of the prediction value of the current chroma block is determined.
[0516] In some embodiments, the preset condition includes at least one of the following:
[0517] The current chroma block is not the first row of chroma blocks 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 a preset shape.
[0520] In some embodiments, the limited range determination unit 22 is specifically used to determine the chroma block corresponding to the prediction mode inherited by the current chroma block; and determine the limited range of the prediction value of the chroma block as the limited range of the prediction value of the current chroma block.
[0521] In some embodiments, the limited range determining unit 22 is specifically configured to determine a limited range of the prediction value of the current chroma block based on the chroma values of the reconstructed area surrounding the current chroma block.
[0522] In some embodiments, the limited range determining unit 22 is specifically configured to determine a limited range of a predicted value of the current chroma block under the i-th chroma component based on the chroma value of the surrounding reconstructed area under the i-th chroma component, where i is a positive integer;
[0523] The prediction unit 23 is specifically configured to determine a first prediction value of the current chroma block under the i-th chroma component based on the cross-component intra prediction mode;
[0524] The limiting unit 24 is specifically configured to determine a second predicted value of the current chroma block under the i-th chroma component based on the first predicted value under the i-th chroma component and a limited range under the i-th chroma component.
[0525] In some embodiments, the limited range determination unit 22 is further used to determine a first surrounding reconstructed area of the current chroma block under the i-th component 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 surrounding reconstructed area under the i-th chroma component; and determine the limited range of the predicted value of the current chroma block under the i-th chroma component based on the first surrounding reconstructed area.
[0526] In some embodiments, the limited range determination unit 22 is specifically used to determine the second surrounding reconstructed area corresponding to the convolution cross-component model mode if the prediction mode of the current chroma block is the convolution cross-component model mode; and determine the first surrounding reconstructed area based on the second surrounding reconstructed area.
[0527] In some embodiments, the second surrounding reconstructed area includes any one of a first type of reconstruction area, a second type of reconstruction area and a third type of reconstruction area, the first type of reconstruction area includes the upper, upper left, upper right, left and lower left areas of the current chroma block, the second type of reconstruction area includes the upper, upper left and upper right areas of the current chroma block, and the third type of estimated area includes the left, upper left and lower left areas of the current chroma block.
[0528] In some embodiments, the limited range determination unit 22 is specifically used to determine that the first surrounding reconstructed area is the second type of reconstruction area if the second surrounding reconstructed area is the second type of reconstruction area; or, if the second surrounding reconstructed area is the third type of reconstruction area, determine that the first surrounding reconstructed area is the third type of reconstruction area.
[0529] In some embodiments, the first surrounding reconstructed area includes at least one of N preset types of reconstructed areas, where N is a positive integer.
[0530] In some embodiments, the N types of reconstruction areas include 5 types of reconstruction areas, the first type of reconstruction area includes the upper, upper left and left areas of the current chroma block, the second type of reconstruction area includes the upper and upper right areas of the current chroma block, the third type of reconstruction area includes the upper area of the current chroma block, the fourth type of reconstruction area includes the upper left and left areas of the current chroma block, and the fifth type of reconstruction area includes the left area of the current chroma block.
[0531] In some embodiments, the limited range determination unit 22 is specifically used to determine the maximum chroma value of the surrounding reconstructed area under the i-th chroma component as the maximum limited value of the predicted value of the current chroma block under the i-th chroma component; and / or, to determine the minimum chroma value of the surrounding reconstructed area under the i-th chroma component as the minimum limited value of the predicted value of the current chroma block under the i-th chroma component.
[0532] In some embodiments, the limited range includes the maximum limit value, and the limiting unit 24 is specifically used to determine the first prediction value as the second prediction value if the first prediction value is less than or equal to the maximum limit value; if the first prediction value is greater than the maximum limit value, then the maximum limit value is determined as the second prediction value.
[0533] In some embodiments, the limited range includes the minimum limit value, and the limiting unit 24 is specifically used to determine the first predicted value as the second predicted value if the first predicted value is greater than the minimum limit value; if the first predicted value is less than the minimum limit value, then the minimum limit value is determined as the second predicted value.
[0534] In some embodiments, the limited range includes the minimum limit value and the maximum limit value, and the limiting unit 24 is specifically used to determine the first predicted value as the second predicted value if the first predicted value is less than or equal to the maximum limit value and greater than or equal to the minimum limit value; if the first predicted value is greater than the maximum limit value, then the maximum limit value is determined as the second predicted value; if the first predicted value is less than the minimum limit value, then the minimum limit value is determined as the second predicted value.
[0535] It should be understood that the device embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, they will not be described here. Specifically, the device 20 shown in Figure 14 may correspond to the corresponding subject in the encoding method of the encoding end of the embodiment of the present application, and the aforementioned and other operations and / or functions of each unit in the device 20 are respectively for implementing the corresponding processes in each method such as the encoding method of the encoding end. For the sake of brevity, they will not be described here.
[0536] The above describes the apparatus and system of the embodiment of the present application from the perspective of functional units in conjunction with the accompanying drawings. It should be understood that the functional unit can be implemented in the form of hardware, can be implemented by instructions in the form of software, or can be implemented by a combination of hardware and software units. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed 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 a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiment in conjunction with its hardware.
[0537] FIG15 is a schematic block diagram of an electronic device provided in an embodiment of the present application.
[0538] As shown in FIG15 , the electronic device 30 may be a video encoder or a video decoder as described in an embodiment of the present application. The electronic device 30 may include:
[0539] The memory 33 and the processor 32 are configured to store a computer program 34 and transmit the program code 34 to the processor 32. In other words, the processor 32 can call and run the computer program 34 from the memory 33 to implement the method in the embodiment of the present application.
[0540] For example, the processor 32 may be configured to execute the steps of the method 200 according to the instructions in the computer program 34 .
[0541] In some embodiments of the present application, the processor 32 may include but is not limited to:
[0542] General-purpose processor, Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
[0543] In some embodiments of the present 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 and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).
[0545] In some embodiments of the present 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 implement the method provided by the present application. The one or more units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 34 in the electronic device 30.
[0546] As shown in FIG15 , the electronic device 30 may further include:
[0547] The transceiver 33 may be connected to the processor 32 or the 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 an antenna, 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 via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0550] FIG16 is a schematic block diagram of a video encoding and decoding system provided in an embodiment of the present 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 embodiment of the present application, and the video decoder 42 is used to execute the video decoding method involved in the embodiment of the present application.
[0552] The present application also provides a computer storage medium having a computer program stored thereon, which, when executed by a computer, enables the computer to perform the method of the above-mentioned method embodiment. In other words, the present application also provides a computer program product containing instructions, which, when executed by a computer, enables the computer to perform the method of the above-mentioned method embodiment.
[0553] The present application also provides a code stream, which is generated according to the above encoding method.
[0554] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. 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 computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. 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 includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid state drive (SSD)).
[0555] Those skilled in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel 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, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the unit is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0557] The units described as separate components may or may not be physically separate, and 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment. For example, the functional units in the various embodiments of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0558] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A video decoding method, characterized in that: include: Determining a prediction mode for a current chroma block; If the prediction mode is an inter-component intra prediction mode, determining a limited range of a prediction value of the current chroma block based on chroma values of a reconstructed area around the current chroma block, the limited range including 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; Based on the first prediction value and the limited range, a second prediction value of the current chroma block is determined.
2. The method according to claim 1, characterized in that The determining of the prediction mode of the current chrominance block comprises: Decode the code stream to obtain the prediction mode of the current chrominance block.
3. The method according to claim 2, characterized in that The decoding bit stream to obtain the prediction mode of the current chrominance block includes: Decoding the bitstream to obtain a first prediction mode; Based on the first prediction mode, a prediction mode of the current chroma block is determined.
4. The method according to claim 3, characterized in that The determining, based on the first prediction mode, a prediction mode of the current chroma block includes: If the first prediction mode is a convolution cross-component model mode or a gradient linear model mode, the convolution cross-component model mode or the gradient linear model mode is determined as the prediction mode of the current chroma block.
5. The method according to claim 3, characterized in that: The determining, based on the first prediction mode, a prediction mode of the current chroma block includes: If the first prediction mode is the cross-component merge mode, constructing a cross-component prediction mode list by inheriting the cross-component intra prediction modes of chroma blocks adjacent to and / or not adjacent to the current chroma block around the current chroma block; Based on the cross-component prediction mode list, a prediction mode for the current chroma block is determined.
6. The method according to claim 5, characterized in that The determining, based on the cross-component prediction mode list, a prediction mode of the current chroma block comprises: Decoding the code stream to obtain a mode index; Based on the mode index, a prediction mode of the current chroma block is determined in the cross-component prediction mode list.
7. The method according to claim 1, characterized in that Before determining the limited range of the prediction value of the current chrominance block, the method further includes: Determine a first flag corresponding to the current chroma block, where the first flag is used to indicate whether to limit a prediction value of the current chroma block; The determining of a limited range of a prediction value of the current chrominance block comprises: If the first flag indicates that the prediction value of the current chroma block is limited, a limited range of the prediction value of the current chroma block is determined.
8. The method according to claim 7, characterized in that The determining a first flag corresponding to the current chroma block includes: If the first prediction mode obtained by decoding the bitstream is the cross-component merge mode, determining the chroma block corresponding to the prediction mode inherited by the current chroma block; The first flag corresponding to the chroma block is determined as the first flag corresponding to the current chroma block.
9. The method according to claim 7, characterized in that: The determining a first flag corresponding to the current chroma block includes: Decode the code stream to obtain a first flag corresponding to the current chroma block.
10. The method according to claim 1, characterized in that Before determining the limited range of the prediction value of the current chrominance block, the method further includes: Determining whether the current chroma block meets a preset condition; The determining of a limited range of a prediction value of the current chrominance block comprises: If the current chroma block meets the preset condition, a limited range of the prediction value of the current chroma block is determined.
11. The method according to claim 10, characterized in that The preset condition includes at least one of the following: The current chroma block is not the first row of chroma blocks of the current CTU; The size of the current chroma block meets the preset size; The shape of the current chroma block satisfies a preset shape.
12. The method according to claim 5, characterized in that The determining of a limited range of a prediction value of the current chrominance block comprises: Determine a chroma block corresponding to a prediction mode inherited by the current chroma block; The limited range of the prediction value of the chroma block is determined as the limited 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 determining of a limited range of a prediction value of the current chrominance block comprises: Based on the chrominance values of the reconstructed area around the current chrominance block, a limited range of the prediction value of the current chrominance block is determined.
14. The method according to claim 13, characterized in that The determining the limited range of the predicted value of the current chroma block based on the chroma value of the surrounding reconstructed area of the current chroma block comprises: 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 surrounding reconstructed area under the i-th chroma component, where i is a positive integer; The determining, based on the cross-component intra prediction mode, a first prediction value of the current chroma block comprises: determining, based on the cross-component intra prediction mode, a first prediction value of the current chroma block under the i-th chroma component; The method of determining the second prediction value of the current chroma block based on the first prediction value and the limited range includes: determining the second prediction value of the current chroma block under the i-th chroma component based on the first prediction value under the i-th chroma component and the limited range under the i-th chroma component.
15. The method according to claim 14, characterized in that Before determining the limited range of the predicted value of the current chrominance block under the i-th chrominance component based on the chrominance value of the surrounding reconstructed area under the i-th chrominance component, the method further includes: Determine a first surrounding reconstructed area of the current chrominance block under the i-th component; The method further comprises determining a predicted value of the current chrominance block under the i-th chrominance component based on the chrominance value of the surrounding reconstructed area under the i-th chrominance component. The limited scope includes: Based on the first surrounding reconstructed area, a limited range of a prediction value of the current chrominance block under the i-th chrominance component is determined.
16. The method according to claim 15, characterized in that The determining of a first surrounding reconstructed area of the current chroma block under the i-th component comprises: If the prediction mode of the current chroma block is a convolution cross-component model mode, determining a second surrounding reconstructed area corresponding to the convolution cross-component model mode; The first surrounding reconstructed area is determined based on the second surrounding reconstructed area.
17. The method according to claim 16, characterized in that The second surrounding reconstructed area includes any one of the first type of reconstruction area, the second type of reconstruction area and the third type of reconstruction area. The first type of reconstruction area includes the upper, upper left, upper right, left and lower left areas of the current chroma block, the second type of reconstruction area includes the upper, upper left and upper right areas of the current chroma block, and the third type of estimated area includes the left, upper left and lower left areas of the current chroma block.
18. The method according to claim 17, characterized in that The determining, based on the second surrounding reconstructed area, as the first surrounding reconstructed area comprises: If the second surrounding reconstructed area is the second type of reconstructed area, then determining the first surrounding reconstructed area is the second type of reconstructed area; or, If the second surrounding reconstructed area is the third type of reconstructed area, then the first surrounding reconstructed area is determined to be the third type of reconstructed area.
19. The method according to claim 15, characterized in that The first surrounding reconstructed area includes at least one of N preset types of reconstructed areas, where N is a positive integer.
20. The method according to claim 19, characterized in that The N types of reconstruction areas include 5 types of reconstruction areas. The first type of reconstruction area includes the upper, upper left and left areas of the current chroma block, the second type of reconstruction area includes the upper and upper right areas of the current chroma block, the third type of reconstruction area includes the upper area of the current chroma block, the fourth type of reconstruction area includes the upper left and left areas of the current chroma block, and the fifth type of reconstruction area includes the left area of the current chroma block.
21. The method according to claim 14, characterized in that The determining, based on the chrominance value of the surrounding reconstructed area under the i-th chrominance component, a limited range of the predicted value of the current chrominance block under the i-th chrominance component comprises: Determine the maximum chroma value of the surrounding reconstructed area under the i-th chroma component as the maximum limit value of the predicted value of the current chroma block under the i-th chroma component; and / or, The minimum chrominance value of the surrounding reconstructed area under the i-th chrominance component is determined as the minimum limiting value of the predicted value of the current chrominance block under the i-th chrominance component.
22. The method according to claim 14, characterized in that The limited range includes the maximum limited value, and the determining, based on the first predicted value under the i-th chroma component and the limited range under the i-th chroma component, a second predicted value of the current chroma block under the i-th chroma component comprises: If the first predicted value is less than or equal to the maximum limit value, determining the first predicted value as the second predicted value; If the first predicted value is greater than the maximum limit value, the maximum limit value is determined as the second predicted value.
23. The method according to claim 14, characterized in that The limited range includes the minimum limited value, and the determining, based on the first predicted value under the i-th chroma component and the limited range under the i-th chroma component, a second predicted value of the current chroma block under the i-th chroma component comprises: If the first predicted value is greater than the minimum limit value, determining the first predicted value as the second predicted value; If the first predicted value is smaller than the minimum limit value, the minimum limit value is determined as the second predicted value.
24. The method according to claim 14, characterized in that The limited range includes the minimum limited value and the maximum limited value, and the determining, based on the first predicted value under the i-th chroma component and the limited range under the i-th chroma component, the second predicted value of the current chroma block under the i-th chroma component includes: If the first predicted value is less than or equal to the maximum limit value and greater than or equal to the minimum limit value, the first predicted value is determined as the second predicted value; If the first predicted value is greater than the maximum limit value, the maximum limit value is determined as the second predicted value; If the first predicted value is smaller than the minimum limit value, the minimum limit value is determined as the second predicted value.
25. A video encoding method, characterized in that: include: Determining a prediction mode for a current chroma block; If the prediction mode is an inter-component intra prediction mode, determining a limited range of a prediction value of the current chroma block based on chroma values of a reconstructed area around the current chroma block, the limited range including 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; Based on the first prediction value and the limited range, a second prediction value of the current chroma block is determined.
26. The method according to claim 25, characterized in that The determining of the prediction mode of the current chrominance block comprises: determining a first prediction mode; Based on the first prediction mode, a prediction mode of the current chroma block is determined.
27. The method according to claim 26, characterized in that The determining, based on the first prediction mode, a prediction mode of the current chroma block includes: If the first prediction mode is a convolution cross-component model mode or a gradient linear model mode, the convolution cross-component model mode or the gradient linear model mode is determined as the prediction mode of the current chroma block.
28. The method according to claim 26, characterized in that The determining, based on the first prediction mode, a prediction mode of the current chroma block comprises: If the first prediction mode is the cross-component merge mode, constructing a cross-component prediction mode list by inheriting the cross-component intra prediction modes of chroma blocks adjacent to and / or not adjacent to the current chroma block around the current chroma block; Based on the cross-component prediction mode list, a prediction mode for the current chroma block is determined.
29. The method according to claim 28, characterized in that The method may include: The mode index of the prediction mode of the current chroma block in the cross-component prediction mode list is written into the bitstream.
30. The method according to claim 25, characterized in that The method further comprises: The prediction mode of the current chroma block is written into the bitstream.
31. The method according to claim 25, characterized in that Before determining the limited range of the prediction value of the current chrominance block, the method further includes: Determine a first flag corresponding to the current chroma block, where the first flag is used to indicate whether to limit a prediction value of the current chroma block; The determining of a limited range of a prediction value of the current chrominance block comprises: If the first flag indicates that the prediction value of the current chroma block is limited, a limited range of the prediction value of the current chroma block is determined.
32. The method according to claim 31, characterized in that The determining a first flag corresponding to the current chroma block includes: determining a first prediction mode; If the first prediction mode is the cross-component merge mode, determining a chroma block corresponding to the prediction mode inherited by the current chroma block; The first flag corresponding to the chroma block is determined as the first flag corresponding to the current chroma block.
33. The method according to claim 31, characterized in that The method further comprises: The first flag corresponding to the current chroma block is written into the bitstream.
34. The method according to claim 25, characterized in that Before determining the limited range of the prediction value of the current chrominance block, the method further includes: Determining whether the current chroma block meets a preset condition; The determining of a limited range of a prediction value of the current chrominance block comprises: If the current chroma block meets the preset condition, a limited range of the prediction value of the current chroma block is determined.
35. The method according to claim 34, characterized in that The preset condition includes at least one of the following: The current chroma block is not the first row of chroma blocks of the current CTU; The size of the current chroma block meets the preset size; The shape of the current chroma block satisfies a preset shape.
36. The method according to claim 28, characterized in that The determining of a limited range of a prediction value of the current chrominance block comprises: Determine a chroma block corresponding to a prediction mode inherited by the current chroma block; The limited range of the prediction value of the chroma block is determined as the limited range of the prediction value of the current chroma block.
37. The method according to any one of claims 25 to 35, characterized in that: The determining of a limited range of a prediction value of the current chrominance block comprises: Based on the chrominance values of the reconstructed area around the current chrominance block, a limited range of the prediction value of the current chrominance block is determined.
38. The method according to claim 37, characterized in that The determining the limited range of the predicted value of the current chroma block based on the chroma value of the surrounding reconstructed area of the current chroma block comprises: 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 surrounding reconstructed area under the i-th chroma component, where i is a positive integer; The determining, based on the cross-component intra prediction mode, a first prediction value of the current chroma block comprises: determining, based on the cross-component intra prediction mode, a first prediction value of the current chroma block under the i-th chroma component; The method of determining the second prediction value of the current chroma block based on the first prediction value and the limited range includes: determining the second prediction value of the current chroma block under the i-th chroma component based on the first prediction value under the i-th chroma component and the limited range under the i-th chroma component.
39. The method according to claim 38, characterized in that Before determining the limited range of the predicted value of the current chrominance block under the i-th chrominance component based on the chrominance value of the surrounding reconstructed area under the i-th chrominance component, the method further includes: Determine a first surrounding reconstructed area of the current chrominance block under the i-th component; The determining, based on the chrominance value of the surrounding reconstructed area under the i-th chrominance component, a limited range of the predicted value of the current chrominance block under the i-th chrominance component comprises: Based on the first surrounding reconstructed area, a limited range of a prediction value of the current chrominance block under the i-th chrominance component is determined.
40. The method according to claim 39, characterized in that The determining of a first surrounding reconstructed area of the current chroma block under the i-th component comprises: If the prediction mode of the current chroma block is a convolution cross-component model mode, determining a second surrounding reconstructed area corresponding to the convolution cross-component model mode; The first surrounding reconstructed area is determined based on the second surrounding reconstructed area.
41. The method according to claim 40, characterized in that The second surrounding reconstructed area includes any one of the first type of reconstruction area, the second type of reconstruction area and the third type of reconstruction area. The first type of reconstruction area includes the upper, upper left, upper right, left and lower left areas of the current chroma block, the second type of reconstruction area includes the upper, upper left and upper right areas of the current chroma block, and the third type of estimated area includes the left, upper left and lower left areas of the current chroma block.
42. The method according to claim 41, characterized in that The determining, based on the second surrounding reconstructed area, as the first surrounding reconstructed area comprises: If the second surrounding reconstructed area is the second type of reconstructed area, then determining the first surrounding reconstructed area is the second type of reconstructed area; or, If the second surrounding reconstructed area is the third type of reconstructed area, then the first surrounding reconstructed area is determined to be the third type of reconstructed area.
43. The method according to claim 39, characterized in that The first surrounding reconstructed area includes at least one of N preset types of reconstructed areas, where N is a positive integer.
44. The method according to claim 43, characterized in that The N types of reconstruction areas include 5 types of reconstruction areas. The first type of reconstruction area includes the upper, upper left and left areas of the current chroma block, the second type of reconstruction area includes the upper and upper right areas of the current chroma block, the third type of reconstruction area includes the upper area of the current chroma block, the fourth type of reconstruction area includes the upper left and left areas of the current chroma block, and the fifth type of reconstruction area includes the left area of the current chroma block.
45. The method according to claim 38, characterized in that The determining, based on the chrominance value of the surrounding reconstructed area under the i-th chrominance component, a limited range of the predicted value of the current chrominance block under the i-th chrominance component comprises: Determine the maximum chroma value of the surrounding reconstructed area under the i-th chroma component as the maximum limit value of the predicted value of the current chroma block under the i-th chroma component; and / or, The minimum chrominance value of the surrounding reconstructed area under the i-th chrominance component is determined as the minimum limiting value of the predicted value of the current chrominance block under the i-th chrominance component.
46. The method according to claim 38, characterized in that The limited range includes the maximum limited value, and the determining, based on the first predicted value under the i-th chroma component and the limited range under the i-th chroma component, a second predicted value of the current chroma block under the i-th chroma component comprises: If the first predicted value is less than or equal to the maximum limit value, determining the first predicted value as the second predicted value; If the first predicted value is greater than the maximum limit value, the maximum limit value is determined as the second predicted value.
47. The method according to claim 38, characterized in that The limited range includes the minimum limited value, and the determining, based on the first predicted value under the i-th chroma component and the limited range under the i-th chroma component, a second predicted value of the current chroma block under the i-th chroma component comprises: If the first predicted value is greater than the minimum limit value, determining the first predicted value as the second predicted value; If the first predicted value is smaller than the minimum limit value, the minimum limit value is determined as the second predicted value.
48. The method according to claim 38, characterized in that The limited range includes the minimum limited value and the maximum limited value, and the determining, based on the first predicted value under the i-th chroma component and the limited range under the i-th chroma component, the second predicted value of the current chroma block under the i-th chroma component includes: If the first predicted value is less than or equal to the maximum limit value and greater than or equal to the minimum limit value, the first predicted value is determined as the second predicted value; If the first predicted value is greater than the maximum limit value, the maximum limit value is determined as the second predicted value; If the first predicted value is smaller than the minimum limit value, the minimum limit value is determined as the second predicted value.
49. A video decoding device, characterized in that: include: A prediction mode determination unit, used to determine a prediction mode of a current chroma block; a limited range determining unit, configured to determine, if the prediction mode is an inter-component intra prediction mode, a limited range of a prediction value of the current chroma block based on chroma values of a reconstructed area around the current chroma block, wherein the limited range includes at least one of a maximum limited value and a minimum limited value of the prediction value; A prediction unit, configured to determine a first prediction value of the current chroma block based on the cross-component intra prediction mode; A limiting unit is used to determine a second prediction value of the current chroma block based on the first prediction value and the limited range.
50. A video encoding device, characterized in that include: A prediction mode determination unit, used to determine a prediction mode of a current chroma block; a limited range determining unit, configured to determine, if the prediction mode is an inter-component intra prediction mode, a limited range of a prediction value of the current chroma block based on chroma values of a reconstructed area around the current chroma block, wherein the limited range includes at least one of a maximum limited value and a minimum limited value of the prediction value; A prediction unit, configured to determine a first prediction value of the current chroma block based on the cross-component intra prediction mode; A limiting unit is used to determine a second prediction value of the current chroma block based on the first prediction value and the limited range.
51. An electronic device, characterized in that: including a processor and a memory; The memory shown is used to store computer programs; The processor is used to call and run the computer program stored in the memory to implement the method described in any one of claims 1 to 24 or 25 to 48 above.
52. A video encoding and decoding system, characterized in that: include: Video encoders and video decoders; The video decoder is used to implement the method described in any one of claims 1 to 24; The video encoder is used to implement the method described in any one of claims 25 to 48.
53. A computer-readable storage medium, characterized in that: For storing computer programs; The computer program enables a computer to execute the method according to any one of claims 1 to 24 or 25 to 48 above.
Citation Information
Patent Citations
Decoding method and device
CN110662031A
Image component prediction method, encoder, decoder and storage medium
CN113273194A
Image component prediction method, encoder, decoder, and computer storage medium
CN113412621A
Method and apparatus for cross-component prediction
CN114793280A
Apparatus and method for coding and decoding image
US20140112392A1
