Video coding and decoding method, device, equipment, system and storage medium

CN120958801APending Publication Date: 2025-11-14GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380096168.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-22
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

In the existing video coding and decoding technology, the intra prediction mode is not accurate enough to determine the transformation kernel of the current block, resulting in low decoding accuracy and coding efficiency, and the transformation kernel needs to be indicated separately, which increases the overhead of codewords.

Method used

The interpolation filter prediction method is used to determine the prediction block by determining the reference area and interpolation filter of the current block, and determine the transformation kernel based on the traditional prediction mode of the prediction block, thereby improving the accuracy of determining the transformation kernel and reducing codeword overhead.

Benefits of technology

It improves the decoding accuracy and coding efficiency of video encoding and decoding, reduces the use of codewords, and improves the video encoding and decoding effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120958801A_ABST
    Figure CN120958801A_ABST
Patent Text Reader

Abstract

The invention provides a video coding and decoding method, device, equipment and system and a storage medium, and the method comprises the steps: determining a reference region and an interpolation filter of a current block when the current block is predicted, and determining a prediction block of the current block based on the reference region and the interpolation filter; and determining a prediction mode corresponding to the prediction block, determining a transformation kernel corresponding to the current block based on the prediction mode, performing inverse transformation on a transformation coefficient of the current block by using the transformation kernel to obtain a residual block of the current block, and obtaining a reconstruction value of the current block based on the residual block and the prediction block of the current block. According to the method, if the current block is predicted by adopting the interpolation filtering prediction method, the transformation kernel corresponding to the current block is determined by determining the traditional prediction mode corresponding to the prediction block, so that the determination accuracy of the transformation kernel is improved, and the video coding and decoding effects of the current block are improved.
Need to check novelty before this filing date? Find Prior Art

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 compression efficiency. In order to improve the prediction effect, this application proposes an interpolation filtering prediction method.

[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 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] Determining a reference area and an interpolation filter of a current block, and determining a prediction block of the current block based on the reference area and the interpolation filter;

[0008] Determining an intra-frame prediction mode corresponding to the prediction block, and determining a transform kernel corresponding to the current block based on the intra-frame prediction mode corresponding to the prediction block;

[0009] The transform coefficients of the current block are inversely transformed based on the transform kernel corresponding to the current block to obtain a residual block of the current block, and a reconstructed block of the current block is obtained based on the prediction block and the residual block of the current block.

[0010] In a second aspect, an embodiment of the present application provides a video encoding method, applied to an encoder, comprising:

[0011] Determining a reference area and an interpolation filter of a current block, and determining a prediction block of the current block based on the reference area and the interpolation filter;

[0012] Determining an intra-frame prediction mode corresponding to the prediction block, and determining a transform kernel corresponding to the current block based on the intra-frame prediction mode corresponding to the prediction block;

[0013] The residual block of the current block is transformed based on the transformation kernel corresponding to the current block to obtain the transformation coefficient of the current block, and the current block is encoded based on the deformation coefficient to obtain a code stream.

[0014] 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.

[0015] 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.

[0016] In a fifth aspect, a video decoder is provided, 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.

[0017] In a sixth aspect, a video encoder is provided, 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.

[0018] In a seventh aspect, a video encoding and decoding system is provided, 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.

[0019] In an eighth aspect, a chip is provided for implementing the method described in any one of the first and second aspects above, or their respective implementations. Specifically, the chip includes a processor configured to load and execute a computer program from a memory, causing a device equipped with the chip to perform the method described in any one of the first and second aspects above, or their respective implementations.

[0020] In a ninth aspect, a computer-readable storage medium is provided for storing a computer program, which enables a computer to execute the method of any one of the first to second aspects or their respective implementations.

[0021] In a tenth aspect, a computer program product is provided, comprising computer program instructions, which enable a computer to execute the method of any one of the first to second aspects or their respective implementations.

[0022] In an eleventh aspect, a computer program is provided, 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.

[0023] Based on the above technical solution, the present application proposes an interpolation filter prediction method. When predicting a current block, the reference region and interpolation filter of the current block are first determined. Based on the reference region and interpolation filter, a prediction block for the current block is determined. Next, a prediction mode corresponding to the prediction block is determined. Based on the prediction mode, a transform kernel corresponding to the current block is determined. The transform kernel is used to inversely transform the transform coefficients of the current block to obtain a residual block for the current block. Based on the residual block and the prediction block, a reconstruction value for the current block is obtained. In other words, in an embodiment of the present application, when the current block is predicted using the interpolation filter prediction method, the transform kernel corresponding to the current block is determined by determining the traditional prediction mode corresponding to the prediction block. This makes the determined transform kernel more consistent with the characteristics of the current block, thereby improving the accuracy of the determination of the transform kernel. When the accurately determined transform kernel is used to determine the reconstruction value of the current block, the accuracy of the determination of the reconstruction value can be improved, thereby improving the decoding accuracy of the current block. In addition, the embodiment of the present application determines the transform kernel of the current block through the traditional prediction mode corresponding to the prediction block, eliminating the need to separately indicate the transform kernel, saving codewords and further improving video encoding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] FIG1 is a schematic block diagram of a video encoding and decoding system according to an embodiment of the present application;

[0025] FIG2 is a schematic block diagram of a video encoder according to an embodiment of the present application;

[0026] FIG3 is a schematic block diagram of a video decoder according to an embodiment of the present application;

[0027] FIG4A is a schematic diagram of intra-frame prediction;

[0028] FIG4B is a schematic diagram of intra-frame prediction;

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

[0030] FIG6 is a schematic diagram of an intra-frame prediction mode;

[0031] FIG7 is a schematic diagram of an intra-frame prediction mode;

[0032] FIG8 is a schematic diagram of an intra-frame prediction mode;

[0033] Figure 9 is a schematic diagram of the CCCM principle;

[0034] FIG10 is a schematic flow chart of a video decoding method according to an embodiment of the present application;

[0035] FIG11 is a schematic diagram showing the position of the current block in the current image;

[0036] Figure 12 is a schematic diagram of the reconstruction area;

[0037] 13A to 13C are schematic diagrams of several reference areas;

[0038] 14A to 14G are schematic diagrams of several interpolation filter shapes;

[0039] FIG15 is a schematic diagram of shapes of several interpolation filters involved in an embodiment of the present application;

[0040] FIG16 is a schematic diagram of shapes of several interpolation filters involved in an embodiment of the present application;

[0041] FIG17 is a schematic diagram of shapes of several interpolation filters involved in embodiments of the present application;

[0042] FIG18A is a schematic diagram of shapes of several interpolation filters involved in an embodiment of the present application;

[0043] FIG18B is a schematic diagram of shapes of several interpolation filters involved in an embodiment of the present application;

[0044] FIG19 is a schematic diagram of shapes of several interpolation filters involved in an embodiment of the present application;

[0045] FIG20 is a schematic diagram of a first reconstruction area;

[0046] FIG21 is a schematic diagram showing the movement of interpolation filters of different shapes within different types of reference areas;

[0047] FIG22 is a schematic diagram of using an interpolation filter to perform interpolation prediction on a current block;

[0048] FIG23 is a schematic diagram of an intra-frame prediction mode;

[0049] FIG24 is a schematic diagram of determining horizontal gradient and vertical gradient;

[0050] FIG25 is a histogram of gradient amplitude values;

[0051] FIG26 is a flow chart of a prediction method according to an embodiment of the present application;

[0052] FIG27 is a schematic diagram of a process for determining a prediction mode according to an embodiment of the present application;

[0053] FIG28 is a schematic block diagram of a video decoding device according to an embodiment of the present application;

[0054] FIG29 is a schematic block diagram of a video encoding apparatus according to an embodiment of the present application;

[0055] FIG30 is a schematic block diagram of an electronic device provided in an embodiment of the present application;

[0056] Figure 31 is a schematic block diagram of a video encoding and decoding system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] 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.

[0058] 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 .

[0059] 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.

[0060] 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.

[0061] 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.

[0062] 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.

[0063] 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.

[0064] 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.

[0065] 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.

[0066] 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 .

[0067] 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.

[0068] 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.

[0069] 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.

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

[0071] 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 .

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

[0073] 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 .

[0074] 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.

[0075] 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.

[0076] The following is an introduction to the video encoding framework involved in the embodiments of the present application.

[0077] 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.

[0078] 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).

[0079] 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.

[0080] 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.

[0081] 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.

[0082] 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.

[0083] 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.

[0084] 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.

[0085] 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.

[0086] 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.

[0087] 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 high-definition and ultra-high-definition digital video development.

[0088] 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.

[0089] 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.

[0090] 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.

[0091] 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.

[0092] 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.

[0093] 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.

[0094] 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.

[0095] 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.

[0096] FIG3 is a schematic block diagram of a video decoder according to an embodiment of the present application.

[0097] 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.

[0098] 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.

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

[0100] 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.

[0101] 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.

[0102] 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.

[0103] 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.

[0104] 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.

[0105] The loop filtering unit 350 may perform a deblocking filtering operation to reduce blocking artifacts of pixel blocks associated with a CU.

[0106] 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.

[0107] 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.

[0108] 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.

[0109] 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.

[0110] 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.

[0111] 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."

[0112] 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.

[0113] 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.

[0114] 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.

[0115] In addition, there are Plane, Planar and other modes. With the development of technology and the expansion of blocks, there are more and more angular prediction modes. Figure 6 is a schematic diagram of intra-frame prediction modes. As shown in Figure 6, the intra-frame prediction modes used by HEVC include Planar, DC and 33 angular modes, totaling 35 prediction modes. Figure 7 is a schematic diagram of intra-frame prediction modes. As shown in Figure 7, the intra-frame modes used by VVC include Planar, DC and 65 angular modes, totaling 67 prediction modes. Figure 8 is a schematic diagram of intra-frame prediction modes. As shown in Figure 8, VS3 uses DC, Plane, Bilinear, PCM and 62 angular modes, totaling 66 prediction modes.

[0116] There are also some technologies that improve prediction, such as improving the pixel-by-pixel interpolation of reference pixels and filtering the predicted pixels. For example, the multiple intra-frame prediction filter (MIPF) in AVS3 uses different filters to generate prediction values ​​for different block sizes. For pixels at different positions in the same block, one filter is used to generate prediction values ​​for pixels closer to the reference pixel, and another filter is used to generate prediction values ​​for pixels farther from the reference pixel. Technologies that filter predicted pixels, such as the intra-frame prediction filter (IPF) in AVS3, can use reference pixels to filter the predicted values.

[0117] In some embodiments, in current video encoding and decoding, an adaptive loop filter (ALF) technology is used in a loop filter unit, for example, ALF technology is used to filter the reconstructed image to obtain a final decoded image.

[0118] The following is an introduction to the adaptive loop filter (ALF) technology.

[0119] ALF is a filter in the loop filter. It is designed based on the principle of Wiener filter and is a filter that minimizes the error between the target sample and the input sample. In the loop filter, the target sample is the original image and the input is the reconstructed image.

[0120] Before using ALF for filtering, the filter coefficients must be determined first.

[0121] For example, by constructing the Wienerhof equation shown in formula (1), and solving the Wienerhof equation, the filter coefficients of the interpolation filter can be obtained:

[0122] in, Represents a range of the current 2D image. For example, if the input of the filter is a reconstructed image, then Represents the reconstruction area around the current block in the reconstructed image. r is The position of a sample within, for example, the coordinates of the sample at position r can be expressed as (x, y). o[r] is the original pixel value of the sample at position r, t[r] is the pixel value to be filtered at position r, for example, if the input of the filter is a reconstructed image, then t[r] is also called the reconstructed value of the pixel at position r in the reconstructed image. c=[c0,c1,…,c N-1 ] T is the filter coefficient of the adaptive filter, {p0,p1,…,p N-1} is the relative position difference between the N positions corresponding to position r and position r.

[0123] In the above formula (1), except for the filter coefficients c=[c0,c1,…,c N-1 ] T Except for , all other data are known, so the filter coefficients of the filter can be obtained by solving the above formula (1).

[0124] In one example, the filter coefficients of the filter can be obtained by solving the above Wienerhof equation through Cholesky decomposition of the autocorrelation coefficient matrix.

[0125] After the filter coefficients are determined based on the above formula (1), the samples to be filtered are filtered using the following formula (2) to obtain the filtered samples:

[0126] Among them, t[r]′ is the pixel value after filtering at position r, p nis the relative position difference between the nth position and position r in the N positions corresponding to position r, t[r+p n ] means r+p n The pixel value to be filtered at position .

[0127] The convolutional cross component model (CCCM) predicts chrominance pixels using reconstructed luminance pixels. Its advantage is that the CCCM filter coefficients can be obtained from reconstructed pixels at the decoder, eliminating the overhead of storing filter coefficients in the bitstream as with ALF. As shown in Figure 9, the CCCM coefficients are calculated from the reconstructed pixels surrounding the chrominance block to be predicted and the reconstructed pixels surrounding the luminance block at the corresponding position of the chrominance block.

[0128] The present invention provides an interpolation filter prediction method. When predicting a current block, the method first determines a reference region and an interpolation filter for the current block. Based on the reference region and the interpolation filter, a prediction block for the current block is determined. For example, the reference region is filtered using the interpolation filter, and filter coefficients of the filter are calculated. The current block is then subjected to interpolation filter prediction based on the interpolation filter with the determined filter coefficients to obtain the prediction block for the current block. Next, a prediction mode corresponding to the prediction block is determined, and a transform kernel corresponding to the current block is determined based on the prediction mode. The transform kernel is used to perform an inverse transform on the transform coefficients of the current block to obtain a residual block for the current block. A reconstructed value for the current block is obtained based on the residual block and the prediction block. In other words, in the present invention, when the current block is predicted using the interpolation filter prediction method, the method determines the transform kernel corresponding to the prediction block by determining the traditional prediction mode corresponding to the prediction block. This makes the determined transform kernel more consistent with the characteristics of the current block, thereby improving the accuracy of the determination of the transform kernel. When the reconstructed value of the current block is determined using the accurately determined transform kernel, the accuracy of the determination of the reconstructed value can be improved, thereby improving the decoding accuracy of the current block. In addition, the embodiment of the present application determines the transformation kernel of the current block by predicting the traditional prediction mode corresponding to the block, without the need to indicate the transformation kernel separately, thus saving codewords and further improving the video encoding and decoding effect.

[0129] 10 , the video decoding method provided in the embodiment of the present application is introduced by taking the decoding end as an example.

[0130] FIG10 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 FIG10, the method according to the embodiment of the present application includes:

[0131] S101 : Determine a reference area and an interpolation filter of a current block, and determine a prediction block of the current block based on the reference area and the interpolation filter.

[0132] When decoding the current block, the decoder decodes the bitstream to obtain the quantization coefficients for the current block, dequantizes the quantization coefficients to obtain the transform coefficients for the current block, and de-transforms the transform coefficients to obtain the residual value for the current block. Next, the prediction mode for the current block is determined, and based on the prediction mode, the predicted value for the current block is determined. Based on the predicted value and the residual value for the current block, the reconstructed value for the current block is obtained.

[0133] In some embodiments, the current block also becomes a block to be predicted.

[0134] In the embodiment of the present application, the decoding end first determines the prediction mode of the current block.

[0135] In some embodiments, the decoding end determines the prediction mode of the current block in at least the following ways:

[0136] In Method 1, the encoder determines the prediction mode for the current block. For example, from the candidate prediction modes consisting of the traditional prediction mode and the interpolation filter prediction mode shown in Figure 6 or Figure 7, the candidate prediction mode with the lowest cost is selected as the prediction mode for the current block. Next, the encoder adds information indicating the prediction mode for the current block to the bitstream. The decoder then decodes the bitstream to obtain the information indicating the prediction mode for the current block. Based on this information, the decoder determines the prediction mode for the current block and uses the intra-frame prediction mode to predict the current block, obtaining a predicted value for the current block.

[0137] For example, if the terminal device determines that the prediction mode for the current block is the traditional prediction mode, the prediction mode index for the current block is written into the bitstream as the indication of the prediction mode. The decoder obtains the prediction mode index by decoding the bitstream and, based on the index, determines the prediction mode for the current block from the traditional prediction modes shown in Figures 6 or 7.

[0138] In method 2, the encoder constructs a candidate list of intra-frame prediction modes and selects the intra-frame prediction mode for the current block from the candidate list. It should be noted that the candidate list includes the interpolation filter prediction mode. Next, the encoder writes the sequence number (or index number) of the intra-frame prediction mode of the current block in the candidate list into the bitstream. In this way, the decoder determines the sequence number of the intra-frame prediction mode of the current block in the candidate list of intra-frame prediction modes by decoding the bitstream. Simultaneously, based on the same method as the encoder, it constructs a candidate list of intra-frame prediction modes (it should be noted that the constructed candidate list of intra-frame prediction modes includes the interpolation filter prediction mode). Then, based on the sequence number of the intra-frame prediction mode of the current block in the candidate list of intra-frame prediction modes, it determines the intra-frame prediction mode for the current block from the constructed candidate list of intra-frame prediction modes. Finally, the determined intra-frame prediction mode of the current block is used to predict the current block to obtain a predicted value for the current block.

[0139] Method 3: The encoding end constructs a candidate list of intra-frame prediction modes, which includes an interpolation filter prediction mode. Then, the intra-frame prediction mode of the current block is selected from the candidate list of intra-frame prediction modes. For example, the cost of each candidate prediction mode in the candidate list of intra-frame prediction modes on the template of the current block is determined, and then the intra-frame prediction mode of the current block is determined based on the cost. Correspondingly, the decoding end constructs a candidate list of intra-frame prediction modes based on the same method as the encoding end. The constructed candidate list of intra-frame prediction modes also includes an interpolation filter prediction mode. Then, the cost of each candidate prediction mode in the candidate list of intra-frame prediction modes on the template of the current block is determined, and then the intra-frame prediction mode of the current block is determined based on the cost. Finally, the intra-frame prediction mode of the current block is used to predict the current block to obtain the predicted value of the current block.

[0140] In mode 4, the encoder and decoder use the interpolation filter prediction mode by default to predict the current block.

[0141] In addition to determining whether the current block adopts the interpolation filtering prediction mode for prediction through the above-mentioned methods 1 to 4, the decoding end can also determine whether the current block adopts the interpolation filtering prediction mode through the following method 5.

[0142] In mode 5, the decoder decodes the bitstream to obtain third information indicating whether the current block is predicted using the interpolation filter prediction mode. If the decoder determines, based on the third information, that the current block is predicted using the interpolation filter prediction mode, it determines a reference area and an interpolation filter for the current block.

[0143] In this method 5, if the encoder determines that the current block adopts the interpolation filter prediction mode, the third information is written into the bitstream. In this way, the decoder obtains the third information by decoding the bitstream, and then determines whether the current block adopts the interpolation filter prediction mode for prediction based on the third information. If the third information indicates that the current block adopts the interpolation filter prediction mode for prediction, the decoder uses the interpolation filter prediction mode to predict the current block and obtains the prediction block of the current block. If the third information indicates that the current block does not adopt the interpolation filter prediction mode for prediction, the decoder skips the step of predicting the current block using the interpolation filter prediction mode, further determines the prediction mode of the current block, and predicts the current block using the determined prediction mode to obtain the prediction block of the current block.

[0144] The embodiment of the present application does not limit the specific form of expression of the above-mentioned third information, which can be any indication information that can indicate whether the current block adopts the interpolation filtering prediction mode for prediction.

[0145] In one example, the third information can be represented as intra_eip_flag, so that different values ​​of intra_eip_flag can be used to determine whether the current block is predicted using the interpolation filtering prediction mode. For example, when intra_eip_flag = 0, it indicates that the current block is not predicted using the interpolation filtering prediction mode, and when intra_eip_flag = 1, it indicates that the current block is predicted using the interpolation filtering prediction mode. In this way, the encoder writes the preset flag intra_eip_flag into the bitstream, and the decoder determines the prediction mode of the current block by decoding the value of the preset flag intra_eip_flag. For example, when the preset flag intra_eip_flag = 1, it indicates that the prediction mode of the current block is the interpolation filtering prediction mode, and the decoder then uses the interpolation filtering prediction mode to predict the current block.

[0146] In some embodiments, to improve the prediction accuracy of the interpolation filter prediction mode, the interpolation filter prediction mode is used for some blocks that meet the requirements, while the interpolation filter prediction mode is not used for some blocks that do not meet the requirements. Based on this, before decoding the bitstream and obtaining the third information, the decoding end needs to determine whether the position of the current block in the current image meets the preset position requirements and whether the size of the current block meets the preset block size. If it is determined that the position of the current block in the current image meets the preset position requirements and the size of the current block meets the preset block size, the bitstream is decoded to obtain the third information.

[0147] The embodiment of the present application does not impose any restrictions on the preset position requirements and the prediction block size, which are determined based on actual needs.

[0148] In one example, as shown in FIG11 , assuming that the position of the upper left corner of the current image is (0, 0), and the position of the upper left corner of the current block is (x, y), where the preset position requirements are that the x value of the current block is greater than or equal to a first preset value XX, and the y value of the current block is greater than or equal to a second preset value YY.

[0149] The embodiment of the present application does not limit the specific values ​​of the first preset value and the second preset value.

[0150] Exemplarily, the first preset value and the second preset value are the same.

[0151] Exemplarily, the first preset value and the second preset value are both 13, that is, when the distance from the upper edge line of the current block to the upper edge line of the current image is greater than or equal to 13 pixel rows, and the distance from the left edge line of the current block to the left edge line of the current image is greater than or equal to 13 pixel columns, it indicates that the position of the current block in the current image meets the preset position requirements.

[0152] In one example, continuing to refer to Figure 11, assuming that the width of the current block is W and the height of the current block is H, the preset block size requirement is that the width W of the current block is less than or equal to the third preset value A, and the height H of the current block is less than or equal to the fourth preset value B.

[0153] The embodiment of the present application does not limit the specific values ​​of the third preset value and the fourth preset value.

[0154] Exemplarily, the third preset value and the fourth preset value are the same.

[0155] Exemplarily, the third preset value and the fourth preset value are both 32, that is, when the width and height of the current block are both less than or equal to 32, it indicates that the current block meets the preset block size requirement.

[0156] In an embodiment of the present application, before determining whether the current block is predicted using the interpolation filter prediction mode, the decoding end first determines whether the position of the current block in the current image meets the preset position requirement, and determines whether the size of the current block meets the preset block size requirement. If the position of the current block in the current image meets the preset position requirement, and the size of the current block meets the preset block size requirement, the code stream is decoded to obtain third information, and based on the third information, it is determined whether the current block is predicted using the interpolation filter prediction mode. For example, as shown in Figure 11, the distance from the upper edge of the current block to the upper edge of the current image is greater than or equal to 13 pixel rows, the distance from the left edge of the current block to the left edge of the current image is greater than or equal to 13 pixel columns, and the width and height of the current block are both less than or equal to 32, then the decoding end decodes the code stream to obtain the third information.

[0157] In some embodiments, the first preset value, the second preset value, the third preset value, and the fourth preset value are default values.

[0158] In some embodiments, the first preset value, the second preset value, the third preset value, and the fourth preset value are values ​​decoded from the bitstream by the decoding end.

[0159] In some embodiments, if the position of the current block in the current image does not meet a preset position requirement, and / or the size of the current block does not meet a preset block size requirement, it is determined that the current block is not predicted using the interpolation filtering prediction mode.

[0160] In some embodiments, before determining whether the position of the current block in the current image meets the preset position requirement and determining whether the size of the current block meets the preset block size, the decoding end further includes: decoding the code stream to obtain fourth information, and the fourth information is used to indicate whether the current sequence is allowed to be predicted using the interpolation filtering prediction mode; if the fourth information indicates that the current sequence is allowed to be predicted using the interpolation filtering prediction mode, then determining whether the position of the current block in the current image meets the preset position requirement and determining whether the size of the current block meets the preset block size.

[0161] In an embodiment of the present application, a high-level syntax element, such as fourth information at the sequence level, indicates whether the current sequence is allowed to be predicted using the interpolation filtering prediction mode. If the fourth information indicates that the current sequence is allowed to be predicted using the interpolation filtering prediction mode, the decoding end determines whether the position of the current block in the current image meets the preset position requirement and whether the size of the current block meets the preset block size requirement. Then, when it is determined that the position of the current block in the current image meets the preset position requirement and that the size of the current block meets the preset block size requirement, the decoding end decodes the third information to determine whether the current block is predicted using the interpolation filtering prediction mode.

[0162] In some embodiments, if the fourth information indicates that the current sequence is not allowed to be predicted using the interpolation filtering prediction mode, the decoding end skips the above-mentioned steps of determining whether the position of the current block in the current image meets the preset position requirements, and determining whether the size of the current block meets the preset block size requirements, and skips the step of decoding the third information.

[0163] The embodiment of the present application does not limit the specific form of the fourth information, which can be any indication information that can indicate whether the current sequence is allowed to be predicted using the interpolation filtering prediction mode.

[0164] In one example, the fourth information may be represented by sps_eip_enabled_flag, so that different values ​​of sps_eip_enabled_flag can be used to determine whether the current sequence is allowed to be predicted using the interpolation filtering prediction mode. For example, when sps_eip_enabled_flag = 0, it indicates that the current sequence is not allowed to be predicted using the interpolation filtering prediction mode, and when sps_eip_enabled_flag = 1, it indicates that the current sequence is allowed to be predicted using the interpolation filtering prediction mode.

[0165] Exemplarily, the fourth information is carried in a sequence parameter set (SPS), for example, as shown in Table 1:

[0166] Table 1

[0167] Among them, sps_eip_enabled_flag represents the fourth information, which is carried in seq_parameter_set_rbsp(). For example, when sps_eip_enabled_flag=0, it indicates that the current sequence is not allowed to use the interpolation filter prediction mode for prediction, and when sps_eip_enabled_flag=1, it indicates that the current sequence is allowed to use the interpolation filter prediction mode for prediction.

[0168] In some embodiments, embodiments of the present application may further include a general constraints information (GCI) flag to indicate whether interpolation filter prediction technology is used. Exemplarily, gci_no_eip_constraint_flag is used to indicate whether interpolation filter prediction technology is enabled for the current video. Exemplarily, as shown in Table 2, the gci_no_eip_constraint_flag is carried in the general constraints information general_constraints_info().

[0169] Table 2

[0170] As shown in Table 2, if gci_no_eip_constraint_flag = 1, it means that the interpolation filter prediction technology is not enabled for the current video, that is, the interpolation filter intra prediction technology at the sequence level must be 0 in all images, that is, it means that the interpolation filter intra prediction technology is not allowed in all sequences in the current video. If gci_no_eip_constraint_flag = 0, it means that the interpolation filter prediction technology is enabled for the current video, that is, the interpolation filter intra prediction technology at the sequence level must be 0 in all images.

[0171] As can be seen from the above, if the syntax elements of the embodiment of the present application include the high-level syntax elements gci_no_eip_constraint_flag and sps_eip_enabled_flag, as well as the block-level intra_eip_flag, the decoding end first decodes the high-level syntax elements, that is, first decodes gci_no_eip_constraint_flag. If gci_no_eip_constraint_flag = 0, it continues to decode sps_eip_enabled_flag. If sps_eip_enabled_flag = 1, it parses the syntax elements of the block.

[0172] Exemplary block-level syntax elements are shown in Table 3:

[0173] Table 3

[0174] In Table 3, cbWidth and cbHeight are the width and height of the current block, SIZE_A can be understood as the third preset value mentioned above, SIZE_B can be understood as the fourth preset value, XX can be understood as the first preset value, YY can be understood as the second preset value, and x0 and y0 represent the coordinate difference between the upper left corner of the current block and the upper left corner of the current image.

[0175] As can be seen from Table 3 above, if the fourth sequence-level information, sps_eip_enabled_flag = 1, indicating that the current sequence allows the use of the interpolation filter prediction mode, then a determination is made as to whether the position of the current block in the current image meets a preset position requirement, and whether the size of the current block meets a preset block size requirement. If it is determined that the position of the current block in the current image meets the preset position requirement and that the size of the current block meets the preset block size requirement, the third information, intra_eip_flag, is decoded, and based on the decoded third information, a determination is made as to whether the current block is predicted using the interpolation filter prediction mode.

[0176] The above describes the specific process of determining whether the current block is predicted using the interpolation filtering prediction mode.

[0177] In an embodiment of the present application, if the decoding end determines that the current block is predicted using the interpolation filtering prediction mode, the interpolation filtering prediction mode is used to predict the current block to obtain a predicted value of the current block.

[0178] The following describes the process of using the interpolation filter prediction mode at the decoding end to predict the current block.

[0179] When the decoding end determines that the current block is predicted using the interpolation filtering prediction mode, it first determines the reference area and interpolation filter of the current block.

[0180] The following describes the specific process of determining the reference area of ​​the current block at the decoding end.

[0181] In the embodiment of the present application, the reference area of ​​the current block is part or all of the reconstructed area around the current block.

[0182] For example, as shown in FIG12 , the reconstructed area around the current block may include: an upper reconstructed area of ​​the current block, a left reconstructed area of ​​the current block, an upper right reconstructed area of ​​the current block, a lower left reconstructed area of ​​the current block, and an upper left reconstructed area of ​​the current block. The block to be predicted in FIG12 is the current block.

[0183] The embodiment of the present application does not limit the specific shape and size of the reference area of ​​the current block.

[0184] In one example, the reference area of ​​the current block includes any one of an upper reconstruction area of ​​the current block, a left reconstruction area of ​​the current block, an upper right reconstruction area of ​​the current block, a lower left reconstruction area of ​​the current block, and an upper left reconstruction area of ​​the current block. For example, the reference area of ​​the current block is the upper reconstruction area of ​​the current block, or the reference area of ​​the current block is the left reconstruction area of ​​the current block.

[0185] In one example, the reference area of ​​the current block includes any two of the reconstruction areas above the current block, the reconstruction area to the left of the current block, the reconstruction area to the upper right of the current block, the reconstruction area to the lower left of the current block, and the reconstruction area to the upper left of the current block. For example, the reference area of ​​the current block includes the reconstruction area above the current block and the reconstruction area to the left of the current block. For another example, the reference area of ​​the current block includes the reconstruction area above the current block and the reconstruction area to the lower left of the current block.

[0186] In one example, the reference area of ​​the current block includes any three reconstruction areas of the upper reconstruction area of ​​the current block, the left reconstruction area of ​​the current block, the upper right reconstruction area of ​​the current block, the lower left reconstruction area of ​​the current block, and the upper left reconstruction area of ​​the current block. For example, the reference area of ​​the current block includes the upper reconstruction area of ​​the current block, the upper right reconstruction area of ​​the current block, and the upper left reconstruction area of ​​the current block. For another example, the reference area of ​​the current block includes the left reconstruction area of ​​the current block, the upper left reconstruction area of ​​the current block, and the lower left reconstruction area of ​​the current block.

[0187] In one example, the reference area of ​​the current block includes any four reconstruction areas of the upper reconstruction area of ​​the current block, the left reconstruction area of ​​the current block, the upper right reconstruction area of ​​the current block, the lower left reconstruction area of ​​the current block, and the upper left reconstruction area of ​​the current block. For example, the reference area of ​​the current block includes the upper reconstruction area of ​​the current block, the upper right reconstruction area of ​​the current block, the upper left reconstruction area of ​​the current block, and the left reconstruction area of ​​the current block. For another example, the reference area of ​​the current block includes the left reconstruction area of ​​the current block, the upper left reconstruction area of ​​the current block, the lower left reconstruction area of ​​the current block, and the upper reconstruction area of ​​the current block.

[0188] In one example, the reference area of ​​the current block includes five reconstruction areas: an upper reconstruction area of ​​the current block, a left reconstruction area of ​​the current block, an upper right reconstruction area of ​​the current block, a lower left reconstruction area of ​​the current block, and an upper left reconstruction area of ​​the current block.

[0189] In the embodiment of the present application, the specific manners in which the decoding end determines the reference area of ​​the current block include but are not limited to the following:

[0190] In method 1, the reference area of ​​the current block is a default area. For example, the encoding end and the decoding end default that the reference area of ​​the current block includes at least one reconstruction area of ​​the upper reconstruction area of ​​the current block, the left reconstruction area of ​​the current block, the upper right reconstruction area of ​​the current block, the lower left reconstruction area of ​​the current block, and the upper left reconstruction area of ​​the current block.

[0191] In method 2, the decoding end decodes the code stream to obtain first information, which is used to indicate the type of the reference area of ​​the current block; based on the type of the reference area, the reference area of ​​the current block is determined from among the preset P reference areas, where P is a positive integer greater than 1.

[0192] In this implementation, the encoder determines a reference region for the current block from among P preset reference regions. For example, the encoder determines the coding costs corresponding to each of the P reference regions and selects the reference region with the lowest coding cost as the reference region for the current block. The encoder then indicates the type of the reference region with the lowest coding cost to the decoder via first information. The decoder then decodes the bitstream to obtain the first information and, based on the reference region type indicated by the first information, determines a reference region for the current block from among the P preset reference regions.

[0193] It should be noted that the types or shapes of the preset P reference areas are different.

[0194] The embodiment of the present application does not impose any specific limitation on the specific number and shape of the P reference areas.

[0195] In one example, the P reference regions include at least one of a first reference region, a second reference region, and a third reference region.

[0196] As shown in FIG13A , the first reference region includes the reconstruction regions above, to the upper right, to the left, to the upper left, and to the upper left of the current block. As shown in FIG13B , the second reference region includes the reconstruction regions above, to the upper right, and to the upper left of the current block. As shown in FIG13C , the third reference region includes the reconstruction regions to the left, to the upper left, and to the upper left of the current block. The block to be predicted in FIG13A through FIG13C is the current block.

[0197] The embodiment of the present application does not limit the specific form of the first information, as long as it is any indication information that can indicate the type of the reference area of ​​the current block.

[0198] In an example, eip_ref_type is used to represent the first information. For example, different types of reference areas are indicated by the value of eip_ref_type.

[0199] For example, as shown in Table 4, the correspondence between the three reference areas shown in FIG. 13A and FIG. 13B and the eip_ref_type value is as follows:

[0200] Table 4

[0201] Based on Table 4 above, the decoder decodes the bitstream to obtain the first information eip_ref_type, and then determines the reference area of ​​the current block based on the value of the first information eip_ref_type. For example, if eip_ref_type = 0, the reference area of ​​the current block is determined to be the first reference area. As shown in Figure 13A, the first reference area includes the reconstruction area above, to the upper right, to the left, to the upper left, and to the upper left of the current block. If eip_ref_type = 1, the reference area of ​​the current block is determined to be the second reference area. As shown in Figure 13B, the second reference area includes the reconstruction area above, to the upper right, and to the upper left of the current block. If eip_ref_type = 2, the reference area of ​​the current block is determined to be the third reference area. As shown in Figure 13C, the third reference area includes the reconstruction area above, to the upper right, and to the upper left of the current block.

[0202] It should be noted that the above description uses the three reference regions shown in Figures 13A to 13C as an example. The P reference regions in this embodiment of the present application also include other reference regions in addition to the three reference regions described above, and this embodiment of the present application does not limit this. The correspondence between the reference regions and the eip_ref_type values ​​shown in Table 4 above can be adaptively adjusted according to the number of reference regions.

[0203] In some embodiments, the decoding end may adopt a truncated binary code decoding method to decode the code stream to obtain the first information.

[0204] For example, the correspondence between the truncated binary code, the eip_ref_type value, and the type of the reference area is shown in Table 5:

[0205] Table 5

[0206] In an embodiment of the present application, the decoding end may adopt an equal probability decoding method or a context model decoding method to decode the codeword of the truncated binary code.

[0207] In addition to using the above-mentioned method 1 or method 2 to determine the reference area of ​​the current block, the decoding end can also use the following method 3 to determine the reference area of ​​the current block.

[0208] Mode 3: Based on the shape of the current block, a reference area of ​​the current block is determined from among P preset reference areas.

[0209] In this method 3, different reference areas are used to perform prediction on current blocks of different shapes to improve the accuracy of prediction.

[0210] For example, if the shape of the current block is a square, the first type of reference region is used.

[0211] For another example, if the shape of the current block is a rectangle with a width greater than a height, the second type of reference region is used.

[0212] For another example, if the shape of the current block is a rectangle with a width smaller than a height, the third type of reference region is used.

[0213] That is, in this embodiment of the present application, the correspondence between the P reference regions and the shape of the current block is preset. Thus, the decoding end can determine the reference region of the current block from the P reference regions based on the shape of the current block and the correspondence between the P reference regions and the shape of the current block.

[0214] The following describes the process of determining the interpolation filter of the current block at the decoding end.

[0215] In the embodiment of the present application, there is no limitation on the specific shape of the interpolation filter.

[0216] Illustratively, the interpolation filters provided in the embodiments of the present application include, but are not limited to, square interpolation filters and interpolation filters with a height smaller than a width.

[0217] For example, the square interpolation filter includes but is not limited to the 4X4 interpolation filter shown in Figure 14A.

[0218] For another example, interpolation filters that are taller than they are wide include, but are not limited to, the 5X3 interpolation filter shown in FIG. 14B , the 6X2 interpolation filter shown in FIG. 14D , and the 7X1 interpolation filter shown in FIG. 14G .

[0219] For another example, interpolation filters with a height smaller than a width include but are not limited to the 3X5 interpolation filter shown in FIG. 14C , the 2X6 interpolation filter shown in FIG. 14E , and the 1X7 interpolation filter shown in FIG. 14F .

[0220] It should be noted that in the above filter, the dark gray position represents the current position to be predicted, and the light gray position represents the input position of the interpolation filter, that is, {p0, p1, ..., p N-1}Location.

[0221] In the embodiment of the present application, the specific manners in which the decoding end determines the interpolation filter for the current block include but are not limited to the following:

[0222] In mode 1, the interpolation filter of the current block is a default interpolation filter. For example, the encoder and decoder default the interpolation filter of the current block to any one of the interpolation filters in Figures 14A to 14G. For example, the default interpolation filter is a 4x4 interpolation filter.

[0223] Method 2: The decoding end decodes the code stream to obtain second information, which is used to indicate the shape of the interpolation filter of the current block; based on the shape of the interpolation filter of the current block, the interpolation filter of the current block is determined from the preset Q interpolation filters, where Q is a positive integer greater than 1.

[0224] In this implementation, the encoder determines the interpolation filter for the current block from among Q preset interpolation filters. For example, the encoder determines the coding costs corresponding to each of the Q interpolation filters and selects the interpolation filter with the lowest coding cost as the interpolation filter for the current block. The shape of the interpolation filter with the lowest coding cost is then transmitted to the decoder via second information. The decoder then decodes the bitstream to obtain the second information and, based on the shape of the interpolation filter indicated by the second information, determines the interpolation filter for the current block from among the Q preset interpolation filters.

[0225] It should be noted that the shapes of the preset Q interpolation filters are different.

[0226] The embodiments of the present application do not impose any specific restrictions on the specific number and shape of the Q interpolation filters. For example, the Q interpolation filters include at least one of a first interpolation filter, a second interpolation filter, and a third interpolation filter, where the first interpolation filter is a square interpolation filter, the second interpolation filter is a rectangular interpolation filter with a width greater than a height, and the third interpolation filter is a rectangular interpolation filter with a height greater than a width.

[0227] In one example, the Q interpolation filters include the plurality of interpolation filters in FIG. 14A to FIG. 14H .

[0228] The embodiment of the present application does not limit the specific form of the second information, as long as it is any indication information that can indicate the shape of the interpolation filter of the current block.

[0229] In an example, eip_filter_type is used to represent the second information. For example, the value of eip_filter_type is used to indicate interpolation filters of different shapes.

[0230] For example, if the Q interpolation filters are the five interpolation filters shown in FIG15 , as shown in Table 6, the correspondence between the five interpolation filters and the eip_filter_type values ​​is:

[0231] Table 6

[0232] Based on Table 5 above, the decoder decodes the bitstream to obtain the second information eip_filter_type, and then determines the interpolation filter of the current block based on the value of the second information eip_filter_type. For example, if eip_filter_type = 0, the shape of the interpolation filter of the current block is determined to be 4x4. If eip_filter_type = 1, the shape of the interpolation filter of the current block is determined to be 3x5. If eip_filter_type = 2, the shape of the interpolation filter of the current block is determined to be 5x3. If eip_filter_type = 3, the shape of the interpolation filter of the current block is determined to be 2x6. If eip_filter_type = 4, the shape of the interpolation filter of the current block is determined to be 6x2.

[0233] In some embodiments, the decoding end may adopt a truncated binary code decoding method to decode the code stream to obtain the second information.

[0234] For example, if the preset Q interpolation filters include the five interpolation filters shown in FIG15 , the correspondence between the truncated binary code, the eip_filter_type value, and the shape of the interpolation filter is shown in Table 7:

[0235] Table 7

[0236] At this time, the five interpolation filter shapes shown in Table 7 and the three reconstruction region types shown in Table 5 provide a total of 15 combinations of interpolation filters and reconstruction regions.

[0237] In some embodiments, the decoding end can obtain the second information eip_filter_type by decoding the bitstream, and then determine the interpolation filter for the current block based on the shape of the interpolation filter indicated by the second information eip_filter_type, as shown in Table 7. Similarly, the decoding end can obtain the first information by decoding the bitstream, and then determine the reference area for the current block based on the value of the first information eip_ref_type, as shown in Table 5.

[0238] In an example, the syntax elements of the embodiment of the present application are shown in Table 8:

[0239] Table 8

[0240] As shown in Table 8, the decoder decodes the bitstream and first obtains the fourth sequence-level information, sps_eip_enabled_flag, which indicates whether the current sequence allows prediction using the interpolation filter prediction mode. Next, the decoder determines whether the position of the current block in the current image meets the preset position requirement and whether the size of the current block meets the preset block size requirement. If the position of the current block in the current image meets the preset position requirement and the size of the current block meets the preset block size requirement, the decoder decodes the third information, intra_eip_flag, which indicates whether the current block is predicted using the interpolation filter prediction mode. If the third information, intra_eip_flag = 1, indicates that the current block is predicted using the interpolation filter prediction mode, the decoder then obtains the first information, eip_ref_type, and the second information, eip_filter_type. The first information, eip_ref_type, indicates the type of the reference region for the current block. Based on the value of the first information, eip_ref_type, the decoder can obtain the reference region for the current block by looking up the table. The second information eip_filter_type indicates the shape of the interpolation filter of the current block, and based on the value of the second information eip_filter_type, the interpolation filter of the current block is obtained by looking up the table.

[0241] In some embodiments, when the embodiment of the present application includes the seven interpolation filters shown in FIG16 , the correspondence between the truncated binary code, the eip_filter_type value, and the shape of the interpolation filter is shown in Table 9:

[0242] Table 9

[0243] At this time, the 7 interpolation filter shapes shown in Table 9 and the 3 reconstruction region types shown in Table 5 provide a total of 21 combinations of interpolation filters and reconstruction regions.

[0244] Similarly, the decoding end can obtain the reference area and interpolation filter of the current block by decoding the syntax shown in Table 8 and looking up Table 5 and the above Table 8.

[0245] In some embodiments, when the embodiment of the present application includes the three interpolation filters shown in FIG17 , the correspondence between the truncated binary code, the eip_filter_type value, and the shape of the interpolation filter is shown in Table 10:

[0246] Table 10

[0247] At this time, the three interpolation filter shapes shown in Table 10 and the three reconstruction region types shown in Table 5 provide a total of nine combinations of interpolation filters and reconstruction regions.

[0248] Similarly, the decoding end can obtain the reference area and interpolation filter of the current block by decoding the syntax shown in Table 8 and looking up Table 5 and the above Table 10.

[0249] In some embodiments, when the embodiment of the present application includes the three interpolation filters shown in FIG18A , the correspondence between the truncated binary code, the eip_filter_type value, and the shape of the interpolation filter is shown in Table 11:

[0250] Table 11

[0251] At this time, the three interpolation filter shapes shown in Table 11 and the three reconstruction region types shown in Table 5 provide a total of nine combinations of interpolation filters and reconstruction regions.

[0252] Similarly, the decoding end can obtain the reference area and interpolation filter of the current block by decoding the syntax shown in Table 8 and looking up Table 5 and the above Table 11.

[0253] In some embodiments, when the embodiment of the present application includes three interpolation filters as shown in FIG18B , the correspondence between the truncated binary code, the eip_filter_type value, and the shape of the interpolation filter is shown in Table 12:

[0254] Table 12

[0255] At this time, the three interpolation filter shapes shown in Table 12 and the three reconstruction region types shown in Table 5 provide a total of nine combinations of interpolation filters and reconstruction regions.

[0256] Similarly, the decoding end can obtain the reference area and interpolation filter of the current block by decoding the syntax shown in Table 8 and looking up Table 5 and the above Table 11.

[0257] Generally, using a filter with more taps for the same number of samples can achieve better interpolation effects. Compared to the 2x6 and 6x2 interpolation filters shown in Figure 18A, Figure 18B increases the number of taps in the filter, for example, expanding it to 2x8 and 8x2 interpolation filters. In fact, the 2x8 and 8x2 filters and the 4x4 filter all use 15 samples as input and 1 output, and their complexity is similar. Therefore, the interpolation filter shown in Figure 18B improves the interpolation effect without increasing complexity.

[0258] In some embodiments, when the embodiment of the present application includes the three interpolation filters shown in FIG19 , the correspondence between the truncated binary code, the eip_filter_type value, and the shape of the interpolation filter is shown in Table 13:

[0259] Table 13

[0260] At this time, the three interpolation filter shapes shown in Table 13 and the three reconstruction region types shown in Table 5 provide a total of nine combinations of interpolation filters and reconstruction regions.

[0261] Similarly, the decoding end can obtain the reference area and interpolation filter of the current block by decoding the syntax shown in Table 8 and looking up Table 5 and the above Table 13.

[0262] In addition to using the above-mentioned method 1 or method 2 to determine the interpolation filter of the current block, the decoding end may also use the following method 3 to determine the interpolation filter of the current block.

[0263] Mode 3: Based on the shape of the current block, an interpolation filter for the current block is determined from among Q preset interpolation filters.

[0264] In this method 3, different interpolation filters are used to perform prediction on current blocks of different shapes to improve the accuracy of prediction.

[0265] For example, if the shape of the current block is a square, an interpolation filter of the first shape is used.

[0266] For another example, if the shape of the current block is a rectangle with a width greater than a height, the interpolation filter of the second shape is used.

[0267] For another example, if the shape of the current block is a rectangle with a width smaller than a height, the interpolation filter of the third shape is used.

[0268] That is, in the embodiment of the present application, the correspondence between the Q interpolation filters and the shape of the current block is preset. In this way, the decoding end can determine the interpolation filter for the current block from the Q interpolation filters based on the shape of the current block and the correspondence between the Q interpolation filters and the shape of the current block.

[0269] In an embodiment of the present application, after the decoding end determines the reference area and the interpolation filter of the current block based on the above steps, it determines the prediction block of the current block based on the reference area and the interpolation filter.

[0270] The following describes how the decoding end determines the prediction block of the current block based on the reference area and interpolation filter of the current block.

[0271] In an embodiment of the present application, after the decoding end determines the reference area and interpolation filter of the current block, the interpolation filter is used to filter on the reference area to determine the filter coefficient of the interpolation filter, and then based on the determined filter coefficient, the current block is interpolated and filtered to obtain a predicted block of the current block.

[0272] The embodiment of the present application does not limit the specific manner in which the decoding end determines the prediction block of the current block based on the reference area and the interpolation filter of the current block.

[0273] In some embodiments, determining the prediction block of the current block based on the reference area and the interpolation filter of the current block in S101 includes the following steps:

[0274] S101-A1, determining a filter coefficient of an interpolation filter based on a reference area;

[0275] S101-A2: Based on the filter coefficient, use an interpolation filter to perform interpolation filtering prediction on the current block to obtain a predicted block of the current block.

[0276] The above-mentioned S101-A1 may determine the filter coefficients of the interpolation filter in at least the following ways:

[0277] Method 1: Use the interpolation filter determined above to slide over the reference area of ​​the current block to construct the Wienerhof equation. Then, solve the Wienerhof equation to obtain the filter coefficients of the interpolation filter.

[0278] In the process of sliding the interpolation filter in the reference area of ​​the current block, the N positions corresponding to each position in the reference area are determined based on the shape of the interpolation filter. For example, for position r in the reference area, based on the shape of the interpolation filter, the N positions corresponding to position r are determined in the reference area. The pixel reconstruction values ​​of these N positions are the input of the interpolation filter. The phase position difference between these N positions and position r is {p0, p1, ..., p N-1}, p N is a two-dimensional representation. In which {c0,c1,…,c N-1} is {p0,p1,…,p N-1}Interpolation filter coefficients at the position.

[0279] In one example, the interpolation filter is slid in the reference area of ​​the current block to construct the Wienerhof equation, as shown in formula (3):

[0280] in, is the reference area of ​​the current block, t[r+p n ] is r+p in the reference area nThe pixel reconstructed value of the pixel at position r in the reference area is t[r].

[0281] Since the reference area of ​​the current block is the reconstruction area, the above formula (3) contains the following: Except for , all other parameters are known, so the filter coefficients of the interpolation filter of the current block can be determined by solving the above formula (3).

[0282] In one example, the decoding end may solve the Wienerhof equation shown in the above formula (3) by Cholesky decomposition of the autocorrelation coefficient matrix to obtain the filter coefficients of the filter.

[0283] After the decoding end determines the filter coefficient of the interpolation filter based on the above formula (3), it uses the interpolation filter to perform interpolation filtering prediction on the current block based on the filter coefficient to obtain the prediction block of the current block

[0284] For example, the decoding end obtains the prediction block of the current block based on the following formula (4):

[0285] Among them, p n is the relative position difference between the nth position and position ri in the N positions corresponding to position ri in the current block, c n is the nth filter coefficient among the filter coefficients. n ] is the position ri+p n The pixel value at position ri+p n In the current block, t[ri+p n ] is the position ri+p n The predicted value of the pixel at position ri+p n In the reconstruction area around the current block, t[ri+p n ] is the position ri+p n The reconstructed value of the pixel at pred ri is the predicted value of the pixel at position ri in the current block. Based on formula (4), the decoder can determine the predicted value of each point in the current block and obtain the predicted block of the current block.

[0286] Method 2: The above S101-A1 includes the following steps S101-A11 to S101-A14:

[0287] S101-A11, determining a first reconstruction area around the current block;

[0288] S101-A12, determining a pixel average reconstruction value based on the reconstruction value of the first reconstruction area;

[0289] S101-A13, based on the pixel average reconstruction value, removing the mean of the reconstructed values ​​of the pixels in the reference area;

[0290] S101-A14: Using the pixel values ​​of the pixels in the reference area after averaging as inputs of the interpolation filter, sliding the interpolation filter in the reference area to obtain filter coefficients of the interpolation filter.

[0291] In this second approach, the reference region is de-averaged, and the interpolation filter coefficients are determined based on the de-averaged reference region. Since the amount of data in the de-averaged reference region is reduced, determining the filter coefficients based on the de-averaged reference region can improve efficiency.

[0292] Specifically, the decoding end first determines a first reconstruction area, and the first reconstruction area can be any part of the reconstruction area around the current block.

[0293] In the embodiment of the present application, the decoding end determines the first reconstruction area around the current block in at least the following ways:

[0294] In mode 1, the decoding end determines a reconstruction area around the current block as the first reconstruction area by default.

[0295] For example, as shown in FIG20 , the decoding end defaults to determining an area consisting of a row above, a column to the left, and a pixel point in the upper left corner of the current block as the first reconstruction area.

[0296] Method 2: Determine the first reconstruction area based on the shape of the current block.

[0297] For example, if the shape of the current block is a square, the reconstructed pixel area in one row above and one column on the left of the current block is determined as the first reconstructed area.

[0298] For another example, if the shape of the current block is a rectangle with a width greater than a height, a row of reconstructed pixel areas above the current block is determined as the first reconstructed area.

[0299] For another example, if the shape of the current block is a rectangle with a height greater than a width, a left column of reconstructed pixel areas of the current block is determined as the first reconstructed area.

[0300] It should be noted that, based on the shape of the current block, the manner of determining the first reconstruction area includes but is not limited to the above examples.

[0301] After determining the first reconstruction area, the decoding end determines the pixel average reconstruction value m based on the reconstruction value of the first reconstruction area.

[0302] In one implementation, the average value of the reconstruction values ​​of the first reconstruction area is determined as the pixel average reconstruction value m.

[0303] In an example, if the first reconstruction area is as shown in FIG20 , the pixel average reconstruction value m can be calculated using the method shown in Table 14:

[0304] Table 14

[0305] In one example, if the first reconstruction area is a row above and / or a column to the left of the current block, the average of the reconstruction values ​​in the row above and / or the column to the left can be determined as the pixel average reconstruction value m. In this case, the pixel average reconstruction value m can be calculated using the method shown in Table 15:

[0306] Table 15

[0307] As shown in Table 15 above, if the first reconstruction area is a row above and / or a column to the left of the current block, shift calculation can be used instead of division to quickly calculate the pixel average reconstruction value m.

[0308] In addition to determining the average value of the reconstruction values ​​of the first reconstruction area as the pixel average reconstruction value m, the decoding end may also determine the pixel average reconstruction value m in the following manner.

[0309] In another manner, a weighted average of the reconstruction values ​​of the first reconstruction area is determined as the pixel average reconstruction value m.

[0310] The decoding end may also use other methods to determine the pixel average reconstruction value m.

[0311] After the decoding end determines the pixel average reconstruction value, it removes the average of the reconstructed values ​​of the pixels in the reference area based on the pixel average reconstruction value.

[0312] For example, for each pixel in the reference area, the reconstructed value of the pixel is divided by the pixel average reconstructed value and then rounded to the integer to obtain the pixel value of the pixel in the reference area after removing the average value.

[0313] For another example, the decoding end subtracts the pixel average reconstructed value from the reconstructed value of the pixel in the reference area to obtain the pixel value of the pixel in the reference area after the average is removed. For example, for each pixel in the reference area, the pixel average reconstructed value is subtracted from the reconstructed value of the pixel to obtain the pixel value of the pixel in the reference area after the average is removed.

[0314] The embodiment of the present application does not limit the specific manner in which the decoding end performs de-averaging on the reconstructed values ​​of the pixels in the reference area based on the pixel average reconstruction value.

[0315] Based on the above method, the decoding end de-averages the reconstructed values ​​of the pixel points in the reference area, obtains the pixel values ​​of the de-averaged pixel points in the reference area, and then executes the above steps S101-A14, uses the pixel values ​​of the de-averaged pixel points in the reference area as the input of the interpolation filter, slides the interpolation filter in the reference area, and obtains the filter coefficients of the interpolation filter.

[0316] For example, as shown in FIG21, if the interpolation filter of the current block is an interpolation filter of five different shapes and the reference area of ​​the current block is a reference area of ​​three different types, the interpolation filter of the current block is slid on the reference area after the current block is averaged to obtain the filter coefficient of the interpolation filter. The interpolation filter can slide horizontally row by row or vertically column by column on the reference area after the current block is averaged. The block to be predicted in FIG21 is the current block.

[0317] As shown in Figure 21, when using the interpolation filter to slide in the reference area of ​​the current block, first, according to the shape of the interpolation filter, the N positions corresponding to each position in the reference area are determined. For example, for position r in the reference area, based on the shape of the interpolation filter, the N positions corresponding to position r are determined in the reference area, and the pixel reconstruction values ​​of these N positions are the input of the interpolation filter. The phase position difference between these N positions and position r is {p0, p1, ..., p N-1}, p N is a two-dimensional representation. In which {c0,c1,…,c N-1} is {p0,p1,…,p N-1}Interpolation filter coefficients at the position.

[0318] In one example, the interpolation filter is slid in the reference area of ​​the current block, and the constructed Wienerhof equation is shown in formula (5):

[0319] in, is the reference area of ​​the current block, t[r+p n ]-m is r+p in the reference area n The pixel reconstructed value after removing the mean of the pixel point at position r in the reference area is t[r]-m, and the pixel reconstructed value after removing the mean of the pixel point at position r in the reference area is t[r]-m.

[0320] Since the reference area of ​​the current block is the reconstruction area, the above formula (5) contains the following: Except for , all other parameters are known, so the filter coefficients of the interpolation filter of the current block can be determined by solving the above formula (5).

[0321] In one example, the decoding end may solve the Wienerhof equation shown in the above formula (5) by Cholesky decomposition of the autocorrelation coefficient matrix to obtain the filter coefficients of the filter.

[0322] After the decoding end determines the filter coefficients of the interpolation filter based on the above formula (5), it executes the above steps S101-A2, and uses the interpolation filter to perform interpolation filtering prediction on the current block based on the filter coefficients to obtain a predicted block of the current block.

[0323] The filter coefficient is determined by the reference area after de-averaging in the above formula (5). Therefore, when determining the prediction value of the current block based on the filter coefficient, the influence of the pixel average reconstruction value m needs to be considered.

[0324] In one possible implementation, the interpolation filter coefficient determined by the above formula (5) is substituted into the above formula (4) to obtain the predicted value of each point in the current block. Then, the predicted value of each point is added to the pixel average reconstruction value m to obtain the final predicted value of each point in the current block, thereby obtaining the predicted block of the current block.

[0325] In another possible implementation, the above S101-A2 includes the following steps:

[0326] S101-A21, for the r-th point in the current point, determine the pixel values ​​of N positions corresponding to the r-th point based on the shape of the interpolation filter, where r is a positive integer;

[0327] S101-A22, removing the mean of pixel values ​​at N positions based on the pixel average reconstruction value to obtain the pixel values ​​after removing the mean of the N positions;

[0328] S101-A23, based on the pixel values ​​and filter coefficients after removing the mean at N positions, obtain the predicted value of the r-th point;

[0329] S101-A24. Obtain a predicted block of the current block based on the predicted value of the midpoint of the current block.

[0330] As shown in Figure 22, assuming that the shape of the interpolation filter of the current block is 4X4, the decoder uses an interpolation filter with known filter coefficients to perform interpolation prediction on each position in the current block. Specifically, for the rth point in the current block, the pixel values ​​of the N positions corresponding to the rth point are first determined based on the shape of the interpolation filter of the current block. For example, as shown in Figure 22, in the 4X4 interpolation filter, the dark position is the position of the rth point to be processed, and the 15 light positions are the N positions corresponding to the rth point. The block to be predicted in Figure 22 is the current block.

[0331] Next, the pixel values ​​of the N positions corresponding to the rth point are determined. For example, for any of the N positions, if the position is located in the reconstructed area surrounding the current block, the reconstructed value of the position is determined as the pixel value of the position. If the position is located within the current block, the predicted value of the position is determined as the pixel value of the position.

[0332] Since the filter coefficients are determined based on the reference area after averaging, the decoding end averages the pixel values ​​at the N positions of the r-th point based on the pixel average reconstruction value to obtain the averaged pixel value at the N positions of the r-th point. For example, the averaged pixel reconstruction value is subtracted from the pixel values ​​at the N positions of the r-th point to obtain the averaged pixel value at the N positions of the r-th point.

[0333] Next, the predicted value of the rth point is obtained based on the pixel values ​​and filter coefficients after removing the mean of N positions.

[0334] The embodiment of the present application does not limit the specific method of obtaining the predicted value of the rth point based on the pixel values ​​and filter coefficients after removing the mean of N positions.

[0335] In one implementation, the decoder takes the pixel values ​​and filter coefficients of the N positions of the r-th point after removing the mean, and puts them into the above formula (4). At this time, t[ri+p n ] is the position ri+p n The pixel value after removing the mean value of the pixel at . After determining a predicted value of the r-th point based on the above formula (4), add the pixel average reconstruction value m to the predicted value to obtain the final predicted value of the r-th point.

[0336] In another implementation, the above S101-A23 includes the following steps:

[0337] S101-A231, determining a second reconstruction area around the current block, and determining a maximum reconstruction value and a minimum reconstruction value of the second reconstruction area;

[0338] S101-A232, obtaining a first prediction value based on the pixel values ​​after de-averaging at N positions, the filter coefficients, and the pixel average reconstruction value;

[0339] S101-A233. Determine the predicted value of the rth point based on the first predicted value, the maximum reconstructed value, and the minimum reconstructed value.

[0340] In this implementation, the decoding end limits the prediction value of the current block to a range. Specifically, a second reconstruction area is determined, and the maximum reconstruction value (max) and the minimum reconstruction value (min) of the pixels in the second reconstruction area are determined.

[0341] The embodiment of the present application does not limit the specific method of determining the second reconstruction area around the current block.

[0342] In an example, the second reconstructed region of the current block is consistent with the reference region of the current block.

[0343] In an example, the second reconstructed area of ​​the current block is consistent with the first reconstructed area of ​​the current block.

[0344] In one example, the reconstruction areas above, to the left, to the upper right, to the upper left, and to the lower left of the current block are determined as the second reconstruction area. For example, the reconstruction areas 13 rows above, 13 columns to the left, 13 rows to the upper right, 13 rows and 13 columns to the upper left, and 13 columns to the lower left of the current block are determined as the second reconstruction area.

[0345] It should be noted that there is no order of precedence between the above S101-A231 and the above S101-A232 in the specific implementation process. For example, the above S101-A231 can be executed before the above S101-A232, or after the above S101-A232, or synchronously with the above S101-A232.

[0346] The embodiment of the present application does not limit the specific method for obtaining the first prediction value at the decoding end based on the pixel values ​​after de-averaging at N positions, the filter coefficients and the pixel average reconstruction value.

[0347] For example, the pixel values ​​of the N positions of the r-th point after deaveraging are multiplied by the filter coefficient to obtain the second predicted value of the r-th point; the second predicted value and the pixel average reconstruction value are added to obtain the first predicted value of the r-th point.

[0348] For example, the decoding end obtains the first predicted value of the r-th point based on the following formula (6):

[0349] in, is the position r+p n The pixel value after removing the mean value of the pixel point at pred r is the first predicted value of the r-th point, is the second predicted value of the r-th point.

[0350] For another example, after the decoding end obtains a prediction value of the r-th point based on the above formula (6), the prediction value is processed to obtain a first prediction value of the r-th point.

[0351] After determining the first prediction value of the r-th point in the current block based on the above steps, the decoding end determines the prediction value of the r-th point based on the first prediction value, the maximum reconstructed value, and the minimum reconstructed value.

[0352] For example, if the first predicted value is greater than the minimum reconstruction value and less than the maximum reconstruction value, the first predicted value is determined as the predicted value of the rth point.

[0353] For another example, if the first predicted value is less than or equal to the minimum reconstruction value, the minimum reconstruction value is determined as the predicted value of the rth point.

[0354] For another example, if the first predicted value is greater than or equal to the maximum reconstructed value, the maximum reconstructed value is determined as the predicted value of the rth point.

[0355] In one example, the decoding end determines the predicted value of the rth point by the following formula (7):

[0356] Where Clip represents the first predicted value of the rth point The maximum reconstruction value is limited to between max and min.

[0357] Taking the determination of the prediction value of the rth point in the current block as an example, the decoding end can refer to the above method to determine the prediction value of each point in the current block, and then the prediction value of each point in the current block constitutes the prediction block of the current block.

[0358] Based on the above steps, the decoding end performs interpolation filtering prediction on the current block, obtains the predicted block of the current block, and then performs the following steps.

[0359] S102 : Determine an intra-frame prediction mode corresponding to the prediction block, and determine a transform kernel corresponding to the current block based on the intra-frame prediction mode corresponding to the prediction block.

[0360] As can be seen from the above, when decoding the current block, the decoder decodes the bitstream to obtain the quantization coefficients of the current block. Then, it dequantizes the quantization coefficients to obtain the transform coefficients of the current block. The transform coefficients of the current block are then inversely transformed to obtain the residual block (or residual value) of the current block. At the same time, the prediction mode of the current block is determined, and the current block is predicted using this prediction mode to obtain the predicted block of the current block. The predicted block and the residual block are added together to obtain the reconstructed block of the current block.

[0361] When performing an inverse transformation on the transform coefficients of the current block, it is necessary to determine the transform kernel, and based on the transform kernel, perform an inverse transformation on the transform coefficients of the current block to obtain the residual value of the current block. Currently, the decoding end predicts the current block by adopting the traditional intra-frame prediction mode. The decoding end can determine the transform kernel used for the current block based on the correspondence between the transform kernels in the traditional intra-frame prediction mode. However, in an embodiment of the present application, when predicting the current block, an interpolation filter prediction mode is used instead of the traditional intra-frame prediction mode. Therefore, it is impossible to directly determine the transform kernel corresponding to the current block based on the interpolation filter prediction mode.

[0362] In order to solve this technical problem, in an embodiment of the present application, after determining the prediction block of the current block using the interpolation filtering prediction mode, the traditional intra-frame prediction mode corresponding to the prediction block is determined, and then based on the traditional intra-frame prediction mode, the transformation kernel corresponding to the current block is determined.

[0363] The following describes the specific process of determining the intra-frame prediction mode corresponding to the prediction block at the decoding end.

[0364] In one example, as shown in FIG7 , the conventional intra prediction modes currently included in VVC are:

[0365] PLANAR mode: intra prediction mode index is 0,

[0366] DC mode: intra prediction mode index is 1,

[0367] Angle mode: The intra prediction mode index is 2 to 66.

[0368] In one example, as shown in Figure 23, the arrows in the figure point to the directions predicted by the angle modes in VVC, and the prediction mode indexes used during decoding are 2 to 66. When the current block is a non-square block, some angle directions will be replaced with wide angles, such as -1 to -14 and 67 to 80 in Figure 23.

[0369] In some embodiments, the intra-frame prediction mode corresponding to the above-mentioned prediction block is a default intra-frame prediction mode. That is, if the current block is predicted using the interpolation filtering prediction mode, when the prediction block is obtained, one of the traditional intra-frame prediction modes is determined as the default intra-frame prediction mode corresponding to the prediction block.

[0370] In some embodiments, the decoding end determines the intra prediction mode corresponding to the prediction block through the following steps:

[0371] S102-A1, determining angle values ​​of M points in the prediction block, where M is a positive integer;

[0372] S102-A2: Determine the intra-frame prediction mode corresponding to the prediction block based on the angle values ​​of the M points.

[0373] In the embodiment of the present application, the intra-frame prediction mode corresponding to the prediction block is determined by counting the intra-frame prediction modes corresponding to the angle values ​​of M points in the prediction block.

[0374] The embodiment of the present application does not limit the specific position and number of the M points in the prediction block used to determine the angle value. For example, the M points can be one point in the prediction block, or multiple points in the prediction block.

[0375] For example, if the above-mentioned M points are one point, the decoding end determines the angle value of a point in the prediction block (for example, the center point of the prediction block), and based on the angle value of the point, determines the intra-frame prediction mode corresponding to the point, and then determines the intra-frame prediction mode as the intra-frame prediction mode corresponding to the prediction block.

[0376] For another example, if the above-mentioned M points are multiple points, the decoding end determines the angle values ​​of these multiple points, and based on the angle values ​​of these multiple points, determines the intra-frame prediction mode corresponding to each of these multiple points, and then determines the intra-frame prediction mode with the largest number of identical intra-frame prediction modes among these multiple points as the intra-frame prediction mode corresponding to the prediction block.

[0377] In some embodiments, when determining the angle values ​​of M points in a prediction block using a sliding window approach, the selection of these M points is related to the shape and size of the sliding window. For example, each of the M points is the center point of the sliding window as it slides across the prediction block.

[0378] In the embodiment of the present application, the method for determining the angle value of each of the M points is the same. For the convenience of description, the method of determining the angle value of the i-th point among the M points is used as an example for explanation.

[0379] The embodiment of the present application does not limit the specific method of determining the angle value of the point.

[0380] In some embodiments, the above S102-A1 includes steps S102-A11 and S102-A12:

[0381] S102-A11, for the i-th point among the M points, determine the horizontal gradient and vertical gradient of the i-th point, where i is a positive integer less than or equal to M;

[0382] S102-A12: Determine the angle value of the i-th point based on the horizontal gradient and the vertical gradient of the i-th point.

[0383] In this embodiment, the decoding end first determines the horizontal gradient and vertical gradient of each of the M points, such as the i-th point, and then determines the angle value of the i-th point based on the horizontal gradient and the vertical gradient.

[0384] The embodiment of the present application does not limit the specific method of determining the horizontal gradient and vertical gradient of the i-th point.

[0385] In one example, the horizontal gradient value of the i-th point is determined based on the predicted values ​​of the points around the i-th point in the prediction block and the change in the predicted value of the i-th point in the horizontal direction, and the vertical gradient value of the i-th point is determined based on the predicted values ​​of the points around the i-th point in the prediction block and the change in the predicted value of the i-th point in the vertical direction.

[0386] In another example, the decoding end determines the prediction value of the point in the sliding window centered on the i-th point in the prediction block; based on the prediction value of the point in the sliding window and the horizontal gradient operator, as well as the vertical gradient operator, the horizontal gradient and vertical gradient of the i-th point are obtained.

[0387] In this example, a sliding window is first determined. For example, as shown in Figure 24, a 3×3 sliding window is determined. This sliding window is then slid across the prediction block. With each slide, the horizontal and vertical gradients at the center point of the sliding window are determined. For example, taking the center point of the current sliding window as the i-th point, the predicted values ​​for each point within the current sliding window are first obtained. For example, predicted values ​​for 3×3 = 9 points can be obtained. Next, based on the predicted values ​​for these 9 points and the preset horizontal and vertical gradient operators, the horizontal and vertical gradients at the i-th point are determined.

[0388] For example, the product of the predicted value of the point in the sliding window and the horizontal gradient operator is determined as the horizontal gradient G of the i-th point x ; The product of the predicted value of the point in the sliding window and the vertical gradient operator is determined as the vertical gradient of the i-th point.

[0389] For another example, the predicted value of the point in the sliding window is multiplied by the horizontal gradient operator and then the preset operation is performed with the preset value to obtain the horizontal gradient G of the i-th point. x ; Multiply the predicted value of the point in the sliding window by the vertical gradient operator and then perform a preset operation with the preset value to obtain the vertical gradient of the i-th point.

[0390] The embodiment of the present application does not limit the specific values ​​of the horizontal gradient operator and the vertical gradient operator.

[0391] For example, the horizontal gradient operator M x and the vertical gradient operator M y for:

[0392] After the decoding end determines the horizontal gradient and vertical gradient of the i-th point based on the above steps, it can determine the angle value of the i-th point according to the horizontal gradient and vertical gradient of the i-th point.

[0393] For example, the inverse tangent value of the ratio of the vertical gradient to the horizontal gradient at the i-th point is determined as the angle value of the i-th point. For example, as shown in formula (8):

[0394] Among them, G x is the horizontal gradient of the i-th point, G y is the vertical gradient of the i-th point, O is the angle value of the i-th point, and atan() is the inverse tangent function.

[0395] In addition to using the above formula (8) to determine the angle value of the i-th point, the decoding end may also use other methods to determine the angle value of the i-th point. For example, the decoding end adjusts the angle value determined by the above formula (8) to obtain the angle value of the i-th point.

[0396] The decoding end uses the above method for each of the M points to determine the angle value of each of the M points, and then executes the above S102-A2 to determine the intra-frame prediction mode corresponding to the prediction block based on the angle values ​​of the M points.

[0397] The embodiment of the present application does not limit the specific method of determining the intra-frame prediction mode corresponding to the prediction block based on the angle values ​​of M points.

[0398] In some embodiments, the decoding end selects the angle value 1 that is the same the most times from the angle values ​​of M points, matches the angle value 1 with the prediction angle of the traditional intra-frame prediction mode, obtains the intra-frame prediction mode corresponding to the angle value 1, and determines the intra-frame prediction mode corresponding to the angle value 1 as the intra-frame prediction mode corresponding to the prediction block.

[0399] In some embodiments, the above S102-A2 includes the following steps S102-A21 and S102-A22:

[0400] S102-A21, determining the intra-frame prediction mode corresponding to the M points based on the angle values ​​of the M points;

[0401] S102-A22: Determine the intra-frame prediction mode corresponding to the prediction block based on the intra-frame prediction modes corresponding to the M points.

[0402] In this implementation, the decoder determines the intra-frame prediction mode corresponding to each of the M points based on the angle value of each point. For example, for each of the M points, the angle value of that point is matched with the prediction angle of the traditional intra-frame prediction mode to obtain the intra-frame prediction mode corresponding to that angle value. In this way, the intra-frame prediction mode corresponding to each of the M points can be obtained.

[0403] Next, based on the intra-frame prediction mode corresponding to each of the M points, the intra-frame prediction mode corresponding to the prediction block is determined.

[0404] In a possible implementation, the intra-frame prediction mode with the greatest number of repetitions among the intra-frame prediction modes corresponding to the M points is determined as the intra-frame prediction mode corresponding to the prediction block.

[0405] In another possible implementation, the above S102-A22 includes the following steps:

[0406] S102-A221, determining gradient amplitude values ​​corresponding to the M points based on the horizontal gradients and vertical gradients of the M points;

[0407] S102-A222: Determine the intra-frame prediction mode corresponding to the prediction block based on the intra-frame prediction modes and gradient magnitude values ​​corresponding to the M points.

[0408] In this implementation, the decoding end determines the gradient amplitude value corresponding to each of the M points based on the horizontal gradient and vertical gradient of each of the M points determined above.

[0409] In the embodiment of the present application, the specific method for the decoding end to determine the gradient amplitude value corresponding to each of the M points is the same. For ease of description, take determining the gradient amplitude value corresponding to the i-th point among the M points as an example.

[0410] The embodiment of the present application does not limit the specific manner in which the decoding end determines the gradient amplitude value corresponding to the i-th point based on the horizontal gradient and vertical gradient of the i-th point.

[0411] For example, the decoding end multiplies the horizontal gradient and the vertical gradient of the i-th point to obtain the gradient amplitude value corresponding to the i-th point.

[0412] For another example, the decoding end adds the absolute value of the horizontal gradient and the absolute value of the vertical gradient of the i-th point to obtain the gradient amplitude value corresponding to the i-th point.

[0413] Exemplarily, the decoding end determines the gradient amplitude value corresponding to the i-th point based on the following formula (9): G = |G x |+|G y | (9)

[0414] Among them, G is the gradient amplitude value corresponding to the i-th point, G x is the horizontal gradient of the i-th point, G y is the vertical gradient of the i-th point.

[0415] The decoder can determine the gradient magnitude value corresponding to each of the M points based on the above steps. Next, the decoder performs the above steps S102-A222 to determine the intra-frame prediction mode corresponding to the prediction block based on the intra-frame prediction modes and gradient magnitude values ​​corresponding to the M points.

[0416] In one example, the intra-frame prediction mode corresponding to the point with the largest gradient magnitude value among the M points is determined as the intra-frame prediction mode corresponding to the prediction block.

[0417] In another example, for any point among the M points, the gradient amplitude value corresponding to the point is accumulated on the intra-frame prediction mode corresponding to the point to obtain the accumulated gradient amplitude values ​​of the intra-frame prediction modes corresponding to the M points; and the intra-frame prediction mode with the largest accumulated gradient amplitude value among the intra-frame prediction modes corresponding to the M points is determined as the intra-frame prediction mode corresponding to the prediction block.

[0418] For example, as shown in FIG25, the gradient amplitude value corresponding to each of the M points is accumulated on the corresponding intra-frame prediction mode. For example, the intra-frame prediction modes corresponding to point 1 and point 2 of the M points are both intra-frame prediction mode 1, so the gradient amplitude values ​​corresponding to point 1 and point 2 are accumulated to the gradient amplitude value corresponding to intra-frame prediction mode 1. Similarly, the gradient amplitude value histogram shown in FIG25 can be obtained. In this way, the intra-frame prediction mode with the largest cumulative gradient amplitude value in the gradient amplitude value histogram can be determined as the intra-frame prediction mode corresponding to the prediction block. For example, the intra-frame prediction mode corresponding to the dark cumulative gradient amplitude value in FIG25 is determined as the intra-frame prediction mode corresponding to the prediction block.

[0419] In some embodiments, if the gradient magnitude values ​​corresponding to the M points are all 0, the first intra-frame prediction mode is determined as the intra-frame prediction mode corresponding to the prediction block. In other words, if the gradient magnitude values ​​corresponding to all of the M points are 0, it means that the horizontal gradient and vertical gradient of each of the M points are both 0. In this case, the preset first intra-frame prediction mode can be determined as the intra-frame prediction mode corresponding to the prediction block.

[0420] The embodiment of the present application does not limit the type of the first intra-frame prediction mode.

[0421] Exemplarily, the first intra-frame prediction mode is the PLANAR mode.

[0422] After the decoding end determines the intra prediction mode corresponding to the prediction block based on the above steps, it determines the transform kernel corresponding to the current block based on the intra prediction mode corresponding to the prediction block.

[0423] The embodiment of the present application does not limit the specific manner in which the decoding end determines the transform kernel corresponding to the current block based on the intra-frame prediction mode corresponding to the prediction block.

[0424] In some embodiments, the decoding end searches for an image block whose intra-frame prediction mode is the same as the intra-frame prediction mode corresponding to the prediction block in the decoded image blocks around the prediction block based on the intra-frame prediction mode corresponding to the prediction block, and then determines the transform kernel corresponding to the image block as the transform kernel corresponding to the current block.

[0425] In some embodiments, determining the transform kernel corresponding to the current block based on the intra prediction mode corresponding to the prediction block in S102 includes the following steps:

[0426] S102-B1, obtaining a correspondence between an intra prediction mode and a transform core group, wherein one transform core group includes at least one type of transform core;

[0427] S102-B2, searching for a first transform kernel group corresponding to the intra prediction mode of the prediction block in the corresponding relationship;

[0428] S102-B3: Determine a transform core corresponding to the current block from the first transform core group.

[0429] In the embodiment of the present application, there is a correspondence between the intra prediction mode and the transform core group. Based on this, after determining the intra prediction mode corresponding to the prediction block, the decoder obtains the preset correspondence between the intra prediction mode and the transform core group.

[0430] In one example, the correspondence between the intra prediction modes and the transform kernel groups is shown in Table 16:

[0431] Table 16

[0432] It should be noted that the above Table 16 is only a correspondence between an intra-frame prediction mode and a transform core group involved in an embodiment of the present application. The correspondence between the intra-frame prediction mode and the transform core group in the embodiment of the present application includes but is not limited to that shown in Table 15.

[0433] Each transformation core group includes at least one type of transformation core.

[0434] After obtaining the correspondence between intra-frame prediction modes and transform kernel groups shown in Table 16, the decoder searches the correspondence between intra-frame prediction modes and transform kernel groups based on the intra-frame prediction mode corresponding to the prediction block, and records this transform kernel group as the first transform kernel group. For example, if the intra-frame prediction mode corresponding to the prediction block is an angular prediction mode in the 64-angle direction, searching Table 16 shows that the transform kernel group corresponding to this angular prediction mode in the 64-angle direction is 4. In this way, the decoder determines the transform kernel corresponding to the current block from the at least one type of transform kernel included in transform kernel group 4.

[0435] For example, if the first transform core group includes one transform core, the transform core is determined as the transform core corresponding to the current block.

[0436] For another example, if the first transform core group includes transform cores of multiple categories, the decoder determines the transform core category corresponding to the current block, and then determines the transform core of the transform core category in the first transform core group as the transform core corresponding to the current block.

[0437] The methods for the decoder to determine the transform kernel type corresponding to the current block include but are not limited to the following:

[0438] In one example, the transform kernel category corresponding to the current block is a default category, so the decoding end determines the default category as the transform kernel category corresponding to the current block.

[0439] In another example, the encoder writes the transform kernel type corresponding to the current block into the bitstream, so that the decoder obtains the transform kernel type corresponding to the current block by decoding the bitstream.

[0440] As can be seen from the above, in an embodiment of the present application, the decoding end uses an interpolation filter prediction mode to determine the prediction block of the current block, and then determines the traditional intra-frame prediction mode corresponding to the prediction block, and based on the traditional intra-frame prediction mode corresponding to the prediction block, determines the transform kernel corresponding to the current block. That is to say, the embodiment of the present application is based on the traditional intra-frame prediction mode derived from the interpolation filter prediction, and is used for the selection of transform kernel groups of the non-separable primary transform (NSPT) and the non-separable secondary transform (LFNST), so that the determined transform kernel is more consistent with the characteristics of the current block, and the accuracy of determining the transform kernel is improved. When the accurately determined transform kernel is used to determine the reconstruction value of the current block, the accuracy of determining the reconstruction value can be improved, and the decoding accuracy of the current block can be improved. In addition, when the embodiment of the present application determines the transform kernel of the current block through the traditional prediction mode corresponding to the prediction block, there is no need to indicate the transform kernel separately, which saves codewords and further improves the video encoding and decoding effect.

[0441] After the decoding end determines the transform kernel corresponding to the current block based on the above steps, it executes the following step S103.

[0442] S103 . Perform inverse transformation on the transform coefficients of the current block based on the transform kernel corresponding to the current block to obtain a residual block of the current block, and obtain a reconstructed block of the current block based on the prediction block and the residual block of the current block.

[0443] In the embodiment of the present application, the decoding end determines the prediction block of the current block and the transform kernel corresponding to the current block based on the above steps. In this way, the decoding end can decode the bitstream to obtain the quantization coefficients of the current block. Then, the quantization coefficients are dequantized to obtain the transform coefficients of the current block. Using the transform kernel corresponding to the current block determined above, the transform coefficients of the current block are detransformed to obtain the residual block (or residual value) of the current block. Finally, the decoding end adds the prediction block and the residual block of the current block to obtain the reconstructed block of the current block.

[0444] In some embodiments, the above-mentioned current block is a bright color block or a chroma block, that is, in the embodiment of the present application, the interpolation filtering prediction mode provided by the embodiment of the present application can be used to predict both the luminance block and the chroma block.

[0445] In some embodiments, if the current block is a luminance block, the prediction mode of the current block is an interpolation filtering prediction mode, and the chrominance block corresponding to the current block adopts a direct derivation mode DM, then the PLANAR mode or the intra-frame prediction mode corresponding to the above prediction block is determined as the prediction mode of the chrominance block.

[0446] In this embodiment, the luminance block (or luminance component) can be predicted using the interpolation filtering prediction mode provided in the embodiment of the present application, while the chrominance block (or chrominance component) can be predicted using other intra-frame prediction modes.

[0447] Specifically, after the decoding end uses the above-mentioned interpolation filter prediction mode to predictively decode the current block (i.e., the luminance block), it begins to predictively decode the chrominance block corresponding to the current block (i.e., the luminance block). When predictively decoding the chrominance block, the prediction mode used by the chrominance block is first determined, for example, by decoding the bitstream to obtain the prediction mode of the chrominance block. In one example, if it is determined that the chrominance block uses the direct derivation (DM) mode, the decoding end derives the intra-frame prediction mode of the chrominance block based on the intra-frame prediction mode of the luminance block.

[0448] In one example, if the current block (i.e., the luminance block) adopts the interpolation filtering prediction mode and the chrominance block adopts the DM mode, the PLANAR mode is determined as the intra-frame prediction mode of the chrominance block, the chrominance block is predicted, and the predicted value of the chrominance block is obtained.

[0449] In another example, if the current block (i.e., the luminance block) adopts the interpolation filtering prediction mode and the chrominance block adopts the DM mode, the intra-frame prediction mode corresponding to the prediction block of the current block determined above is determined as the intra-frame prediction mode of the chrominance block, and the chrominance block is predicted to obtain the prediction value of the chrominance block.

[0450] The video decoding method provided in an embodiment of the present application first determines a reference region and an interpolation filter for the current block when predicting the current block. Based on the reference region and the interpolation filter, a prediction block for the current block is determined. For example, the reference region is filtered using an interpolation filter to calculate the filter coefficients of the filter. The current block is then subjected to interpolation filtering prediction based on the interpolation filter with the determined filter coefficients to obtain the prediction block for the current block. Next, a prediction mode corresponding to the prediction block is determined. Based on the prediction mode, a transform kernel corresponding to the current block is determined. The transform kernel is used to inversely transform the transform coefficients of the current block to obtain a residual block for the current block. A reconstructed value for the current block is obtained based on the residual block and the prediction block. In other words, in an embodiment of the present application, if the current block is predicted using an interpolation filtering prediction method, the transform kernel corresponding to the current block is determined by determining the traditional prediction mode corresponding to the prediction block. This makes the determined transform kernel more consistent with the characteristics of the current block, thereby improving the accuracy of the transform kernel determination. When the reconstructed value of the current block is determined using the accurately determined transform kernel, the accuracy of the reconstructed value determination can be improved, thereby improving the decoding accuracy of the current block. In addition, the embodiment of the present application determines the transformation kernel of the current block by predicting the traditional prediction mode corresponding to the block, without the need to indicate the transformation kernel separately, thus saving codewords and further improving the video encoding and decoding effect.

[0451] 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.

[0452] FIG26 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 FIG23, the method according to the embodiment of the present application includes:

[0453] S201 : Determine a reference area and an interpolation filter of a current block, and determine a prediction block of the current block based on the reference area and the interpolation filter.

[0454] When encoding the current block, the encoder first determines the prediction mode for the current block and uses it to predict the current block, obtaining the predicted block (or predicted value) for the current block. The current block is then subtracted from the predicted block to obtain the residual block (or residual value) for the current block. The residual block is then transformed to obtain transform coefficients, which are then quantized to obtain quantized coefficients. These quantized coefficients are then encoded to produce the bitstream.

[0455] In the embodiment of the present application, the encoding end first determines the prediction mode of the current block.

[0456] In some embodiments, the encoder determines the prediction mode of the current block in at least the following ways:

[0457] In Method 1, the encoder selects the candidate prediction mode with the lowest cost from among multiple candidate prediction modes, including the traditional prediction mode and the interpolation filter prediction mode, as shown in Figures 6 or 7. The encoder then adds information indicating the prediction mode for the current block to the bitstream. The decoder then decodes the bitstream to obtain the information indicating the prediction mode for the current block and, based on this information, determines the prediction mode for the current block.

[0458] In Method 2, the encoder constructs a candidate list of intra-prediction modes and selects the intra-prediction mode for the current block from this list. It should be noted that this list includes the interpolation filter prediction mode. The encoder then writes the sequence number (or index number) of the intra-prediction mode for the current block in the candidate list into the bitstream.

[0459] Method 3: The encoding end constructs a candidate list of intra-frame prediction modes, which includes an interpolation filter prediction mode. Then, the intra-frame prediction mode of the current block is selected from the candidate list of intra-frame prediction modes. For example, the cost of each candidate prediction mode in the candidate list of intra-frame prediction modes on the template of the current block is determined, and then the intra-frame prediction mode of the current block is determined based on the cost. Correspondingly, the decoding end constructs a candidate list of intra-frame prediction modes based on the same method as the encoding end. The constructed candidate list of intra-frame prediction modes also includes an interpolation filter prediction mode. Then, the cost of each candidate prediction mode in the candidate list of intra-frame prediction modes on the template of the current block is determined, and then the intra-frame prediction mode of the current block is determined based on the cost. Finally, the intra-frame prediction mode of the current block is used to predict the current block to obtain the predicted value of the current block.

[0460] It can be seen from the above methods that when determining the prediction mode of the current block, the encoder first determines multiple candidate prediction modes, and then determines the prediction mode of the current block from these multiple candidate prediction modes, where the multiple candidate prediction modes include the interpolation filtering prediction mode.

[0461] A specific method for determining the prediction mode of the current block from the multiple candidate prediction modes may be that the encoder determines any one of the multiple candidate prediction modes as the prediction mode of the current block. In other words, the encoder predicts the current block using the multiple candidate prediction modes, determines a cost corresponding to each candidate prediction mode, which may be RDO or SATD, and then determines the candidate prediction mode with the smallest cost as the prediction mode of the current block.

[0462] The encoder determines the prediction mode of the current block based on the above method. If the prediction mode of the current block is the interpolation filtering prediction mode, the above step S201 is executed.

[0463] In some embodiments, before determining the prediction mode of the current block from multiple candidate prediction modes, the encoding end also needs to determine whether the position of the current block in the current image meets the preset position requirement and whether the size of the current block meets the preset block size requirement.

[0464] The embodiment of the present application does not limit the preset position and prediction block size, which are determined based on actual needs.

[0465] In one example, as shown in FIG11 , assuming that the position of the upper left corner of the current image is (0, 0), and the position of the upper left corner of the current block is (x, y), where the preset position requirements are that the x value of the current block is greater than or equal to a first preset value XX, and the y value of the current block is greater than or equal to a second preset value YY.

[0466] The embodiment of the present application does not limit the specific values ​​of the first preset value and the second preset value.

[0467] Exemplarily, the first preset value and the second preset value are the same.

[0468] Exemplarily, the first preset value and the second preset value are both 13, that is, when the distance from the upper edge line of the current block to the upper edge line of the current image is greater than or equal to 13 pixel rows, and the distance from the left edge line of the current block to the left edge line of the current image is greater than or equal to 13 pixel columns, it indicates that the position of the current block in the current image meets the preset position requirements.

[0469] In one example, continuing to refer to Figure 11, assuming that the width of the current block is W and the height of the current block is H, the preset block size requirement is that the width W of the current block is less than or equal to the third preset value A, and the height H of the current block is less than or equal to the fourth preset value B.

[0470] The embodiment of the present application does not limit the specific values ​​of the third preset value and the fourth preset value.

[0471] Exemplarily, the third preset value and the fourth preset value are the same.

[0472] Exemplarily, the third preset value and the fourth preset value are both 32, that is, when the width and height of the current block are both less than or equal to 32, it indicates that the current block meets the preset block size requirement.

[0473] In an embodiment of the present application, before determining whether the current block is predicted using the interpolation filter prediction mode, the decoding end first determines whether the position of the current block in the current image meets the preset position requirement, and determines whether the size of the current block meets the preset block size requirement. If the position of the current block in the current image meets the preset position requirement, and the size of the current block meets the preset block size requirement, then the prediction mode of the current block is determined from the above-mentioned multiple candidate prediction modes including the interpolation filter prediction mode. For example, as shown in Figure 11, the distance from the upper edge of the current block to the upper edge of the current image is greater than or equal to 13 pixel rows, the distance from the left edge of the current block to the left edge of the current image is greater than or equal to 13 pixel columns, and the width and height of the current block are both less than or equal to 32, then the prediction mode of the current block is determined from the above-mentioned multiple candidate prediction modes including the interpolation filter prediction mode.

[0474] In some embodiments, the first preset value, the second preset value, the third preset value, and the fourth preset value are default values.

[0475] In some embodiments, if the position of the current block in the current image does not meet the preset position requirement, and / or the size of the current block does not meet the preset block size requirement, the encoding end determines that the prediction mode of the current block is not the interpolation filtering prediction mode, so that the encoding end determines the prediction mode of the current block from the candidate prediction modes that do not include the interpolation filtering prediction mode.

[0476] In some embodiments, before determining whether the position of the current block in the current image meets the preset position requirement and determining whether the size of the current block meets the preset block size, the encoding end also includes: determining whether the current sequence allows the use of an interpolation filtering prediction mode for prediction; if the current sequence allows the use of an interpolation filtering prediction mode for prediction, then determining whether the position of the current block in the current image meets the preset position requirement and determining whether the size of the current block meets the preset block size.

[0477] In an embodiment of the present application, a high-level syntax element is used to indicate whether the current sequence is allowed to be predicted using the interpolation filtering prediction mode. If the current sequence is predicted using the interpolation filtering prediction mode, the encoder determines whether the position of the current block in the current image meets the preset position requirement and whether the size of the current block meets the preset block size requirement. When it is determined that the position of the current block in the current image meets the preset position requirement and the size of the current block meets the preset block size requirement, the encoder determines the prediction mode for the current block from candidate prediction modes that do not include the interpolation filtering prediction mode.

[0478] In some embodiments, if the encoder determines that the current sequence is not allowed to be predicted using the interpolation filtering prediction mode, the encoder skips step S201 .

[0479] In some embodiments, the encoder writes fourth information into the bitstream, where the fourth information is used to indicate whether the current sequence is allowed to be predicted using the interpolation filtering prediction mode.

[0480] The embodiment of the present application does not limit the specific form of the fourth information, which can be any indication information that can indicate whether the current sequence is allowed to be predicted using the interpolation filtering prediction mode.

[0481] In one example, the fourth information may be represented by sps_eip_enabled_flag, so that different values ​​of sps_eip_enabled_flag can be assigned to indicate whether the current sequence is allowed to be predicted using the interpolation filtering prediction mode. For example, when sps_eip_enabled_flag = 0, it indicates that the current sequence is not allowed to be predicted using the interpolation filtering prediction mode, and when sps_eip_enabled_flag = 1, it indicates that the current sequence is allowed to be predicted using the interpolation filtering prediction mode.

[0482] Exemplarily, the fourth information is carried in a sequence parameter set (SPS).

[0483] In some embodiments, embodiments of the present application may further include a general constraints information (GCI) flag to indicate whether interpolation filter prediction technology is used. Exemplarily, gci_no_eip_constraint_flag is used to indicate whether interpolation filter prediction technology is enabled for the current video. Exemplarily, as shown in Table 2, the gci_no_eip_constraint_flag is carried in the general constraints information general_constraints_info().

[0484] In some embodiments, if the encoder determines that the current series allows prediction using the interpolation filtering prediction mode, third information is written into the bitstream, where the third information is used to indicate whether the current block is predicted using the interpolation filtering prediction mode.

[0485] The embodiment of the present application does not limit the specific form of expression of the above-mentioned third information, which can be any indication information that can indicate whether the current block adopts the interpolation filtering prediction mode for prediction.

[0486] In one example, the third information can be represented as intra_eip_flag, so that different values ​​of intra_eip_flag can be assigned to indicate whether the current block is predicted using the interpolation filtering prediction mode. For example, when intra_eip_flag = 0, it indicates that the current block is not predicted using the interpolation filtering prediction mode, and when intra_eip_flag = 1, it indicates that the current block is predicted using the interpolation filtering prediction mode. In this way, the encoder writes the preset flag intra_eip_flag into the bitstream, and the decoder determines the prediction mode of the current block by decoding the value of the preset flag intra_eip_flag. For example, when the preset flag intra_eip_flag = 1, it indicates that the prediction mode of the current block is the interpolation filtering prediction mode, and the decoder then uses the interpolation filtering prediction mode to predict the current block.

[0487] In some embodiments, as shown in FIG27 , the process of determining the prediction mode of the current block in an embodiment of the present application may include: first, determining whether the current block is predicted using the interpolation filter prediction mode. For example, when the fourth information at the sequence level indicates that the current sequence allows the use of the interpolation filter prediction mode, and when it is determined that the position of the current block in the current image meets the preset position requirement, and when it is determined that the size of the current block meets the preset block size requirement, it is determined that the current block can be predicted using the interpolation filter prediction mode. Next, the filter coefficient is obtained, and the current block is predicted based on the filter coefficient to obtain the predicted value of the current block. At the same time, a coarse screening of the prediction mode is performed with other intra-frame prediction mode tools, and several prediction modes with a smaller cost are selected for fine screening to determine the final intra-frame prediction mode as the prediction mode for the current block. If it is determined that the current block cannot be predicted using the interpolation filter prediction mode, the screening of the interpolation filter prediction mode is skipped.

[0488] For example, during the coarse screening of the prediction mode of the current block, the encoder calculates the cost of each candidate intra prediction mode (including the interpolation filter prediction mode). The cost calculation formula is shown in Formula (10): cost = D + λR (10)

[0489] Where R represents the bit overhead expected for the intra-frame prediction mode, λ is the Lagrange multiplier, which is related to the quantization parameter used in the current encoding, and D represents the distortion value between the predicted block and the original block in the current prediction mode.

[0490] In one example, the calculation of the distortion value D is as shown in formula (11): D = min (SAD × 2, SATD) (11)

[0491] Among them, SAD (The sum of absolute difference) and SATD (The sum of transformed difference) represent the absolute error sum algorithm and Hadamard transform error sum algorithm between the prediction and the original block, respectively.

[0492] After the encoder determines the cost of each candidate prediction mode, it selects several candidate prediction modes from multiple candidate prediction modes for detailed screening.

[0493] The prediction modes selected after the rough screening are further transformed, quantized, inversely quantized, inversely transformed, and reconstructed. The rate-distortion cost of each mode combination (prediction mode + transform mode + quantization mode) is compared to determine the final prediction mode, transform mode, and quantized residual value. The rate-distortion cost calculation is still D + λR, but here D represents the SSE (sum of squared error) between the reconstructed block and the original block, and R represents the total bit overhead of encoding the current block's mode identifier, coefficients, and so on.

[0494] The encoder determines the candidate prediction mode with the lowest cost during the fine screening process as the prediction mode for the current block.

[0495] If the encoder determines that the prediction mode of the current block is the interpolation filtering prediction mode, the above step S101 is executed.

[0496] The following describes the process of using the interpolation filter prediction mode at the encoder to predict the current block.

[0497] When the encoder determines that the current block is predicted using the interpolation filtering prediction mode, it first determines the reference area and interpolation filter of the current block.

[0498] The following describes the specific process of the encoder determining the reference area of ​​the current block.

[0499] In the embodiment of the present application, the reference area of ​​the current block is part or all of the reconstructed area around the current block.

[0500] Exemplarily, as shown in FIG12 , the reconstruction area around the current block may include: an upper reconstruction area of ​​the current block, a left reconstruction area of ​​the current block, an upper right reconstruction area of ​​the current block, a lower left reconstruction area of ​​the current block, and an upper left reconstruction area of ​​the current block.

[0501] The embodiment of the present application does not limit the specific shape and size of the reference area of ​​the current block.

[0502] In one example, the reference area of ​​the current block includes any one of an upper reconstruction area of ​​the current block, a left reconstruction area of ​​the current block, an upper right reconstruction area of ​​the current block, a lower left reconstruction area of ​​the current block, and an upper left reconstruction area of ​​the current block. For example, the reference area of ​​the current block is the upper reconstruction area of ​​the current block, or the reference area of ​​the current block is the left reconstruction area of ​​the current block.

[0503] In one example, the reference area of ​​the current block includes any two of the reconstruction areas above the current block, the reconstruction area to the left of the current block, the reconstruction area to the upper right of the current block, the reconstruction area to the lower left of the current block, and the reconstruction area to the upper left of the current block. For example, the reference area of ​​the current block includes the reconstruction area above the current block and the reconstruction area to the left of the current block. For another example, the reference area of ​​the current block includes the reconstruction area above the current block and the reconstruction area to the lower left of the current block.

[0504] In one example, the reference area of ​​the current block includes any three reconstruction areas of the upper reconstruction area of ​​the current block, the left reconstruction area of ​​the current block, the upper right reconstruction area of ​​the current block, the lower left reconstruction area of ​​the current block, and the upper left reconstruction area of ​​the current block. For example, the reference area of ​​the current block includes the upper reconstruction area of ​​the current block, the upper right reconstruction area of ​​the current block, and the upper left reconstruction area of ​​the current block. For another example, the reference area of ​​the current block includes the left reconstruction area of ​​the current block, the upper left reconstruction area of ​​the current block, and the lower left reconstruction area of ​​the current block.

[0505] In one example, the reference area of ​​the current block includes any four reconstruction areas of the upper reconstruction area of ​​the current block, the left reconstruction area of ​​the current block, the upper right reconstruction area of ​​the current block, the lower left reconstruction area of ​​the current block, and the upper left reconstruction area of ​​the current block. For example, the reference area of ​​the current block includes the upper reconstruction area of ​​the current block, the upper right reconstruction area of ​​the current block, the upper left reconstruction area of ​​the current block, and the left reconstruction area of ​​the current block. For another example, the reference area of ​​the current block includes the left reconstruction area of ​​the current block, the upper left reconstruction area of ​​the current block, the lower left reconstruction area of ​​the current block, and the upper reconstruction area of ​​the current block.

[0506] In one example, the reference area of ​​the current block includes five reconstruction areas: an upper reconstruction area of ​​the current block, a left reconstruction area of ​​the current block, an upper right reconstruction area of ​​the current block, a lower left reconstruction area of ​​the current block, and an upper left reconstruction area of ​​the current block.

[0507] In the embodiment of the present application, the specific manners in which the encoder determines the reference area of ​​the current block include but are not limited to the following:

[0508] In method 1, the reference area of ​​the current block is a default area. For example, the encoding end and the decoding end default that the reference area of ​​the current block includes at least one reconstruction area of ​​the upper reconstruction area of ​​the current block, the left reconstruction area of ​​the current block, the upper right reconstruction area of ​​the current block, the lower left reconstruction area of ​​the current block, and the upper left reconstruction area of ​​the current block.

[0509] Method 2: determining first costs for predicting the current block based on P reference regions respectively; determining the reference region with the smallest first cost among the P reference regions as the reference region for the current block.

[0510] In this implementation, the encoding end predicts the current block based on the P reference areas, determines the first cost corresponding to each reference area, and then determines the reference area with the smallest first cost among the P reference areas as the reference area of ​​the current block.

[0511] In some embodiments, the encoder writes first information into the bitstream, where the first information indicates the type of the reference region of the current block. That is, in this approach 2, the encoder also indicates the determined type of the reference region of the current block to the decoder via the first information.

[0512] It should be noted that the types or shapes of the preset P reference areas are different.

[0513] The embodiment of the present application does not impose any specific limitation on the specific number and shape of the P reference areas.

[0514] In one example, the P reference regions include at least one of a first reference region, a second reference region, and a third reference region.

[0515] As shown in FIG13A , the first reference area includes the reconstruction areas above, to the upper right, to the left, to the upper left, and to the upper left of the current block. As shown in FIG13B , the second reference area includes the reconstruction areas above, to the upper right, and to the upper left of the current block. As shown in FIG13C , the third reference area includes the reconstruction areas to the left, to the upper left, and to the upper left of the current block.

[0516] The embodiment of the present application does not limit the specific form of expression of the first information, as long as it is any indication information that can indicate the type of the reference area of ​​the current block.

[0517] In an example, eip_ref_type is used to represent the first information. For example, different types of reference areas are indicated by the value of eip_ref_type.

[0518] Exemplarily, the correspondence between the three reference areas shown in FIG. 13A and FIG. 13B and the eip_ref_type values ​​is shown in Table 4.

[0519] Based on Table 4 above, the encoder determines the value of the first information eip_ref_type based on the reference region type of the current block. For example, if the reference region of the current block is determined to be the first reference region, eip_ref_type is determined to be 0. If the reference region of the current block is determined to be the second reference region, eip_ref_type is determined to be 1. If the reference region of the current block is determined to be the third reference region, eip_ref_type is obtained to be 2.

[0520] It should be noted that the above description uses the three reference regions shown in Figures 13A to 13C as an example. The P reference regions in this embodiment of the present application also include other reference regions in addition to the three reference regions described above, and this embodiment of the present application does not limit this. The correspondence between the reference regions and the eip_ref_type values ​​shown in Table 4 above can be adaptively adjusted according to the number of reference regions.

[0521] In some embodiments, the encoding end may use a truncated binary code encoding method to write the first information into the code stream.

[0522] For example, the correspondence between the truncated binary code, the eip_ref_type value, and the type of the reference area is shown in Table 5.

[0523] In an embodiment of the present application, the encoding end may use an equal probability encoding method or a context model encoding method to encode the codeword of the truncated binary code.

[0524] In addition to using the above-mentioned method 1 or method 2 to determine the reference area of ​​the current block, the encoder can also use the following method 3 to determine the reference area of ​​the current block.

[0525] Mode 3: Based on the shape of the current block, a reference area of ​​the current block is determined from among P preset reference areas.

[0526] In this method 3, different reference areas are used to perform prediction on current blocks of different shapes to improve the accuracy of prediction.

[0527] For example, if the shape of the current block is a square, the first type of reference region is used.

[0528] For another example, if the shape of the current block is a rectangle with a width greater than a height, the second type of reference region is used.

[0529] For another example, if the shape of the current block is a rectangle with a width smaller than a height, the third type of reference region is used.

[0530] That is, in this embodiment of the present application, the correspondence between the P reference regions and the shape of the current block is preset. Thus, the encoder can determine the reference region of the current block from among the P reference regions based on the shape of the current block and the correspondence between the P reference regions and the shape of the current block.

[0531] The following describes the process of determining the interpolation filter of the current block at the encoder end.

[0532] In the embodiment of the present application, there is no limitation on the specific shape of the interpolation filter.

[0533] Illustratively, the interpolation filters provided in the embodiments of the present application include, but are not limited to, square interpolation filters and interpolation filters with a height smaller than a width.

[0534] For example, the square interpolation filter includes but is not limited to the 4X4 interpolation filter shown in Figure 14A.

[0535] For another example, interpolation filters that are taller than they are wide include, but are not limited to, the 5X3 interpolation filter shown in FIG. 14B , the 6X2 interpolation filter shown in FIG. 14D , and the 7X1 interpolation filter shown in FIG. 14G .

[0536] For another example, interpolation filters with a height smaller than a width include but are not limited to the 3X5 interpolation filter shown in FIG. 14C , the 2X6 interpolation filter shown in FIG. 14E , and the 1X7 interpolation filter shown in FIG. 14F .

[0537] It should be noted that in the above filter, the dark gray position represents the current position to be predicted, and the light gray position represents the input position of the interpolation filter, that is, {p0, p1, ..., p N-1}Location.

[0538] In the embodiment of the present application, the specific manners in which the encoder determines the interpolation filter for the current block include but are not limited to the following:

[0539] In mode 1, the interpolation filter of the current block is a default interpolation filter. For example, the encoder and decoder default the interpolation filter of the current block to any one of the interpolation filters in Figures 14A to 14G. For example, the default interpolation filter is a 4x4 interpolation filter.

[0540] In mode 2, the encoder determines an interpolation filter for the current block from among Q preset interpolation filters.

[0541] For example, the encoder randomly selects an interpolation filter from Q interpolation filters as the interpolation filter of the current block.

[0542] For another example, the encoder determines the second costs when using Q interpolation filters to predict the current block respectively; and determines the interpolation filter with the smallest second cost among the Q interpolation filters as the interpolation filter for the current block.

[0543] In some embodiments, the encoding end writes second information into the bitstream, where the second information is used to indicate the shape of the interpolation filter of the current block.

[0544] In this implementation, the encoder determines the interpolation filter for the current block from among Q preset interpolation filters. For example, the encoder determines the second costs corresponding to each of the Q interpolation filters and selects the interpolation filter with the smallest second cost as the interpolation filter for the current block. The shape of the interpolation filter with the smallest second cost is then indicated to the encoder via second information. The decoder then decodes the bitstream to obtain the second information and, based on the shape of the interpolation filter indicated by the second information, determines the interpolation filter for the current block from among the Q preset interpolation filters.

[0545] It should be noted that the shapes of the preset Q interpolation filters are different.

[0546] The embodiments of the present application do not impose any specific restrictions on the specific number and shape of the Q interpolation filters. For example, the Q interpolation filters include at least one of a first interpolation filter, a second interpolation filter, and a third interpolation filter, where the first interpolation filter is a square interpolation filter, the second interpolation filter is a rectangular interpolation filter with a width greater than a height, and the third interpolation filter is a rectangular interpolation filter with a height greater than a width.

[0547] In one example, the Q interpolation filters include the plurality of interpolation filters in FIG. 14A to FIG. 14H .

[0548] The embodiment of the present application does not limit the specific form of the second information, as long as it is any indication information that can indicate the shape of the interpolation filter of the current block.

[0549] In an example, eip_filter_type is used to represent the second information. For example, the value of eip_filter_type is used to indicate interpolation filters of different shapes.

[0550] Exemplarily, if the Q interpolation filters are the five interpolation filters shown in FIG. 15 , the correspondence between the five interpolation filters and the eip_filter_type values ​​is as shown in Table 6.

[0551] Based on Table 5, the encoder determines the value of the second information eip_filter_type based on the shape of the interpolation filter of the current block. For example, if the shape of the interpolation filter of the current block is determined to be 4x4, eip_filter_type is determined to be 0. If the shape of the interpolation filter of the current block is determined to be 3x5, eip_filter_type is determined to be 1. If the shape of the interpolation filter of the current block is determined to be 5x3, eip_filter_type is determined to be 2. If the shape of the interpolation filter of the current block is determined to be 2x6, eip_filter_type is determined to be 3. If the shape of the interpolation filter of the current block is determined to be 6x2, eip_filter_type is determined to be 4.

[0552] In some embodiments, the encoding end may use a truncated binary code encoding method to encode the second information into the code stream.

[0553] Exemplarily, if the preset Q interpolation filters include the five interpolation filters shown in FIG. 15 , the correspondence between the truncated binary code, the eip_filter_type value, and the shape of the interpolation filter is shown in Table 7.

[0554] At this time, the five interpolation filter shapes shown in Table 7 and the three reconstruction region types shown in Table 5 provide a total of 15 combinations of interpolation filters and reconstruction regions.

[0555] In some embodiments, when the embodiment of the present application includes the seven interpolation filters shown in Figure 16, the correspondence between the truncated binary code, the eip_filter_type value and the shape of the interpolation filter is shown in Table 9.

[0556] At this time, the 7 interpolation filter shapes shown in Table 9 and the 3 reconstruction region types shown in Table 5 provide a total of 21 combinations of interpolation filters and reconstruction regions.

[0557] In some embodiments, when the embodiment of the present application includes three interpolation filters as shown in Figure 17, the correspondence between the truncated binary code, the eip_filter_type value and the shape of the interpolation filter is shown in Table 10.

[0558] At this time, the three interpolation filter shapes shown in Table 10 and the three reconstruction region types shown in Table 5 provide a total of nine combinations of interpolation filters and reconstruction regions.

[0559] In some embodiments, when the embodiment of the present application includes three interpolation filters as shown in Figure 18A, the correspondence between the truncated binary code, the eip_filter_type value and the shape of the interpolation filter is shown in Table 11.

[0560] At this time, the three interpolation filter shapes shown in Table 11 and the three reconstruction region types shown in Table 5 provide a total of nine combinations of interpolation filters and reconstruction regions.

[0561] In some embodiments, when the embodiment of the present application includes three interpolation filters as shown in Figure 18B, the correspondence between the truncated binary code, the eip_filter_type value and the shape of the interpolation filter is shown in Table 12.

[0562] At this time, the three interpolation filter shapes shown in Table 12 and the three reconstruction region types shown in Table 5 provide a total of nine combinations of interpolation filters and reconstruction regions.

[0563] In some embodiments, when the embodiment of the present application includes the three interpolation filters shown in Figure 19, the correspondence between the truncated binary code, the eip_filter_type value and the shape of the interpolation filter is shown in Table 13.

[0564] At this time, the three interpolation filter shapes shown in Table 13 and the three reconstruction region types shown in Table 5 provide a total of nine combinations of interpolation filters and reconstruction regions.

[0565] In addition to using the above-mentioned method 1 or method 2 to determine the interpolation filter of the current block, the encoder can also use the following method 3 to determine the interpolation filter of the current block.

[0566] Mode 3: Based on the shape of the current block, an interpolation filter for the current block is determined from among Q preset interpolation filters.

[0567] In this method 3, different interpolation filters are used to perform prediction on current blocks of different shapes to improve the accuracy of prediction.

[0568] For example, if the shape of the current block is a square, an interpolation filter of the first shape is used.

[0569] For another example, if the shape of the current block is a rectangle with a width greater than a height, the interpolation filter of the second shape is used.

[0570] For another example, if the shape of the current block is a rectangle with a width smaller than a height, the interpolation filter of the third shape is used.

[0571] That is, in the embodiment of the present application, the correspondence between the Q interpolation filters and the shape of the current block is preset. In this way, the encoder can determine the interpolation filter for the current block from the Q interpolation filters based on the shape of the current block and the correspondence between the Q interpolation filters and the shape of the current block.

[0572] In an embodiment of the present application, after the encoder determines the reference area and interpolation filter of the current block based on the above steps, it determines the prediction block of the current block based on the reference area and the interpolation filter.

[0573] The following describes how the encoder determines the prediction block of the current block based on the reference area and interpolation filter of the current block.

[0574] In an embodiment of the present application, after the encoding end determines the reference area and interpolation filter of the current block, the interpolation filter is used to filter on the reference area to determine the filter coefficient of the interpolation filter, and then based on the determined filter coefficient, the current block is interpolated and filtered to obtain a predicted block of the current block.

[0575] The embodiment of the present application does not limit the specific manner in which the encoder determines the prediction block of the current block based on the reference area and interpolation filter of the current block.

[0576] In some embodiments, determining the prediction block of the current block based on the reference area and the interpolation filter of the current block in S201 includes the following steps:

[0577] S201-A1, determining a filter coefficient of an interpolation filter based on a reference area;

[0578] S201-A2: Based on the filter coefficient, use an interpolation filter to perform interpolation filtering prediction on the current block to obtain a predicted block of the current block.

[0579] The above-mentioned method of determining the filter coefficient of the interpolation filter in S201-A1 includes at least the following methods:

[0580] Method 1: Use the interpolation filter determined above to slide over the reference area of ​​the current block to construct the Wienerhof equation. Then, solve the Wienerhof equation to obtain the filter coefficients of the interpolation filter.

[0581] In the process of sliding the interpolation filter in the reference area of ​​the current block, the N positions corresponding to each position in the reference area are determined based on the shape of the interpolation filter. For example, for position r in the reference area, based on the shape of the interpolation filter, the N positions corresponding to position r are determined in the reference area. The pixel reconstruction values ​​of these N positions are the input of the interpolation filter. The phase position difference between these N positions and position r is {p0, p1, ..., p N-1}, p N is a two-dimensional representation. In which {c0,c1,…,c N-1} is {p0,p1,…,p N-1}Interpolation filter coefficients at the position.

[0582] In one example, the interpolation filter is slid in the reference area of ​​the current block to construct the Wienerhof equation, as shown in formula (3).

[0583] Since the reference area of ​​the current block is the reconstructed area, all parameters except the interpolation filter coefficient in the above formula (3) are known. Therefore, the filter coefficient of the interpolation filter of the current block can be determined by solving the above formula (3).

[0584] In one example, the encoding end may solve the Wienerhof equation shown in the above formula (3) by Cholesky decomposition of the autocorrelation coefficient matrix to obtain the filter coefficients of the filter.

[0585] After the encoder determines the filter coefficient of the interpolation filter based on the above formula (3), it uses the interpolation filter to perform interpolation filtering prediction on the current block based on the filter coefficient to obtain the prediction block of the current block

[0586] Exemplarily, the encoding end obtains the prediction block of the current block based on the following formula (4).

[0587] In the second method, the above S201-A1 includes the following steps S201-A11 to S201-A14:

[0588] S201-A11, determining a first reconstruction area around the current block;

[0589] S201-A12, determining a pixel average reconstruction value based on the reconstruction value of the first reconstruction area;

[0590] S201-A13, based on the pixel average reconstruction value, remove the mean of the reconstructed values ​​of the pixels in the reference area;

[0591] S201-A14: Using the pixel values ​​of the pixels in the reference area after averaging as inputs of the interpolation filter, sliding the interpolation filter in the reference area to obtain filter coefficients of the interpolation filter.

[0592] In this second approach, the reference region is de-averaged, and the interpolation filter coefficients are determined based on the de-averaged reference region. Since the amount of data in the de-averaged reference region is reduced, determining the filter coefficients based on the de-averaged reference region can improve efficiency.

[0593] Specifically, the encoding end first determines a first reconstruction area, where the first reconstruction area may be any part of the reconstruction area surrounding the current block.

[0594] In the embodiment of the present application, the encoder determines the first reconstruction area around the current block in at least the following ways:

[0595] In mode 1, the encoder determines a reconstruction area around the current block as the first reconstruction area by default.

[0596] For example, as shown in FIG20 , the encoder uses the area consisting of a row above, a column to the left, and a pixel point in the upper left corner of the current block as the first reconstruction area by default.

[0597] Method 2: Determine the first reconstruction area based on the shape of the current block.

[0598] For example, if the shape of the current block is a square, the reconstructed pixel area in one row above and one column on the left of the current block is determined as the first reconstructed area.

[0599] For another example, if the shape of the current block is a rectangle with a width greater than a height, a row of reconstructed pixel areas above the current block is determined as the first reconstructed area.

[0600] For another example, if the shape of the current block is a rectangle with a height greater than a width, a left column of reconstructed pixel areas of the current block is determined as the first reconstructed area.

[0601] It should be noted that, based on the shape of the current block, the manner of determining the first reconstruction area includes but is not limited to the above examples.

[0602] After determining the first reconstruction area, the encoder determines the pixel average reconstruction value m based on the reconstruction value of the first reconstruction area.

[0603] In one implementation, the average value of the reconstruction values ​​of the first reconstruction area is determined as the pixel average reconstruction value m.

[0604] In an example, if the first reconstruction area is as shown in FIG. 20 , the pixel average reconstruction value m can be calculated using the method shown in Table 13.

[0605] In one example, if the first reconstructed area is a row above and / or a column to the left of the current block, the average of the reconstructed values ​​in the row above and / or the column to the left can be determined as the pixel average reconstructed value m. In this case, the pixel average reconstructed value m can be calculated using the method shown in Table 15.

[0606] As shown in Table 15 above, if the first reconstruction area is a row above and / or a column to the left of the current block, shift calculation can be used instead of division to quickly calculate the pixel average reconstruction value m.

[0607] In addition to determining the average value of the reconstruction values ​​of the first reconstruction area as the pixel average reconstruction value m, the encoder may also determine the pixel average reconstruction value m in the following manner.

[0608] In another manner, a weighted average of the reconstruction values ​​of the first reconstruction area is determined as the pixel average reconstruction value m.

[0609] The encoding end may also use other methods to determine the pixel average reconstruction value m.

[0610] After determining the pixel average reconstruction value, the encoder performs de-averaging on the reconstruction values ​​of the pixels in the reference area based on the pixel average reconstruction value.

[0611] For example, for each pixel in the reference area, the reconstructed value of the pixel is divided by the pixel average reconstructed value and then rounded to the integer to obtain the pixel value of the pixel in the reference area after removing the average value.

[0612] For another example, the encoder subtracts the average pixel reconstruction value from the reconstructed value of the pixel in the reference area to obtain the averaged pixel value of the pixel in the reference area. For example, for each pixel in the reference area, the average pixel reconstruction value is subtracted from the reconstructed value of the pixel to obtain the averaged pixel value of the pixel in the reference area.

[0613] The embodiment of the present application does not limit the specific manner in which the encoding end performs de-averaging on the reconstructed values ​​of the pixels in the reference area based on the pixel average reconstruction value.

[0614] Based on the above method, the encoding end de-averages the reconstructed values ​​of the pixel points in the reference area, obtains the pixel values ​​of the de-averaged pixel points in the reference area, and then executes the above steps S201-A14, uses the pixel values ​​of the de-averaged pixel points in the reference area as the input of the interpolation filter, slides the interpolation filter in the reference area, and obtains the filter coefficients of the interpolation filter.

[0615] For example, as shown in FIG21, when the interpolation filter of the current block is an interpolation filter of five different shapes and the reference area of ​​the current block is a reference area of ​​three different types, the interpolation filter of the current block is slid on the reference area after the current block is averaged to obtain the filter coefficients of the interpolation filter. The interpolation filter can slide horizontally row by row or vertically column by column on the reference area after the current block is averaged.

[0616] As shown in Figure 21, when using the interpolation filter to slide in the reference area of ​​the current block, first, according to the shape of the interpolation filter, the N positions corresponding to each position in the reference area are determined. For example, for position r in the reference area, based on the shape of the interpolation filter, the N positions corresponding to position r are determined in the reference area, and the pixel reconstruction values ​​of these N positions are the input of the interpolation filter. The phase position difference between these N positions and position r is {p0, p1, ..., p N-1}, p Nis a two-dimensional representation. In which {c0,c1,…,c N-1} is {p0,p1,…,p N-1}Interpolation filter coefficients at the position.

[0617] In one example, the interpolation filter is slid in the reference area of ​​the current block, and the constructed Wienerhof equation is shown in formula (5).

[0618] Since the reference area of ​​the current block is the reconstructed area, all parameters except the interpolation filter coefficient in the above formula (5) are known. Therefore, the filter coefficient of the interpolation filter of the current block can be determined by solving the above formula (5).

[0619] In one example, the encoding end may solve the Wienerhof equation shown in the above formula (5) by Cholesky decomposition of the autocorrelation coefficient matrix to obtain the filter coefficients of the filter.

[0620] After the encoder determines the filter coefficients of the interpolation filter based on the above formula (5), it executes the above steps S201-A2 and uses the interpolation filter to perform interpolation filtering prediction on the current block based on the filter coefficients to obtain a predicted block of the current block.

[0621] According to the above formula (5), the reference area after de-averaging is used to determine the filter coefficient. Therefore, when determining the prediction value of the current block based on the filter coefficient, the influence of the pixel average reconstruction value m needs to be considered.

[0622] In one possible implementation, the interpolation filter coefficient determined by the above formula (5) is substituted into the above formula (4) to obtain the predicted value of each point in the current block. Then, the predicted value of each point is added to the pixel average reconstruction value m to obtain the final predicted value of each point in the current block, thereby obtaining the predicted block of the current block.

[0623] In another possible implementation, the above S201-A2 includes the following steps:

[0624] S201-A21, for the r-th point in the current point, determine the pixel values ​​of N positions corresponding to the r-th point based on the shape of the interpolation filter, where r is a positive integer;

[0625] S201-A22, performing mean removal on pixel values ​​at N positions based on the pixel average reconstruction value to obtain mean-removed pixel values ​​at the N positions;

[0626] S201-A23, based on the pixel values ​​and filter coefficients after removing the mean at N positions, obtain the predicted value of the r-th point;

[0627] S201-A24. Obtain a prediction block of the current block based on the prediction value of the midpoint of the current block.

[0628] As shown in Figure 22, assuming the interpolation filter shape of the current block is 4x4, the encoder uses an interpolation filter with known filter coefficients to perform interpolation prediction for each position in the current block. Specifically, for the rth point in the current block, the pixel values ​​of the N positions corresponding to the rth point are first determined based on the shape of the interpolation filter of the current block. For example, as shown in Figure 22, in the 4x4 interpolation filter, the dark position is the position of the rth point to be processed, and the 15 light positions are the N positions corresponding to the rth point.

[0629] Next, the pixel values ​​of the N positions corresponding to the rth point are determined. For example, for any of the N positions, if the position is located in the reconstructed area surrounding the current block, the reconstructed value of the position is determined as the pixel value of the position. If the position is located within the current block, the predicted value of the position is determined as the pixel value of the position.

[0630] Because the filter coefficients are determined based on the reference area after averaging, the encoder performs averaging on the pixel values ​​at the N positions of the r-th point based on the pixel average reconstruction value to obtain the averaged pixel value at the N positions of the r-th point. For example, the averaged pixel reconstruction value is subtracted from the pixel values ​​at the N positions of the r-th point to obtain the averaged pixel value at the N positions of the r-th point.

[0631] Next, the predicted value of the rth point is obtained based on the pixel values ​​and filter coefficients after removing the mean of N positions.

[0632] The embodiment of the present application does not limit the specific method of obtaining the predicted value of the rth point based on the pixel values ​​and filter coefficients after removing the mean of N positions.

[0633] In one implementation, the encoder takes the pixel values ​​and filter coefficients of the N positions of the r-th point after removing the mean, and puts them into the above formula (4). At this time, t[ri+p n ] is the position ri+p n The pixel value after removing the mean value of the pixel at . After determining a predicted value of the r-th point based on the above formula (4), add the pixel average reconstruction value m to the predicted value to obtain the final predicted value of the r-th point.

[0634] In another implementation, the above S201-A23 includes the following steps:

[0635] S201-A231, determining a second reconstruction area around the current block, and determining a maximum reconstruction value and a minimum reconstruction value of the second reconstruction area;

[0636] S201-A232, obtaining a first prediction value based on the pixel values ​​after de-averaging at N positions, the filter coefficients, and the pixel average reconstruction value;

[0637] S201-A233. Determine the predicted value of the rth point based on the first predicted value, the maximum reconstructed value, and the minimum reconstructed value.

[0638] In this implementation, the encoder limits the prediction value of the current block to a range. Specifically, a second reconstruction area is determined, and the maximum reconstruction value (max) and the minimum reconstruction value (min) of the pixels in the second reconstruction area are determined.

[0639] The embodiment of the present application does not limit the specific method of determining the second reconstruction area around the current block.

[0640] In an example, the second reconstructed region of the current block is consistent with the reference region of the current block.

[0641] In an example, the second reconstructed area of ​​the current block is consistent with the first reconstructed area of ​​the current block.

[0642] In one example, the reconstruction areas above, to the left, to the upper right, to the upper left, and to the lower left of the current block are determined as the second reconstruction area. For example, the reconstruction areas 13 rows above, 13 columns to the left, 13 rows to the upper right, 13 rows and 13 columns to the upper left, and 13 columns to the lower left of the current block are determined as the second reconstruction area.

[0643] It should be noted that there is no order of precedence between the above S201-A231 and the above S201-A232 in the specific implementation process. For example, the above S201-A231 can be executed before the above S201-A232, or after the above S201-A232, or synchronously with the above S201-A232.

[0644] The embodiment of the present application does not limit the specific method for the encoding end to obtain the first prediction value based on the pixel values ​​after de-averaging at N positions, the filter coefficients and the pixel average reconstruction value.

[0645] For example, the pixel values ​​of the N positions of the r-th point after deaveraging are multiplied by the filter coefficient to obtain the second predicted value of the r-th point; the second predicted value and the pixel average reconstruction value are added to obtain the first predicted value of the r-th point.

[0646] Exemplarily, the encoding end obtains the first prediction value of the r-th point based on the following formula (6).

[0647] For another example, after the encoding end obtains a prediction value of the r-th point based on the above formula (6), the prediction value is processed to obtain a first prediction value of the r-th point.

[0648] After determining the first prediction value of the r-th point in the current block based on the above steps, the encoder determines the prediction value of the r-th point based on the first prediction value, the maximum reconstructed value, and the minimum reconstructed value.

[0649] For example, if the first predicted value is greater than the minimum reconstruction value and less than the maximum reconstruction value, the first predicted value is determined as the predicted value of the rth point.

[0650] For another example, if the first predicted value is less than or equal to the minimum reconstruction value, the minimum reconstruction value is determined as the predicted value of the rth point.

[0651] For another example, if the first predicted value is greater than or equal to the maximum reconstructed value, the maximum reconstructed value is determined as the predicted value of the rth point.

[0652] In one example, the encoding end determines the predicted value of the rth point through the following formula (7).

[0653] Taking the determination of the prediction value of the rth point in the current block as an example, the encoder can refer to the above method to determine the prediction value of each point in the current block, and then the prediction value of each point in the current block constitutes the prediction block of the current block.

[0654] Based on the above steps, the encoder performs interpolation filtering prediction on the current block, obtains the predicted block of the current block, and then performs the following steps.

[0655] S202 : Determine an intra-frame prediction mode corresponding to the prediction block, and determine a transform kernel corresponding to the current block based on the intra-frame prediction mode corresponding to the prediction block.

[0656] As can be seen from the above, when encoding the current block, the encoder determines the prediction block for the current block based on the above steps. Next, the prediction block of the current block is subtracted from the current block to obtain the residual block of the current block. Next, the residual block of the current block is transformed to obtain transform coefficients, which are quantized to obtain quantized coefficients, and these quantized coefficients are encoded to obtain the bitstream.

[0657] When transforming the residual value of the current block to obtain the transform coefficient, it is necessary to determine the transform kernel, and based on the transform kernel, transform the residual value of the current block to obtain the transform coefficient. Currently, the encoding end predicts the current block by adopting the traditional intra-frame prediction mode. The encoding end can determine the transform kernel used for the current block based on the correspondence between the transform kernels in the traditional intra-frame prediction mode. However, in the embodiment of the present application, when predicting the current block, the interpolation filter prediction mode is used instead of the traditional intra-frame prediction mode. Therefore, it is impossible to directly determine the transform kernel corresponding to the current block.

[0658] In order to solve this technical problem, in an embodiment of the present application, after determining the prediction block of the current block using the interpolation filtering prediction mode, the traditional intra-frame prediction mode corresponding to the prediction block is determined, and then based on the traditional intra-frame prediction mode, the transformation kernel corresponding to the current block is determined.

[0659] The following describes the specific process by which the encoder determines the intra-frame prediction mode corresponding to the prediction block.

[0660] In one example, as shown in FIG7 , the conventional intra prediction modes currently included in VVC are:

[0661] PLANAR mode: intra prediction mode index is 0,

[0662] DC mode: intra prediction mode index is 1,

[0663] Angle mode: The intra prediction mode index is 2 to 66.

[0664] In one example, as shown in Figure 23, the arrows in the figure point to the directions predicted by the angle modes in VVC, and the prediction mode indexes used during encoding are 2 to 66. When the current block is a non-square block, some angle directions will be replaced with wide angles, such as -1 to -14 and 67 to 80 in Figure 23.

[0665] In some embodiments, the intra-frame prediction mode corresponding to the above-mentioned prediction block is a default intra-frame prediction mode. That is, if the current block is predicted using the interpolation filtering prediction mode, when the prediction block is obtained, one of the traditional intra-frame prediction modes is determined as the default intra-frame prediction mode corresponding to the prediction block.

[0666] In some embodiments, the encoder determines the intra prediction mode corresponding to the prediction block through the following steps:

[0667] S202-A1, determining angle values ​​of M points in the prediction block, where M is a positive integer;

[0668] S202-A2: Determine the intra-frame prediction mode corresponding to the prediction block based on the angle values ​​of the M points.

[0669] In the embodiment of the present application, the intra-frame prediction mode corresponding to the prediction block is determined by counting the intra-frame prediction modes corresponding to the angle values ​​of M points in the prediction block.

[0670] The embodiment of the present application does not limit the specific position and number of the M points in the prediction block used to determine the angle value. For example, the M points can be one point in the prediction block, or multiple points in the prediction block.

[0671] For example, if the above-mentioned M points are one point, the encoding end determines the angle value of a point in the prediction block (for example, the center point of the prediction block), and based on the angle value of the point, determines the intra-frame prediction mode corresponding to the point, and then determines the intra-frame prediction mode as the intra-frame prediction mode corresponding to the prediction block.

[0672] For another example, if the above-mentioned M points are multiple points, the encoding end determines the angle values ​​of these multiple points, and based on the angle values ​​of these multiple points, determines the intra-frame prediction mode corresponding to each of these multiple points, and then determines the intra-frame prediction mode with the largest number of identical intra-frame prediction modes among these multiple points as the intra-frame prediction mode corresponding to the prediction block.

[0673] In some embodiments, when determining the angle values ​​of M points in a prediction block using a sliding window approach, the selection of these M points is related to the shape and size of the sliding window. For example, each of the M points is the center point of the sliding window as it slides across the prediction block.

[0674] In the embodiment of the present application, the method for determining the angle value of each of the M points is the same. For the convenience of description, the method of determining the angle value of the i-th point among the M points is used as an example for explanation.

[0675] The embodiment of the present application does not limit the specific method of determining the angle value of the point.

[0676] In some embodiments, the above S202-A1 includes steps S202-A11 and S202-A12:

[0677] S202-A11. For the i-th point among the M points, determine the horizontal gradient and vertical gradient of the i-th point, where i is a positive integer less than or equal to M;

[0678] S202-A12: Determine the angle value of the i-th point based on the horizontal gradient and vertical gradient of the i-th point.

[0679] In this embodiment, the encoding end first determines the horizontal gradient and vertical gradient of each of the M points, such as the i-th point, and then determines the angle value of the i-th point based on the horizontal gradient and the vertical gradient.

[0680] The embodiment of the present application does not limit the specific method of determining the horizontal gradient and vertical gradient of the i-th point.

[0681] In one example, the horizontal gradient value of the i-th point is determined based on the predicted values ​​of the points around the i-th point in the prediction block and the change in the predicted value of the i-th point in the horizontal direction, and the vertical gradient value of the i-th point is determined based on the predicted values ​​of the points around the i-th point in the prediction block and the change in the predicted value of the i-th point in the vertical direction.

[0682] In another example, the encoding end determines the prediction value of the point in the sliding window centered on the i-th point in the prediction block; based on the prediction value of the point in the sliding window and the horizontal gradient operator, as well as the vertical gradient operator, the horizontal gradient and vertical gradient of the i-th point are obtained.

[0683] In this example, a sliding window is first determined. For example, as shown in Figure 24, a 3×3 sliding window is determined. This sliding window is then slid across the prediction block. With each slide, the horizontal and vertical gradients at the center point of the sliding window are determined. For example, taking the center point of the current sliding window as the i-th point, the predicted values ​​for each point within the current sliding window are first obtained. For example, predicted values ​​for 3×3 = 9 points can be obtained. Next, based on the predicted values ​​for these 9 points and the preset horizontal and vertical gradient operators, the horizontal and vertical gradients at the i-th point are determined.

[0684] For example, the product of the predicted value of the point in the sliding window and the horizontal gradient operator is determined as the horizontal gradient G of the i-th point x ; The product of the predicted value of the point in the sliding window and the vertical gradient operator is determined as the vertical gradient of the i-th point.

[0685] For another example, the predicted value of the point in the sliding window is multiplied by the horizontal gradient operator and then the preset operation is performed with the preset value to obtain the horizontal gradient G of the i-th point. x ; Multiply the predicted value of the point in the sliding window by the vertical gradient operator and then perform a preset operation with the preset value to obtain the vertical gradient of the i-th point.

[0686] The embodiment of the present application does not limit the specific values ​​of the horizontal gradient operator and the vertical gradient operator.

[0687] After determining the horizontal gradient and vertical gradient of the i-th point based on the above steps, the encoder can determine the angle value of the i-th point based on the horizontal gradient and vertical gradient of the i-th point.

[0688] For example, the inverse tangent value of the ratio of the vertical gradient to the horizontal gradient at the i-th point is determined as the angle value of the i-th point. For example, the angle value of the i-th point is determined according to formula (8).

[0689] In addition to using the above formula (8) to determine the angle value of the i-th point, the encoder can also use other methods to determine the angle value of the i-th point. For example, the encoder adjusts the angle value determined by the above formula (8) to obtain the angle value of the i-th point.

[0690] The encoding end uses the above method for each of the M points to determine the angle value of each of the M points, and then executes the above S202-A2 to determine the intra-frame prediction mode corresponding to the prediction block based on the angle values ​​of the M points.

[0691] The embodiment of the present application does not limit the specific method of determining the intra-frame prediction mode corresponding to the prediction block based on the angle values ​​of M points.

[0692] In some embodiments, the encoding end selects the angle value 1 that is the same the most times from the angle values ​​of M points, matches the angle value 1 with the prediction angle of the traditional intra-frame prediction mode, obtains the intra-frame prediction mode corresponding to the angle value 1, and determines the intra-frame prediction mode corresponding to the angle value 1 as the intra-frame prediction mode corresponding to the prediction block.

[0693] In some embodiments, the above S202-A2 includes the following steps S202-A21 and S202-A22:

[0694] S202-A21, determining the intra-frame prediction mode corresponding to the M points based on the angle values ​​of the M points;

[0695] S202-A22: Determine the intra-frame prediction mode corresponding to the prediction block based on the intra-frame prediction modes corresponding to the M points.

[0696] In this implementation, the encoder determines the intra-frame prediction mode corresponding to each of the M points based on the angle value of each point. For example, for each of the M points, the angle value of the point is matched with the prediction angle of the traditional intra-frame prediction mode to obtain the intra-frame prediction mode corresponding to the angle value of the point. In this way, the intra-frame prediction mode corresponding to each of the M points can be obtained.

[0697] Next, based on the intra-frame prediction mode corresponding to each of the M points, the intra-frame prediction mode corresponding to the prediction block is determined.

[0698] In a possible implementation, the intra-frame prediction mode with the greatest number of repetitions among the intra-frame prediction modes corresponding to the M points is determined as the intra-frame prediction mode corresponding to the prediction block.

[0699] In another possible implementation, the above S202-A22 includes the following steps:

[0700] S202-A221, based on the horizontal gradients and vertical gradients of the M points, determine the gradient amplitude values ​​corresponding to the M points;

[0701] S202-A222: Determine the intra-frame prediction mode corresponding to the prediction block based on the intra-frame prediction modes and gradient magnitude values ​​corresponding to the M points.

[0702] In this implementation, the encoding end determines the gradient amplitude value corresponding to each of the M points based on the horizontal gradient and vertical gradient of each of the M points determined above.

[0703] In the embodiment of the present application, the specific method for the encoder to determine the gradient amplitude value corresponding to each of the M points is the same. For ease of description, take determining the gradient amplitude value corresponding to the i-th point among the M points as an example.

[0704] The embodiment of the present application does not limit the specific manner in which the encoding end determines the gradient amplitude value corresponding to the i-th point based on the horizontal gradient and vertical gradient of the i-th point.

[0705] For example, the encoder multiplies the horizontal gradient and the vertical gradient of the i-th point to obtain the gradient amplitude value corresponding to the i-th point.

[0706] For another example, the encoding end adds the absolute value of the horizontal gradient and the absolute value of the vertical gradient of the i-th point to obtain the gradient amplitude value corresponding to the i-th point.

[0707] Exemplarily, the encoder determines the gradient amplitude value corresponding to the i-th point based on the following formula (9).

[0708] The encoder can determine the gradient magnitude value corresponding to each of the M points based on the above steps. Next, the encoder performs S202-A222 above to determine the intra prediction mode corresponding to the prediction block based on the intra prediction modes and gradient magnitude values ​​corresponding to the M points.

[0709] In one example, the intra-frame prediction mode corresponding to the point with the largest gradient magnitude value among the M points is determined as the intra-frame prediction mode corresponding to the prediction block.

[0710] In another example, for any point among the M points, the gradient amplitude value corresponding to the point is accumulated on the intra-frame prediction mode corresponding to the point to obtain the accumulated gradient amplitude values ​​of the intra-frame prediction modes corresponding to the M points; and the intra-frame prediction mode with the largest accumulated gradient amplitude value among the intra-frame prediction modes corresponding to the M points is determined as the intra-frame prediction mode corresponding to the prediction block.

[0711] For example, as shown in FIG25, the gradient amplitude value corresponding to each of the M points is accumulated on the corresponding intra-frame prediction mode. For example, the intra-frame prediction modes corresponding to point 1 and point 2 of the M points are both intra-frame prediction mode 1, so the gradient amplitude values ​​corresponding to point 1 and point 2 are accumulated to the gradient amplitude value corresponding to intra-frame prediction mode 1. Similarly, the gradient amplitude value histogram shown in FIG25 can be obtained. In this way, the intra-frame prediction mode with the largest cumulative gradient amplitude value in the gradient amplitude value histogram can be determined as the intra-frame prediction mode corresponding to the prediction block. For example, the intra-frame prediction mode corresponding to the dark cumulative gradient amplitude value in FIG25 is determined as the intra-frame prediction mode corresponding to the prediction block.

[0712] In some embodiments, if the gradient magnitude values ​​corresponding to the M points are all 0, the first intra-frame prediction mode is determined as the intra-frame prediction mode corresponding to the prediction block. In other words, if the gradient magnitude values ​​corresponding to all of the M points are 0, it means that the horizontal gradient and vertical gradient of each of the M points are both 0. In this case, the preset first intra-frame prediction mode can be determined as the intra-frame prediction mode corresponding to the prediction block.

[0713] The embodiment of the present application does not limit the type of the first intra-frame prediction mode.

[0714] Exemplarily, the first intra-frame prediction mode is the PLANAR mode.

[0715] After the encoder determines the intra prediction mode corresponding to the prediction block based on the above steps, it determines the transform kernel corresponding to the current block based on the intra prediction mode corresponding to the prediction block.

[0716] The embodiment of the present application does not limit the specific manner in which the encoder determines the transform kernel corresponding to the current block based on the intra-frame prediction mode corresponding to the prediction block.

[0717] In some embodiments, the encoding end searches for an image block whose intra-frame prediction mode is the same as the intra-frame prediction mode corresponding to the prediction block in the encoded image blocks around the prediction block based on the intra-frame prediction mode corresponding to the prediction block, and then determines the transform kernel corresponding to the image block as the transform kernel corresponding to the current block.

[0718] In some embodiments, determining the transform kernel corresponding to the current block based on the intra prediction mode corresponding to the prediction block in S202 includes the following steps:

[0719] S202-B1, obtaining a correspondence between an intra prediction mode and a transform kernel group, wherein one transform kernel group includes at least one type of transform kernel;

[0720] S202-B2, searching for a first transform kernel group corresponding to the intra prediction mode of the prediction block in the corresponding relationship;

[0721] S202-B3: Determine a transform core corresponding to the current block from the first transform core group.

[0722] In the embodiment of the present application, there is a correspondence between the intra prediction mode and the transform core group. Based on this, after determining the intra prediction mode corresponding to the prediction block, the encoder obtains the preset correspondence between the intra prediction mode and the transform core group.

[0723] In an example, the correspondence between the intra prediction modes and the transform kernel groups is shown in Table 16.

[0724] It should be noted that the above Table 16 is only a correspondence between an intra-frame prediction mode and a transform core group involved in an embodiment of the present application. The correspondence between the intra-frame prediction mode and the transform core group in the embodiment of the present application includes but is not limited to that shown in Table 16.

[0725] Each transformation core group includes at least one type of transformation core.

[0726] After obtaining the correspondence between intra-frame prediction modes and transform kernel groups shown in Table 16, the encoder searches the correspondence between intra-frame prediction modes and transform kernel groups based on the intra-frame prediction mode corresponding to the prediction block, and records this transform kernel group as the first transform kernel group. For example, if the intra-frame prediction mode corresponding to the prediction block is an angular prediction mode in the 64-angle direction, searching Table 16 shows that the transform kernel group corresponding to the 64-angle prediction mode is 4. In this way, the encoder determines the transform kernel corresponding to the current block from the at least one type of transform kernel included in transform kernel group 4.

[0727] For example, if the first transform core group includes one transform core, the transform core is determined as the transform core corresponding to the current block.

[0728] For another example, if the first transform core group includes transform cores of multiple categories, the encoder determines the transform core category corresponding to the current block, and then determines the transform core of the transform core category in the first transform core group as the transform core corresponding to the current block.

[0729] The methods for the encoder to determine the transform kernel type corresponding to the current block include but are not limited to the following:

[0730] In one example, the transform kernel category corresponding to the current block is a default category, so the encoder determines the default category as the transform kernel category corresponding to the current block.

[0731] In another example, the encoder writes the transform kernel type corresponding to the current block into the bitstream, so that the encoder obtains the transform kernel type corresponding to the current block by encoding the bitstream.

[0732] As can be seen from the above, in an embodiment of the present application, the encoding end uses an interpolation filter prediction mode to determine the prediction block of the current block, and then determines the traditional intra-frame prediction mode corresponding to the prediction block, and based on the traditional intra-frame prediction mode corresponding to the prediction block, determines the transform kernel corresponding to the current block. That is to say, the embodiment of the present application is based on the traditional intra-frame prediction mode derived from the interpolation filter prediction, and is used for the selection of transform kernel groups of the non-separable primary transform (NSPT) and the non-separable secondary transform (LFNST), so that the determined transform kernel is more consistent with the characteristics of the current block, and the accuracy of determining the transform kernel is improved. When the accurately determined transform kernel is used to determine the reconstruction value of the current block, the accuracy of determining the reconstruction value can be improved, and the encoding accuracy of the current block can be improved. In addition, when the embodiment of the present application determines the transform kernel of the current block through the traditional prediction mode corresponding to the prediction block, there is no need to indicate the transform kernel separately, which saves codewords and further improves the video encoding effect.

[0733] After the encoder determines the transform kernel corresponding to the current block based on the above steps, it executes the following step S203.

[0734] S203 , transforming the residual block of the current block based on the transformation kernel corresponding to the current block to obtain the transformation coefficient of the current block, and encoding based on the deformation coefficient of the current block to obtain a bitstream.

[0735] In an embodiment of the present application, the encoder determines the prediction block of the current block and the transform kernel corresponding to the current block based on the above steps. In this way, the encoder can obtain the residual block of the current block based on the prediction block of the current block and the current block, for example, by subtracting the current block from the prediction block of the current block to obtain the residual block of the current block. Next, the residual block of the current block is transformed based on the above-determined transform kernel to obtain the transform coefficients of the current block. Next, the transform coefficients are directly encoded to obtain a bitstream. Alternatively, the transform coefficients are quantized to obtain quantized coefficients, and the quantized coefficients are encoded to obtain a bitstream.

[0736] In some embodiments, the above-mentioned current block is a bright color block or a chroma block, that is, in the embodiment of the present application, the interpolation filtering prediction mode provided by the embodiment of the present application can be used to predict both the luminance block and the chroma block.

[0737] In some embodiments, if the current block is a luminance block, the prediction mode of the current block is an interpolation filtering prediction mode, and the chrominance block corresponding to the current block adopts a direct derivation mode DM, then the PLANAR mode or the intra-frame prediction mode corresponding to the above prediction block is determined as the prediction mode of the chrominance block.

[0738] The effect of the interpolation filtering prediction mode proposed in the embodiment of the present application is tested through experiments below.

[0739] In one example, using the reference region types shown in FIG13A to FIG13C and 3×5=15 filter coefficient combinations determined by the five interpolation filter shapes shown in FIG15 , and under the All Intra Main test condition, when compressing different videos, the compression effects are shown in Table 17:

[0740] Table 17

[0741] As shown in Table 17, using the reference area types shown in Figures 13A to 13C and the five interpolation filter shapes shown in Figure 15, under general test conditions, when compressing different types of test data, the objective compression effect of the Y / U / V components is improved by 0.26% / 0.20% / 0.17%, respectively.

[0742] In one example, using the reference region types shown in FIG13A to FIG13C and 3×7=21 filter coefficient combinations determined by the seven interpolation filter shapes shown in FIG14A to FIG14G , and under the All Intra Main test condition, when compressing different videos, the compression effects are shown in Table 18:

[0743] Table 18

[0744] As shown in Table 18, using the reference area types shown in Figures 13A to 13C and the seven shapes of interpolation filters shown in Figures 14A to 14G, under general test conditions, when compressing different types of test data, the objective compression effect of the Y / U / V components is improved by 0.26% / 0.19% / 0.19% respectively.

[0745] In one example, using the reference region types shown in FIG. 13A to FIG. 13C and the interpolation filter of one shape shown in FIG. 14A , 3x1=3 filter coefficient combinations are determined. Under the All Intra Main test condition, when compressing different videos, the compression effects are shown in Table 19:

[0746] Table 19

[0747] As shown in Table 19, using the reference area types shown in Figures 13A to 13C and one shape of interpolation filter shown in Figure 14A, under general test conditions, when compressing different types of test data, the objective compression effect of the Y / U / V components is improved by 0.13% / 0.11% / 0.02%, respectively.

[0748] In one example, using the reference region types shown in FIG13A to FIG13C and 3×3=9 filter coefficient combinations determined by the three interpolation filter shapes shown in FIG17 , and under the All Intra Main test condition, when compressing different videos, the compression effects are shown in Table 20:

[0749] Table 20

[0750] As shown in Table 20, using the reference area types shown in Figures 13A to 13C and the three interpolation filter shapes shown in Figure 17, under general test conditions, when compressing different types of test data, the objective compression effect of the Y / U / V components is improved by 0.23% / 0.20% / 0.15%, respectively.

[0751] In one example, using the reference region types shown in FIG13A to FIG13C and 3×3=9 filter coefficient combinations determined by the three interpolation filter shapes shown in FIG18 , and under the All Intra Main test condition, when compressing different videos, the compression effects are shown in Table 21:

[0752] Table 21

[0753] As shown in Table 21, using the reference area types shown in Figures 13A to 13C and the three interpolation filter shapes shown in Figure 18, under general test conditions, when compressing different types of test data, the objective compression effect of the Y / U / V components is improved by 0.25% / 0.18% / 0.18% respectively.

[0754] In one example, using the reference region types shown in FIG13A to FIG13C and 3×3=9 filter coefficient combinations determined by the three interpolation filter shapes shown in FIG19 , and under the All Intra Main test condition, when compressing different videos, the compression effects are shown in Table 22:

[0755] Table 22

[0756] As shown in Table 22, using the reference area types shown in Figures 13A to 13C and the three interpolation filter shapes shown in Figure 19, under general test conditions, when compressing different types of test data, the objective compression effect of the Y / U / V components is improved by 0.19% / 0.15% / 0.14% respectively.

[0757] The video encoding method provided in the embodiment of the present application, when predicting the current block, first determines the reference area and interpolation filter of the current block, and determines the prediction block of the current block based on the reference area and interpolation filter. Next, the prediction mode corresponding to the prediction block is determined, and then the residual block of the current block is transformed based on the transform kernel corresponding to the current block to obtain the transform coefficients of the current block, and then encoded based on the deformation coefficients of the current block to obtain a bitstream. That is, in the embodiment of the present application, if the current block is predicted using the interpolation filter prediction method, by determining the traditional prediction mode corresponding to the prediction block, the transform kernel corresponding to the current block is determined, so that the determined transform kernel is more consistent with the characteristics of the current block, thereby improving the accuracy of determining the transform kernel. When the accurately determined transform kernel is used to determine the reconstruction value of the current block, the accuracy of determining the reconstruction value can be improved, thereby improving the encoding accuracy of the current block. In addition, the embodiment of the present application determines the transform kernel of the current block through the traditional prediction mode corresponding to the prediction block, without the need to separately indicate the transform kernel, saving codewords and further improving the video encoding effect.

[0758] It should be understood that Figures 10 to 26 are merely examples of the present application and should not be understood as limiting the present application.

[0759] 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.

[0760] 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.

[0761] The above describes in detail the method embodiment of the present application in conjunction with Figures 10 to 27, and the following describes in detail the device embodiment of the present application in conjunction with Figures 28 to 30.

[0762] FIG28 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.

[0763] As shown in FIG28 , the video decoding apparatus 10 includes:

[0764] A prediction unit 11 is configured to determine a reference area and an interpolation filter of a current block, and determine a prediction block of the current block based on the reference area and the interpolation filter;

[0765] a transform unit 12, configured to determine an intra-frame prediction mode corresponding to the prediction block, and determine a transform kernel corresponding to the current block based on the intra-frame prediction mode corresponding to the prediction block;

[0766] The decoding unit 13 is configured to perform an inverse transform on the transform coefficients of the current block based on the transform kernel corresponding to the current block to obtain a residual block of the current block, and obtain a reconstructed block of the current block based on the prediction block and the residual block of the current block.

[0767] In some embodiments, the transform unit 12 is specifically configured to determine angle values ​​of M points in the prediction block, where M is a positive integer; and determine an intra-frame prediction mode corresponding to the prediction block based on the angle values ​​of the M points.

[0768] In some embodiments, the transformation unit 12 is specifically used to determine the horizontal gradient and vertical gradient of the i-th point among the M points, where i is a positive integer less than or equal to M; and determine the angle value of the i-th point based on the horizontal gradient and vertical gradient of the i-th point.

[0769] In some embodiments, the transformation unit 12 is specifically used to determine, in the prediction block, a prediction value of a point within a sliding window centered on the i-th point; and obtain the horizontal gradient and vertical gradient of the i-th point based on the prediction value of the point within the sliding window and a horizontal gradient operator and a vertical gradient operator.

[0770] In some embodiments, the transformation unit 12 is specifically used to determine the horizontal gradient of the i-th point by multiplying the predicted value of the point in the sliding window by the horizontal gradient operator; and to determine the vertical gradient of the i-th point by multiplying the predicted value of the point in the sliding window by the vertical gradient operator.

[0771] In some embodiments, the transformation unit 12 is specifically configured to determine an arc tangent value of a ratio of a vertical gradient to a horizontal gradient at the i-th point as an angle value corresponding to the i-th point.

[0772] In some embodiments, the transformation unit 12 is specifically configured to determine the intra-frame prediction mode corresponding to the M points based on the angle values ​​of the M points; and determine the intra-frame prediction mode corresponding to the prediction block based on the intra-frame prediction mode corresponding to the M points.

[0773] In some embodiments, the transformation unit 12 is specifically used to determine the gradient amplitude values ​​corresponding to the M points based on the horizontal gradients and vertical gradients of the M points; and determine the intra-frame prediction mode corresponding to the prediction block based on the intra-frame prediction mode and gradient amplitude values ​​corresponding to the M points.

[0774] In some embodiments, the transform unit 12 is specifically configured to add the absolute value of the horizontal gradient and the absolute value of the vertical gradient of the i-th point to obtain the gradient amplitude value corresponding to the i-th point.

[0775] In some embodiments, the transformation unit 12 is specifically used to accumulate the gradient amplitude value corresponding to any point among the M points on the intra-frame prediction mode corresponding to the point to obtain the accumulated gradient amplitude value of the intra-frame prediction mode corresponding to the M points; and determine the intra-frame prediction mode with the largest accumulated gradient amplitude value among the intra-frame prediction modes corresponding to the M points as the intra-frame prediction mode corresponding to the prediction block.

[0776] In some embodiments, the transform unit 12 is further configured to, if the gradient amplitude values ​​corresponding to the M points are all 0, determine the first intra-frame prediction mode as the intra-frame prediction mode corresponding to the prediction block.

[0777] Optionally, the first intra-frame prediction mode is a PLANAR mode.

[0778] In some embodiments, the transformation unit 12 is specifically used to obtain a correspondence between an intra-frame prediction mode and a transformation core group, where one transformation core group includes at least one type of transformation core; in the correspondence, the first transformation core group corresponding to the intra-frame prediction mode of the prediction block is searched; and from the first transformation core group, the transformation core corresponding to the current block is determined.

[0779] In some embodiments, the transform unit 12 is specifically configured to determine a transform kernel category corresponding to the current block; and determine a transform kernel of the transform kernel category in the first transform kernel group as the transform kernel corresponding to the current block.

[0780] In some embodiments, the transform unit 12 is specifically configured to decode the bitstream to obtain a transform kernel category corresponding to the current block.

[0781] In some embodiments, the prediction unit 11 is specifically used to decode the code stream to obtain first information, where the first information is used to indicate the type of the reference area of ​​the current block; based on the type of the reference area, the reference area of ​​the current block is determined in preset P reference areas, where P is a positive integer greater than 1.

[0782] In some embodiments, the prediction unit 11 is specifically configured to determine a reference area of ​​the current block from among P preset reference areas based on the shape of the current block, where P is a positive integer greater than 1.

[0783] In a game embodiment, the P reference areas include at least one of a first reference area, a second reference area and a third reference area, the first reference area includes the reconstruction areas above, to the upper right, to the left, to the upper left and to the upper left of the current block, the second reference area includes the reconstruction areas above, to the upper right and to the upper left of the current block, and the third reference area includes the reconstruction areas to the left, to the upper left and to the upper left of the current block.

[0784] In some embodiments, the prediction unit 11 is specifically used to decode the code stream to obtain second information, where the second information is used to indicate the shape of the interpolation filter of the current block; based on the shape of the interpolation filter, the interpolation filter of the current block is determined among the preset Q interpolation filters, where Q is a positive integer greater than 1.

[0785] In some embodiments, the prediction unit 11 is specifically configured to determine an interpolation filter for the current block from among Q preset interpolation filters based on the shape of the current block, where Q is a positive integer greater than 1.

[0786] In some embodiments, the Q interpolation filters include at least one of a first interpolation filter, a second interpolation filter, and a third interpolation filter, the first interpolation filter is a square interpolation filter, the second interpolation filter is a rectangular interpolation filter with a width greater than a height, and the third interpolation filter is a rectangular interpolation filter with a height greater than a width.

[0787] In some embodiments, the prediction unit 11 is further configured to adopt a truncated binary code decoding method to decode the code stream to obtain the first information and / or the second information.

[0788] In some embodiments, before determining the reference area and interpolation filter of the current block, the prediction unit 11 is further used to decode the code stream to obtain third information, where the third information is used to indicate whether the current block is predicted using the interpolation filtering prediction mode; if, based on the third information, it is determined that the current block is predicted using the interpolation filtering prediction mode, the reference area and interpolation filter of the current block are determined.

[0789] In some embodiments, before decoding the code stream and obtaining the third information, the prediction unit 11 is further configured to determine whether the position of the current block in the current image meets a preset position requirement, and determine whether the size of the current block meets a preset block size requirement; if it is determined that the position of the current block in the current image meets the preset position requirement, and the size of the current block meets the preset block size requirement, the code stream is decoded to obtain the third information.

[0790] In some embodiments, the prediction unit 11 is further configured to determine that the current block is not predicted using the interpolation filtering prediction mode if the position of the current block in the current image does not meet the preset position requirement and / or the size of the current block does not meet the preset block size requirement.

[0791] In some embodiments, the prediction unit 11 is further used to decode the code stream to obtain fourth information before determining whether the position of the current block in the current image meets the preset position requirement and whether the size of the current block meets the preset block size. The fourth information is used to indicate whether the current sequence is allowed to be predicted using the interpolation filtering prediction mode; if the fourth information indicates that the current sequence is allowed to be predicted using the interpolation filtering prediction mode, then it is determined whether the position of the current block in the current image meets the preset position requirement and whether the size of the current block meets the preset block size.

[0792] In some embodiments, the prediction unit 11 determines a filter coefficient of the interpolation filter based on the reference area; and performs interpolation filtering prediction on the current block using the interpolation filter based on the filter coefficient to obtain a predicted block of the current block.

[0793] In some embodiments, the prediction unit 11 determines a first reconstruction area around the current block; determines a pixel average reconstruction value based on the reconstruction value of the first reconstruction area; de-averages the reconstruction values ​​of the pixel points in the reference area based on the pixel average reconstruction value; uses the de-averaged pixel values ​​of the pixel points in the reference area as input of the interpolation filter, slides the interpolation filter within the reference area, and obtains the filter coefficients of the interpolation filter.

[0794] In some embodiments, the prediction unit 11 determines the first reconstructed area based on the shape of the current block.

[0795] In some embodiments, the prediction unit 11, if the shape of the current block is a square, determines the reconstructed pixel area in one row above and one column to the left of the current block as the first reconstructed area; or, if the shape of the current block is a rectangle with a width greater than a height, determines the reconstructed pixel area in one row above the current block as the first reconstructed area; or, if the shape of the current block is a rectangle with a height greater than a width, determines the reconstructed pixel area in one column to the left of the current block as the first reconstructed area.

[0796] In some embodiments, the prediction unit 11 subtracts the pixel average reconstruction value from the reconstructed value of the pixel point in the reference area to obtain the pixel value of the pixel point in the reference area after removing the mean value.

[0797] In some embodiments, the prediction unit 11 determines, for the rth point in the current point, the pixel values ​​of the N positions corresponding to the rth point based on the shape of the interpolation filter, where r is a positive integer; de-averages the pixel values ​​of the N positions based on the pixel average reconstruction value to obtain the de-averaged pixel values ​​of the N positions; obtains the predicted value of the rth point based on the de-averaged pixel values ​​of the N positions and the filter coefficient; and obtains the predicted block of the current block based on the predicted value of the point in the current block.

[0798] In some embodiments, the prediction unit 11, for any one of the N positions, if the position is located in a reconstructed area around the current block, determines the reconstructed value of the position as the pixel value of the position; or, if the position is located within the current block, determines the predicted value of the position as the pixel value of the position.

[0799] In some embodiments, the prediction unit 11 subtracts the pixel average reconstruction value from the pixel values ​​of the N positions to obtain the pixel values ​​of the N positions after removing the average value.

[0800] In some embodiments, the prediction unit 11 determines a second reconstruction area around the current block, and determines a maximum reconstruction value and a minimum reconstruction value of the second reconstruction area; obtains a first prediction value based on the pixel values ​​after de-averaging the N positions, the filter coefficient and the pixel average reconstruction value; and determines the prediction value of the rth point based on the first prediction value, the maximum reconstruction value and the minimum reconstruction value.

[0801] In some embodiments, the prediction unit 11 multiplies the pixel values ​​after de-averaging the N positions by the filter coefficient to obtain a second prediction value of the r-th point; and adds the second prediction value and the pixel average reconstruction value to obtain the first prediction value.

[0802] In some embodiments, the prediction unit 11 determines the first prediction value as the prediction value of the r-th point if the first prediction value is greater than the minimum reconstruction value and less than the maximum reconstruction value.

[0803] In some embodiments, the prediction unit 11 determines the minimum reconstruction value as the prediction value of the r-th point if the first prediction value is less than or equal to the minimum reconstruction value.

[0804] In some embodiments, the prediction unit 11 determines the maximum reconstruction value as the prediction value of the r-th point if the first prediction value is greater than or equal to the maximum reconstruction value.

[0805] In some embodiments, the prediction unit 11 determines the reconstruction areas above, to the left, to the upper right, to the upper left, and to the lower left of the current block as the second reconstruction areas.

[0806] In some embodiments, if the current block is a luminance block and the prediction mode of the current block is an interpolation filtering prediction mode, the prediction unit 11 is further used to determine the PLANAR mode or the intra-frame prediction mode corresponding to the prediction block as the prediction mode of the chrominance block if the chrominance block corresponding to the current block adopts the direct derivation mode DM.

[0807] It should be understood that the device embodiment and the method embodiment can correspond to each other, and similar descriptions can refer to the method embodiment. To avoid repetition, no further description is given here. Specifically, the device 10 shown in Figure 28 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.

[0808] FIG29 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.

[0809] As shown in FIG. 29 , the video encoding apparatus 20 may include:

[0810] A prediction unit 21 is configured to determine a reference area and an interpolation filter of a current block, and determine a prediction block of the current block based on the reference area and the interpolation filter;

[0811] a transform unit 22, configured to determine an intra-frame prediction mode corresponding to the prediction block, and determine a transform kernel corresponding to the current block based on the intra-frame prediction mode corresponding to the prediction block;

[0812] The encoding unit 23 is configured to transform the residual block of the current block based on the transformation kernel corresponding to the current block to obtain the transformation coefficient of the current block, and perform encoding based on the deformation coefficient of the current block to obtain a code stream.

[0813] In some embodiments, the transform unit 22 is specifically configured to determine angle values ​​of M points in the prediction block, where M is a positive integer; and determine an intra-frame prediction mode corresponding to the prediction block based on the angle values ​​of the M points.

[0814] In some embodiments, the transformation unit 22 is specifically used to determine the horizontal gradient and vertical gradient of the i-th point among the M points, where i is a positive integer less than or equal to M; and determine the angle value of the i-th point based on the horizontal gradient and vertical gradient of the i-th point.

[0815] In some embodiments, the transformation unit 22 is specifically used to determine, in the prediction block, a prediction value of a point within a sliding window centered on the i-th point; and obtain the horizontal gradient and vertical gradient of the i-th point based on the prediction value of the point within the sliding window and a horizontal gradient operator and a vertical gradient operator.

[0816] In some embodiments, the transformation unit 22 is specifically used to determine the horizontal gradient of the i-th point by multiplying the predicted value of the point in the sliding window by the horizontal gradient operator; and to determine the vertical gradient of the i-th point by multiplying the predicted value of the point in the sliding window by the vertical gradient operator.

[0817] In some embodiments, the transformation unit 22 is specifically configured to determine the arc tangent value of the ratio of the vertical gradient to the horizontal gradient of the i-th point as the angle value corresponding to the i-th point.

[0818] In some embodiments, the transformation unit 22 is specifically configured to determine the intra-frame prediction mode corresponding to the M points based on the angle values ​​of the M points; and determine the intra-frame prediction mode corresponding to the prediction block based on the intra-frame prediction mode corresponding to the M points.

[0819] In some embodiments, the transformation unit 22 is specifically used to determine the gradient amplitude values ​​corresponding to the M points based on the horizontal gradients and vertical gradients of the M points; and determine the intra-frame prediction mode corresponding to the prediction block based on the intra-frame prediction mode and gradient amplitude values ​​corresponding to the M points.

[0820] In some embodiments, the transform unit 22 is specifically configured to add the absolute value of the horizontal gradient and the absolute value of the vertical gradient of the i-th point to obtain the gradient amplitude value corresponding to the i-th point.

[0821] In some embodiments, the transformation unit 22 is specifically used to accumulate the gradient amplitude value corresponding to any point among the M points on the intra-frame prediction mode corresponding to the point to obtain the accumulated gradient amplitude value of the intra-frame prediction mode corresponding to the M points; and determine the intra-frame prediction mode with the largest accumulated gradient amplitude value among the intra-frame prediction modes corresponding to the M points as the intra-frame prediction mode corresponding to the prediction block.

[0822] In some embodiments, the transform unit 22 is further configured to, if the gradient magnitude values ​​corresponding to the M points are all 0, determine the first intra-frame prediction mode as the intra-frame prediction mode corresponding to the prediction block.

[0823] Optionally, the first intra-frame prediction mode is a PLANAR mode.

[0824] In some embodiments, the transformation unit 22 is specifically used to obtain a correspondence between an intra-frame prediction mode and a transformation core group, where one transformation core group includes at least one type of transformation core; in the correspondence, the first transformation core group corresponding to the intra-frame prediction mode of the prediction block is searched; and from the first transformation core group, the transformation core corresponding to the current block is determined.

[0825] In some embodiments, the transform unit 22 is specifically configured to determine a transform kernel category corresponding to the current block; and determine a transform kernel of the transform kernel category in the first transform kernel group as the transform kernel corresponding to the current block.

[0826] In some embodiments, the encoding unit 23 is further configured to write the transform kernel category corresponding to the current block into the bitstream.

[0827] In some embodiments, the prediction unit 21 is specifically configured to determine a reference area of ​​the current block from among P preset reference areas, where P is a positive integer greater than 1.

[0828] In some embodiments, the prediction unit 21 is specifically used to determine a first cost when predicting the current block based on the P reference areas respectively; and determine the reference area with the smallest first cost among the P reference areas as the reference area of ​​the current block.

[0829] In some embodiments, the encoding unit 23 is further configured to write first information into the bitstream, where the first information is used to indicate a type of the reference region of the current block.

[0830] In some embodiments, the prediction unit 21 is specifically configured to determine a reference area of ​​the current block from among P preset reference areas based on the shape of the current block, where P is a positive integer greater than 1.

[0831] In some embodiments, the P reference areas include at least one of a first reference area, a second reference area, and a third reference area, the first reference area includes the reconstruction areas above, to the upper right, to the left, to the upper left, and to the upper left of the current block, the second reference area includes the reconstruction areas above, to the upper right, and to the upper left of the current block, and the third reference area includes the reconstruction areas to the left, to the upper left, and to the upper left of the current block.

[0832] In some embodiments, the prediction unit 21 is specifically configured to determine an interpolation filter for the current block from among Q preset interpolation filters, where Q is a positive integer greater than 1.

[0833] In some embodiments, the prediction unit 21 is specifically used to determine the second cost when using the Q interpolation filters to predict the current block respectively; and determine the interpolation filter with the smallest second cost among the Q interpolation filters as the interpolation filter of the current block.

[0834] In some embodiments, the encoding unit 23 is further configured to write second information into the bitstream, where the second information is used to indicate a shape of the interpolation filter of the current block.

[0835] In some embodiments, the prediction unit 21 is specifically configured to determine an interpolation filter for the current block from among Q preset interpolation filters based on the shape of the current block, where Q is a positive integer greater than 1.

[0836] In some embodiments, the Q interpolation filters include at least one of a first interpolation filter, a second interpolation filter, and a third interpolation filter, the first interpolation filter is a square interpolation filter, the second interpolation filter is a rectangular interpolation filter with a width greater than a height, and the third interpolation filter is a rectangular interpolation filter with a height greater than a width.

[0837] In some embodiments, the encoding unit 23 is further configured to write the first information and / or the second information into the code stream by using a truncated binary code encoding method.

[0838] In some embodiments, before determining the reference area and interpolation filter of the current block, the prediction unit 21 is also used to determine the prediction mode of the current block from multiple candidate prediction modes, and the multiple candidate prediction modes include an interpolation filtering prediction mode; if the prediction mode of the current block is predicted by the interpolation filtering prediction mode, the reference area and interpolation filter of the current block are determined.

[0839] In some embodiments, before determining the prediction mode of the current block from multiple candidate prediction modes, the prediction unit 21 is also used to determine whether the position of the current block in the current image meets the preset position requirement, and determine whether the size of the current block meets the preset block size requirement; if the position of the current block in the current image meets the preset position requirement, and the size of the current block meets the preset block size requirement, then the prediction mode of the current block is determined from the multiple candidate prediction modes.

[0840] In some embodiments, the prediction unit 21 is further used to determine that the current block is not predicted using the interpolation filtering prediction mode if the position of the current block in the current image does not meet the preset position requirement, and / or the size of the current block meets the preset block size requirement.

[0841] In some embodiments, the prediction unit 21, before determining whether the position of the current block in the current image meets the preset position requirement and determining whether the size of the current block meets the preset block size requirement, is further used to determine whether the current sequence allows the use of the interpolation filtering prediction mode for prediction; if the current sequence allows the use of the interpolation filtering prediction mode for prediction, then determine whether the position of the current block in the current image meets the preset position requirement and determine whether the size of the current block meets the preset block size.

[0842] In some embodiments, the encoding unit 23 is further configured to write third information into the bitstream, where the third information is used to indicate whether the current block is predicted using the interpolation filtering prediction mode.

[0843] In some embodiments, the encoding unit 23 is further configured to write fourth information into the bitstream, where the fourth information is used to indicate whether the current sequence is allowed to be predicted using the interpolation filtering prediction mode.

[0844] In some embodiments, the prediction unit 21 is specifically configured to determine a filter coefficient of the interpolation filter based on the reference area; and based on the filter coefficient, use the interpolation filter to perform interpolation filtering prediction on the current block to obtain a predicted block of the current block.

[0845] In some embodiments, the prediction unit 21 is specifically used to determine a first reconstruction area around the current block; determine a pixel average reconstruction value based on the reconstruction value of the first reconstruction area; de-average the reconstruction values ​​of the pixel points in the reference area based on the pixel average reconstruction value; use the de-averaged pixel values ​​of the pixel points in the reference area as the input of the interpolation filter, slide the interpolation filter within the reference area, and obtain the filter coefficients of the interpolation filter.

[0846] In some embodiments, the prediction unit 21 is specifically configured to determine the first reconstructed area based on the shape of the current block.

[0847] In some embodiments, the prediction unit 21 is specifically configured to, if the shape of the current block is a square, determine the reconstructed pixel area in a row above and a column to the left of the current block as the first reconstructed area; or, if the shape of the current block is a rectangle with a width greater than a height, determine the reconstructed pixel area in a row above the current block as the first reconstructed area; or, if the shape of the current block is a rectangle with a height greater than a width, determine the reconstructed pixel area in a column to the left of the current block as the first reconstructed area.

[0848] In some embodiments, the prediction unit 21 is specifically configured to subtract the pixel average reconstruction value from the reconstructed value of the pixel point in the reference area to obtain the pixel value of the pixel point in the reference area after removing the mean value.

[0849] In some embodiments, the prediction unit 21 is specifically used to determine, for the rth point in the current point, the pixel values ​​of the N positions corresponding to the rth point based on the shape of the interpolation filter, where r is a positive integer; de-average the pixel values ​​of the N positions based on the pixel average reconstruction value to obtain the de-averaged pixel values ​​of the N positions; obtain the predicted value of the rth point based on the de-averaged pixel values ​​of the N positions and the filter coefficient; and obtain the predicted block of the current block based on the predicted value of the point in the current block.

[0850] In some embodiments, the prediction unit 21 is specifically used to determine, for any one of the N positions, the reconstructed value of the position as the pixel value of the position if the position is located in the reconstructed area around the current block; or, if the position is located within the current block, the predicted value of the position as the pixel value of the position.

[0851] In some embodiments, the prediction unit 21 is specifically configured to subtract the pixel average reconstruction value from the pixel values ​​of the N positions to obtain the pixel values ​​of the N positions after removing the average value.

[0852] In some embodiments, the prediction unit 21 is specifically used to determine a second reconstruction area around the current block, and determine the maximum reconstruction value and the minimum reconstruction value of the second reconstruction area; obtain a first prediction value based on the pixel values ​​after de-averaging the N positions, the filter coefficient and the pixel average reconstruction value; and determine the prediction value of the rth point based on the first prediction value, the maximum reconstruction value and the minimum reconstruction value.

[0853] In some embodiments, the prediction unit 21 is specifically used to multiply the pixel values ​​after de-averaging the N positions and the filter coefficient to obtain the second prediction value of the rth point; and add the second prediction value and the pixel average reconstruction value to obtain the first prediction value.

[0854] In some embodiments, the prediction unit 21 is specifically configured to determine the first prediction value as the prediction value of the r th point if the first prediction value is greater than the minimum reconstruction value and less than the maximum reconstruction value.

[0855] In some embodiments, the prediction unit 21 is specifically configured to determine the minimum reconstruction value as the prediction value of the r-th point if the first prediction value is less than or equal to the minimum reconstruction value.

[0856] In some embodiments, the prediction unit 21 is specifically configured to determine the maximum reconstruction value as the prediction value of the r-th point if the first prediction value is greater than or equal to the maximum reconstruction value.

[0857] In some embodiments, the prediction unit 21 is specifically configured to determine the reconstruction areas above, to the left, to the upper right, to the upper left, and to the lower left of the current block as the second reconstruction area.

[0858] In some embodiments, if the current block is a luminance block and the prediction mode of the current block is an interpolation filtering prediction mode, the prediction unit 21 is further used to determine the PLANAR mode or the intra-frame prediction mode corresponding to the prediction block as the prediction mode of the chrominance block if the chrominance block corresponding to the current block adopts the direct derivation mode DM.

[0859] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, no further details are given here. Specifically, the device 20 shown in Figure 29 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, no further details are given here.

[0860] 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.

[0861] Figure 30 is a schematic block diagram of an electronic device provided in an embodiment of the present application.

[0862] As shown in FIG30 , 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:

[0863] 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.

[0864] 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 .

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

[0866] 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.

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

[0868] 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).

[0869] 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.

[0870] As shown in FIG30 , the electronic device 30 may further include:

[0871] The transceiver 33 may be connected to the processor 32 or the memory 33 .

[0872] 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.

[0873] 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.

[0874] Figure 31 is a schematic block diagram of a video encoding and decoding system provided in an embodiment of the present application.

[0875] As shown in Figure 31, 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.

[0876] 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.

[0877] The present application also provides a code stream, which is generated according to the above encoding method.

[0878] 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)).

[0879] 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.

[0880] 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.

[0881] 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.

[0882] 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 reference area and an interpolation filter of a current block, and determining a prediction block of the current block based on the reference area and the interpolation filter; Determining an intra-frame prediction mode corresponding to the prediction block, and determining a transform kernel corresponding to the current block based on the intra-frame prediction mode corresponding to the prediction block; The transform coefficients of the current block are inversely transformed based on the transform kernel corresponding to the current block to obtain a residual block of the current block, and a reconstructed block of the current block is obtained based on the prediction block and the residual block of the current block.

2. The method according to claim 1, characterized in that: The determining the intra prediction mode corresponding to the prediction block includes: Determine the angle values ​​of M points in the prediction block, where M is a positive integer; Based on the angle values ​​of the M points, an intra-frame prediction mode corresponding to the prediction block is determined.

3. The method according to claim 2, characterized in that The determining the angle values ​​of the M points in the prediction block comprises: For the i-th point among the M points, determine the horizontal gradient and the vertical gradient of the i-th point, where i is a positive integer less than or equal to M; Based on the horizontal gradient and the vertical gradient of the i-th point, an angle value of the i-th point is determined.

4. The method according to claim 3, characterized in that The determining the horizontal gradient and the vertical gradient of the i-th point includes: In the prediction block, determining the prediction value of a point within a sliding window centered at the i-th point; Based on the predicted value of the point in the sliding window and the horizontal gradient operator, as well as the vertical gradient operator, the horizontal gradient and the vertical gradient of the i-th point are obtained.

5. The method according to claim 4, characterized in that The step of obtaining the horizontal gradient and the vertical gradient of the i-th point based on the predicted value of the point in the sliding window and the horizontal gradient operator and the vertical gradient operator comprises: Determine the product of the predicted value of the point in the sliding window and the horizontal gradient operator as the horizontal gradient of the i-th point; The product of the predicted value of the point in the sliding window and the vertical gradient operator is determined as the vertical gradient of the i-th point.

6. The method according to claim 3, characterized in that The determining the angle value corresponding to the i-th point based on the horizontal gradient and the vertical gradient of the i-th point includes: The arc tangent value of the ratio of the vertical gradient to the horizontal gradient of the i-th point is determined as the angle value corresponding to the i-th point.

7. The method according to claim 3, characterized in that The determining, based on the angle values ​​of the M points, the intra-frame prediction mode corresponding to the prediction block includes: Determining, based on the angle values ​​of the M points, an intra-frame prediction mode corresponding to the M points; Based on the intra-frame prediction modes corresponding to the M points, the intra-frame prediction mode corresponding to the prediction block is determined.

8. The method according to claim 7, characterized in that The determining, based on the intra-frame prediction modes corresponding to the M points, the intra-frame prediction mode corresponding to the prediction block comprises: Determine the gradient amplitude values ​​corresponding to the M points based on the horizontal gradients and the vertical gradients of the M points; Based on the intra-frame prediction modes and gradient magnitude values ​​corresponding to the M points, the intra-frame prediction mode corresponding to the prediction block is determined.

9. The method according to claim 8, characterized in that The determining the gradient amplitude values ​​corresponding to the M points based on the horizontal gradients and the vertical gradients of the M points includes: The absolute value of the horizontal gradient and the absolute value of the vertical gradient of the i-th point are added to obtain the gradient amplitude value corresponding to the i-th point.

10. The method according to claim 8, characterized in that The determining, based on the intra-frame prediction modes and gradient amplitude values ​​corresponding to the M points, the intra-frame prediction mode corresponding to the prediction block comprises: For any point among the M points, accumulating the gradient amplitude value corresponding to the point on the intra-frame prediction mode corresponding to the point to obtain the accumulated gradient amplitude value of the intra-frame prediction mode corresponding to the M points; The intra-frame prediction mode with the largest accumulated gradient amplitude value among the intra-frame prediction modes corresponding to the M points is determined as the intra-frame prediction mode corresponding to the prediction block.

11. The method according to claim 8, characterized in that The method further comprises: If the gradient amplitude values ​​corresponding to the M points are all 0, the first intra-frame prediction mode is determined as the intra-frame prediction mode corresponding to the prediction block.

12. The method according to claim 11, characterized in that The first intra-frame prediction mode is the PLANAR mode.

13. The method according to any one of claims 1 to 12, characterized in that: The determining, based on the intra prediction mode corresponding to the prediction block, a transform kernel corresponding to the current block comprises: Acquire a correspondence between an intra-frame prediction mode and a transform core group, wherein one transform core group includes at least one type of transform core; In the corresponding relationship, searching for a first transform core group corresponding to the intra prediction mode of the prediction block; A transform core corresponding to the current block is determined from the first transform core group.

14. The method according to claim 13, characterized in that The step of determining the transform core corresponding to the current block from the first transform core group includes: Determining a transform kernel category corresponding to the current block; A transform core of the transform core category in the first transform core group is determined as a transform core corresponding to the current block.

15. The method according to claim 14, characterized in that The determining of the transform kernel category corresponding to the current block includes: The code stream is decoded to obtain a transform kernel category corresponding to the current block.

16. The method according to claim 1, characterized in that The determining of the reference area of ​​the current block includes: Decoding a bitstream to obtain first information, where the first information is used to indicate a type of a reference area of ​​the current block; Based on the type of the reference area, a reference area of ​​the current block is determined in preset P reference areas, where P is a positive integer greater than 1.

17. The method according to claim 1, characterized in that The determining of the reference area of ​​the current block includes: Based on the shape of the current block, a reference area of ​​the current block is determined in preset P reference areas, where P is a positive integer greater than 1.

18. The method according to claim 16 or 17, characterized in that The P reference areas include at least one of a first reference area, a second reference area and a third reference area, the first reference area includes reconstruction areas above, to the upper right, to the left, to the upper left and to the upper left of the current block, the second reference area includes reconstruction areas above, to the upper right and to the upper left of the current block, and the third reference area includes reconstruction areas to the left, to the upper left and to the upper left of the current block.

19. The method according to claim 1, characterized in that The determining of the interpolation filter of the current block comprises: Decoding a bitstream to obtain second information, where the second information is used to indicate a shape of an interpolation filter of the current block; Based on the shape of the interpolation filter, an interpolation filter of the current block is determined from among preset Q interpolation filters, where Q is a positive integer greater than 1.

20. The method according to claim 1, characterized in that The determining of the interpolation filter of the current block comprises: Based on the shape of the current block, an interpolation filter of the current block is determined from among Q preset interpolation filters, where Q is a positive integer greater than 1.

21. The method according to claim 19 or 20, characterized in that The Q interpolation filters include at least one of a first interpolation filter, a second interpolation filter and a third interpolation filter, the first interpolation filter is a square interpolation filter, the second interpolation filter is a rectangular interpolation filter with a width greater than a height, and the third interpolation filter is a rectangular interpolation filter with a height greater than a width.

22. The method according to claim 16 or 19, characterized in that The method further comprises: The first information and / or the second information is obtained by decoding the code stream using a truncated binary code decoding method.

23. The method according to claim 1, characterized in that Before determining the reference area and the interpolation filter of the current block, the method further includes: Decoding the bitstream to obtain third information, where the third information is used to indicate whether the current block is predicted using an interpolation filtering prediction mode; The determining of the reference area and the interpolation filter of the current block comprises: If it is determined based on the third information that the current block is predicted using the interpolation filtering prediction mode, a reference area and an interpolation filter of the current block are determined.

24. The method according to claim 23, characterized in that Before decoding the code stream to obtain the third information, the method further includes: Determining whether the position of the current block in the current image meets a preset position requirement, and determining whether the size of the current block meets a preset block size requirement; The decoding bit stream to obtain the third information includes: If it is determined that the position of the current block in the current image meets the preset position requirement, and the size of the current block meets the preset block size requirement, the bitstream is decoded to obtain the third information.

25. The method according to claim 24, characterized in that The method further comprises: If the position of the current block in the current image does not meet the preset position requirement, and / or the size of the current block does not meet the preset block size requirement, it is determined that the current block is not predicted using the interpolation filtering prediction mode.

26. The method according to claim 24, characterized in that Before determining whether the position of the current block in the current image meets the preset position requirement and determining whether the size of the current block meets the preset block size, the method further includes: Decoding the bit stream to obtain fourth information, where the fourth information is used to indicate whether the current sequence is allowed to be predicted using the interpolation filtering prediction mode; The determining whether the position of the current block in the current image meets a preset position requirement, and determining whether the size of the current block meets a preset block size, includes: If the fourth information indicates that the current sequence is allowed to be predicted using the interpolation filtering prediction mode, it is determined whether the position of the current block in the current image meets the preset position requirement, and whether the size of the current block meets the preset block size.

27. The method according to claim 1, characterized in that The determining, based on the reference area and the interpolation filter, a prediction block of the current block comprises: Based on the reference area, determining a filter coefficient of the interpolation filter; Based on the filter coefficient, the interpolation filter is used to perform interpolation filtering prediction on the current block to obtain a prediction block of the current block.

28. The method according to claim 27, characterized in that The determining, based on the reference area, a filter coefficient of the interpolation filter comprises: Determining a first reconstruction area around the current block; Determining a pixel average reconstruction value based on the reconstruction value of the first reconstruction area; Based on the pixel average reconstruction value, de-averaging the reconstruction values ​​of the pixel points in the reference area; The pixel values ​​of the pixels in the reference area after averaging are used as the input of the interpolation filter, and the interpolation filter is slid in the reference area to obtain the filter coefficients of the interpolation filter.

29. The method according to claim 28, characterized in that The determining a first reconstruction area around the current block comprises: Based on the shape of the current block, the first reconstruction area is determined.

30. The method according to claim 29, characterized in that The determining the first reconstruction area based on the shape of the current block includes: If the shape of the current block is a square, a reconstructed pixel area in an upper row and a left column of the current block is determined as the first reconstructed area; or, If the shape of the current block is a rectangle with a width greater than a height, a row of reconstructed pixel areas above the current block is determined as the first reconstructed area; or, If the shape of the current block is a rectangle with a height greater than a width, a left column of reconstructed pixel regions of the current block is determined as the first reconstructed region.

31. The method according to claim 28, characterized in that The step of removing the average of the reconstructed values ​​of the pixels in the reference area based on the pixel average reconstruction value comprises: The pixel average reconstruction value is subtracted from the reconstructed value of the pixel point in the reference area to obtain the pixel value of the pixel point in the reference area after the average value is removed.

32. The method according to claim 28, characterized in that Based on the filter coefficient, using the interpolation filter to perform interpolation filtering prediction on the current block to obtain a prediction block of the current block, including: For an r-th point in the current point, based on the shape of the interpolation filter, determine the pixel values ​​of N positions corresponding to the r-th point, where r is a positive integer; De-averaging the pixel values ​​at the N positions based on the pixel average reconstruction value to obtain the de-averaged pixel values ​​at the N positions; Obtaining a predicted value of the r-th point based on the pixel values ​​of the N positions after averaging and the filter coefficient; Based on the prediction value of the midpoint of the current block, a prediction block of the current block is obtained.

33. The method according to claim 32, characterized in that The determining pixel values ​​of N positions corresponding to the r-th point includes: For any position among the N positions, if the position is located in a reconstructed area around the current block, the reconstructed value of the position is determined as the pixel value of the position; or, if the position is located within the current block, the predicted value of the position is determined as the pixel value of the position.

34. The method according to claim 32, characterized in that The step of removing the mean value of the pixel values ​​at the N positions based on the pixel average reconstruction value to obtain the pixel values ​​after removing the mean value at the N positions includes: The pixel values ​​at the N positions are subtracted from the pixel average reconstruction value to obtain the pixel values ​​at the N positions after the average value is removed.

35. The method according to claim 32, characterized in that The step of obtaining the predicted value of the r-th point based on the pixel values ​​after averaging the N positions and the filter coefficient comprises: Determine a second reconstruction area around the current block, and determine a maximum reconstruction value and a minimum reconstruction value of the second reconstruction area; Obtaining a first prediction value based on the pixel values ​​after averaging the N positions, the filter coefficient, and the pixel average reconstruction value; A prediction value of the r th point is determined based on the first prediction value, the maximum reconstruction value and the minimum reconstruction value.

36. The method according to claim 35, characterized in that The obtaining of a first prediction value based on the pixel values ​​after averaging the N positions, the filter coefficient and the pixel average reconstruction value comprises: Multiplying the pixel values ​​after removing the mean of the N positions by the filter coefficient to obtain a second predicted value of the r-th point; The second predicted value and the pixel average reconstruction value are added to obtain the first predicted value.

37. The method according to claim 35, characterized in that The determining the predicted value of the r-th point based on the first predicted value, the maximum reconstructed value, and the minimum reconstructed value includes: If the first predicted value is greater than the minimum reconstruction value and less than the maximum reconstruction value, the first predicted value is determined as the predicted value of the rth point.

38. The method according to claim 35, characterized in that The determining the predicted value of the r-th point based on the first predicted value, the maximum reconstructed value, and the minimum reconstructed value includes: If the first predicted value is less than or equal to the minimum reconstruction value, the minimum reconstruction value is determined as the predicted value of the rth point.

39. The method according to claim 35, characterized in that The determining the predicted value of the r-th point based on the first predicted value, the maximum reconstructed value, and the minimum reconstructed value includes: If the first predicted value is greater than or equal to the maximum reconstruction value, the maximum reconstruction value is determined as the predicted value of the rth point.

40. The method according to claim 35, characterized in that Determining a second reconstruction area around the current block includes: The reconstruction areas above, on the left, on the upper right, on the upper left and on the lower left of the current block are determined as the second reconstruction areas.

41. The method according to claim 1, characterized in that If the current block is a luminance block, and the prediction mode of the current block is an interpolation filtering prediction mode, the method further includes: If the chroma block corresponding to the current block adopts the direct derivation mode DM, the PLANAR mode or the intra-frame prediction mode corresponding to the prediction block is determined as the prediction mode of the chroma block.

42. A video encoding method, characterized in that: include: Determining a reference area and an interpolation filter of a current block, and determining a prediction block of the current block based on the reference area and the interpolation filter; Determining an intra-frame prediction mode corresponding to the prediction block, and determining a transform kernel corresponding to the current block based on the intra-frame prediction mode corresponding to the prediction block; The residual block of the current block is transformed based on the transformation kernel corresponding to the current block to obtain the transformation coefficient of the current block, and encoding is performed based on the deformation coefficient of the current block to obtain a code stream.

43. The method according to claim 42, characterized in that The determining the intra prediction mode corresponding to the prediction block includes: Determine the angle values ​​of M points in the prediction block, where M is a positive integer; Based on the angle values ​​of the M points, an intra-frame prediction mode corresponding to the prediction block is determined.

44. The method according to claim 43, characterized in that The determining the angle values ​​of the M points in the prediction block comprises: For the i-th point among the M points, determine the horizontal gradient and the vertical gradient of the i-th point, where i is a positive integer less than or equal to M; Based on the horizontal gradient and the vertical gradient of the i-th point, an angle value of the i-th point is determined.

45. The method according to claim 44, characterized in that The determining the horizontal gradient and the vertical gradient of the i-th point includes: In the prediction block, determining the prediction value of a point within a sliding window centered at the i-th point; Based on the predicted value of the point in the sliding window and the horizontal gradient operator, as well as the vertical gradient operator, the horizontal gradient and the vertical gradient of the i-th point are obtained.

46. ​​The method according to claim 45, characterized in that The step of obtaining the horizontal gradient and the vertical gradient of the i-th point based on the predicted value of the point in the sliding window and the horizontal gradient operator and the vertical gradient operator comprises: Determine the product of the predicted value of the point in the sliding window and the horizontal gradient operator as the horizontal gradient of the i-th point; The product of the predicted value of the point in the sliding window and the vertical gradient operator is determined as the vertical gradient of the i-th point.

47. The method according to claim 44, characterized in that The determining the angle value corresponding to the i-th point based on the horizontal gradient and the vertical gradient of the i-th point includes: The arc tangent value of the ratio of the vertical gradient to the horizontal gradient of the i-th point is determined as the angle value corresponding to the i-th point.

48. The method according to claim 44, characterized in that The determining, based on the angle values ​​of the M points, the intra-frame prediction mode corresponding to the prediction block includes: Determining, based on the angle values ​​of the M points, an intra-frame prediction mode corresponding to the M points; Based on the intra-frame prediction modes corresponding to the M points, the intra-frame prediction mode corresponding to the prediction block is determined.

49. The method according to claim 48, characterized in that The determining, based on the intra-frame prediction modes corresponding to the M points, the intra-frame prediction mode corresponding to the prediction block comprises: Determine the gradient amplitude values ​​corresponding to the M points based on the horizontal gradients and the vertical gradients of the M points; Based on the intra-frame prediction modes and gradient magnitude values ​​corresponding to the M points, the intra-frame prediction mode corresponding to the prediction block is determined.

50. The method according to claim 49, characterized in that The determining the gradient amplitude values ​​corresponding to the M points based on the horizontal gradients and the vertical gradients of the M points includes: The absolute value of the horizontal gradient and the absolute value of the vertical gradient of the i-th point are added to obtain the gradient amplitude value corresponding to the i-th point.

51. The method according to claim 49, characterized in that The determining, based on the intra-frame prediction modes and gradient amplitude values ​​corresponding to the M points, the intra-frame prediction mode corresponding to the prediction block comprises: For any point among the M points, accumulating the gradient amplitude value corresponding to the point on the intra-frame prediction mode corresponding to the point to obtain the accumulated gradient amplitude value of the intra-frame prediction mode corresponding to the M points; The intra-frame prediction mode with the largest accumulated gradient amplitude value among the intra-frame prediction modes corresponding to the M points is determined as the intra-frame prediction mode corresponding to the prediction block.

52. The method according to claim 49, characterized in that The method further comprises: If the gradient amplitude values ​​corresponding to the M points are all 0, the first intra-frame prediction mode is determined as the intra-frame prediction mode corresponding to the prediction block.

53. The method according to claim 52, characterized in that The first intra-frame prediction mode is the PLANAR mode.

54. The method according to any one of claims 42 to 53, characterized in that The determining, based on the intra prediction mode corresponding to the prediction block, a transform kernel corresponding to the current block comprises: Acquire a correspondence between an intra-frame prediction mode and a transform core group, wherein one transform core group includes at least one type of transform core; In the corresponding relationship, searching for a first transform core group corresponding to the intra prediction mode of the prediction block; A transform core corresponding to the current block is determined from the first transform core group.

55. The method according to claim 54, characterized in that The step of determining the transform core corresponding to the current block from the first transform core group includes: Determining a transform kernel category corresponding to the current block; A transform core of the transform core category in the first transform core group is determined as a transform core corresponding to the current block.

56. The method according to claim 55, characterized in that The method further comprises: The transform kernel category corresponding to the current block is written into the bitstream.

57. The method of claim 42, wherein: The determining of the reference area of ​​the current block includes: A reference area of ​​the current block is determined in preset P reference areas, where P is a positive integer greater than 1.

58. The method according to claim 57, characterized in that The determining of the reference area of ​​the current block in the preset P reference areas includes: Determine a first cost when predicting the current block based on the P reference regions respectively; Determine the reference region with the smallest first cost among the P reference regions as the reference region of the current block.

59. The method according to claim 58, characterized in that The method further comprises: First information is written into a bitstream, where the first information is used to indicate a type of a reference area of ​​the current block.

60. The method of claim 42, wherein: The determining of the reference area of ​​the current block includes: Based on the shape of the current block, a reference area of ​​the current block is determined in preset P reference areas, where P is a positive integer greater than 1.

61. The method according to claim 57 or 60, characterized in that The P reference areas include at least one of a first reference area, a second reference area and a third reference area, the first reference area includes reconstruction areas above, to the upper right, to the left, to the upper left and to the upper left of the current block, the second reference area includes reconstruction areas above, to the upper right and to the upper left of the current block, and the third reference area includes reconstruction areas to the left, to the upper left and to the upper left of the current block.

62. The method of claim 42, wherein: The determining of the interpolation filter of the current block comprises: An interpolation filter for the current block is determined among preset Q interpolation filters, where Q is a positive integer greater than 1.

63. The method according to claim 62, characterized in that The step of determining the interpolation filter of the current block from among the preset Q interpolation filters comprises: Determining a second cost when using the Q interpolation filters to predict the current block respectively; The interpolation filter with the smallest second cost among the Q interpolation filters is determined as the interpolation filter of the current block.

64. The method according to claim 62, characterized in that The method further comprises: Writing second information into a bitstream, where the second information is used to indicate a shape of an interpolation filter of the current block.

65. The method of claim 42, wherein: The determining of the interpolation filter of the current block comprises: Based on the shape of the current block, an interpolation filter of the current block is determined from among Q preset interpolation filters, where Q is a positive integer greater than 1.

66. The method according to claim 62 or 65, characterized in that The Q interpolation filters include at least one of a first interpolation filter, a second interpolation filter and a third interpolation filter, the first interpolation filter is a square interpolation filter, the second interpolation filter is a rectangular interpolation filter with a width greater than a height, and the third interpolation filter is a rectangular interpolation filter with a height greater than a width.

67. The method according to claim 59 or 64, characterized in that The method further comprises: The first information and / or the second information is written into the code stream by using a truncated binary code encoding method.

68. The method of claim 42, wherein: Before determining the reference area and the interpolation filter of the current block, the method further includes: Determining a prediction mode of the current block from a plurality of candidate prediction modes, wherein the plurality of candidate prediction modes include an interpolation filtering prediction mode; The determining of the reference area and the interpolation filter of the current block comprises: If the prediction mode of the current block is the interpolation filtering prediction mode, a reference area and an interpolation filter of the current block are determined.

69. The method according to claim 68, characterized in that Before determining the prediction mode of the current block from a plurality of candidate prediction modes, the method further includes: Determining whether the position of the current block in the current image meets a preset position requirement, and determining whether the size of the current block meets a preset block size requirement; The step of determining the prediction mode of the current block from a plurality of candidate prediction modes comprises: If the position of the current block in the current image meets the preset position requirement, and the size of the current block meets the preset block size requirement, a prediction mode of the current block is determined from the multiple candidate prediction modes.

70. The method according to claim 69, characterized in that The method further comprises: If the position of the current block in the current image does not satisfy the preset position requirement, and / or the size of the current block satisfies the preset block size requirement, it is determined that the current block is not predicted using the interpolation filtering prediction mode.

71. The method according to claim 69, characterized in that Before determining whether the position of the current block in the current image meets the preset position requirement and determining whether the size of the current block meets the preset block size requirement, the method further includes: Determine whether the current sequence allows prediction using the interpolation filtering prediction mode; The determining whether the position of the current block in the current image meets a preset position requirement, and determining whether the size of the current block meets a preset block size, includes: If the current sequence allows prediction using the interpolation filter prediction mode, it is determined whether the position of the current block in the current image meets the preset position requirement, and whether the size of the current block meets the preset block size.

72. The method of claim 68, wherein: The method further comprises: The third information is written into the bitstream, where the third information is used to indicate whether the current block is predicted using the interpolation filtering prediction mode.

73. The method according to claim 71, characterized in that The method further comprises: The fourth information is written into the bitstream, where the fourth information is used to indicate whether the current sequence is allowed to be predicted using the interpolation filtering prediction mode.

74. The method of claim 42, wherein: The determining, based on the reference area and the interpolation filter, a prediction block of the current block comprises: Based on the reference area, determining a filter coefficient of the interpolation filter; Based on the filter coefficient, the interpolation filter is used to perform interpolation filtering prediction on the current block to obtain a prediction block of the current block.

75. The method according to claim 74, characterized in that The determining, based on the reference area, a filter coefficient of the interpolation filter comprises: Determining a first reconstruction area around the current block; Determining a pixel average reconstruction value based on the reconstruction value of the first reconstruction area; Based on the pixel average reconstruction value, de-averaging the reconstruction values ​​of the pixel points in the reference area; The pixel values ​​of the pixels in the reference area after averaging are used as the input of the interpolation filter, and the interpolation filter is slid in the reference area to obtain the filter coefficients of the interpolation filter.

76. The method according to claim 75, characterized in that The determining a first reconstruction area around the current block comprises: Based on the shape of the current block, the first reconstruction area is determined.

77. The method according to claim 76, characterized in that The determining the first reconstruction area based on the shape of the current block includes: If the shape of the current block is a square, a reconstructed pixel area in an upper row and a left column of the current block is determined as the first reconstructed area; or, If the shape of the current block is a rectangle with a width greater than a height, a row of reconstructed pixel areas above the current block is determined as the first reconstructed area; or, If the shape of the current block is a rectangle with a height greater than a width, a left column of reconstructed pixel regions of the current block is determined as the first reconstructed region.

78. The method according to claim 75, characterized in that The step of removing the average of the reconstructed values ​​of the pixels in the reference area based on the pixel average reconstruction value comprises: The pixel average reconstruction value is subtracted from the reconstructed value of the pixel point in the reference area to obtain the pixel value of the pixel point in the reference area after the average value is removed.

79. The method according to claim 75, characterized in that Based on the filter coefficient, using the interpolation filter to perform interpolation filtering prediction on the current block to obtain a prediction block of the current block, including: For an r-th point in the current point, based on the shape of the interpolation filter, determine the pixel values ​​of N positions corresponding to the r-th point, where r is a positive integer; De-averaging the pixel values ​​at the N positions based on the pixel average reconstruction value to obtain the de-averaged pixel values ​​at the N positions; Obtaining a predicted value of the r-th point based on the pixel values ​​of the N positions after averaging and the filter coefficient; Based on the prediction value of the midpoint of the current block, a prediction block of the current block is obtained.

80. The method according to claim 79, characterized in that The determining pixel values ​​of N positions corresponding to the r-th point includes: For any position among the N positions, if the position is located in a reconstructed area around the current block, the reconstructed value of the position is determined as the pixel value of the position; or, if the position is located within the current block, the predicted value of the position is determined as the pixel value of the position.

81. The method according to claim 79, characterized in that The step of removing the mean value of the pixel values ​​at the N positions based on the pixel average reconstruction value to obtain the pixel values ​​after removing the mean value at the N positions includes: The pixel values ​​at the N positions are subtracted from the pixel average reconstruction value to obtain the pixel values ​​at the N positions after the average value is removed.

82. The method of claim 79, wherein: The step of obtaining the predicted value of the r-th point based on the pixel values ​​after averaging the N positions and the filter coefficient comprises: Determine a second reconstruction area around the current block, and determine a maximum reconstruction value and a minimum reconstruction value of the second reconstruction area; Obtaining a first prediction value based on the pixel values ​​after averaging the N positions, the filter coefficient, and the pixel average reconstruction value; A prediction value of the r th point is determined based on the first prediction value, the maximum reconstruction value and the minimum reconstruction value.

83. The method according to claim 82, characterized in that The obtaining of a first prediction value based on the pixel values ​​after averaging the N positions, the filter coefficient and the pixel average reconstruction value comprises: Multiplying the pixel values ​​after removing the mean of the N positions by the filter coefficient to obtain a second predicted value of the r-th point; The second predicted value and the pixel average reconstruction value are added to obtain the first predicted value.

84. The method according to claim 82, characterized in that The determining the predicted value of the r-th point based on the first predicted value, the maximum reconstructed value, and the minimum reconstructed value includes: If the first predicted value is greater than the minimum reconstruction value and less than the maximum reconstruction value, the first predicted value is determined as the predicted value of the rth point.

85. The method according to claim 82, characterized in that The determining the predicted value of the r-th point based on the first predicted value, the maximum reconstructed value, and the minimum reconstructed value includes: If the first predicted value is less than or equal to the minimum reconstruction value, the minimum reconstruction value is determined as the predicted value of the rth point.

86. The method according to claim 82, characterized in that The determining the predicted value of the r-th point based on the first predicted value, the maximum reconstructed value, and the minimum reconstructed value includes: If the first predicted value is greater than or equal to the maximum reconstruction value, the maximum reconstruction value is determined as the predicted value of the rth point.

87. The method according to claim 82, characterized in that Determining a second reconstruction area around the current block includes: The reconstruction areas above, on the left, on the upper right, on the upper left and on the lower left of the current block are determined as the second reconstruction areas.

88. The method of claim 42, wherein: If the current block is a luminance block, and the prediction mode of the current block is an interpolation filtering prediction mode, the method further includes: If the chroma block corresponding to the current block adopts the direct derivation mode DM, the PLANAR mode or the intra-frame prediction mode corresponding to the prediction block is determined as the prediction mode of the chroma block.

89. A video decoding device, characterized in that: include: A prediction unit, configured to determine a reference area and an interpolation filter of a current block, and determine a prediction block of the current block based on the reference area and the interpolation filter; A transform unit, configured to determine an intra-frame prediction mode corresponding to the prediction block, and determine a transform kernel corresponding to the current block based on the intra-frame prediction mode corresponding to the prediction block; A decoding unit is used to perform an inverse transformation on the transformation coefficient of the current block based on the transformation kernel corresponding to the current block to obtain a residual block of the current block, and to obtain a reconstructed block of the current block based on the prediction block and the residual block of the current block.

90. A video encoding device, characterized in that include: A prediction unit, configured to determine a reference area and an interpolation filter of a current block, and determine a prediction block of the current block based on the reference area and the interpolation filter; A transform unit, configured to determine an intra-frame prediction mode corresponding to the prediction block, and determine a transform kernel corresponding to the current block based on the intra-frame prediction mode corresponding to the prediction block; The encoding unit is used to transform the residual block of the current block based on the transformation kernel corresponding to the current block to obtain the transformation coefficient of the current block, and encode based on the deformation coefficient of the current block to obtain a code stream.

91. 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 41 or 42 to 88 above.

92. 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 41 above; The video encoder is used to implement the method described in any one of claims 42 to 88.

93. A computer-readable storage medium, characterized in that For storing computer programs; The computer program enables a computer to execute the method as described in any one of claims 1 to 41 or 42 to 88 above.