Video encoding and decoding method, apparatus, device, system, and storage medium
By determining a first angular precision for the intra-prediction mode candidate list, the method directly constructs the list with improved accuracy, enhancing video encoding and decoding performance.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2026-03-30
AI Technical Summary
Current video encoding and decoding methods suffer from inaccuracies in constructing intra-prediction mode candidate lists, leading to reduced effectiveness in predicting video blocks.
Determine a first angular precision to indicate the search range of angular prediction modes in the intra-prediction mode candidate list, directly constructing the list with this precision to improve accuracy.
This approach enhances the accuracy of predicting video blocks, thereby improving the overall video encoding and decoding performance.
Smart Images

Figure 2026510082000001_ABST
Abstract
Description
[Technical Field]
[0001] This application relates to the field of video encoding and decoding technology, and more particularly to video encoding and decoding methods, apparatus, devices, systems, and storage media. [Background technology]
[0002] Digital video technology can be incorporated into various video devices such as digital televisions, smartphones, computers, e-readers, or video players. As video technology advances, the amount of data contained in video data is increasing. To facilitate the transmission of video data, video devices implement video compression technology to transmit or store video data more effectively.
[0003] Because video contains temporal or spatial redundancy, prediction can eliminate or reduce redundancy in the video, thereby improving compression efficiency. Currently, to improve prediction effectiveness, multiple prediction modes can be used to predict the current block. For example, an intra-prediction mode candidate list can be constructed, and multiple prediction modes can be selected from this list to predict the current block. However, the currently constructed intra-prediction mode candidate list is not accurate enough, resulting in reduced effectiveness of encoding and decoding the current block. [Overview of the project] [Problems that the invention aims to solve]
[0004] The embodiments of the present invention provide a video coding and decoding method, apparatus, device, system, and storage medium that can improve coding and decoding performance by improving the accuracy of constructing an intra-prediction mode candidate list, thereby increasing the prediction accuracy of the current block. [Means for solving the problem]
[0005] In a first embodiment, the present application provides a video decoding method performed by a decoder, the method being The current block is to determine a first angular precision corresponding to the intra-prediction mode candidate list, wherein the first angular precision is used to indicate the search range of angular prediction modes in the intra-prediction mode candidate list. Based on the first angular accuracy, construct the intra-prediction mode candidate list, This includes predicting the current block based on the intra prediction mode candidate list and obtaining the predicted value of the current block.
[0006] In a second embodiment, the present invention provides a video encoding method, the method being: The current block is to determine a first angular precision corresponding to the intra-prediction mode candidate list, wherein the first angular precision is used to indicate the search range of angular prediction modes in the intra-prediction mode candidate list. Based on the first angular accuracy, construct the intra-prediction mode candidate list, This includes predicting the current block based on the intra prediction mode candidate list and obtaining the predicted value of the current block.
[0007] In a third embodiment, the present application provides a video decoding device configured to perform the methods in the first embodiment or each of its implementations. Specifically, the device comprises a functional unit configured to perform the methods in the first embodiment or each of its implementations.
[0008] In a fourth embodiment, the present application provides a video encoding apparatus configured to perform the methods in the second embodiment or each of its implementations. Specifically, the apparatus comprises a functional unit configured to perform the methods in the second embodiment or each of its implementations.
[0009] In a fifth embodiment, a video decoder is provided, comprising a processor and memory. The memory is configured to store computer programs, and the processor is configured to execute the method in the first embodiment or each of its implementations by calling and executing the computer programs stored in the memory.
[0010] In a sixth embodiment, a video encoder is provided, comprising a processor and memory. The memory is configured to store computer programs, and the processor is configured to perform the method in the second embodiment or each of its implementations by calling and executing the computer programs stored in the memory.
[0011] In a seventh embodiment, a video encoding and decoding system is provided, comprising a video encoder and a video decoder. The video decoder is configured to perform the method in the first embodiment or each of its implementations, and the video encoder is configured to perform the method in the second embodiment or each of its implementations.
[0012] In the eighth embodiment, a chip is provided which is configured to implement one of the first or second embodiments or the method in each of its respective implementations. Specifically, the chip comprises a processor which, by calling and executing a computer program from memory, causes a device on which the chip is mounted to execute one of the first and second embodiments or the method in each of its respective implementations.
[0013] In the ninth embodiment, a computer-readable storage medium is provided, which stores a computer program that causes a computer to execute one of the first to second embodiments or the methods in each of their respective implementations.
[0014] In a tenth aspect, there is provided a computer program product including computer program instructions for causing a computer to execute the method according to any one of the first to second aspects or each implementation form thereof as described above.
[0015] In an eleventh aspect, there is provided a computer program which, when executed on a computer, causes the computer to execute the method according to any one of the first to second aspects or each implementation form thereof as described above.
Advantages of the Invention
[0016] Based on the above technical solution, in the present application, when constructing an intra prediction mode candidate list, first, a first angular accuracy corresponding to the intra prediction mode candidate list is determined, and the first angular accuracy is used to indicate a search range of an angular prediction mode in the intra prediction mode candidate list. Next, an intra prediction mode candidate list is constructed based on the first angular accuracy. Taking the case where the intra prediction mode candidate list is a TIMD list as an example, assuming that the first angular accuracy corresponding to TIMD is 129, the embodiments of the present application do not first construct an intra prediction mode candidate list with an angular accuracy of 65 and then re-derive the intra prediction mode candidate list with an angular accuracy of 65 to an angular accuracy of 129, but directly construct an intra prediction mode candidate list with an angular accuracy of 129, thereby avoiding loss of angular accuracy, improving the accuracy of constructing the intra prediction mode candidate list, and thus improving the prediction accuracy of the current block when predicting based on the accurately constructed intra prediction mode candidate list, and ultimately improving the effect of video encoding and decoding.
Brief Description of the Drawings
[0017] [Figure 1] FIG. 19 is an exemplary block diagram of a video encoding / decoding system according to an embodiment of the present application. [Figure 2] FIG. 22 is an exemplary block diagram of a video encoder according to an embodiment of the present application. [Figure 3]This is an exemplary block diagram of a video decoder according to an embodiment of the present invention. [Figure 4A] This is a schematic diagram of intranet prediction. [Figure 4B] This is a schematic diagram of intranet prediction. [Figure 5A] This is a schematic diagram of intranet prediction. [Figure 5B] This is a schematic diagram of intranet prediction. [Figure 5C] This is a schematic diagram of intranet prediction. [Figure 5D] This is a schematic diagram of intranet prediction. [Figure 5E] This is a schematic diagram of intranet prediction. [Figure 5F] This is a schematic diagram of intranet prediction. [Figure 5G] This is a schematic diagram of intranet prediction. [Figure 5H] This is a schematic diagram of intranet prediction. [Figure 5I] This is a schematic diagram of intranet prediction. [Figure 6] This is a schematic diagram of the intra-prediction mode. [Figure 7] This is a schematic diagram of the intra-prediction mode. [Figure 8] This is a schematic diagram of the intra-prediction mode. [Figure 9] This is a schematic diagram of the adjacent block. [Figure 10] This is a schematic diagram of MIP. [Figure 11] This is a schematic diagram of the weight assignment. [Figure 12] This is a schematic diagram of the weight assignment. [Figure 13] This is a schematic diagram of the template. [Figure 14A] This is a schematic diagram of the DIMD principle. [Figure 14B] This is a schematic diagram of the TIMD principle. [Figure 15A] This is a schematic diagram of the PDPC principle. [Figure 15B] This is a schematic diagram of the PDPC principle. [Figure 15C] This is a schematic diagram of the PDPC principle. [Figure 15D] This is a schematic diagram of the PDPC principle. [Figure 16] This is an illustrative flowchart of a video decoding method according to one embodiment of the present invention. [Figure 17] This is a schematic diagram of adjacent locations. [Figure 18] This is another schematic diagram of an adjacent location. [Figure 19] This is a schematic diagram of adjacent and non-adjacent locations. [Figure 20] This is a schematic diagram of other adjacent and non-adjacent locations. [Figure 21] This is a schematic diagram showing the correspondence between angular direction and conventional prediction mode index. [Figure 22] This is a schematic diagram of the reconstructed pixels. [Figure 23] This is an illustrative flowchart of a video encoding method according to one embodiment of the present invention. [Figure 24] This is an illustrative block diagram of a video decoding device according to one embodiment of the present application. [Figure 25] This is an illustrative block diagram of a video encoding device according to one embodiment of the present invention. [Figure 26] This is an exemplary block diagram of an electronic device according to an embodiment of the present application. [Figure 27] This is an exemplary block diagram of a video encoding and decoding system according to an embodiment of the present invention. [Modes for carrying out the invention]
[0018] This invention can be applied to the fields of image coding and decoding, video coding and decoding, hardware video coding and decoding, dedicated circuit video coding and decoding, real-time video coding and decoding, and the like. For example, the solution of this invention can be combined with audio video coding standards (AVS), such as the H.264 / Audio Video Coding (AVC) standard, the H.265 / High Efficiency Video Coding (HEVC) standard, and the H.266 / Versatile Video Coding (VVC) standard. Alternatively, the solutions of this application may work in combination with other proprietary or industry standards, including ITU-TH.261, ISO / IEC MPEG-1 Visual, ITU-TH.262 or ISO / IEC MPEG-2 Visual, ITU-TH.263, ISO / IEC MPEG-4 Visual, ITU-TH.264 (also known as ISO / IEC MPEG-4 AVC), and the extension standards Scalable Video Coding (SVC) and Multiview Video Coding (MVC). It should be understood that the technology of this application is not limited to any specific encoding / decoding standard or technology.
[0019] To facilitate understanding, we will first describe the video encoding and decoding system according to an embodiment of the present invention with reference to Figure 1.
[0020] Figure 1 is an exemplary block diagram of a video encoding and decoding system according to an embodiment of the present application. Note that Figure 1 is merely one example, and the video encoding and decoding systems of the embodiments of the present application include, but are not limited to, those shown in Figure 1. As shown in Figure 1, the video encoding and decoding system 100 includes an encoding device 110 and a decoding device 120. Here, the encoding device is configured to encode (may be understood as compressing) video data to generate a bitstream and transmit the bitstream to the decoding device. The decoding device decodes the bitstream generated by the encoding of the encoding device and obtains the decoded video data.
[0021] The encoding device 110 in the embodiments of the present application may be understood as a device having video encoding capabilities, and the decoding device 120 may be understood as a device having video decoding capabilities. That is, the encoding device 110 and decoding device 120 in the embodiments of the present application include a wider range of devices such as smartphones, desktop computers, mobile computing devices, notebook computers (e.g., laptop computers), tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, and vehicle computers.
[0022] In some embodiments, the encoding device 110 can transmit encoded video data (e.g., a bitstream) to the decoding device 120 via channel 130. 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.
[0023] In one example, channel 130 includes one or more communication media that enable the encoding device 110 to directly transmit encoded video data to the decoding device 120 in real time. In this example, the encoding device 110 can modulate the encoded video data based on a communication standard and transmit the modulated video data to the decoding device 120. Here, the communication media includes wireless communication media such as radio frequency spectrum, and optionally, the communication media may also include wired communication media such as one or more physical transmission lines.
[0024] In another example, channel 130 includes a storage medium that can store video data encoded by the encoding device 110. The storage medium includes various locally accessible data storage media such as optical discs, DVDs, and flash memory. In this example, the decoding device 120 can retrieve the encoded video data from the storage medium.
[0025] As another example, channel 130 may include a storage server that can store 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. Optionally, the storage server can store the encoded video data and transmit the encoded video data to the decoding device 120, for example, a web server (e.g., for a website) or a File Transfer Protocol (FTP) server.
[0026] In some embodiments, the encoding device 110 comprises a video encoder 112 and an output interface 113, where the output interface 113 may include a modulator / demodulator (modem) and / or transmitter.
[0027] In some embodiments, the encoding device 110 is connected to the video encoder 112. output In addition to interface 113, a video source 111 can also be provided.
[0028] The video source 111 may comprise at least one of a video acquisition device (e.g., a video camera), a video archive, a video input interface, and a computer graphics system, wherein the video input interface is configured to receive video data from a video content provider, and the computer graphics system is configured to generate video data.
[0029] The video encoder 112 encodes video data from the video source 111 to generate a bitstream. The video data may include one or more pictures or sequences of pictures. The bitstream contains encoding information for the pictures or sequences of pictures in bitstream format. The encoding information may include encoded image data and associated data. The associated data may include a Sequence Parameter Set (SPS), a Picture Parameter Set (PPS), and other syntactic 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. A syntactic structure refers to a set of zero or more syntactic elements arranged in a specified order in the bitstream.
[0030] The video encoder 112 transmits the encoded video data directly to the decoding device 120 via the output interface 113. The encoded video data can also be stored in a storage medium or storage server for later reading by the decoding device 120.
[0031] In some embodiments, the decoding device 120 includes an input interface 121 and a video decoder 122.
[0032] 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.
[0033] Here, the input interface 121 includes a receiver and / or modem. The input interface 121 can receive encoded video data via channel 130.
[0034] The video decoder 122 is configured to decode the encoded video data, obtain the decoded video data, and transmit the decoded video data to the display device 123.
[0035] The display device 123 displays the decoded video data. The display device 123 may be integrated with the decoding device 120 or may be located outside the decoding device 120. The display device 123 may include various display devices such as liquid crystal displays (LCDs), plasma displays, organic light-emitting diode (OLED) displays, or other types of display devices.
[0036] Furthermore, Figure 1 is merely an example, and the technical solutions of the embodiments of the present application are not limited to Figure 1. For example, the technology of the present application may be applied to single-sided video encoding or single-sided video decoding.
[0037] The following describes the video encoding framework according to the embodiment of the present application.
[0038] Figure 2 is an illustrative block diagram of a video encoder according to an embodiment of the present invention. It should be understood that the video encoder 200 may be used to perform lossy compression on an image or lossless compression on an image. This lossless compression may be visually lossless compression or mathematically lossless compression.
[0039] The video encoder 200 is applicable to image data in luminance chroma (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents luminance (Luma), Cb (U) represents blue chromaticity, Cr (V) represents red chromaticity, and U and V are represented as chromaticity (Chroma) to describe color and saturation. For example, in a color format, 4:2:0 indicates that there are four luminance components and two chromaticity components (YYYYCbCr) for every four pixels, 4:2:2 indicates that there are four luminance components and four chromaticity components (YYYYCbCrCbCr) for every four pixels, and 4:4:4 indicates full pixel representation (YYYYCbCrCbCrCbCrCbCr).
[0040] For example, the video encoder 200 reads video data and divides the image of each frame of the video data into several coding tree units (CTUs). In some examples, CTUs are also called "tree blocks," "largest coding units" (LCUs), or "coding tree blocks" (CTBs). Each CTU can be associated with a pixel block of the same size in the image. Each pixel can correspond to one luminance (or luma) sample and two chrominance (or chroma) samples. Thus, each CTU can be associated with one luminance sample block and two chroma sample blocks. For example, the size of one CTU may be 128×128, 64×64, 32×32, etc. One CTU can be further divided into several coding units (CUs) for coding, and CUs may be rectangular blocks or square blocks. A CU can be further divided into a Prediction Unit (PU) and a Transform Unit (TU), separating coding, prediction, and transformation for greater processing flexibility. In one example, a CTU is divided into CUs using a quadtree scheme, and each CU is then divided into TUs and PUs using a quadtree scheme.
[0041] Video encoders and video decoders can support a variety of PU sizes. Assuming a specific CU size is 2N×2N, video encoders and video decoders can support 2N×2N or N×N PU sizes for intra-prediction, and symmetric PUs of 2N×2N, 2N×N, N×2N, N×N, or similar sizes for inter-prediction. Video encoders and video decoders can also support asymmetric PUs of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-prediction.
[0042] In some embodiments, as shown in Figure 2, the video encoder 200 may include a prediction unit 210, a residual unit 220, a transform / quantization unit 230, an inverse transform / inverse quantization unit 240, a reconstruction unit 250, an in-loop filter unit 260, a decoded image buffer 270, and an entropy coding unit 280. The video encoder 200 may include more, fewer, or different functional components.
[0043] Optionally, in this application, the Current Block is also called the Current Encoding Unit (CU) or Current Prediction Unit (PU). The Prediction Block is also called the Prediction Image Block or Image Prediction Block, and the Reconstruction Image Block is also called the Reconstruction Block or Image Reconstruction Image Block.
[0044] In some embodiments, the prediction unit 210 includes an inter-prediction unit 211 and an intra-prediction unit 212. Because there is a strong correlation between adjacent pixels in a single frame of video, the use of an intra-prediction method in video coding and decoding techniques can eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent frames in video, the use of an inter-prediction method in video coding and decoding techniques can eliminate temporal redundancy between adjacent frames, thereby improving coding efficiency.
[0045] The interprediction unit 211 can be used for interprediction, which may include motion estimation and motion compensation, and can reference image information from different frames. Interprediction is used to eliminate temporal redundancy by using motion information to find reference blocks from reference frames, generating prediction blocks based on the reference blocks, and so on. The frames used in interprediction may be P-frames and / or B-frames, where P-frames refer to forward prediction frames and B-frames refer to bidirectional prediction frames. Interprediction uses motion information to find reference blocks from reference frames and generates prediction blocks based on the reference blocks. Motion information includes a list of reference frames to which the reference frames belong, a reference frame index, and a motion vector. The motion vector may be an integer pixel or a subpixel, and if the motion vector is a subpixel, it is necessary to create a block of the desired subpixel using an interpolation filter within the reference frame, and here, the block of integer pixels or subpixels within the reference frame found based on the motion vector is called a reference block. In some techniques, the reference block is directly used as the prediction block, while in other techniques, further processing is applied to the reference block to generate the prediction block. The process of generating a prediction block by adding further processing based on a reference block can be understood as using the reference block as a prediction block, and then generating a new prediction block by adding further processing based on that prediction block.
[0046] The intra-prediction unit 212 is configured to refer only to image information from the same frame, predict pixel information within the currently encoded image block, and eliminate spatial redundancy. The frame used for intra-prediction may be an I-frame.
[0047] Intra-prediction offers a variety of prediction modes. Taking the International Digital Video Coding Standard H-Series as an example, the H.264 / AVC standard has 8 angular prediction modes and 1 non-angular prediction mode, while H.265 / HEVC expands this to 33 angular prediction modes and 2 non-angular prediction modes. HEVC uses a total of 35 intra-prediction modes, consisting of Planar mode, DC, and 33 angular modes. VVC uses a total of 67 intra-prediction modes, consisting of Planar mode, DC, and 65 angular modes.
[0048] Furthermore, as the number of angle modes increases, the accuracy of intra-prediction improves, better meeting the demands of the development of high-resolution and ultra-high-resolution digital video.
[0049] The residual unit 220 can generate residual blocks of the CU based on the pixel blocks of the CU and the prediction blocks of the PU of the CU. For example, the residual unit 220 can generate residual blocks of the CU such that each sample in the residual block is equal to the difference between the sample in the pixel block of the CU and the corresponding sample in the prediction block of the PU of the CU.
[0050] The conversion / quantization unit 230 can quantize the conversion coefficients. The conversion / quantization unit 230 can quantize the conversion coefficients associated with the TU of the CU based on the quantization parameter (QP) value associated with the CU. The video encoder 200 can adjust the degree of quantization applied to the conversion coefficients associated with the CU by adjusting the QP value associated with the CU.
[0051] The inverse transform / inverse quantization unit 240 can reconstruct the residual block from the quantized transform coefficients by applying inverse quantization and inverse transform, respectively.
[0052] The reconstruction unit 250 can generate a reconstructed image block associated with the TU by adding the samples of the reconstructed residual block to the corresponding samples of one or more prediction blocks generated by the prediction unit 210. By reconstructing the sample block of each TU in the CU using this method, the video encoder 200 can reconstruct the pixel block of the CU.
[0053] The in-loop filter unit 260 is used to process pixels after inverse transformation and inverse quantization, compensate for distortion information, and provide a better reference for subsequent pixels to be encoded. For example, it can perform a deblocking filter operation to reduce blocking artifacts in pixel blocks associated with the CU.
[0054] In some embodiments, the in-loop filter unit 260 includes a deblocking filter unit and a sample-adaptive offset / self-adaptive loop filter (SAO / ALF) unit, where the deblocking filter unit is configured to remove blocking artifacts and the SAO / ALF unit is configured to remove ringing artifacts.
[0055] The decoded image buffer 270 can store the reconstructed pixel blocks. The inter-prediction unit 211 can perform inter-prediction on other PUs in the same image as the CU using the reference image containing the reconstructed pixel blocks. Furthermore, the intra-prediction unit 212 can perform intra-prediction on other PUs in the same image as the CU using the reconstructed pixel blocks in the decoded image buffer 270.
[0056] The entropy coding unit 280 can receive the quantized conversion coefficients from the conversion / quantization unit 230. The entropy coding unit 280 can perform one or more entropy coding operations on the quantized conversion coefficients to generate entropy coded data.
[0057] Figure 3 is an exemplary block diagram of a video decoder according to an embodiment of the present application.
[0058] As shown in Figure 3, the video decoder 300 includes an entropy decoding unit 310, a prediction unit 320, an inverse quantization / conversion unit 330, a reconstruction unit 340, an in-loop filter unit 350, and a decoded image buffer 360. The video decoder 300 may include more, fewer, or different functional components.
[0059] The video decoder 300 can receive a bitstream. The entropy decoding unit 310 can extract syntactic elements from the bitstream by analyzing it. As part of the bitstream analysis, the entropy decoding unit 310 can analyze the entropy-encoded syntactic elements within the bitstream. The prediction unit 320, the inverse quantization / conversion unit 330, the reconstruction unit 340, and the in-loop filter unit 350 can decode the video data based on the syntactic elements extracted from the bitstream, i.e., generate the decoded video data.
[0060] In some embodiments, the prediction unit 320 includes an intra-prediction unit 322 and an inter-prediction unit 321.
[0061] The intra-prediction unit 322 can perform intra-prediction and generate prediction blocks for the PU. The intra-prediction unit 322 can generate prediction blocks for the PU based on spatially adjacent pixel blocks of the PU using the intra-prediction mode. The intra-prediction unit 322 can further determine the intra-prediction mode for the PU based on one or more syntactic elements analyzed from the bitstream.
[0062] The interprediction unit 321 can construct a first reference image list (list 0) and a second reference image list (list 1) based on syntactic elements analyzed from the bitstream. Furthermore, if the PU is encoded using interprediction, the entropy decoding unit 310 can analyze the motion information of the PU. Based on the motion information of the PU, the interprediction unit 321 can determine one or more reference blocks of the PU. Based on one or more reference blocks of the PU, the interprediction unit 321 can generate prediction blocks of the PU.
[0063] The inverse quantization / conversion unit 330 can inverse quantize (i.e., dequantize) the conversion coefficients associated with the TU. The inverse quantization / conversion unit 330 can determine the degree of quantization using the QP value associated with the CU of the TU.
[0064] After inverse quantization of the conversion coefficients, the inverse quantization / conversion unit 330 can apply one or more inverse transformations to the inverse quantization conversion coefficients to generate residual blocks associated with the TU.
[0065] The reconstruction unit 340 reconstructs the pixel blocks of the CU using the residual blocks associated with the TU of the CU and the predicted blocks of the PU of the CU. For example, the reconstruction unit 340 can reconstruct the pixel blocks of the CU by adding the samples of the residual blocks to the corresponding samples of the predicted blocks, thereby obtaining a reconstructed image block.
[0066] The in-loop filter unit 350 can perform a deblocking filter operation to reduce blocking artifacts in pixel blocks associated with the CU.
[0067] The video decoder 300 can store the reconstructed image of the CU in the decoded image buffer 360. The video decoder 300 can use the reconstructed image in the decoded image buffer 360 as a reference image for subsequent prediction, or it can transmit the reconstructed image to a display device for display.
[0068] The basic process of video encoding and decoding is as follows: On the encoding side, one frame of the image is divided into blocks, and the prediction unit 210 generates a predicted block of the current block using intra-prediction or inter-prediction. The residual unit 220 can calculate a residual block, i.e., the difference between the predicted block and the original block of the current block, based on the predicted block and the original block of the current block, and this residual block may also be called residual information. This residual block can be transformed and quantized by the transformation / quantization unit 230 to remove information that is not visually sensitive to humans and eliminate visual redundancy. Optionally, the residual block before transformation and quantization by the transformation / quantization unit 230 may be called a time-domain residual block, and the time-domain residual block after transformation and quantization by the transformation / quantization unit 230 may be called a frequency residual block or frequency-domain residual block. The entropy coding unit 280 can receive the quantized conversion coefficients output by the conversion / quantization unit 230, perform entropy coding on these quantized conversion coefficients, and output a bitstream. For example, the entropy coding unit 280 can eliminate code redundancy based on the target context model and the probabilistic information of the binary bitstream.
[0069] On the decoding side, the entropy decoding unit 310 analyzes the bitstream to obtain prediction information and quantization coefficient matrix for the current block, and the prediction unit 320 generates a predicted block for the current block using intra-prediction or inter-prediction based on the prediction information. The inverse quantization / transformation unit 330 uses the quantization coefficient matrix obtained from the bitstream to perform inverse quantization and inverse transform on the quantization coefficient matrix to obtain a residual block. The reconstruction unit 340 adds the predicted block and the residual block to obtain a reconstructed block. The reconstructed block constitutes a reconstructed image, and the in-loop filter unit 350 performs in-loop filtering on the reconstructed image on an image basis or block basis to obtain a decoded image. On the encoding side, it is also necessary to perform the same processing as on the decoding side to obtain a decoded image. This decoded image is sometimes called a reconstructed image, and the reconstructed image can be used as a reference frame for inter-prediction of subsequent frames.
[0070] Furthermore, if necessary, the bitstream must include block partitioning information determined by the encoding side, as well as mode information or parameter information such as prediction, transformation, quantization, entropy coding, and in-loop filtering. The decoding side determines the same block partitioning information, prediction, transformation, quantization, entropy coding, and in-loop filtering mode information or parameter information as the encoding side by analyzing the bitstream and analyzing existing information, thereby ensuring that the decoded image obtained by the decoding side is identical to the decoded image obtained by the decoding side.
[0071] The above describes the basic process of a video codec in a block-based hybrid coding framework. As technology advances, some modules or steps of the framework or process may be optimized. This application applies to, but is not limited to, the basic process of a video codec in a block-based hybrid coding framework.
[0072] In the embodiments of this application, the current block may be the current coding unit (CU) or the current prediction unit (PU), etc. Due to the need for parallel processing, the image may be divided into slices, etc., and slices within the same image can be processed in parallel, that is, there is no data dependency between them. On the other hand, "frame" is a commonly used expression, and it can usually be understood that one frame is one image. The frame described in this application may be replaced with an image or a slice, etc.
[0073] Intra prediction typically uses each angular mode and non-angular mode to predict the current encoded block, obtains a predicted block, screens for the optimal prediction mode for the current encoded unit based on rate distortion information calculated based on the predicted block and the original block, and then transmits the predicted mode to the decoding side via a bitstream. The decoding side analyzes the prediction mode, obtains a predicted image of the current decoded block based on the prediction, and obtains a reconstructed image by superimposing the residual pixels transmitted via the bitstream. The intra prediction method predicts the current block using the encoded and decoded reconstructed pixels surrounding the current block as reference pixels. Figure 4A is a schematic diagram of intra prediction. As shown in Figure 4A, the size of the current block is 4x4, and the pixels in the left column and top row of the current block are the reference pixels of the current block. In intra prediction, these reference pixels are used to predict the current block. All of these reference pixels may be available, i.e., all encoded and decoded. Alternatively, some of the reference image may be unavailable. For example, if the current block is at the leftmost position in the entire frame, the reference pixels to the left of the current block are unavailable. Alternatively, when encoding or decoding the current block, if the lower left portion of the current block has not yet been encoded or decoded, the reference pixels for the lower left portion are also unavailable. If reference pixels are unavailable, padding may be performed using available reference pixels, specific values, or specific methods, or no padding may be performed at all.
[0074] Figure 4B is a schematic diagram of intraprediction. As shown in Figure 4B, the Multiple Reference Line (MRL) intraprediction method can improve encoding and decoding efficiency by using more reference pixels. For example, four reference rows / columns are used as reference pixels in the current block.
[0075] Furthermore, intraprediction has multiple prediction modes, and Figures 5A to 5I are schematic diagrams of intraprediction. As shown in Figures 5A to 5I, intraprediction performed on a 4x4 block in H.264 can mainly include nine modes. Here, in mode 0 shown in Figure 5A, the pixels above the current block are copied vertically to the current block as predicted values; in mode 1 shown in Figure 5B, the left reference pixels are copied horizontally to the current block as predicted values; and in mode 2 (DC mode) shown in Figure 5C, the average of eight points A to D and I to L is used as the predicted value for all points. In modes 3 to 8 shown in Figures 5D to 5I, the reference pixels are copied to the corresponding positions in the current block at specific angles, and since some positions in the current block may not exactly correspond to the reference pixels, it may be necessary to use the weighted average of the reference pixels or the interpolated sub-pixels of the reference pixels.
[0076] In addition to these, there are Plane mode, Planar mode, and others, and the number of angle prediction modes is increasing with technological advancements and block expansions. Figure 6 is a schematic diagram of intra-prediction modes, and as shown in Figure 6, for example, the intra-prediction modes used in HEVC include Planar mode, DC mode, and 33 angle modes, for a total of 35 prediction modes. Figure 7 is a schematic diagram of intra-prediction modes, and as shown in Figure 7, for example, the intra-prediction modes used in VVC include Planar mode, DC mode, and 65 angle modes, for a total of 67 prediction modes. Figure 8 is a schematic diagram of intra-prediction modes, and as shown in Figure 8, AVS3 uses a total of 66 prediction modes, including DC mode, Plane mode, Bilinear mode, PCM mode, and 62 angle modes.
[0077] Furthermore, there are several techniques to improve prediction, such as improving sub-pixel interpolation of reference pixels and filtering of predicted pixels. For example, the multiple intra-prediction filter (MIPF) in AVS3 generates predicted values using different filters for different block sizes. For pixels at different locations within the same block, pixels close to the reference pixel use one filter to generate predicted values, while pixels farther from the reference pixel use the other filter. Techniques that filter predicted pixels, such as the intra-prediction filter (IPF) in AVS3, can use the reference pixel to filter the predicted values.
[0078] Statistical characteristics indicate that pixel regions closer to the current block tend to select the same (intra) prediction mode as the current block. Based on this characteristic, HEVC, VVC, and ECM (reference software for further exploring encoding and decoding performance by integrating various new tools based on VTM-10.0 reference software) all employ MPM technology. Intra prediction can improve encoding and decoding efficiency using intra-mode encoding techniques such as the Most Probable Modes List (MPM). A mode list is constructed using the intra-prediction modes of surrounding encoded / decoded blocks, intra-prediction modes derived based on the intra-prediction modes of surrounding encoded / decoded blocks (e.g., adjacent modes), and several commonly used or highly probable intra-prediction modes (e.g., DC, Planar, Bilinear modes). Because textures have a certain spatial continuity, spatial correlations are used for the intra-prediction modes of surrounding encoded / decoded blocks. MPM can be used as a prediction of intra-prediction modes. In other words, the probability that the current block will use an MPM is considered higher than the probability that it will not. Therefore, during binarization, a shorter codeword can be assigned to the MPM, thereby saving overhead and improving encoding and decoding efficiency. In ECM, the MPM is divided into the MPM and the Secondary MPM, which are lists of lengths 6 and 16, respectively. The MPM lists are filled with the intra-prediction modes that are most likely to be selected by the current predicting block. As shown in Figure 9, these modes are determined by the intra-prediction modes selected by the blocks currently located at the top-left (AL), top (A), top-right (AR), left (L), and bottom-left (BL) positions of the block, and the intra-prediction modes adjacent to these modes.
[0079] The second MPM in ECM consists of several key angles other than MPM.
[0080] Specifically, of the six modes of the MPM in the ECM, the Planar mode is always at the beginning of the MPM, and the remaining five positions are filled sequentially according to the following three steps. If there are more than five modes, the extra modes automatically enter the second MPM.
[0081] a) The prediction mode selected by the five adjacent prediction blocks. b) Modes derived from the gradient histogram of the surrounding reconstructed pixels. c) The angles related to the two angular modes initially derived in a and b.
[0082] If the existing intra-prediction modes are insufficient to fill both the MPM and the second MPM, modes from the default intra-mode list will be used to fill both the MPM and the second MPM, ensuring no overlap.
[0083] In some embodiments, intra-prediction can be performed using matrix-based intra-prediction (MIP) (sometimes also referred to as matrix-weighted intra-prediction). As shown in Figure 10, to predict a block of width W and height H, MIP requires H reconstructed pixels from the left column of the current block and W reconstructed pixels from the upper row of the current block as input. MIP generates the predicted block in three steps: averaging, matrix vector multiplication, and interpolation. Here, matrix multiplication is the core of MIP. MIP can be viewed as a process that generates a predicted block from input pixels (reference pixels) using a kind of matrix multiplication scheme. MIP provides multiple matrices, and differences in prediction schemes are reflected in differences in matrices; even with the same input pixels, different results can be obtained by using different matrices. On the other hand, the processes of averaging and interpolation are designed considering the trade-off between performance and complexity. For larger blocks, reference pixel averaging achieves an effect similar to downsampling, allowing the input to fit to a relatively smaller matrix, while interpolation achieves an effect similar to upsampling. This means that instead of providing a separate MIP matrix for each block size, only one or a few matrices of specific sizes are required. With increasing demands for compression performance and improvements in hardware capabilities, next-generation standards may feature more complex MIPs.
[0084] While MIP is somewhat similar to Planar mode, it is clearly more complex and flexible than Planar mode.
[0085] The Versatile Video Coding (VVC) video coding and decoding standard currently under development includes an interpretation mode called Geometric Partitioning Mode (GPM). The Audio Video Coding Standard (AVS), also currently under development, includes an interpretation mode called Angular Weighted Prediction (AWP). Although these two modes differ in name and specific implementation, they share common principles.
[0086] Conventional unidirectional prediction searches for only one reference block of the same size as the current block, while conventional bidirectional prediction uses two reference blocks of the same size as the current block. The pixel value of each point in the prediction block is the average value of the corresponding positions in the two reference blocks; that is, all points in each of the two reference blocks each account for 50% of the total. Bidirectional weighted prediction allows the proportions of the two reference blocks to be different; for example, all points in the first reference block account for 75% of the total, and all points in the second reference block account for 25% of the total. However, the proportion of all points in the same reference block remains the same. Several other optimization techniques, such as Decoder-side Motion Vector Refinement (DMVR) and Bi-directional Optical Flow (BIO), introduce some changes to the reference pixels or prediction pixels, but these are unrelated to the principle described above. BIO can be abbreviated as BDOF. On the other hand, GPM or AWP also uses two reference blocks of the same size as the current block, but uses 100% of the pixel values of the corresponding positions in the first reference block for some pixel positions, 100% of the pixel values of the corresponding positions in the second reference block for some pixel positions, and in blend or transition regions, uses the pixel values of the corresponding positions in these two reference blocks according to a specific proportion. The weights of the blend regions also transition gradually. How these weights are specifically assigned is determined by the mode of GPM or AWP. The weight of each pixel position is determined based on the mode of GPM or AWP. Of course, under certain circumstances, for example, when the block size is very small, the mode of GPM or AWP may not necessarily use 100% of the pixel values of the corresponding positions in the first reference block for some pixel positions and 100% of the pixel values of the corresponding positions in the second reference block for some pixel positions. It is also possible that GPM or AWP uses two reference blocks of different sizes than the current block, meaning that GPM or AWP can each take the necessary parts as reference blocks. In other words, the parts with non-zero weights are used as reference blocks, and the parts with zero weights are deleted.This is an implementation issue and not the main point of this invention.
[0087] As an example, Figure 11 is a schematic diagram of weight assignment, showing a schematic diagram of weight assignment for multiple partition modes of a GPM in a 64x64 current block according to an embodiment of the present application, where there are 64 partition modes for the GPM. Figure 12 is a schematic diagram of weight assignment, showing a schematic diagram of weight assignment for multiple partition modes of an AWP in a 64x64 current block according to an embodiment of the present application, where there are 56 partition modes for the AWP. In either Figure 11 or Figure 12, in each division mode, the black area indicates that the weight value of the corresponding position of the first reference block is 0%, the white area indicates that the weight value of the corresponding position of the first reference block is 100%, the gray area indicates that the weight value of the corresponding position of the first reference block is greater than 0% and less than 100%, depending on the shade of gray, and the weight value of the corresponding position of the second reference block is 100% minus the weight value of the corresponding position of the first reference block.
[0088] The GPM weight derivation method involves determining the angle and offset amount based on each mode, and then calculating the weight matrix for each mode.
[0089] It is important to understand that conventional encoding and decoding techniques only offer rectangular partitioning methods, regardless of whether the partitioning is CU, PU, or Transform Unit (TU). On the other hand, GPM achieves non-rectangular partitioning effects through prediction without performing partitioning. GPM uses a weight mask of two reference blocks, i.e., the weight map described above. This mask determines the weights of the two reference blocks when generating the prediction block, or it can be simply understood that some positions in the prediction block come from the first reference block and some positions come from the second reference block. The blending area is obtained by weighting the corresponding positions of the two reference blocks, thereby making the transition smoother. Because GPM does not partition the current block into two CUs or PUs according to the partition line, the transformation, quantization, inverse transformation, and inverse quantization of the residuals after prediction also treat the current block as a single whole.
[0090] As can be seen from the above, GPM is a type of inter-block splitting prediction mode that divides the inter-block to be predicted into two parts, and the two parts can use different intra-prediction or inter-prediction modes.
[0091] SGPM (Spatial Geometric Partition Mode) is a type of intra-partition prediction mode in which the intra-block to be predicted is divided into two parts, and the two parts are predicted using different intra-prediction modes.
[0092] In ECM reference software, SGPM supports 26 different orientations or positional divisions out of a total of 64 types, compared to GPM.
[0093] The 64 types of divisions include a total of 32 division angles, and these 32 division angles correspond to the conventional intra-prediction angles as shown in Table 1 below.
[0094] [Table 1]
[0095] angleIdx represents one of 32 different division angles, and intraMode represents the index of the conventional 67 (Planar, DC, and 65 different angle modes) intra-prediction modes.
[0096] In some embodiments, a template-based intra-mode derivation (TIMD) intra-prediction technique can be used. TIMD is a technique that derives information about intra-prediction modes using already reconstructed pixel values from multiple rows around the current prediction block, thereby deriving one or more conventional intra-prediction modes. Exemplarily, as shown in Figure 13, the left and upper regions of the current block are used as a template. Except in the case of boundaries, reconstructed values are logically obtainable on the left and upper regions of the current block when encoding and decoding the current block. This is also the basis of many template matching methods. TIMD uses the left and upper regions of the current block shown in Figure 13 as a template, and the pixels in the left and upper regions of the template are the template's reference pixels. The decoder makes a prediction on the template using a certain intra-prediction mode, compares the predicted value with the reconstructed value, and obtains the cost of that intra-prediction mode on the template. Examples include SAD, SATD, and SSE. Since templates and current blocks are adjacent, they are correlated, and therefore, the performance of one prediction mode on the template can be used to estimate its performance on the current block. TIMD predicts several candidate intra-prediction modes on the template, obtains their costs on the template, and adopts the one or two intra-prediction modes with the lowest costs as the intra-predicted values for the current block.
[0097] Studies have shown that when the cost difference between two intra-prediction modes on a template is not significant, weighted averaging of the predictions from the two intra-prediction modes can improve compression performance. The weights of the predictions from the two modes are related to the cost, and in some examples, these weights are inversely proportional to the cost.
[0098] In short, TIMD screens intra-predictive modes by leveraging their predictive effects on the template, and can further weight two intra-predictive modes based on their cost on the template. The advantage of TIMD is that, if a block currently selects a TIMD mode, there is no need to further specify which intra-predictive mode was used, as the decoder itself derives it through the process described above, thus reducing overhead to some extent.
[0099] In the ECM-7.0 reference software, the TIMD derivation method can derive up to four intra-prediction modes: TIMD Mode (timdMode), Secondary TIMD Mode (timdSecondaryMode), Horizontal TIMD Mode (timdHor), and Vertical TIMD Mode (timdVer). What distinguishes it from the conventional 65 angle prediction modes is that the modes derived by TIMD further subdivide the angles, allowing for a further subdivision of 65 angles into 129 angles. In other words, it is possible to add one more precise angle between the original two adjacent angles.
[0100] TIMD screens intra-prediction modes based on the magnitude of the cost value at the template location (in ECM, SATD is used as the cost). As shown in Figure 13, the upper L2 row of the current prediction block is used as the upper template, and the left L1 column is used as the left template. The reconstructed pixel values in the row outside the template region (Reference of the template) are used as reference pixels, and predictions are made on the template region with the given intra-prediction mode. Within the template region, costs such as SAD, SATD, and SSE are calculated between the prediction result and the reconstructed value for the given prediction mode.
[0101] Here, in the four intra-prediction modes derived by the TIMD derivation method, TIMD mode (timdMode) is the mode in which the total SATD value of the upper template and the left template is smallest. The second TIMD mode (timdSecondaryMode) is the mode in which the total SATD value of the upper template and the left template is the second smallest. TIMD vertical mode (timdVer) is the mode with the smallest SATD value in the template above. TIMD horizontal mode (timdHor) is the mode with the smallest SATD value in the left template.
[0102] In the current ECM, the TIMD mode and the second TIMD mode can be adaptively weighted; that is, the prediction results for the current block of the TIMD mode and the prediction results for the current block of the second TIMD mode are weighted together. Whether or not weighting is performed, and the weights of the weighting, are related to the SATD values of these two modes.
[0103] Furthermore, TIMD determines whether to ultimately use the prediction mode with the smallest SATD, or to weight the mode with the smallest SATD and the second smallest mode, according to the following method.
[0104] Assuming that the TIMD mode is the mode with the smallest SATD and its SATD is cost0, and the second TIMD mode is the mode with the second smallest SATD and its SATD is cost1, If cost10*2 > cost1, the prediction results for the current block in the two modes are weighted; otherwise, the prediction result for TIMD mode is used directly.
[0105] For example, the weighting formula is as shown in equation (1).
[0106] Pred=Pred timdMode ×w0+Plinks timdSecondaryMode ×w1 (1) Here, Pred timdMode This is the prediction result in the current prediction block in TIMD mode, Pred timdSecondaryMode This is the prediction result in the current prediction block of the second TIMD mode,
number
[0107] In the actual implementation process, in order to avoid floating-point calculations and division calculations, the value of w0 + w1 is scaled to 64, and at the same time, the division calculation of w0 and w1 is implemented using a lookup table method, and the final weighting process is as shown in equation (2).
[0108] Pred=(Pred timdMode ×w0+Plinks timdSecondaryMode ×w1)>>6 (2) In some embodiments, the Decoder-side Intra Mode Derivation (DIMD) intra-prediction technique can be used. As shown in Figure 14A, DIMD uses the T row T column (T equals 3) pixel values of an already reconstructed region around the current block as a template (a), scans each 3x3 region on the template using the Sobel operator, calculates the horizontal and vertical gradients (b), and calculates the intensity value Amp=Dx+Dy and the angle value angle=arctan(Dy / Dx) at each position based on the horizontal and vertical gradients Dx and Dy obtained. The angle at each position on the template is associated with a conventional angle prediction mode. Using the sliding of the window in (b), multiple intensity values of adjacent reconstructed portions and the corresponding angle values, the intensity values of the same angle mode are accumulated to obtain a histogram of intensity values and angle modes (c), which is sorted in descending order of intensity values to select one or more angle modes. One or more angle modes are the modes derived by DIMD.
[0109] If the angular mode cannot be derived from adjacent reconstruction values, predict the DIMD. mode This is set to Planar prediction mode.
[0110] If one or more angle modes are derived, the DIMD prediction mode is set to a weighted result of the Planar mode and one or more angle prediction modes.
[0111] As an example, the DIMD prediction process is as shown in Figure 14B. The two intra-prediction modes with the highest values in the histogram, namely M1 and M2, are selected, and the Planar mode is added to make a total of three intra-prediction modes. Weights ω1, ω2, and ω3 are determined for each of the three intra-prediction modes, and prediction values Pred1, Pred2, and Pred3 are determined for each of the three intra-prediction modes. Based on the weights corresponding to each of the three intra-prediction modes, these prediction values corresponding to the three intra-prediction modes are weighted to obtain the final prediction block.
[0112] As can be seen from the above, DIMD uses gradient analysis of reconstructed pixels to screen intra-prediction modes, and can further weight the two intra-prediction modes with a Planar mode based on the analysis results. The advantage of DIMD is that if the current block has selected a DIMD mode, there is no need to further specify which intra-prediction mode was used, as the decoder itself derives it through the process described above, thus reducing overhead to some extent.
[0113] TIMD and DIMD have many similarities, and in some embodiments, their names are even reversed. Both support weighting of prediction values from two or more intra-prediction modes.
[0114] In some embodiments, template-based multiple reference line intra-prediction (TMRL) intra-prediction techniques can be used.
[0115] ECM-7.0 newly adopts TMRL intra-prediction technology. TMRL technology is a multiple reference line (MRL) intra-prediction technology based on template matching, and the prediction process of TMRL intra-prediction technology can be broadly divided into the following two steps.
[0116] (1) Bitstream analysis stage: The bitstream is analyzed to confirm that the current block is using TMRL technology, and the list index of TMRL is further analyzed.
[0117] (2) Current block prediction and reconstruction phase: First, build a list of candidate TMRLs.
[0118] Based on the candidate list of TMRLs and the decoded list index, the elements within the selected TMRL list are determined, and each element consists of an intra-prediction mode and a reference row index. Using the confirmed intra-prediction mode and corresponding reference row, processes such as prediction and reconstruction are performed on the current block.
[0119] The construction of the TMRL list is an operation that must be performed by both the encoder and the decoder. From the candidate list, the index of the reference row candidate list selected by encoding / decoding is combined with the sorted candidate list to determine the reference row that will actually be selected, and the prediction is performed using that reference row and the selected intra-prediction mode (conventional prediction mode).
[0120] TMRL sorts up to 5 × 10 combinations of up to 5 predefined extended reference lines (reference lines 1, 3, 5, 7, and 12, which may be fewer than 5 depending on their position in the current CTU of the current block) and 10 predefined prediction modes, using the SAD of the predicted value (pred) and reconstructed value (reco) in the template area.
[0121] For example, (x,-1) and (-1,y) are relative coordinates to the current top-left corner (0,0) of the block, and the SAD corresponding to a 1x1 template area is calculated based on equation (3).
[0122]
number
[0123] PDPC uses the reconstructed pixel values that have not undergone smoothing filtering, and according to the difference in prediction positions within the block, weights the reconstructed pixel values with different weights and the predicted values to improve the accuracy of the predicted values. The following formula (4) is the calculation process in which PDPC acts on the predicted pixels.
[0124] pred(x’,y’)=(wL×R-1,y’+wT×Rx’,-1-wTL×R-1,-1+(64-wL-wT+wTL)×pred(x’,y’)+32)>>6 (4) Here, R -1,y’ 、R x’,-1 、R -1,-1 are the reference pixel values used to correct the predicted value pred(x’,y’), and wL, wT, and wTL are the weights obtained based on (x’,y’).
[0125] In one example, schematic diagrams of PDPC acting on predicted pixels in different modes are as shown in FIGS. 15A to 15D. Here, FIG. 15A is the diagonal upper right mode, FIG. 15B is the diagonal lower left mode, FIG. 15C is the adjacent upper right mode, and FIG. 15D is the adjacent lower left mode.
[0126] In one example, the weighted weights of PDPC in different modes of the above formula (4) can be obtained based on Table 2 below.
[0127]
Table 2
[0128] The current method for constructing intra-prediction mode candidate lists is designed only for the conventional 65-angle precision. When it is necessary to construct an intra-prediction mode candidate list for a prediction tool with 129-angle precision, the existing method first matches the 129-angle precision to the 65-angle precision, and then, when deriving the predicted angles using a template, it re-derives the 65-angle precision in the intra-prediction mode candidate list to the 129-angle precision. This method is redundant, and precision is lost during the matching process from 129-angle precision to 65-angle precision, resulting in a lower precision in the constructed intra-prediction mode candidate list, which in turn affects the accuracy of the prediction and worsens the effectiveness of encoding and decoding.
[0129] To solve the above technical problems, the embodiment of the present application, when constructing an intra-prediction mode candidate list, first determines a first angular precision corresponding to the intra-prediction mode candidate list, and uses this first angular precision to indicate the search range of angular prediction modes in the intra-prediction mode candidate list. Next, the intra-prediction mode candidate list is constructed based on the first angular precision. Assuming that the intra-prediction mode candidate list is a TIMD list, and that the first angular precision corresponding to TIMD is 129, the embodiment of the present application avoids loss of angular precision and improves the accuracy of constructing the intra-prediction mode candidate list by directly constructing an intra-prediction mode candidate list with an angular precision of 129, rather than first constructing an intra-prediction mode candidate list with an angular precision of 65 and then re-deriving the intra-prediction mode candidate list with an angular precision of 65 to an angular precision of 129. This improves the accuracy of constructing the intra-prediction mode candidate list, thereby improving the prediction accuracy of the current block when making predictions based on the accurately constructed intra-prediction mode candidate list, and consequently improving the effectiveness of video coding and decoding.
[0130] In the following, with reference to Figure 16, the video decoding method according to the embodiment of this application will be described, using the decoding side as an example.
[0131] Figure 16 is an illustrative flowchart of a video decoding method according to one embodiment of the present application, which is applicable to the video decoder shown in Figures 1 and 3. As shown in Figure 16, the method of the embodiment of the present application includes the following steps.
[0132] In S101, the first angular accuracy corresponding to the current block's intra-prediction mode candidate list is determined.
[0133] The decoding side, when decoding the current block, decodes the bitstream, obtains the quantization coefficients of the current block, dequantizes the quantization coefficients to obtain the transformation coefficients of the current block, detransforms the transformation coefficients inversely to obtain the residual value of the current block. Next, it determines the prediction mode of the current block, determines the predicted value of the current block based on the prediction mode, and obtains the reconstructed value of the current block based on the predicted value and residual value of the current block.
[0134] Exemplary, the prediction modes of the current block include intra-prediction mode and inter-prediction mode, and the embodiments of the present application mainly relate to intra-prediction mode.
[0135] In intra-prediction mode, the method by which the current block determines the intra-prediction mode of the current block includes at least the following several types:
[0136] In Example 1, the encoding side adds the angular index of the current block's intra-prediction mode to the bitstream. The decoding side decodes the bitstream to obtain the angular index of the current block's intra-prediction mode, and from there determines the intra-prediction mode of the current block from among the intra-prediction modes shown in Figure 6 or Figure 7 above. Using this intra-prediction mode, the decoding side predicts the current block and obtains the predicted value of the current block.
[0137] In Example 2, the encoding side constructs an intra-prediction mode candidate list and selects the intra-prediction mode for the current block from this list. Next, it writes the serial number (or index number) of the current block's intra-prediction mode in the intra-prediction mode candidate list to the bitstream. The decoding side then decodes the bitstream to determine the serial number of the current block's intra-prediction mode in the intra-prediction mode candidate list, and simultaneously constructs an intra-prediction mode candidate list based on the same method as the encoding side. Furthermore, based on the serial number of the current block's intra-prediction mode in the intra-prediction mode candidate list, it determines the current block's intra-prediction mode from the constructed intra-prediction mode candidate list. Finally, it predicts the current block using the determined intra-prediction mode and obtains the predicted value of the current block.
[0138] In Example 3, the encoding side constructs an intra-prediction mode candidate list, selects an intra-prediction mode for the current block from this list, determines the cost of each candidate prediction mode on the current block's template, and then determines the current block's intra-prediction mode based on the cost. Correspondingly, the decoding side constructs an intra-prediction mode candidate list based on the same method as the encoding side, determines the cost of each candidate prediction mode on the current block's template, and then determines the current block's intra-prediction mode based on the cost. Finally, the current block is predicted using the determined intra-prediction mode, and the predicted value of the current block is obtained.
[0139] In Examples 2 and 3 above, the decoding and encoding sides construct the same intra-prediction mode candidate list, predict the current block based on that list, and obtain the predicted value for the current block. As can be seen from this, the accuracy of constructing the intra-prediction mode candidate list directly determines the accuracy of the current block prediction, and thereby affects the decoding effect of the video.
[0140] Currently, when constructing an intra-prediction mode candidate list, it is typically constructed based on 65 angle prediction modes (i.e., 65 angle precisions). For example, taking TIMD as an example, the modes derived by TIMD can be further subdivided from 65 angles to 129 angles, meaning that one more precise angle can be added between the original two adjacent angles, resulting in an angle precision of 129 for the TIMD prediction tool. When constructing an intra-prediction mode candidate list for TIMD, the current technical solution first matches the 129 angle precision prediction modes corresponding to TIMD with the 65 angle precision prediction modes to construct an intra-prediction mode candidate list with 65 angle precision, and then derives the constructed intra-prediction mode candidate list with 65 angle precision back into an intra-prediction mode candidate list with 129 angle precision. Such a method is redundant, and the process of matching 129 angular accuracies to 65 angular accuracies results in a loss of accuracy, which in turn lowers the accuracy of the constructed intra-prediction mode candidate list, affecting prediction accuracy and degrading the effectiveness of coding and decoding.
[0141] To solve the above technical problems, the embodiment of the present application, when constructing an intra-prediction mode candidate list, first determines a first angular precision corresponding to the intra-prediction mode candidate list, and uses this first angular precision to indicate the search range of angular prediction modes in the intra-prediction mode candidate list. Next, the intra-prediction mode candidate list is constructed based on the first angular precision. Assuming that the intra-prediction mode candidate list is a TIMD list, and that the first angular precision corresponding to TIMD is 129, the embodiment of the present application avoids loss of angular precision and improves the accuracy of constructing the intra-prediction mode candidate list by directly constructing an intra-prediction mode candidate list with an angular precision of 129, rather than first constructing an intra-prediction mode candidate list with an angular precision of 65 and then re-deriving the intra-prediction mode candidate list with an angular precision of 65 to an angular precision of 129. This improves the accuracy of constructing the intra-prediction mode candidate list, thereby improving the prediction accuracy of the current block when making predictions based on the accurately constructed intra-prediction mode candidate list, and consequently improving the effectiveness of video coding and decoding.
[0142] In the embodiments of this application, the angular accuracy can be understood as the search range of the angle prediction mode. For example, an angular accuracy of 65 indicates that the search range of the angle prediction mode is 65 types of angle prediction modes, i.e., an angular accuracy of 65 corresponds to 65 types of angle prediction modes. An angular accuracy of 129 indicates that the search range of the angle prediction mode is 129 types of angle prediction modes, i.e., an angular accuracy of 129 corresponds to 129 types of angle prediction modes.
[0143] In embodiments of the present invention, a first angular precision corresponding to the intra-prediction mode candidate list of the current block is used to indicate the search range of angular prediction modes in the intra-prediction mode candidate list. For example, if the first angular precision corresponding to the intra-prediction mode candidate list of the current block is 65, it indicates that each angular prediction mode in the intra-prediction mode candidate list is one of 65 angular prediction modes. As another example, if the first angular precision corresponding to the intra-prediction mode candidate list of the current block is 129, it indicates that each angular prediction mode in the intra-prediction mode candidate list is one of 129 angular prediction modes.
[0144] The following describes the specific process for determining the first angular accuracy corresponding to the current block's intra-prediction mode candidate list.
[0145] In some embodiments, the first angular precision corresponding to the intra-prediction mode candidate list for the current block is a predetermined or default value. That is, both the decoding and encoding sides determine a predetermined or default value as the first angular precision corresponding to the intra-prediction mode candidate list for the current block. This predetermined or default value is indicated by high-level signaling.
[0146] In some embodiments, the decoding side can determine the first angular accuracy by the following steps S101-A to S101-C.
[0147] In S101-A, the prediction method to be used when predicting the current block is determined.
[0148] In S101-B, if the prediction method is a prediction method based on template matching, the angular accuracy corresponding to the prediction method is determined.
[0149] In S101-C, the first angular accuracy is determined based on the angular accuracy corresponding to the prediction method.
[0150] Here, the prediction method currently used to predict blocks is also called a prediction tool, such as TIMD or DIMD.
[0151] The embodiments of this application do not limit the specific type of prediction method (i.e., prediction tool). Exemplary, the prediction method includes, but is not limited to, at least one of TIMD, MPM, TMRL, SGPM, and DIMD. That is, if the current block employs a TIMD, MPM, TMRL, SGPM, or DIMD tool, the angular accuracy corresponding to TIMD, MPM, TMRL, SGPM, or DIMD is determined as the first angular accuracy.
[0152] In S101-A above, determining the prediction method to be used when predicting the current block includes at least the following methods:
[0153] In Method 1, the prediction method used when predicting the current block is the default method.
[0154] In method 2, the bitstream is decoded to obtain the prediction scheme to be used when predicting the current block. For example, when the encoding side predicts the current block using multiple prediction schemes, the prediction cost corresponding to each prediction scheme is determined, and the prediction scheme with the smallest prediction cost is selected as the prediction scheme for the current block, and the identification information of that prediction scheme is written to the bitstream. As a result, the decoding side can obtain the prediction scheme adopted by the current block by decoding the bitstream.
[0155] In method 3, based on the template of the current block, the prediction method to be used to predict the current block is determined from among multiple prediction methods. For example, when the encoding side and the decoding side each predict the template of the current block using multiple prediction methods, the prediction cost corresponding to each prediction method is determined, and the prediction method with the smallest prediction cost is determined as the prediction method adopted by the current block.
[0156] The decoding side first determines the prediction method to be used when predicting the current block, then determines whether the prediction method is a template matching-based prediction method, and if it is a template matching-based prediction method, it determines the angular precision corresponding to the prediction method, and further determines a first angular precision based on the angular precision corresponding to the prediction method.
[0157] In the embodiments of this application, the method for determining the first angular accuracy based on the angular accuracy corresponding to the prediction method includes, but is not limited to, the following methods.
[0158] In the first method, if the angular accuracy corresponding to the prediction method is greater than a predetermined angular accuracy, the first angular accuracy is smaller than the angular accuracy corresponding to the prediction method and greater than the predetermined angular accuracy. For example, if the angular accuracy corresponding to the prediction method is 129 (corresponding to 129 types of angle prediction modes) and the predetermined angular accuracy is 65 (corresponding to 65 types of angle prediction modes), the first angular accuracy can be any angular accuracy that is smaller than 129 and greater than 65. For example, if the first angular accuracy is 120, and this angular accuracy of 120 is part of the angular accuracy of 129, that is, 120 types of angle prediction modes are selected from among the 129 types of angle prediction modes, and an intra-prediction mode candidate list is constructed based on these 120 types of angle prediction modes.
[0159] The 2 In this method, the decoding side determines the angular precision corresponding to the prediction method used when directly predicting the current block as the first angular precision.
[0160] Based on the steps of the above method, the decoding side determines the first angular accuracy corresponding to the intra-prediction mode candidate list, and then executes the following step S102.
[0161] In S102, an intra-prediction mode candidate list is constructed based on the first angular accuracy.
[0162] As can be seen from the above, in TIMD, DIMD, TMRL, SGPM, or MPM tools, when deriving a single intra-prediction mode, it is necessary to construct an intra-prediction mode candidate list, and these candidate lists each have different lengths and different construction methods. However, currently, 65 angles are used in all constructions, which means that when adding modes with 129 angle accuracies, they must be matched to 65 angle accuracies before being added to the candidate list, which leads to further loss of accuracy. On the other hand, in the embodiment of the present invention, a corresponding intra-prediction mode candidate list is constructed based on a first angle accuracy corresponding to TIMD, DIMD, TMRL, SGPM, or MPM.
[0163] For example, if we assume that the current block employs the TIMD tool during prediction and that the first angular precision corresponding to TIMD is 129, then the intra-prediction mode candidate list constructed using TIMD will have an angular precision of 129.
[0164] For example, if we assume that the current block employs the TMRL tool during prediction and that the first angular precision corresponding to TMRL is 129, then the intra-prediction mode candidate list constructed using TMRL will have an angular precision of 129.
[0165] For example, if we assume that the current block employs the MPM tool during prediction and that the first angular precision corresponding to the MPM is 129, then the intra-prediction mode candidate list constructed using the MPM will have an angular precision of 129.
[0166] For example, if we assume that the current block employs the TIMD tool during prediction and that the first angular precision corresponding to TIMD is 65, then the intra-prediction mode candidate list constructed using TIMD will have an angular precision of 65.
[0167] For example, if we assume that the current block employs the TMRL tool during prediction and that the first angular precision corresponding to TMRL is 65, then the intra-prediction mode candidate list constructed using TMRL will have an angular precision of 65.
[0168] For example, if we assume that the current block employs the MPM tool during prediction and that the first angular precision corresponding to the MPM is 65, then the intra-prediction mode candidate list constructed using the MPM will have an angular precision of 65.
[0169] In some embodiments, the intra-prediction mode candidate list, such as TIMD, DIMD, TMRL, SGPM, or MPM, includes modes selected by the prediction blocks around the current block. Based on this, S102 above includes the following steps S102-A and S102-B.
[0170] In S102-A, the first intra-prediction mode is obtained for N prediction blocks (where N is a positive integer) surrounding the current block.
[0171] In S102-B, an intra-prediction mode candidate list is constructed based on the first intra-prediction mode and the first angular accuracy of N prediction blocks.
[0172] The embodiments of this application do not limit the specific locations of the N prediction blocks.
[0173] In one possible implementation, the N prediction blocks include five prediction blocks adjacent to the current block. Exemplarily, these five locations are as shown in Figure 17, and the horizontal and vertical differences of these locations with respect to the top-left corner coordinate of the current block are top-left (-1,-1), top (width-1,-1), top-right (width,-1), left (-1,height-1), and bottom-left (-1,height), respectively, where width and height are the width and height of the current block.
[0174] For example, the order in which the prediction blocks are selected at these five positions is left, top, top left, bottom left, and top right.
[0175] In another possible implementation, embodiments of the present invention can extend the intra-prediction mode candidate list by using prediction modes of prediction blocks corresponding to more adjacent and / or non-adjacent blocks around the current block when constructing the intra-prediction mode candidate list. For example, N prediction blocks include P first prediction blocks and / or Q second prediction blocks, where the first prediction blocks are prediction blocks corresponding to decoded blocks adjacent to the current block, and the second prediction blocks are prediction blocks corresponding to decoded blocks not adjacent to the current block, and both P and Q are positive integers less than or equal to N, and the sum of P and Q is equal to N.
[0176] In other words, in the embodiments of the present invention, all N prediction blocks may be prediction blocks corresponding to decrypted blocks adjacent to the current block, or all N prediction blocks may be prediction blocks corresponding to decrypted blocks not adjacent to the current block, or the N prediction blocks may include prediction blocks corresponding to decrypted blocks adjacent to the current block and prediction blocks corresponding to decrypted blocks not adjacent to the current block.
[0177] In this case, obtaining the first intra-prediction mode of N prediction blocks surrounding the current block in S102-A above includes at least the following methods.
[0178] In method 1, if N prediction blocks include P first prediction blocks, then the above S102-A includes the following steps S102-A-11 and S102-A-12.
[0179] In S102-A-11, the first access order of P first prediction blocks is determined.
[0180] In S102-A-12, the first intra-prediction mode of P first prediction blocks is obtained according to the first access order.
[0181] When the decryption side obtains the first intra-prediction modes of the P first prediction blocks, it must access them according to a specific access order. For example, it obtains the first intra-prediction modes of the P first prediction blocks according to the first access order.
[0182] The embodiments of this application do not limit the specific method for determining the first access order of the P first prediction blocks described above.
[0183] In one example, the first access order of the P first prediction blocks described above is a predetermined order.
[0184] As another example, the decryption side can determine the first access order based on the size of the current block and the sizes of the P decrypted blocks, and / or the shape of the current block and the shapes of the P decrypted blocks.
[0185] For example, for any one of the P decoded blocks, a first similarity is determined based on the size of the decoded block and the size of the current block, and / or a second similarity is determined based on the shape of the decoded block and the shape of the current block. The total similarity between the decoded block and the current block is then determined based on the first and / or second similarity. In this way, the access order of the P decoded blocks is determined according to the total similarity, and the access order of the P decoded blocks is determined as the first access order of the P first predicted blocks. For example, the higher the total similarity, the earlier the blocks are accessed.
[0186] For example, the positions adjacent to the current block can be the 11 positions shown in Figure 18. In other words, P first prediction blocks are 11 first prediction blocks, and these 11 first prediction blocks are prediction blocks corresponding to the positions shown in Figure 18.
[0187] The horizontal and vertical differences between the top-left corner coordinates of the current block at the 11 positions shown in Figure 18 are as follows: Position 1 (-1, height-1), Position 2 (width-1, -1), Position 3 (-1, -1), Position 4 (width, -1), Position 5 (-1, height), Position 6 (-1, height / 2), Position 7 (width / 2, -1), Position 8 (width / 2-1, -1), Position 9 (-1, height / 2-1), Position 10 (-1, 0), and Position 11 (0, -1). width and height are the width and height of the current block, respectively.
[0188] The decoding side determines the first access order of the first prediction block corresponding to the position shown in Figure 18 above, and based on the first access order, obtains the first intra-prediction mode of the first prediction block at these 11 positions.
[0189] For example, the first access order of these 11 first prediction blocks is position 1, position 2, position 3, position 5, position 4, position 10, position 11, position 9, position 8, position 6, position 7.
[0190] In method 2, if N prediction blocks include Q second prediction blocks, then the above S102-A includes the following steps S102-A-21 and S102-A-22.
[0191] In S102-A-21, the second access order of Q second prediction blocks is determined.
[0192] In S102-A-22, the first intra-prediction mode of Q second prediction blocks is obtained according to the second access sequence.
[0193] When the decryption side obtains the first intra-prediction modes of Q second prediction blocks, it must access them according to a specific access order. For example, it obtains the first intra-prediction modes of Q second prediction blocks according to the second access order.
[0194] The embodiments of this application do not limit the specific method for determining the second access order of the Q second prediction blocks described above.
[0195] In one example, the second access order of the Q second prediction blocks described above is a predetermined order.
[0196] As another example, the decryption side can determine the second access order based on the size of the current block and the sizes of the Q decrypted blocks, and / or the shape of the current block and the shapes of the Q decrypted blocks.
[0197] For example, for any one of the Q decrypted blocks, a first similarity is determined based on the size of the decrypted block and the size of the current block, and / or a second similarity is determined based on the shape of the decrypted block and the shape of the current block. Based on the first and / or second similarity, the total similarity between the decrypted block and the current block is determined. In this way, the access order of the Q decrypted blocks is determined according to the total similarity, and the access order of the Q decrypted blocks is determined as the second access order of the Q second predicted blocks. For example, the higher the total similarity, the earlier the blocks are accessed.
[0198] In Example 1, the positions that are not currently adjacent to a block can be the positions numbered 12 to 31 shown in Figure 19. In other words, Q second prediction blocks are 20 second prediction blocks, and these 20 second prediction blocks are prediction blocks corresponding to the positions shown in Figure 19.
[0199] The horizontal and vertical differences from the top-left corner coordinates of the current block at positions 12-31 shown in Figure 19 are, respectively,: Position 12 (-offsetX-1, height+offsetY-1), Position 13 (width+offsetX-1,-offsetY-1), Position 14 (width / 2,-offsetY-1), Position 15 (-offsetX-1, height / 2), Position 16 (-offsetX-1,-offsetY-1), Position 17 (-offsetX×2-1, height+offsetY×2-1), Position 18 (width+offset×2-1,-offsetY×2-1), Position 19 (width / 2,-offsetY×2-1), Position 20 (-offsetX×2-1, height / 2), Position 21 (-offsetX ×2-1,-offsetY×2-1), position 22(-offsetX×3-1,height+offsetY×3-1), position 23(width+offset×3-1,-offset Y×3-1), position 24(width / 2,-offsetY×3-1), position 25(-offsetX×3-1,height / 2), position 26(-offsetX×3-1,-offse tY x 3-1), position 27 (-offsetX x 4-1, height+offsetY x 4-1), position 28 (width+offset x 4-1, -offsetY x 4-1), position 29 (width / 2, -offsetY x 4-1), position 30 (-offsetX x 4-1, height / 2), and position 31 (-offsetX x 4-1, -offsetY x 4-1). width and height are the current width and height of the block, respectively.
[0200] The decoding side determines the second access order of the second prediction block corresponding to the position shown in Figure 19 above, and based on the second access order, obtains the first intra-prediction mode of the second prediction block at these 20 positions.
[0201] In Figure 19, the positions of serial numbers 1 to 11 are the same as the 11 adjacent positions shown in Figure 18 above.
[0202] In Example 2, the positions that are not currently adjacent to a block could be the positions numbered 6 to 23 shown in Figure 20. In other words, Q second prediction blocks are 18 second prediction blocks, and these 18 second prediction blocks are prediction blocks corresponding to the positions shown in Figure 20.
[0203] The horizontal and vertical differences from the top-left corner coordinates of the current block at positions 6-23 shown in Figure 20 are as follows: Position 6 (-offsetX-1, height+offsetY-1), Position 7 (width+offsetX-1,-offsetY-1), Position 8 (-offsetX-1,-offsetY-1), Position 9 (-offsetX×2-1, height+offsetY×2-1), Position 10 (width+offset×2-1,-offsetY×2-1), Position 11 (width / 2,-offsetY×2-1), Position 12 (-offsetX×2-1, height / 2), Position 13 (-offsetX×2-1,-offsetY×2-1), Position 14 (-off The positions are setX×3-1,height+offsetY×3-1), position 15(width+offset×3-1,-offsetY×3-1), position 16(width / 2,-offsetY×3-1), position 17(-offsetX×3-1,height / 2), position 18(-offsetX×3-1,-offsetY×3-1), position 19(-offsetX×4-1,height+offsetY×4-1), position 20(width+offset×4-1,-offsetY×4-1), position 21(width / 2,-offsetY×4-1), position 22(-offsetX×4-1,height / 2), and position 23(-offsetX×4-1,-offsetY×4-1). width and height are the current width and height of the block, respectively.
[0204] The decoding side determines the second access order of the second prediction block corresponding to the position shown in Figure 20 above, and based on the second access order, obtains the first intra-prediction mode of the second prediction block at these 18 positions.
[0205] In Figure 20, the positions of serial numbers 1 to 5 are the same as the five adjacent positions shown in Figure 17 above.
[0206] In Figures 19 and 20 above, offsetX and offsetY may be fixed values, may be equal or not equal, or may be variables that change depending on the shape and size of the block. In some embodiments, offsetX is currently equal to the width of the block, and offsetY is currently equal to the height of the block.
[0207] In some embodiments, to limit complexity, at least one decoded block adjacent to the current block and / or not adjacent to the current block corresponds to the same coding tree unit as the current block, i.e., the current block and the at least one decoded block belong to different image blocks in the same coding tree unit.
[0208] In the embodiment of the present invention, if all N prediction blocks are P first prediction blocks, i.e., N=P, the decoding side obtains the first intra-prediction mode of the P first prediction blocks by the method of Method 1 described above. If all N prediction blocks are Q second prediction blocks, i.e., N=Q, the decoding side obtains the first intra-prediction mode of the Q second prediction blocks by the method of Method 2 described above. If the N prediction blocks include P first prediction blocks and Q second prediction blocks, and N=P+Q, the decoding side obtains the first intra-prediction mode of the P first prediction blocks by the method of Method 1 described above, and obtains the first intra-prediction mode of the Q second prediction blocks by the method of Method 2 described above, thereby obtaining the first intra-prediction mode of the N prediction blocks.
[0209] The above describes the order in which the first intra-prediction mode is obtained for N prediction blocks. Below, we will describe the specific method for obtaining the first intra-prediction mode for prediction blocks.
[0210] In embodiments of the present invention, the first intra-prediction mode of a prediction block can be understood as the intra-prediction mode used by the prediction block during prediction, or an intra-prediction mode derived from the prediction mode used by the prediction block during prediction. For example, if the prediction block is an intra-prediction block, the intra-prediction mode used by the prediction block during prediction is determined as the first intra-prediction mode, or one or more other intra-prediction modes are derived based on the intra-prediction mode used by the prediction block and designated as the first intra-prediction mode of the prediction block. As another example, if the prediction block is an inter-prediction block, the first intra-prediction mode of the prediction block is derived based on the inter-prediction method used by the prediction block.
[0211] Exemplary, in the embodiment of the present invention, the first intra-prediction mode of the prediction block is one of the 67 intra-prediction modes (including 65 angle prediction modes) or one of the 131 intra-prediction modes (including 129 angle prediction modes).
[0212] In the embodiments of this application, the specific method for determining the first intra-prediction mode of each of the N prediction blocks is the same. For the sake of explanation, the acquisition of the first intra-prediction mode of the i-th prediction block will be described below as an example.
[0213] In some embodiments, the first intra-prediction mode for the i-th prediction block is determined based on the type of the i-th prediction block. For example, if the i-th prediction block is an intra-prediction block, the intra-prediction mode used by the i-th prediction block during prediction (e.g., angle prediction mode) is determined as the first intra-prediction mode for the i-th prediction block. In another example, if the i-th prediction block is an intra-prediction block, one intra-prediction mode is determined based on the intra-prediction mode used by the i-th prediction block during prediction, and this is designated as the first intra-prediction mode for the i-th prediction block.
[0214] In some embodiments, the first intra-prediction mode of the i-th prediction block is determined based on the prediction mode of the i-th prediction block, and in this case, S102-A above includes the following steps.
[0215] In S102-A-31, for the i-th prediction block (where i is a positive integer less than or equal to N) out of N prediction blocks, the prediction method used by the i-th prediction block during prediction is determined.
[0216] In S102-A-32, the first intra-prediction mode of the i-th prediction block is determined based on the prediction method.
[0217] In this embodiment, the prediction method used by the i-th prediction block during prediction can be understood as the prediction tool or prediction technique used by the i-th prediction block during prediction. The prediction method used by the i-th prediction block during prediction may be any prediction technique such as TIMD, DIMD, TMRL, MIP, intraTMP, GPM, SGPM, or conventional intra-prediction modes.
[0218] In one example, if the prediction method used by the i-th prediction block during prediction is one of TIMD, DIMD, TMRL, or a conventional intra-prediction mode, the intra-prediction mode derived from that prediction method is determined as the first intra-prediction mode for the i-th prediction block.
[0219] For example, if the i-th prediction block is an intra-prediction block, and the prediction method (or prediction technique) used by the i-th prediction block during prediction is TIMD or TMRL, then at the time of prediction, the i-th prediction block determines at least one intra-prediction mode (e.g., an angle prediction mode) derived using the TIMD or TMRL technique as the first intra-prediction mode of the i-th prediction block.
[0220] As another example, if the i-th prediction block is an intra-prediction block and the prediction method (or prediction technique) used by the i-th prediction block during prediction is DIMD, then the i-th prediction block determines at least one intra-prediction mode (e.g., an angle prediction mode) derived using the DIMD technique as the first intra-prediction mode of the i-th prediction block during prediction.
[0221] As another example, if the i-th prediction block is an intra-prediction block, and the prediction method (or prediction technique) used by the i-th prediction block during prediction is a conventional intra-prediction mode, then when the i-th prediction block makes a prediction, it determines at least one intra-prediction mode derived from the conventional intra-prediction mode (for example, an angle prediction mode) as the first intra-prediction mode of the i-th prediction block.
[0222] In one example, if the prediction method used when the i-th prediction block made prediction is MIP or intraTMP, the DIMD method is used to derive one first angle prediction mode and this first angle prediction mode is determined as the first intra prediction mode for the i-th prediction block, or the planar mode is determined as the first intra prediction mode for the i-th prediction block.
[0223] In embodiments of the present invention, if the i-th prediction block is an intra-prediction block and the prediction method used during prediction is MIP or intraTMP, then MIP or intraTMP cannot be associated with the angle prediction mode and must be replaced with another mode. Exemplarily, if the i-th prediction block is an intra-prediction block and the prediction method used during prediction is MIP or intraTMP, there are at least two methods for determining the first intra-prediction mode of the i-th prediction block.
[0224] The first method involves deriving a first angle prediction mode using the DIMD method and setting it as the first intra-prediction mode for the i-th prediction block. For example, referring to the above technical description of DIMD, an angle prediction mode can be derived on the reconstructed pixels surrounding the decoded block corresponding to the i-th prediction block, and this angle prediction mode can be determined as the first intra-prediction mode for the i-th prediction block.
[0225] The second method is to directly determine the PLANAR mode as the first intra-prediction mode of the i-th prediction block.
[0226] In one example, if the prediction method used when the i-th prediction block made predictions is GPM or SGPM, the angle prediction mode corresponding to the division angle of GPM or SGPM is determined as the first intra-prediction mode of the i-th prediction block.
[0227] For example, if the i-th prediction block is an inter-prediction block and the prediction method (or prediction technique) used when predicting the i-th prediction block is GPM, then the GPM division mode corresponding to the i-th prediction block (as shown in Figure 11) is determined. Next, the GPM division angle is determined based on the GPM division mode, and by referring to Table 1 above, the angle prediction mode corresponding to the GPM division angle can be determined, and this angle prediction mode is determined as the first intra-prediction mode for the i-th prediction block.
[0228] As another example, if the i-th prediction block is an intra-prediction block and the prediction method (or prediction technique) used when predicting the i-th prediction block is SGPM, then the SGPM division mode corresponding to the i-th prediction block (as shown in Figure 11) is determined. Next, the division angle is determined based on the SGPM division mode, and by referring to Table 1 above, the angle prediction mode corresponding to the SGPM division angle can be determined, and this angle prediction mode is determined as the first intra-prediction mode for the i-th prediction block.
[0229] In one example, if the i-th prediction block is an inter-prediction block and the prediction mode used when predicting the i-th prediction block is not GPM mode, the intra-prediction mode in the current block's intra-prediction mode cache is determined as the first intra-prediction mode for the i-th prediction block.
[0230] When predicting the current block, one or more intra-prediction modes are cached in the current block's intra-prediction mode cache, and these one or more intra-prediction modes are the intra-prediction modes of the current block's reference block. As a result, if the i-th predicted block is an inter-prediction block, and the prediction mode used when predicting the i-th predicted block is not a GPM mode, then at least one intra-prediction mode in the current block's intra-prediction mode cache can be determined as the first intra-prediction mode of the i-th predicted block.
[0231] The decryption side can obtain the first intra-prediction mode for each of the N prediction blocks based on the access order of the N prediction blocks described above and the method for obtaining the first intra-prediction mode described above.
[0232] The decoding side obtains the first intra-prediction mode for N prediction blocks, and then performs the step S102-B described above, which is to construct a list of candidate intra-prediction modes corresponding to the current block based on the first intra-prediction mode and first angular accuracy of the N prediction blocks.
[0233] In embodiments of the present invention, the angular accuracy of the prediction tools used by different prediction blocks in the N prediction blocks during prediction is not necessarily identical, and therefore the angular accuracy corresponding to the first intra-prediction mode of the N prediction blocks is not necessarily identical. For example, if prediction block 1 uses TIMD during prediction and the angular accuracy of TIMD is 129 (corresponding to 129 types of angular prediction modes), then the angular accuracy corresponding to the first intra-prediction mode of prediction block 1 is 129 (corresponding to 129 types of angular prediction modes). As another example, if prediction block 2 uses DIMD during prediction and the angular accuracy of DIMD is 65 (corresponding to 65 types of angular prediction modes), then the angular accuracy corresponding to the first intra-prediction mode of prediction block 2 is 65 (corresponding to 65 types of angular prediction modes). In this case, the angular accuracy corresponding to the first intra-prediction mode of prediction block 1 and prediction block 2 is different. Furthermore, the angular accuracy of at least one of the first intra-prediction modes among the N prediction blocks may differ from the first angular accuracy. Therefore, the decoding side needs to obtain a first intra-prediction mode for N prediction blocks based on the steps described above, then perform angle matching on the first intra-prediction mode based on the first angle accuracy to obtain a second intra-prediction mode, and then construct a list of intra-prediction mode candidates based on the second intra-prediction mode.
[0234] The following describes the specific process for constructing a list of candidate intra-prediction modes corresponding to the current block, based on the first intra-prediction mode and first angular accuracy of N prediction blocks.
[0235] In S102-B described above, the method for constructing a list of candidate intra-prediction modes corresponding to the current block based on the first intra-prediction mode and first angular accuracy of N prediction blocks includes at least the following methods.
[0236] In Method 1, the decoding side compares the angular precision corresponding to the first intra-prediction mode of each of the N prediction blocks with the first angular precision. If the angular precision corresponding to the first intra-prediction mode of the prediction block is different from the first angular precision, precision matching is performed on the first intra-prediction mode of the prediction block to obtain the second intra-prediction mode at the first angular precision of the first intra-prediction mode of the prediction block. If the angular precision corresponding to the first intra-prediction mode of the prediction block is the same as the first angular precision, the first intra-prediction mode of the prediction block is determined as the second intra-prediction mode. In this way, the second intra-prediction mode corresponding to the first intra-prediction mode of each of the N prediction blocks can be determined, and an intra-prediction mode candidate list is constructed based on the second intra-prediction modes of the N prediction blocks. For example, different second intra-prediction modes from among the second intra-prediction modes of the N prediction blocks are added to the intra-prediction mode candidate list until the length of the intra-prediction mode candidate list reaches a predetermined length.
[0237] In method 2, the above S102-B includes the following steps S102-B1 to S102-B3.
[0238] In S102-B1, K (where K is a positive integer less than or equal to N) first intra-prediction modes are determined based on the first intra-prediction modes of N prediction blocks.
[0239] In S102-B2, a second intra-prediction mode corresponding to K first intra-prediction modes is determined based on the first angular accuracy.
[0240] In S102-B3, a list of candidate intra-prediction modes is constructed based on K second intra-prediction modes.
[0241] In method 2, the decoding side first selects K first intra-prediction modes from among the N prediction blocks' first intra-prediction modes, and these K first intra-prediction modes are all different. Next, the angular accuracy corresponding to each of the K first intra-prediction modes is compared with the first angular accuracy to determine the second intra-prediction mode corresponding to each of the K first intra-prediction modes. Finally, a list of intra-prediction mode candidates is constructed based on these K second intra-prediction modes.
[0242] In embodiments of the present invention, a specific method for determining K first intra-prediction modes based on the first intra-prediction modes of N prediction blocks includes at least the following methods.
[0243] In method 1, the decryption side selects K first intra-prediction modes from the first intra-prediction modes of the N prediction blocks based on the access order of the N prediction blocks.
[0244] In method 2, the above S102-B1 includes the following steps S102-B1-11 and S102-B1-12.
[0245] In S102-B1-11, some or all of the first intra prediction modes of the N prediction blocks are sorted to obtain the sorted first intra prediction modes.
[0246] In S102-B1-12, K first intra prediction modes are determined based on the sorted first intra prediction modes.
[0247] As can be seen from the above, in some embodiments, N prediction blocks include P first prediction blocks, in some embodiments, N prediction blocks include Q second prediction blocks, and in some embodiments, N prediction blocks include both P first prediction blocks and Q second prediction blocks.
[0248] Based on this point, as a method of sorting some or all of the first intra prediction modes of the N prediction blocks to obtain the sorted first intra prediction modes, the following several examples can be given.
[0249] In Example 1, when the N prediction blocks include the P first prediction blocks, sort the first intra prediction modes of the P first prediction blocks in the N prediction blocks to obtain the sorted first intra prediction modes.
[0250] That is, in this Example 1, only sort the first intra prediction modes of the P first prediction blocks in the N prediction blocks. When the N prediction blocks further include second prediction blocks, do not sort the first intra prediction modes of the second prediction blocks.
[0251] In this example, the method of sorting the first intra prediction modes of the P first prediction blocks may be to predict the template of the current block using the first intra prediction mode of the first prediction block, determine the predicted value of the template, and determine the first prediction cost of the first intra prediction mode based on the predicted value and the reconstructed value of the template. Using this method, the first prediction cost corresponding to each first intra prediction mode of the P first prediction blocks can be determined. Based on the first prediction cost (for example, in ascending order of the first prediction cost), sort the first intra prediction modes of the P first prediction blocks to obtain the sorted first intra prediction modes.
[0252] In Example 2, when the N prediction blocks include the Q second prediction blocks, sort the first intra prediction modes of the Q second prediction blocks in the N prediction blocks to obtain the sorted first intra prediction modes.
[0253] In other words, in Example 2, only the first intra-prediction modes of the Q second-order prediction blocks in the N prediction blocks are sorted, and if the N prediction blocks further contain first-order prediction blocks, the first intra-prediction modes of the first-order prediction blocks are not sorted.
[0254] In this example, a method for sorting the first intra-prediction modes of Q second prediction blocks may involve using the first intra-prediction mode of the second prediction block to predict the template of the current block, determining the predicted value of the template, and determining the first prediction cost of the first intra-prediction mode based on the predicted value and reconstructed value of the template. Using this method, the first prediction cost corresponding to the first intra-prediction mode of each of the Q second prediction blocks can be determined, and the first intra-prediction modes of the Q second prediction blocks can be sorted based on the first prediction cost (for example, in ascending order of the first prediction cost) to obtain the sorted first intra-prediction modes.
[0255] In Example 3, the first intra-prediction modes of N prediction blocks are sorted to obtain the sorted first intra-prediction modes.
[0256] In the embodiments of the present invention, both Example 1 and Example 2 above can be understood as methods for sorting some of the first intra-prediction modes in the first intra-prediction modes of N prediction blocks. Example 3 above can be understood as a method for sorting all of the first intra-prediction modes in the first intra-prediction modes of N prediction blocks.
[0257] In other words, in Example 3, whether the N prediction blocks are N first prediction blocks, N second prediction blocks, or N prediction blocks contain both first and second prediction blocks, the decoding side sorts all first intra-prediction modes of the N prediction blocks.
[0258] In this example, a method for sorting the first intra-prediction modes of N prediction blocks may involve using the first intra-prediction mode to predict the template of the current block, determining the predicted value of the template, and determining the first prediction cost of the first intra-prediction mode based on the predicted value and reconstructed value of the template. Using this method, the first prediction cost corresponding to each first intra-prediction mode can be determined, and the first intra-prediction modes of the N prediction blocks can be sorted based on the first prediction costs (for example, in ascending order of the first prediction costs) to obtain the sorted first intra-prediction modes.
[0259] In Example 4, R (where R is a positive integer less than N) first intra-prediction modes are selected from the N first intra-prediction modes of the prediction blocks, the R first intra-prediction modes are sorted, and the sorted first intra-prediction modes are obtained.
[0260] In Example 4, the decoding side first selects R first intra-prediction modes from among the N first intra-prediction modes of prediction blocks, for example, in a predetermined order or rule. Next, the selected R first intra-prediction modes are sorted to obtain sorted first intra-prediction modes.
[0261] In this example, a method for sorting R first intra-prediction modes may involve using the first intra-prediction mode to predict the template of the current block, determining the predicted value of the template, and determining the first prediction cost of the first intra-prediction mode based on the predicted value and reconstructed value of the template. Using this method, the first prediction cost corresponding to each first intra-prediction mode can be determined, and the R first intra-prediction modes can be sorted based on the first prediction costs (for example, in ascending order of the first prediction costs) to obtain the sorted first intra-prediction modes.
[0262] In method 2, the decoding side sorts some or all of the first intra prediction modes of the N prediction blocks based on the above steps, obtains sorted first intra prediction modes, and then determines K first intra prediction modes based on the sorted first intra prediction modes. For example, by sorting the first intra prediction modes in ascending order of first prediction cost and selecting the first K first intra prediction modes from the sorted first intra prediction modes, K first intra prediction modes can be obtained.
[0263] In addition to determining K first intra-prediction modes using method 2 described above, the decoding side can also obtain K first intra-prediction modes by employing the following method 3.
[0264] In method 3, the above S102-B1 includes the following steps S102-B1-21 and S102-B1-22.
[0265] In S102-B1-21, the first intra-prediction mode corresponding to DIMD is determined.
[0266] In S102-B1-22, K first intra prediction modes are determined based on the first intra prediction mode corresponding to DIMD and the first intra prediction modes of N prediction blocks.
[0267] In method 3, K first intra-prediction modes are determined from the first intra-prediction mode corresponding to DIMD and the first intra-prediction modes of N prediction blocks. Here, the method for deriving the first intra-prediction modes using the DIMD method can be described by referring to the above technical explanation regarding DIMD. For example, one or more intra-prediction modes are derived using the DIMD technique within the template area of the current block, and these one or more intra-prediction modes are designated as the first intra-prediction modes corresponding to DIMD.
[0268] Next, K first intra-prediction modes are determined from the first intra-prediction modes corresponding to DIMD and the first intra-prediction modes of the N prediction blocks.
[0269] Here, the specific implementation of determining K first intra-prediction modes from the first intra-prediction mode corresponding to DIMD and the first intra-prediction modes of N prediction blocks includes at least the following implementations.
[0270] In one method, K first intra-prediction modes are selected from the first intra-prediction modes corresponding to DIMD and the first intra-prediction modes of N prediction blocks, according to a predetermined order or rule.
[0271] In another method, S (where S is a positive integer) first intra prediction modes are selected from the first intra prediction modes corresponding to DIMD and the first intra prediction modes of N prediction blocks, the S first intra prediction modes are sorted to obtain the sorted S first intra prediction modes, and K first intra prediction modes are determined based on the sorted S first intra prediction modes.
[0272] In this implementation, on the decoding side, first, according to a predetermined order or rule, S first intra prediction modes are selected from the first intra prediction mode corresponding to DIMD and the first intra prediction modes of N prediction blocks. Next, the S first intra prediction modes are sorted to obtain the sorted S first intra prediction modes. For example, the prediction value of each first intra prediction mode of the S first intra prediction modes with respect to the template of the current block is calculated, and based on the reconstructed value of the template and the prediction value of the template corresponding to each first intra prediction mode, the first prediction cost corresponding to each first intra prediction mode of the S first intra prediction modes is obtained. Then, based on the first prediction cost, the S first intra prediction modes are sorted to obtain the sorted S first intra prediction modes. For example, the S first intra prediction modes are sorted in ascending order of the first prediction cost to obtain the sorted S first intra prediction modes. In this way, K first intra prediction modes can be determined from the sorted S first intra prediction modes. For example, the first K first intra prediction modes in the sorted S first intra prediction modes are determined as the K first intra prediction modes.
[0273] Based on the above steps, after determining K first intra prediction modes based on the first intra prediction modes of N prediction blocks, the decoding side executes the steps of S102 - B2 above.
[0274] Here, determining the second intra prediction modes corresponding to the K first intra prediction modes based on the first angle accuracy may include several cases as follows.
[0275] In Case 1, for the i-th first intra prediction mode among the K first intra prediction modes, when the angle accuracy corresponding to the i-th first intra prediction mode matches the first angle accuracy, the i-th first intra prediction mode is determined as the i-th second intra prediction mode, where i is a positive integer not exceeding N.
[0276] In Case 2, for the i-th first intra-prediction mode out of K first intra-prediction modes, if the angular accuracy corresponding to the i-th first intra-prediction mode is different from the first angular accuracy, the second intra-prediction mode corresponding to the i-th first intra-prediction mode with the first angular accuracy is determined.
[0277] In some embodiments, the correspondence between the angular direction and the conventional prediction mode index for 129 types of angular precision and 65 types of angular precision is shown in Figure 21. Here, ipmExt refers to the intra-prediction mode index for 129 types of angular precision, and ipm refers to the intra-prediction mode index for 65 types of angular precision.
[0278] For example, if ipmExt and ipm are 0, the corresponding intra-prediction mode is Planar mode.
[0279] For example, if ipmExt and ipm are both 1, the corresponding intra-prediction mode is DC mode.
[0280] For example, if ipmExt is between 2 and 130, the corresponding intra-prediction modes are 129 angles, and the direction of the angles can be roughly compared to those shown in Figure 21.
[0281] For example, if the IPM is between 2 and 66, the corresponding intra-prediction modes are 65 angles, and the direction of the angles can be roughly compared to those shown in Figure 21.
[0282] In one example, the correspondence between ipm and ipmExt is as shown in equations (5) and (6).
[0283]
number
[0284] For example, if the angular precision corresponding to the i-th first intra prediction mode is 65 (corresponding to 65 types of angular prediction modes) and the first angular precision is 129 (corresponding to 129 types of angular prediction modes), then the second intra prediction mode with an angular precision of 129 that corresponds to the i-th first intra prediction mode can be determined by equation (6) above.
[0285] As another example, if the angular precision corresponding to the i-th first intra-prediction mode is 129 (corresponding to 129 types of angular prediction modes) and the first angular precision is 65 (corresponding to 65 types of angular prediction modes), then the corresponding second intra-prediction mode for the i-th first intra-prediction mode with an angular precision of 65 can be determined by equation (5) above.
[0286] In some embodiments, in addition to constructing an intra-prediction mode candidate list based on the first intra-prediction mode of N prediction blocks surrounding the current block as shown in the above embodiment, the decoding side can construct an intra-prediction mode candidate list by the following steps S102-C to S102-E.
[0287] In S102-C, M intra-prediction modes (where M is a positive integer) are selected from the intra-prediction modes already present in the current intra-prediction mode candidate list.
[0288] In S102-D, for the j-th intra-prediction mode (where j is a positive integer less than or equal to M) out of M intra-prediction modes, an intra-prediction mode adjacent to the j-th intra-prediction mode is determined based on the first angular accuracy.
[0289] In S102-E, adjacent intra-prediction modes are added to the intra-prediction mode candidate list.
[0290] In this embodiment, the decoding side first obtains M intra-prediction modes from the intra-prediction modes already present in the current intra-prediction mode candidate list, and then determines intra-prediction modes adjacent to each of these M intra-prediction modes based on a first angular accuracy. Subsequently, these adjacent intra-prediction modes are added to the intra-prediction mode candidate list until the length of the intra-prediction mode candidate list is equal to a predetermined length.
[0291] In this embodiment, if the intra-prediction mode candidate list already contains at least one intra-prediction mode, that is, if the decoding side determines that the length of the current intra-prediction mode candidate list is less than a predetermined length, it obtains M intra-prediction modes from among the intra-prediction modes already present in the current intra-prediction mode candidate list.
[0292] In some embodiments, intra-prediction modes already present in the current intra-prediction mode candidate list may be some of the default intra-prediction modes, such as the PLANAR mode.
[0293] In some embodiments, the intra-prediction modes already present in the current intra-prediction mode candidate list may be the K second intra-prediction modes determined by the method described above. That is, the decoding side first obtains the first intra-prediction modes of N prediction blocks surrounding the current block based on the method described above, determines K first intra-prediction modes based on the first intra-prediction modes of the N prediction blocks, then determines the second intra-prediction modes corresponding to each of the K first intra-prediction modes based on a first angular accuracy, and then adds the different second intra-prediction modes from these K second intra-prediction modes to the intra-prediction mode candidate list. Next, it is determined whether the length of the intra-prediction mode candidate list at this time reaches a predetermined length, and if the length of the intra-prediction mode candidate list is less than the predetermined length, steps S102-C to S102-E described above are performed to determine at least one adjacent intra-prediction mode, and adds the intra-prediction mode that does not overlap with an existing intra-prediction mode from this at least one adjacent intra-prediction mode to the intra-prediction mode candidate list.
[0294] In the embodiments of this application, the method for determining the intra-prediction modes adjacent to each of the M intra-prediction modes is the same. For the sake of explanation, the j-th intra-prediction mode will be described as an example.
[0295] In some embodiments, the intra-prediction modes adjacent to the j-th intra-prediction mode include a first-nearest-nearest-prediction mode whose index is smaller than the first index of the j-th intra-prediction mode, and / or a second-nearest-nearest-prediction mode whose index is larger than the first index.
[0296] In some embodiments, determining the intra-prediction mode adjacent to the j-th intra-prediction mode based on the first angular accuracy in S102-D above includes the method shown in the following example.
[0297] In one example, if a predetermined mode adjacent to the j-th intra-prediction mode includes the first nearest-nearest-prediction mode, and the j-th intra-prediction mode is not the first angle prediction mode among the prediction modes corresponding to the first angle accuracy, then the prediction mode whose index is one value smaller than the first index among the prediction modes corresponding to the first angle accuracy is determined as the first nearest-nearest-prediction mode.
[0298] In one example, if the intra-prediction mode adjacent to the j-th intra-prediction mode includes the first nearest prediction mode, and the j-th prediction mode is the first angle prediction mode among the prediction modes corresponding to the first angle accuracy, then the prediction mode whose index is one value smaller than the index of the prediction mode in the opposite direction of the j-th intra-prediction mode is determined as the first nearest prediction mode. For example, if the first angle accuracy is 65 and the ipm of the j-th prediction mode is 2, then the first nearest prediction mode ipm - This is the index of the angular mode located on the opposite angular direction of the IPM, separated from it by a value of 1 (e.g., delta+1). As another example, if the first angular precision is 129 and the IPMExt of the j-th prediction mode is 2, then the first nearest-neighbor prediction mode IPMExt is - This is the index of the angular mode that is one value away (e.g., delta+1) from ipmExt in the opposite angular direction.
[0299] In one example, if a predetermined mode adjacent to the j-th intra-prediction mode includes a second-nearest-nearest-prediction mode, and the j-th intra-prediction mode is not the last angle prediction mode among the prediction modes corresponding to the first angle accuracy, then the prediction mode whose index is 1 value greater than the first index among the prediction modes corresponding to the first angle accuracy is determined as the second-nearest-nearest-nearest-prediction mode.
[0300] In one example, if a predetermined mode adjacent to the j-th intra-prediction mode includes a second-nearest-nearest-prediction mode, and the j-th intra-prediction mode is the last angle prediction mode among the prediction modes corresponding to the first angle accuracy, then the prediction mode whose index is one value greater than the index of the prediction mode in the opposite direction of the j-th intra-prediction mode is determined as the second-nearest-nearest-prediction mode. For example, if the first angle accuracy is 65 and the ipm of the j-th prediction mode is 66, then the first-nearest-nearest-prediction mode ipm + This is the index of the angular mode located on the opposite angular direction of the IPM, separated from it by a value of 1 (e.g., delta+1). As another example, if the first angular precision is 129 and the IPMExt of the j-th prediction mode is 130, then the first nearest-neighbor prediction mode IPMExt is... + This is the index of the angular mode that is one value away (e.g., delta+1) from ipmExt in the opposite angular direction.
[0301] The embodiments of this application do not limit the specific value of the first value described above.
[0302] In one possible embodiment, the above first value may be a predetermined value.
[0303] In another possible implementation, the above first value is the sum of the first predetermined value and 1, where the first predetermined value delta is a positive integer greater than or equal to 0, and in some embodiments, delta is less than 4.
[0304] In some embodiments, determining the intra-prediction mode adjacent to the j-th intra-prediction mode based on the first angular accuracy in S102-D above includes the following steps:
[0305] In S102-D1, the second and / or third values are determined based on the first angular accuracy.
[0306] In S102-D2, based on the second and / or third values, the first nearest neighbor predictionDetermine the mode and / or the second nearest-neighbor prediction mode.
[0307] The embodiments of this application do not limit the specific method for determining the second and / or third values based on the first angular accuracy.
[0308] In one example, there are different second and / or third values corresponding to different angular accuracies, both of which are predetermined values. For example, if the first angular accuracy is 65, the second value is 61 and the third value is 64. In another example, if the first angular accuracy is 129, the second value is 125 and the third value is 128.
[0309] As another example, the second value is determined by subtracting 4 from the first angular accuracy, and the third value is determined by subtracting 1 from the first angular accuracy.
[0310] After determining the second and / or third digits, the decryption side determines the first nearest neighbor based on the second and / or third digits. prediction Determine the mode and / or second-neighbor prediction mode. Specifically, the first-neighbor prediction mode is determined based on the second and third values. prediction Determine the mode and, based on the third value, the second nearest neighbor. prediction Determine the mode.
[0311] In some embodiments, the decoding side adds a second numerical value to the first index of the j-th intra-prediction mode, then subtracts a first predetermined value to obtain a fourth numerical value, and then adds a second predetermined value to the remainder obtained by dividing the fourth numerical value by the third numerical value to obtain an index corresponding to the first proximity prediction mode, and based on the index corresponding to the first proximity prediction mode, the first proximity prediction mode is determined from among the prediction modes corresponding to the first angular accuracy.
[0312] In some other embodiments, the decoding side subtracts a third predetermined value from the index of the j-th intra-prediction mode, then adds a first predetermined value to obtain a fifth value, and then adds a second predetermined value to the remainder obtained by dividing the fifth value by the third value to obtain an index corresponding to the second proximity prediction mode, and based on the index corresponding to the second proximity prediction mode, the second proximity prediction mode is determined from among the prediction modes corresponding to the first angular accuracy.
[0313] For example, if the first angular accuracy is 65 (corresponding to 65 types of angular prediction modes), the decoding side can determine the first and second nearest-neighbor prediction modes that are close to the j-th intra-prediction mode using the following equation (7).
[0314] ipm_=(ipm+61-delta)%64+2 ipm + =(ipm-1+delta)%64+2 (7) Here, ipm is the first index in the 65 angular precision of the j-th intra prediction mode, delta is the first predetermined value, 61 is the second numerical value corresponding to the 65 angular precision, 64 is the third numerical value corresponding to the 65 angular precision, ipm + 61 - delta is the fourth numerical value, and ipm - is the index of the first nearest predictive mode that is adjacent to the j-th intra predictive mode. ipm-1+delta is the fifth value, where the third predetermined value is equal to 1. + This is the index of the second nearest predictive mode that is adjacent to the j-th intra predictive mode.
[0315] As another example, if the first angular accuracy is 129 (corresponding to 129 types of angular prediction modes), the decoding side can determine the first and second nearest-neighbor prediction modes that are close to the j-th intra-prediction mode using the following equation (8).
[0316] ipmExt_=(ipmExt+125-delta)%128+2 ipmExt+=(ipmExt-1+delta)%128+2 (8) Here, ipmExt is the first index in the 129 angular precision of the j-th intra prediction mode, delta is the first predetermined value, 125 is the second numerical value corresponding to the 129 angular precision, 128 is the third numerical value corresponding to the 129 angular precision, ipmExt + 125 - delta is the fourth numerical value, and ipmExt - is the index of the first nearest predictive mode adjacent to the j-th intra predictive mode. ipmExt-1+delta is the fifth value, where the third predetermined value is equal to 1. ipmExt + This is the index of the second nearest predictive mode that is adjacent to the j-th intra predictive mode.
[0317] Based on the steps described above, it is possible to determine the intra-prediction modes adjacent to each of the M intra-prediction modes, and then add these adjacent intra-prediction modes to the intra-prediction mode candidate list until the length of the list reaches a predetermined length.
[0318] In some embodiments, if the length of the intra-prediction mode candidate list does not reach a predetermined length, the method defaults to an angle prediction The process further includes determining a second angular accuracy corresponding to the mode, determining a second intra-prediction mode in the first angular accuracy that corresponds to the default angular prediction mode if the second angular accuracy differs from the first angular accuracy, and adding the second intra-prediction mode corresponding to the default angular prediction mode to the intra-prediction mode candidate list. Here, determining a second intra-prediction mode in the first angular accuracy that corresponds to the default angular prediction mode can be explained by referring to the relevant explanation in the above embodiment and will not be explained again here.
[0319] The process of constructing the intra-prediction mode candidate list in the embodiment of this application will be further explained below with an example.
[0320] Assume that the angular accuracy for TMRL and TIMD technologies is 129, and the angular accuracy for DIMD, MPM, SGPM, and GPM technologies is 65.
[0321] In Example 1, a list of MPM candidate lists is constructed, and the first angular precision corresponding to the MPM candidate list is 65.
[0322] In Method 1, the MPM candidate list is constructed by the following steps.
[0323] In step 11, the PLANAR mode is placed at the top of the MPM candidate list.
[0324] In step 12, in a specific order, one by one, non-overlapping second intra-prediction modes corresponding to the first intra-prediction modes of the P first prediction blocks corresponding to the decoded blocks at positions adjacent to the current block are added to the MPM candidate list. Illustratively, these P first prediction blocks are the prediction blocks at 11 adjacent positions around the current block in Figure 18. Specifically, the following process is performed on the i-th first prediction block among the 11 first prediction blocks.
[0325] If the i-th first prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th first prediction block is matched from an angular precision of 129 to an angular precision of 65 to obtain the intra-prediction mode index.
[0326] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0327] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived from DIMD is obtained.
[0328] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is obtained.
[0329] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is the conventional intra prediction mode, the intra prediction mode index is obtained.
[0330] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is GPM mode, obtain the angle prediction mode index corresponding to the GPM division angle.
[0331] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is not GPM mode, retrieve the intra-prediction mode index cached in the current block's intra-prediction mode cache.
[0332] Furthermore, all intra-prediction mode indices obtained above can be understood as indices for the second intra-prediction mode.
[0333] In step 13, obtain one or more (e.g., two) angle mode indices that the current block has derived using the DIMD tool.
[0334] In step 14, an extension is performed on an existing angle prediction mode in the intra prediction candidate list to include similar angles, thereby obtaining at least one extended angle prediction mode.
[0335] In step 15, the intra-prediction candidate list is supplemented with the 65 angular-precision mode indices in the default mode list.
[0336] Furthermore, in steps 11 to 15 above, if the quantity of replenished mode reaches the required replenishment quantity, replenishment should be stopped.
[0337] In Method 2, the MPM candidate list is constructed by the following steps.
[0338] In step 21, the PLANAR mode is placed at the top of the MPM candidate list.
[0339] In step 22, in a specific order, one by one, non-overlapping second intra-prediction modes corresponding to the first intra-prediction modes of the P first prediction blocks corresponding to the decoded blocks at positions adjacent to the current block are added to the MPM candidate list. Illustratively, these P first prediction blocks are the prediction blocks at 11 adjacent positions around the current block in Figure 19. Specifically, the following process is performed on the i-th first prediction block among the 11 first prediction blocks.
[0340] If the i-th first prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th first prediction block is matched from an angular precision of 129 to an angular precision of 65, that is, it is matched from 129 types of angular prediction modes to 65 types of angular prediction modes, and the index of the intra-prediction mode is obtained.
[0341] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0342] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived from DIMD is obtained.
[0343] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is obtained.
[0344] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is the conventional intra prediction mode, the intra prediction mode index is obtained.
[0345] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is GPM mode, obtain the angle prediction mode index corresponding to the GPM division angle.
[0346] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is not GPM mode, retrieve the intra-prediction mode index cached in the current block's intra-prediction mode cache.
[0347] Furthermore, all intra-prediction mode indices obtained above can be understood as indices for the second intra-prediction mode.
[0348] In step 23, obtain one or more (e.g., two) angle mode indices that the current block has derived using the DIMD tool.
[0349] In step 24, in a specific order, one by one, non-overlapping second intra-prediction modes are added to the MPM candidate list from among the Q second-prediction blocks corresponding to the first intra-prediction mode of the Q second-prediction blocks corresponding to the decoded block at a location not adjacent to the current block. Illustratively, these Q second-prediction blocks are the prediction blocks at 20 non-adjacent locations around the current block in Figure 19. Specifically, the following process is performed on the i-th second-prediction block among the 20 second-prediction blocks.
[0350] If the i-th second prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th second prediction block is matched from an angular precision of 129 to an angular precision of 65, that is, it is matched from 129 types of angular prediction modes to 65 types of angular prediction modes, and the index of the intra-prediction mode is obtained.
[0351] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0352] If the i-th second prediction block is an intra prediction block and the prediction mode of the i-th second prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived from DIMD is obtained.
[0353] If the i-th second prediction block is an intra prediction block and the prediction mode of the i-th second prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is obtained.
[0354] If the i-th second prediction block is an intra prediction block, and the prediction mode of the i-th second prediction block is the conventional intra prediction mode, then the intra prediction mode index is obtained.
[0355] If the i-th second prediction block is an interpretation block and the prediction mode of the i-th second prediction block is GPM mode, obtain the angle prediction mode index corresponding to the GPM division angle.
[0356] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is not GPM mode, retrieve the intra-prediction mode index cached in the current block's intra-prediction mode cache.
[0357] In step 25, an existing angle prediction mode in the intra prediction candidate list is extended to similar angles to obtain at least one extended angle prediction mode.
[0358] In step 26, the intra-prediction candidate list is supplemented with the 65 angular-precision mode indices in the default mode list.
[0359] Furthermore, in steps 21 to 26 above, if the quantity of replenished mode reaches the required replenishment quantity, replenishment should be stopped.
[0360] In Method 3, the MPM candidate list is constructed by following the steps below.
[0361] In step 31, the PLANAR mode is placed at the top of the MPM candidate list.
[0362] In step 32, in a specific order, one by one, non-overlapping second intra-prediction modes corresponding to the first intra-prediction modes of the P first prediction blocks corresponding to the decoded blocks at positions adjacent to the current block are added to the MPM candidate list. Illustratively, these P first prediction blocks are the prediction blocks at the five adjacent positions around the current block in Figure 20. Specifically, the following process is performed on the i-th first prediction block among the five first prediction blocks.
[0363] If the i-th first prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th first prediction block is matched from an angular precision of 129 to an angular precision of 65, that is, it is matched from 129 types of angular prediction modes to 65 types of angular prediction modes, and the index of the intra-prediction mode is obtained.
[0364] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0365] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived from DIMD is obtained.
[0366] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is obtained.
[0367] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is the conventional intra prediction mode, the intra prediction mode index is obtained.
[0368] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is GPM mode, obtain the angle prediction mode index corresponding to the GPM division angle.
[0369] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is not GPM mode, retrieve the intra-prediction mode index cached in the current block's intra-prediction mode cache.
[0370] Furthermore, all intra-prediction mode indices obtained above can be understood as indices for the second intra-prediction mode.
[0371] In step 33, obtain one or more (e.g., two) angle mode indices that the current block has derived using the DIMD tool.
[0372] In step 34, in a specific order, one by one, non-overlapping second intra-prediction modes are added to the MPM candidate list from among the Q second prediction blocks corresponding to the decoded block at a location not adjacent to the current block, and corresponding to the first intra-prediction mode of each second prediction block. Illustratively, these Q second prediction blocks are the prediction blocks at 18 non-adjacent locations around the current block in Figure 20. Specifically, the following process is performed on the i-th second prediction block among the 18 second prediction blocks.
[0373] If the i-th second prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th second prediction block is matched from an angular precision of 129 to an angular precision of 65, that is, it is matched from 129 types of angular prediction modes to 65 types of angular prediction modes, and the index of the intra-prediction mode is obtained.
[0374] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0375] If the i-th second prediction block is an intra prediction block and the prediction mode of the i-th second prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived from DIMD is obtained.
[0376] If the i-th second prediction block is an intra prediction block and the prediction mode of the i-th second prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is obtained.
[0377] If the i-th second prediction block is an intra prediction block, and the prediction mode of the i-th second prediction block is the conventional intra prediction mode, then the intra prediction mode index is obtained.
[0378] If the i-th second prediction block is an interpretation block and the prediction mode of the i-th second prediction block is GPM mode, obtain the angle prediction mode index corresponding to the GPM division angle.
[0379] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is not GPM mode, retrieve the intra-prediction mode index cached in the current block's intra-prediction mode cache.
[0380] In step 35, an existing angle prediction mode in the intra prediction candidate list is extended to similar angles to obtain at least one extended angle prediction mode.
[0381] In step 36, the intra-prediction candidate list is supplemented with the 65 angular-precision mode indices in the default mode list.
[0382] Furthermore, in steps 31 to 36 above, if the quantity of replenished mode reaches the required replenishment quantity, replenishment should be stopped.
[0383] In some embodiments, the total number of modes acquired at adjacent and non-adjacent positions and modes derived by DIMD can be limited so as not to exceed a predetermined value. This predetermined value may be a standard value that the encoder and decoder commonly follow, or it may be a value analyzed from the bitstream.
[0384] In Example 2, a list of TMRL candidates is constructed, and the first angular precision corresponding to the TMRL candidate list is 129.
[0385] In Method 1, the TMRL candidate list is constructed by following the steps below.
[0386] In step 41, in a specific order, one by one, non-overlapping second intra-prediction modes corresponding to the first intra-prediction modes of the P first prediction blocks corresponding to the decoded blocks at positions adjacent to the current block are added to the TMRL candidate list. Illustratively, these P first prediction blocks are the prediction blocks at 11 adjacent positions around the current block in Figure 18. Specifically, the following process is performed on the i-th first prediction block among the 11 first prediction blocks.
[0387] If the i-th first prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th first prediction block is obtained.
[0388] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0389] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived by DIMD is matched to the intra prediction mode index with an angular precision of 129.
[0390] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is matched to an intra-prediction mode index with an angle precision of 129.
[0391] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is a conventional intra prediction mode, then the first intra prediction mode index of the i-th first prediction block is matched to an intra prediction mode index with an angular precision of 129.
[0392] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is GPM mode, the intraprediction mode index corresponding to the GPM division is matched to an intraprediction mode index with an angular precision of 129.
[0393] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is not GPM mode, then the intraprediction mode index cached in the current block's intraprediction mode cache is matched to an intraprediction mode index with an angular precision of 129.
[0394] Furthermore, all intra-prediction mode indices obtained above can be understood as indices for the second intra-prediction mode.
[0395] In step 42, the current block obtains one or more (e.g., two) angular mode indices derived using the DIMD tool and matches them to an intra-predictive mode index with an angular precision of 129.
[0396] In step 43, an existing angle prediction mode in the intra prediction candidate list is extended to similar angles to obtain at least one extended angle prediction mode.
[0397] In step 44, the 65 angular-precision mode indices in the default mode list are matched to the 129 angular-precision intra-predictive mode indices.
[0398] Furthermore, in steps 41 to 44 above, if the quantity of replenished mode reaches the required quantity for replenishment, replenishment should be stopped.
[0399] In Method 2, the TMRL candidate list is constructed by the following steps.
[0400] In step 51, in a specific order, one by one, non-overlapping second intra-prediction modes corresponding to the first intra-prediction modes of the P first prediction blocks corresponding to the decoded blocks at positions adjacent to the current block are added to the TMRL candidate list. Illustratively, these P first prediction blocks are the prediction blocks at 11 adjacent positions around the current block in Figure 19. Specifically, the following process is performed on the i-th first prediction block among the 11 first prediction blocks.
[0401] If the i-th first prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th first prediction block is obtained.
[0402] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0403] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived by DIMD is matched to the intra prediction mode index with an angular precision of 129.
[0404] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is matched to an intra-prediction mode index with an angle precision of 129.
[0405] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is a conventional intra prediction mode, then the first intra prediction mode index of the i-th first prediction block is matched to an intra prediction mode index with an angular precision of 129.
[0406] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is GPM mode, the intraprediction mode index corresponding to the GPM division is matched to an intraprediction mode index with an angular precision of 129.
[0407] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is not GPM mode, then the intraprediction mode index cached in the current block's intraprediction mode cache is matched to an intraprediction mode index with an angular precision of 129.
[0408] Furthermore, all intra-prediction mode indices obtained above can be understood as indices for the second intra-prediction mode.
[0409] In step 52, the current block obtains one or more (e.g., two) angular mode indices derived using the DIMD tool and matches them to an intra-predictive mode index with an angular precision of 129.
[0410] In step 53, in a specific order, one by one, the second intra-prediction modes corresponding to the first intra-prediction mode of the Q second-prediction blocks corresponding to the decoded block at a position not adjacent to the current block are selected, in order of their respective second intra-prediction modes. TMRL Add to the candidate list. For example, these Q second prediction blocks are prediction blocks in 20 non-adjacent positions around the current block in Figure 19. Specifically, for the i-th second prediction block out of the 20 second prediction blocks, perform the following process:
[0411] If the i-th second prediction block is an intra prediction block and TIMD mode or TMRL mode is adopted, then the i-th 2 Get the index of the intra-prediction mode corresponding to the prediction block.
[0412] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0413] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is DIMD mode, then the intra-prediction mode index with an angular precision of 65 derived by DIMD is matched to the intra-prediction mode index with an angular precision of 129.
[0414] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is matched to an intra-prediction mode index with an angle precision of 129.
[0415] If the i-th second prediction block is an intra prediction block, and the prediction mode of the i-th second prediction block is the conventional intra prediction mode, then the i-th 2 The first intra-prediction mode index of the prediction block is matched to an intra-prediction mode index with an angular precision of 129.
[0416] If the i-th second prediction block is an inter-prediction block and the prediction mode of the i-th second prediction block is GPM mode, the intra-prediction mode index corresponding to the GPM division is matched to an intra-prediction mode index with an angular precision of 129.
[0417] If the i-th second prediction block is an interpretation block and the prediction mode of the i-th second prediction block is not GPM mode, then the intraprediction mode index cached in the current block's intraprediction mode cache is matched to an intraprediction mode index with an angular precision of 129.
[0418] In step 54, an existing angle prediction mode in the intra prediction candidate list is extended to similar angles to obtain at least one extended angle prediction mode.
[0419] In step 55, the 65 angular-precision mode indices in the default mode list are matched to the 129 angular-precision intra-predictive mode indices.
[0420] Furthermore, in steps 51 to 55 above, if the quantity of replenished mode reaches the required replenishment quantity, replenishment should be stopped.
[0421] In Method 3, the following steps are taken: TMRL Build a list of candidates.
[0422] In step 61, in a specific order, one by one, non-overlapping second intra-prediction modes corresponding to the first intra-prediction modes of the P first prediction blocks corresponding to the decoded blocks at positions adjacent to the current block are added to the TMRL candidate list. Illustratively, these P first prediction blocks are the prediction blocks at the five adjacent positions around the current block in Figure 20. Specifically, the following process is performed on the i-th first prediction block among the five first prediction blocks.
[0423] If the i-th first prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th first prediction block is obtained.
[0424] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0425] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived by DIMD is matched to the intra prediction mode index with an angular precision of 129.
[0426] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is matched to an intra-prediction mode index with an angle precision of 129.
[0427] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is a conventional intra prediction mode, then the first intra prediction mode index of the i-th first prediction block is matched to an intra prediction mode index with an angular precision of 129.
[0428] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is GPM mode, the intraprediction mode index corresponding to the GPM division is matched to an intraprediction mode index with an angular precision of 129.
[0429] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is not GPM mode, then the intraprediction mode index cached in the current block's intraprediction mode cache is matched to an intraprediction mode index with an angular precision of 129.
[0430] Furthermore, all intra-prediction mode indices obtained above can be understood as indices for the second intra-prediction mode.
[0431] In step 62, the current block obtains one or more (e.g., two) angular mode indices derived using the DIMD tool and matches them to an intra-predictive mode index with an angular precision of 129.
[0432] In step 63, one by one, in a certain order, among the Q second prediction modes corresponding to the first intra prediction mode of the Q second prediction blocks corresponding to the decoded block at a position not adjacent to the current block, select the non-overlapping second intra prediction modes. TMRL Add to the candidate list. For example, these Q second prediction blocks are prediction blocks in 18 non-adjacent positions around the current block in Figure 20. Specifically, for the i-th second prediction block out of the 18 second prediction blocks, perform the following process:
[0433] If the i-th second prediction block is an intra prediction block and TIMD mode or TMRL mode is adopted, then the i-th 2 Get the index of the intra-prediction mode corresponding to the prediction block.
[0434] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0435] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is DIMD mode, then the intra-prediction mode index with an angular precision of 65 derived by DIMD is matched to the intra-prediction mode index with an angular precision of 129.
[0436] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is matched to an intra-prediction mode index with an angle precision of 129.
[0437] If the i-th second prediction block is an intra prediction block, and the prediction mode of the i-th second prediction block is the conventional intra prediction mode, then the i-th 2 The first intra-prediction mode index of the prediction block is matched to an intra-prediction mode index with an angular precision of 129.
[0438] If the i-th second prediction block is an inter-prediction block and the prediction mode of the i-th second prediction block is GPM mode, the intra-prediction mode index corresponding to the GPM division is matched to an intra-prediction mode index with an angular precision of 129.
[0439] If the i-th second prediction block is an interpretation block and the prediction mode of the i-th second prediction block is not GPM mode, then the intraprediction mode index cached in the current block's intraprediction mode cache is matched to an intraprediction mode index with an angular precision of 129.
[0440] In step 64, an existing angle prediction mode in the intra prediction candidate list is extended to similar angles to obtain at least one extended angle prediction mode.
[0441] In step 65, the 65 angular-precision mode indices in the default mode list are matched to the 129 angular-precision intra-predictive mode indices.
[0442] Furthermore, in steps 61 to 65 above, if the quantity of replenished mode reaches the required replenishment quantity, replenishment should be stopped.
[0443] In some embodiments, the total number of modes acquired at adjacent and non-adjacent positions and modes derived by DIMD can be limited so as not to exceed a predetermined value. This predetermined value may be a standard value that the encoder and decoder commonly follow, or it may be a value analyzed from the bitstream.
[0444] The decoding side, after obtaining a list of intra-prediction mode candidates based on the method described above, then executes the following step S103.
[0445] In S103, the current block is predicted based on the intra prediction mode candidate list, and the predicted value of the current block is obtained.
[0446] The embodiments of this application do not limit the specific method for predicting the current block and obtaining the predicted value of the current block based on the intra-prediction mode candidate list.
[0447] In some embodiments, the decryption side decrypts the bitstream to obtain an intra-prediction mode index corresponding to the current block, selects an intra-prediction mode corresponding to the index from the intra-prediction mode candidate list constructed above based on the index, then predicts the current block using the selected intra-prediction mode to obtain the predicted value of the current block.
[0448] In some embodiments, the decoding side predicts the template of the current block using each candidate prediction mode in the intra-prediction mode list, obtains a template prediction value corresponding to each candidate prediction mode, and then determines the prediction cost corresponding to each candidate prediction mode based on each template prediction value and template reconstruction value. Next, the candidate prediction mode with the smallest prediction cost is determined as the intra-prediction mode for the current block, and the current block is predicted using that intra-prediction mode to obtain a prediction value for the current block.
[0449] In some embodiments, step S103 above includes steps S103-A and S103-B below.
[0450] In S103-A, the T candidate prediction modes (where T is a positive integer greater than 1) in the intra-prediction mode candidate list are sorted to obtain the sorted intra-prediction mode candidate list.
[0451] In S103-B, the current block is predicted based on the sorted intra-prediction mode candidate list, and the predicted value for the current block is obtained.
[0452] In one example, the above T candidate prediction modes may be some of the candidate prediction modes in the intra prediction mode list.
[0453] As another example, the T candidate prediction modes mentioned above could be all the candidate prediction modes in the intra prediction mode list.
[0454] In other words, the embodiment of the present invention sorts some or all of the candidate prediction modes in the constructed intra-prediction mode candidate list to obtain a sorted intra-prediction mode candidate list.
[0455] The embodiments of this application do not limit the specific method for sorting T candidate prediction modes in the intra-prediction mode candidate list to obtain the sorted intra-prediction mode candidate list.
[0456] In one possible implementation, T candidate prediction modes in the intra-prediction mode candidate list are sorted based on a predetermined sorting rule and order to obtain a sorted intra-prediction mode candidate list.
[0457] In another possible implementation, sorting is performed based on predicted cost, in which case S103-A above includes the following steps.
[0458] In S103-A1, for the t-th candidate prediction mode (where t is a positive integer less than or equal to T) out of T candidate prediction modes, the second prediction cost of the t-th candidate prediction mode when predicting the template of the current block is used.
[0459] In S103-A2, T candidate prediction modes are sorted based on the second prediction cost, and a sorted list of intra-prediction mode candidates is obtained.
[0460] In this implementation, for the t-th candidate prediction mode out of T candidate prediction modes, the template of the current block is predicted using the t-th candidate prediction mode, and the predicted value of the template in the t-th candidate prediction mode is obtained. Next, based on the reconstructed value of the template and the predicted value of the template in the t-th candidate prediction mode, a second prediction cost corresponding to the t-th candidate prediction mode is determined, and this second prediction cost may be an approximate cost such as SAD or SATD. In this way, the second prediction cost corresponding to each of the T candidate prediction modes can be determined, and the T candidate prediction modes are sorted based on the second prediction cost to obtain a sorted intra-prediction mode candidate list. For example, the T candidate prediction modes are sorted in ascending order of the second prediction cost to obtain a sorted intra-prediction mode candidate list.
[0461] In some embodiments, when determining the predicted values of the current block template, the reference pixel lines used by the current block template are at least one row and / or at least one column of reconstructed pixel lines adjacent to the current block template.
[0462] Exemplary, as shown in Figure 22, the template of the current block includes an upper template and / or a left template, where the upper template includes K rows of pixel lines and the left template includes K columns of pixel lines, where K is a positive integer. The reference pixel lines of the template of the current block include an upper reference pixel line and / or a left reference pixel column. In one example, the upper reference pixel line includes one row of pixel lines, e.g., the reconstructed pixel line of the (K+1)th row. In another example, the left reference pixel column is one column of pixel lines, e.g., the reconstructed pixel column of the (K+1)th column.
[0463] In some embodiments, the number of rows in the upper reference pixel line may differ from the number of columns in the left reference pixel column. In some embodiments, the number of rows in the upper reference pixel line and / or the number of columns in the left reference pixel column can be determined according to the difference in size of the current block.
[0464] In some embodiments, the upper template of the current block includes one or two rows of pixel lines, and / or the left template of the current block includes one or two columns of pixel rows.
[0465] For example, to reduce the complexity of calculating the second predicted cost described above, the upper template may contain one row of pixel lines, and / or the left template may contain one column of pixel lines.
[0466] As another example, the complexity of the calculation can be reduced by using the upper and / or left-side templates with two rows and / or two columns to calculate the second predicted cost described above.
[0467] In some embodiments, the complexity of prediction in templates can be simplified, for example, by not using PDPC or by reducing the number of taps in the interpolation filter.
[0468] In some embodiments, the number of pixel lines in the upper template may differ from the number of pixel columns in the left template. In some embodiments, the number of pixel lines in the upper template and the number of pixel columns in the left template can be determined based on the difference in block size.
[0469] In some embodiments, the current block template may include only the upper template and not the left template. Alternatively, the current block template may include only the left template and not the upper template.
[0470] The video decoding method according to the embodiment of the present invention, when constructing an intra-prediction mode candidate list, first determines a first angular precision corresponding to the intra-prediction mode candidate list, and this first angular precision is used to indicate the search range of the angular prediction mode in the intra-prediction mode candidate list. Next, the intra-prediction mode candidate list is constructed based on the first angular precision. Assuming that the intra-prediction mode candidate list is a TIMD list, and that the first angular precision corresponding to TIMD is 129, the embodiment of the present invention avoids loss of angular precision and improves the accuracy of constructing the intra-prediction mode candidate list by directly constructing an intra-prediction mode candidate list with an angular precision of 129, rather than first constructing an intra-prediction mode candidate list with an angular precision of 65 and then re-deriving the intra-prediction mode candidate list with an angular precision of 65 to an angular precision of 129. This improves the accuracy of the intra-prediction mode candidate list construction, thereby improving the prediction accuracy of the current block when making predictions based on the accurately constructed intra-prediction mode candidate list, and ultimately improving the effectiveness of video coding and decoding.
[0471] The above describes the prediction method of this application using the decoding side as an example, while the following will explain it using the encoding side as an example.
[0472] Figure 23 is an illustrative flowchart of a prediction method according to one embodiment of the present application, which is applied to the video encoder shown in Figures 1 and 2. As shown in Figure 23, the method of the embodiment of the present application includes the following steps.
[0473] In S201, the first angular accuracy corresponding to the current block's intra-prediction mode candidate list is determined.
[0474] Exemplary, the prediction modes of the current block include intra-prediction mode and inter-prediction mode, and the embodiments of the present application mainly relate to intra-prediction mode.
[0475] Currently, when constructing an intra-prediction mode candidate list, it is typically constructed based on 65 angle prediction modes (i.e., 65 angle precisions). For example, taking TIMD as an example, the modes derived by TIMD can be further subdivided from 65 angles to 129 angles, meaning that one more precise angle is added between the original two adjacent angles, resulting in an angle precision of 129 for the TIMD prediction tool. When constructing an intra-prediction mode candidate list for TIMD, the current technical solution first matches the 129 angle precision prediction modes corresponding to TIMD with the 65 angle precision prediction modes to construct an intra-prediction mode candidate list with 65 angle precision, and then derives the constructed intra-prediction mode candidate list with 65 angle precision back into an intra-prediction mode candidate list with 129 angle precision. Such a method is redundant, and the process of matching 129 angular accuracies to 65 angular accuracies results in a loss of accuracy, which in turn lowers the accuracy of the constructed intra-prediction mode candidate list, affecting prediction accuracy and worsening the coding and decoding effect.
[0476] To solve the above technical problems, the embodiment of the present application, when constructing an intra-prediction mode candidate list, first determines a first angular precision corresponding to the intra-prediction mode candidate list, and uses this first angular precision to indicate the search range of angular prediction modes in the intra-prediction mode candidate list. Next, the intra-prediction mode candidate list is constructed based on the first angular precision. Assuming that the intra-prediction mode candidate list is a TIMD list, and that the first angular precision corresponding to TIMD is 129, the embodiment of the present application avoids loss of angular precision and improves the accuracy of constructing the intra-prediction mode candidate list by directly constructing an intra-prediction mode candidate list with an angular precision of 129, rather than first constructing an intra-prediction mode candidate list with an angular precision of 65 and then re-deriving the intra-prediction mode candidate list with an angular precision of 65 to an angular precision of 129. This improves the accuracy of constructing the intra-prediction mode candidate list, thereby improving the prediction accuracy of the current block when making predictions based on the accurately constructed intra-prediction mode candidate list, and consequently improving the effectiveness of video coding and decoding.
[0477] In the embodiments of this application, the angular accuracy can be understood as the search range of the angle prediction mode. For example, an angular accuracy of 65 indicates that the search range of the angle prediction mode is 65 types of angle prediction modes, i.e., an angular accuracy of 65 corresponds to 65 types of angle prediction modes. An angular accuracy of 129 indicates that the search range of the angle prediction mode is 129 types of angle prediction modes, i.e., an angular accuracy of 129 corresponds to 129 types of angle prediction modes.
[0478] In embodiments of the present invention, a first angular precision corresponding to the intra-prediction mode candidate list of the current block is used to indicate the search range of angular prediction modes in the intra-prediction mode candidate list. For example, if the first angular precision corresponding to the intra-prediction mode candidate list of the current block is 65, it indicates that each angular prediction mode in the intra-prediction mode candidate list is one of 65 angular prediction modes. As another example, if the first angular precision corresponding to the intra-prediction mode candidate list of the current block is 129, it indicates that each angular prediction mode in the intra-prediction mode candidate list is one of 129 angular prediction modes.
[0479] The following describes the specific process for determining the first angular accuracy corresponding to the current block's intra-prediction mode candidate list.
[0480] In some embodiments, the first angular accuracy corresponding to the current block's intra-prediction mode candidate list is a predetermined or default value. decrypt Both the signaling and encoding sides determine a predetermined or default value as the first angular precision corresponding to the intra-prediction mode candidate list for the current block. This predetermined or default value is indicated by high-level signaling.
[0481] In some embodiments, the encoding side can determine the first angular accuracy by the following steps S201-A to S201-C.
[0482] In S201-A, the prediction method to be used when predicting the current block is determined.
[0483] In S201-B, if the prediction method is a prediction method based on template matching, the angular accuracy corresponding to the prediction method is determined.
[0484] In S201-C, the first angular accuracy is determined based on the angular accuracy corresponding to the prediction method.
[0485] Here, the prediction method currently used to predict blocks is also called a prediction tool, such as TIMD or DIMD.
[0486] The embodiments of this application do not limit the specific type of prediction method (i.e., prediction tool). Exemplary, the prediction method includes, but is not limited to, at least one of TIMD, MPM, TMRL, SGPM, and DIMD. That is, if the current block employs a TIMD, MPM, TMRL, SGPM, or DIMD tool, the angular accuracy corresponding to TIMD, MPM, TMRL, SGPM, or DIMD is determined as the first angular accuracy.
[0487] In S201-A above, determining the prediction method to be used when predicting the current block includes at least the following methods:
[0488] In Method 1, the prediction method used when predicting the current block is the default method.
[0489] In method 2, based on the template of the current block, the prediction method to be used to predict the current block is determined from among multiple prediction methods. For example, when the encoding side uses multiple prediction methods to predict the template of the current block, the prediction cost corresponding to each prediction method is determined, and the prediction method with the smallest prediction cost is determined as the prediction method adopted by the current block.
[0490] The encoding side determines the prediction method to be used when predicting the current block, then determines whether the prediction method is a template matching-based prediction method, and if it is a template matching-based prediction method, it determines the angular precision corresponding to the prediction method, and further determines a first angular precision based on the angular precision corresponding to the prediction method.
[0491] In the embodiments of this application, the method for determining the first angular accuracy based on the angular accuracy corresponding to the prediction method includes, but is not limited to, the following:
[0492] In the first method, if the angular accuracy corresponding to the prediction method is greater than a predetermined angular accuracy, the first angular accuracy is smaller than the angular accuracy corresponding to the prediction method and greater than the predetermined angular accuracy. For example, if the angular accuracy corresponding to the prediction method is 129 (corresponding to 129 types of angle prediction modes) and the predetermined angular accuracy is 65 (corresponding to 65 types of angle prediction modes), the first angular accuracy can be any angular accuracy that is smaller than 129 and greater than 65. For example, if the first angular accuracy is 120, and this angular accuracy of 120 is part of the angular accuracy of 129, that is, 120 types of angle prediction modes are selected from among the 129 types of angle prediction modes, and an intra-prediction mode candidate list is constructed based on these 120 types of angle prediction modes.
[0493] The 2 In this method, the encoding side determines the angular precision corresponding to the prediction method used when directly predicting the current block as the first angular precision.
[0494] Based on the steps of the above method, the encoding side determines the first angular accuracy corresponding to the intra-prediction mode candidate list, and then performs the following step S202.
[0495] In S202, a list of candidate intra-prediction modes is constructed based on the first angular accuracy.
[0496] As can be seen from the above, in TIMD, DIMD, TMRL, SGPM, or MPM tools, when deriving one type of intra-prediction mode, it is necessary to construct an intra-prediction mode candidate list, and these candidate lists each have different lengths and different construction methods. However, currently, 65 angles are used in all constructions, which means that when adding modes with 129 angle accuracies, they must be matched to 65 angle accuracies before being added to the candidate list, which results in a greater loss of accuracy. On the other hand, in the embodiments of the present invention, a corresponding intra-prediction mode candidate list is constructed based on a first angle accuracy corresponding to TIMD, DIMD, TMRL, SGPM, or MPM.
[0497] For example, if we assume that the current block employs the TIMD tool during prediction and that the first angular precision corresponding to TIMD is 129, then the intra-prediction mode candidate list constructed using TIMD will have an angular precision of 129.
[0498] For example, if we assume that the current block employs the TMRL tool during prediction and that the first angular precision corresponding to TMRL is 129, then the intra-prediction mode candidate list constructed using TMRL will have an angular precision of 129.
[0499] For example, if we assume that the current block employs the MPM tool during prediction and that the first angular precision corresponding to the MPM is 129, then the intra-prediction mode candidate list constructed using the MPM will have an angular precision of 129.
[0500] For example, if we assume that the current block employs the TIMD tool during prediction and that the first angular precision corresponding to TIMD is 65, then the intra-prediction mode candidate list constructed using TIMD will have an angular precision of 65.
[0501] For example, if we assume that the current block employs the TMRL tool during prediction and that the first angular precision corresponding to TMRL is 65, then the intra-prediction mode candidate list constructed using TMRL will have an angular precision of 65.
[0502] For example, if we assume that the current block employs the MPM tool during prediction and that the first angular precision corresponding to the MPM is 65, then the intra-prediction mode candidate list constructed using the MPM will have an angular precision of 65.
[0503] In some embodiments, the intra-prediction mode candidate list includes TIMD, DIMD, TMRL, SGPM, or MPM, where the modes in the intra-prediction mode candidate list include the modes selected by the prediction blocks around the current block. Based on this, S202 above includes the following steps S202-A and S202-B.
[0504] In S202-A, the first intra-prediction mode is obtained for the N prediction blocks (where N is a positive integer) surrounding the current block.
[0505] In S202-B, an intra-prediction mode candidate list is constructed based on the first intra-prediction mode and the first angular accuracy of N prediction blocks.
[0506] The embodiments of this application do not limit the specific locations of the N prediction blocks.
[0507] In one possible implementation, the N prediction blocks include five prediction blocks adjacent to the current block. Exemplarily, these five locations are as shown in Figure 17, and the horizontal and vertical differences of these locations with respect to the top-left corner coordinate of the current block are top-left (-1,-1), top (width-1,-1), top-right (width,-1), left (-1,height-1), and bottom-left (-1,height), respectively, where width and height are the width and height of the current block.
[0508] For example, the order in which the prediction blocks are selected at these five positions is left, top, top left, bottom left, and top right.
[0509] In another possible implementation, embodiments of the present invention can extend the intra-prediction mode candidate list by using prediction modes of prediction blocks corresponding to more adjacent and / or non-adjacent blocks around the current block when constructing the intra-prediction mode candidate list. For example, N prediction blocks include P first prediction blocks and / or Q second prediction blocks, where the first prediction blocks are prediction blocks corresponding to encoded blocks adjacent to the current block, and the second prediction blocks are prediction blocks corresponding to encoded blocks not adjacent to the current block, and both P and Q are positive integers less than or equal to N, and the sum of P and Q is equal to N.
[0510] In other words, in the embodiments of the present invention, all N prediction blocks may be prediction blocks corresponding to encoded blocks adjacent to the current block, or all N prediction blocks may be prediction blocks corresponding to encoded blocks not adjacent to the current block, or the N prediction blocks may include prediction blocks corresponding to encoded blocks adjacent to the current block and prediction blocks corresponding to encoded blocks not adjacent to the current block.
[0511] In this case, obtaining the first intra-prediction mode of N prediction blocks surrounding the current block in S202-A above includes at least the following methods.
[0512] In method 1, if N prediction blocks include P first prediction blocks, then the above S202-A includes the following steps S202-A-11 and S202-A-12.
[0513] In S202-A-11, the first access order of P first prediction blocks is determined.
[0514] In S202-A-12, the first intra-prediction mode of P first prediction blocks is obtained according to the first access order.
[0515] When the encoding side obtains the first intra-prediction modes of the P first prediction blocks, it must access them according to a specific access order. For example, it obtains the first intra-prediction modes of the P first prediction blocks according to the first access order.
[0516] The embodiments of this application do not limit the specific method for determining the first access order of the P first prediction blocks described above.
[0517] In one example, the first access order of the P first prediction blocks described above is a predetermined order.
[0518] As another example, the encoding side can determine the first access order based on the size of the current block and the sizes of the P encoded blocks, and / or the shape of the current block and the shapes of the P encoded blocks.
[0519] For example, for any one of the P encoded blocks, a first similarity is determined based on the size of the encoded block and the size of the current block, and / or a second similarity is determined based on the shape of the encoded block and the shape of the current block. Based on the first and / or second similarity, the total similarity between the encoded block and the current block is determined. In this way, the access order of the P encoded blocks is determined according to the total similarity, and the access order of the P encoded blocks is determined as the first access order of the P first prediction blocks. For example, the higher the total similarity, the earlier the blocks are accessed.
[0520] For example, the positions adjacent to the current block can be the 11 positions shown in Figure 18. In other words, P first prediction blocks are 11 first prediction blocks, and these 11 first prediction blocks are prediction blocks corresponding to the positions shown in Figure 18.
[0521] The horizontal and vertical differences between the top-left corner coordinates of the current block at the 11 positions shown in Figure 18 are as follows: Position 1 (-1, height-1), Position 2 (width-1, -1), Position 3 (-1, -1), Position 4 (width, -1), Position 5 (-1, height), Position 6 (-1, height / 2), Position 7 (width / 2, -1), Position 8 (width / 2-1, -1), Position 9 (-1, height / 2-1), Position 10 (-1, 0), and Position 11 (0, -1). width and height are the width and height of the current block, respectively.
[0522] The encoding side determines the first access order of the first prediction block corresponding to the position shown in Figure 18 above, and based on the first access order, obtains the first intra-prediction mode of the first prediction block at these 11 positions.
[0523] For example, the first access order of these 11 first prediction blocks is position 1, position 2, position 3, position 5, position 4, position 10, position 11, position 9, position 8, position 6, position 7.
[0524] In method 2, if N prediction blocks include Q second prediction blocks, then the above S202-A includes the following steps S202-A-21 and S202-A-22.
[0525] In S202-A-21, the second access order of Q second prediction blocks is determined.
[0526] In S202-A-22, the first intra-prediction mode of Q second prediction blocks is obtained according to the second access order.
[0527] When the encoding side obtains the first intra-prediction modes of Q second prediction blocks, it must access them according to a specific access order. For example, it obtains the first intra-prediction modes of Q second prediction blocks according to the second access order.
[0528] The embodiments of this application do not limit the specific method for determining the second access order of the Q second prediction blocks described above.
[0529] In one example, the second access order of the Q second prediction blocks described above is a predetermined order.
[0530] As another example, the encoding side can determine the second access order based on the size of the current block and the sizes of the Q encoded blocks, and / or the shape of the current block and the shapes of the Q encoded blocks.
[0531] For example, for any one of the Q encoded blocks, a first similarity is determined based on the size of the encoded block and the size of the current block, and / or a second similarity is determined based on the shape of the encoded block and the shape of the current block. Based on the first and / or second similarity, the total similarity between the encoded block and the current block is determined. In this way, the access order of the Q encoded blocks is determined according to the total similarity, and the access order of the Q encoded blocks is determined as the second access order of the Q second prediction blocks. For example, the higher the total similarity, the earlier the blocks are accessed.
[0532] In Example 1, the positions that are not currently adjacent to a block can be the positions numbered 12 to 31 shown in Figure 19. In other words, Q second prediction blocks are 20 second prediction blocks, and these 20 second prediction blocks are prediction blocks corresponding to the positions shown in Figure 19.
[0533] The horizontal and vertical differences from the top-left corner coordinates of the current block at positions 12-31 shown in Figure 19 are, respectively,: Position 12 (-offsetX-1, height+offsetY-1), Position 13 (width+offsetX-1,-offsetY-1), Position 14 (width / 2,-offsetY-1), Position 15 (-offsetX-1, height / 2), Position 16 (-offsetX-1,-offsetY-1), Position 17 (-offsetX×2-1, height+offsetY×2-1), Position 18 (width+offset×2-1,-offsetY×2-1), Position 19 (width / 2,-offsetY×2-1), Position 20 (-offsetX×2-1, height / 2), Position 21 (-offsetX ×2-1,-offsetY×2-1), position 22(-offsetX×3-1,height+offsetY×3-1), position 23(width+offset×3-1,-offset Y×3-1), position 24(width / 2,-offsetY×3-1), position 25(-offsetX×3-1,height / 2), position 26(-offsetX×3-1,-offse tY x 3-1), position 27 (-offsetX x 4-1, height+offsetY x 4-1), position 28 (width+offset x 4-1, -offsetY x 4-1), position 29 (width / 2, -offsetY x 4-1), position 30 (-offsetX x 4-1, height / 2), and position 31 (-offsetX x 4-1, -offsetY x 4-1). width and height are the current width and height of the block, respectively.
[0534] The encoding side determines the second access order of the second prediction block corresponding to the positions shown in Figure 19 above, and based on the second access order, obtains the first intra-prediction mode of the second prediction block at these 20 positions.
[0535] In Figure 19, the positions of serial numbers 1 to 11 are the same as the 11 adjacent positions shown in Figure 18 above.
[0536] In Example 2, the positions that are not currently adjacent to a block could be the positions numbered 6 to 23 shown in Figure 20. In other words, Q second prediction blocks are 18 second prediction blocks, and these 18 second prediction blocks are prediction blocks corresponding to the positions shown in Figure 20.
[0537] The horizontal and vertical differences from the top-left corner coordinates of the current block at positions 6-23 shown in Figure 20 are as follows: Position 6 (-offsetX-1, height+offsetY-1), Position 7 (width+offsetX-1,-offsetY-1), Position 8 (-offsetX-1,-offsetY-1), Position 9 (-offsetX×2-1, height+offsetY×2-1), Position 10 (width+offset×2-1,-offsetY×2-1), Position 11 (width / 2,-offsetY×2-1), Position 12 (-offsetX×2-1, height / 2), Position 13 (-offsetX×2-1,-offsetY×2-1), Position 14 (-off The positions are setX×3-1,height+offsetY×3-1), position 15(width+offset×3-1,-offsetY×3-1), position 16(width / 2,-offsetY×3-1), position 17(-offsetX×3-1,height / 2), position 18(-offsetX×3-1,-offsetY×3-1), position 19(-offsetX×4-1,height+offsetY×4-1), position 20(width+offset×4-1,-offsetY×4-1), position 21(width / 2,-offsetY×4-1), position 22(-offsetX×4-1,height / 2), and position 23(-offsetX×4-1,-offsetY×4-1). width and height are the current width and height of the block, respectively.
[0538] The encoding side determines the second access order of the second prediction block corresponding to the position shown in Figure 20 above, and based on the second access order, obtains the first intra-prediction mode of the second prediction block at these 18 positions.
[0539] In Figure 20, the positions of serial numbers 1 to 5 are the same as the five adjacent positions shown in Figure 17 above.
[0540] In Figures 19 and 20 above, offsetX and offsetY may be fixed values, may be equal or not equal, or may be variables that change depending on the shape and size of the block. In some embodiments, offsetX is currently equal to the width of the block, and offsetY is currently equal to the height of the block.
[0541] In some embodiments, to limit complexity, at least one encoded block, which is adjacent to the current block and / or not adjacent to the current block, corresponds to the same encoding tree unit as the current block; that is, the current block and the at least one encoded block belong to different image blocks in the same encoding tree unit.
[0542] In the embodiments of the present invention, if all N prediction blocks are P first prediction blocks, i.e., N=P, the encoding side obtains the first intra-prediction mode of the P first prediction blocks by the method of Method 1 described above. If all N prediction blocks are Q second prediction blocks, i.e., N=Q, the encoding side obtains the first intra-prediction mode of the Q second prediction blocks by the method of Method 2 described above. If the N prediction blocks include P first prediction blocks and Q second prediction blocks, and N=P+Q, the encoding side obtains the first intra-prediction mode of the P first prediction blocks by the method of Method 1 described above, and obtains the first intra-prediction mode of the Q second prediction blocks by the method of Method 2 described above, thereby obtaining the first intra-prediction mode of the N prediction blocks.
[0543] The above describes the order in which the first intra-prediction mode is obtained for N prediction blocks. Below, we will describe the specific method for obtaining the first intra-prediction mode for prediction blocks.
[0544] In embodiments of the present invention, the first intra-prediction mode of a prediction block can be understood as the intra-prediction mode used by the prediction block during prediction, or an intra-prediction mode derived from the prediction mode used by the prediction block during prediction. For example, if the prediction block is an intra-prediction block, the intra-prediction mode used by the prediction block during prediction is determined as the first intra-prediction mode, or one or more other intra-prediction modes are derived based on the intra-prediction mode used by the prediction block and designated as the first intra-prediction mode of the prediction block. As another example, if the prediction block is an inter-prediction block, the first intra-prediction mode of the prediction block is derived based on the inter-prediction method used by the prediction block.
[0545] Exemplary, in the embodiment of the present invention, the first intra-prediction mode of the prediction block is one of the 67 intra-prediction modes (including 65 angle prediction modes) or one of the 131 intra-prediction modes (including 129 angle prediction modes).
[0546] In the embodiments of this application, the specific method for determining the first intra-prediction mode of each of the N prediction blocks is the same. For the sake of explanation, the acquisition of the first intra-prediction mode of the i-th prediction block will be described below as an example.
[0547] In some embodiments, the first intra-prediction mode for the i-th prediction block is determined based on the type of the i-th prediction block. For example, if the i-th prediction block is an intra-prediction block, the intra-prediction mode used by the i-th prediction block during prediction (e.g., angle prediction mode) is determined as the first intra-prediction mode for the i-th prediction block. In another example, if the i-th prediction block is an intra-prediction block, one intra-prediction mode is determined based on the intra-prediction mode used by the i-th prediction block during prediction, and this is designated as the first intra-prediction mode for the i-th prediction block.
[0548] In some embodiments, the first intra-prediction mode of the i-th prediction block is determined based on the prediction mode of the i-th prediction block, and in this case, S202-A above includes the following steps.
[0549] In S202-A-31, for the i-th prediction block (where i is a positive integer less than or equal to N) out of N prediction blocks, the prediction method used by the i-th prediction block during prediction is determined.
[0550] In S202-A-32, the first intra-prediction mode of the i-th prediction block is determined based on the prediction method.
[0551] In this embodiment, the prediction method used by the i-th prediction block during prediction can be understood as the prediction tool or prediction technique used by the i-th prediction block during prediction. The prediction method used by the i-th prediction block during prediction may be any prediction technique such as TIMD, DIMD, TMRL, MIP, intraTMP, GPM, SGPM, or conventional intra-prediction modes.
[0552] In one example, if the prediction method used by the i-th prediction block during prediction is one of TIMD, DIMD, TMRL, or a conventional intra-prediction mode, the intra-prediction mode derived from that prediction method is determined as the first intra-prediction mode for the i-th prediction block.
[0553] For example, if the i-th prediction block is an intra-prediction block, and the prediction method (or prediction technique) used by the i-th prediction block during prediction is TIMD or TMRL, then at the time of prediction, the i-th prediction block determines at least one intra-prediction mode (e.g., an angle prediction mode) derived using the TIMD or TMRL technique as the first intra-prediction mode of the i-th prediction block.
[0554] As another example, if the i-th prediction block is an intra-prediction block and the prediction method (or prediction technique) used by the i-th prediction block during prediction is DIMD, then the i-th prediction block determines at least one intra-prediction mode (e.g., an angle prediction mode) derived using the DIMD technique as the first intra-prediction mode of the i-th prediction block during prediction.
[0555] As another example, if the i-th prediction block is an intra-prediction block, and the prediction method (or prediction technique) used by the i-th prediction block during prediction is a conventional intra-prediction mode, then when the i-th prediction block makes a prediction, it determines at least one intra-prediction mode derived from the conventional intra-prediction mode (for example, an angle prediction mode) as the first intra-prediction mode of the i-th prediction block.
[0556] In one example, if the prediction method used when the i-th prediction block made prediction is MIP or intraTMP, the DIMD method is used to derive one first angle prediction mode and this first angle prediction mode is determined as the first intra prediction mode for the i-th prediction block, or the planar mode is determined as the first intra prediction mode for the i-th prediction block.
[0557] In embodiments of the present invention, if the i-th prediction block is an intra-prediction block and the prediction method used during prediction is MIP or intraTMP, then MIP or intraTMP cannot be associated with the angle prediction mode and must be replaced with another mode. Exemplarily, if the i-th prediction block is an intra-prediction block and the prediction method used during prediction is MIP or intraTMP, there are at least two methods for determining the first intra-prediction mode of the i-th prediction block.
[0558] The first method involves deriving a first angle prediction mode using the DIMD method and setting it as the first intra-prediction mode for the i-th prediction block. For example, referring to the above technical description of DIMD, an angle prediction mode can be derived on the reconstructed pixels surrounding the encoded block corresponding to the i-th prediction block, and this angle prediction mode can be determined as the first intra-prediction mode for the i-th prediction block.
[0559] The second method is to directly determine the PLANAR mode as the first intra-prediction mode of the i-th prediction block.
[0560] In one example, if the prediction method used when the i-th prediction block made predictions is GPM or SGPM, the angle prediction mode corresponding to the division angle of GPM or SGPM is determined as the first intra-prediction mode of the i-th prediction block.
[0561] For example, if the i-th prediction block is an inter-prediction block and the prediction method (or prediction technique) used when predicting the i-th prediction block is GPM, then the GPM division mode corresponding to the i-th prediction block (as shown in Figure 11) is determined. Next, the GPM division angle is determined based on the GPM division mode, and by referring to Table 1 above, the angle prediction mode corresponding to the GPM division angle can be determined, and this angle prediction mode is determined as the first intra-prediction mode for the i-th prediction block.
[0562] As another example, if the i-th prediction block is an intra-prediction block and the prediction method (or prediction technique) used when predicting the i-th prediction block is SGPM, then the SGPM division mode corresponding to the i-th prediction block (as shown in Figure 11) is determined. Next, the division angle is determined based on the SGPM division mode, and by referring to Table 1 above, the angle prediction mode corresponding to the SGPM division angle can be determined, and this angle prediction mode is determined as the first intra-prediction mode for the i-th prediction block.
[0563] In one example, if the i-th prediction block is an inter-prediction block and the prediction mode used when predicting the i-th prediction block is not GPM mode, the intra-prediction mode in the current block's intra-prediction mode cache is determined as the first intra-prediction mode for the i-th prediction block.
[0564] When predicting the current block, one or more intra-prediction modes are cached in the current block's intra-prediction mode cache, and these one or more intra-prediction modes are the intra-prediction modes of the current block's reference block. As a result, if the i-th predicted block is an inter-prediction block, and the prediction mode used when predicting the i-th predicted block is not a GPM mode, then at least one intra-prediction mode in the current block's intra-prediction mode cache can be determined as the first intra-prediction mode of the i-th predicted block.
[0565] The encoding side can obtain the first intra-prediction mode for each of the N prediction blocks based on the access order of the N prediction blocks and the method for obtaining the first intra-prediction mode described above.
[0566] The encoding side obtains the first intra-prediction mode for N prediction blocks, and then performs the step S202-B described above, namely, the step of constructing a list of candidate intra-prediction modes corresponding to the current block based on the first intra-prediction mode and first angular accuracy of the N prediction blocks.
[0567] In embodiments of the present invention, the angular accuracy of the prediction tools used by different prediction blocks in the N prediction blocks during prediction is not necessarily identical, and therefore the angular accuracy corresponding to the first intra-prediction mode of the N prediction blocks is not necessarily identical. For example, if prediction block 1 uses TIMD during prediction and the angular accuracy of TIMD is 129, then the angular accuracy corresponding to the first intra-prediction mode of prediction block 1 is 129. As another example, if prediction block 2 uses DIMD during prediction and the angular accuracy of DIMD is 65, then the angular accuracy corresponding to the first intra-prediction mode of prediction block 2 is 65. In this case, the angular accuracy corresponding to the first intra-prediction mode of prediction block 1 and prediction block 2 is different. Furthermore, the angular accuracy of at least one of the first intra-prediction modes among the N prediction blocks may differ from the first angular accuracy. Therefore, the encoding side needs to obtain a first intra-prediction mode for N prediction blocks based on the steps described above, then perform angular matching on the first intra-prediction mode based on the first angular accuracy to obtain a second intra-prediction mode, and then construct a list of intra-prediction mode candidates based on the second intra-prediction mode.
[0568] The following describes the specific process for constructing a list of candidate intra-prediction modes corresponding to the current block, based on the first intra-prediction mode and first angular accuracy of N prediction blocks.
[0569] In S202-B described above, the method for constructing a list of candidate intra-prediction modes corresponding to the current block based on the first intra-prediction mode and first angular accuracy of N prediction blocks includes at least the following methods.
[0570] In Method 1, the encoding side compares the angular precision corresponding to the first intra-prediction mode of each of the N prediction blocks with the first angular precision. If the angular precision corresponding to the first intra-prediction mode of the prediction block is different from the first angular precision, precision matching is performed on the first intra-prediction mode of the prediction block to obtain the second intra-prediction mode at the first angular precision of the first intra-prediction mode of the prediction block. If the angular precision corresponding to the first intra-prediction mode of the prediction block is the same as the first angular precision, the first intra-prediction mode of the prediction block is determined as the second intra-prediction mode. In this way, the second intra-prediction mode corresponding to the first intra-prediction mode of each of the N prediction blocks can be determined, and an intra-prediction mode candidate list is constructed based on the second intra-prediction modes of the N prediction blocks. For example, different second intra-prediction modes from among the second intra-prediction modes of the N prediction blocks are added to the intra-prediction mode candidate list until the length of the intra-prediction mode candidate list reaches a predetermined length.
[0571] In method 2, the above S202-B includes the following steps S202-B1 to S202-B3.
[0572] In S202-B1, K (where K is a positive integer less than or equal to N) first intra-prediction modes are determined based on the first intra-prediction modes of N prediction blocks.
[0573] In S202-B2, a second intra-prediction mode is determined based on the first angular accuracy, corresponding to K first intra-prediction modes.
[0574] In S202-B3, a list of candidate intra-prediction modes is constructed based on K second intra-prediction modes.
[0575] In method 2, the encoding side first selects K first intra-prediction modes from among the first intra-prediction modes of N prediction blocks, and these K first intra-prediction modes are all different. Next, the angular precision corresponding to each of the K first intra-prediction modes is compared with the first angular precision to determine the second intra-prediction mode corresponding to each of the K first intra-prediction modes. Finally, a list of intra-prediction mode candidates is constructed based on these K second intra-prediction modes.
[0576] In embodiments of the present invention, a specific method for determining K first intra-prediction modes based on the first intra-prediction modes of N prediction blocks includes at least the following methods.
[0577] In method 1, the encoding side selects K first intra-prediction modes from the first intra-prediction modes of the N prediction blocks based on the access order of the N prediction blocks described above.
[0578] In method 2, the above S202-B1 includes the following steps S202-B1-11 and S202-B1-12.
[0579] In S202-B1-11, some or all of the first intra prediction modes of the N prediction blocks are sorted to obtain the sorted first intra prediction modes.
[0580] In S202-B1-12, K first intra-prediction modes are determined based on the sorted first intra-prediction modes.
[0581] As can be seen from the above, in some embodiments, N prediction blocks include P first prediction blocks, in some embodiments, N prediction blocks include Q second prediction blocks, and in some embodiments, N prediction blocks include both P first prediction blocks and Q second prediction blocks.
[0582] Based on this point, the following are some examples of methods for sorting some or all of the first intra-prediction modes of N prediction blocks to obtain the sorted first intra-prediction modes.
[0583] In Example 1, if N prediction blocks include P first prediction blocks, the first intra-prediction modes of the P first prediction blocks in the N prediction blocks are sorted to obtain the sorted first intra-prediction modes.
[0584] In other words, in Example 1, only the first intra-prediction modes of the P first prediction blocks in the N prediction blocks are sorted, and if the N prediction blocks further include second prediction blocks, the first intra-prediction modes of the second prediction blocks are not sorted.
[0585] In this example, a method for sorting the first intra-prediction modes of P first prediction blocks may involve using the first intra-prediction mode of the first prediction block to predict the template of the current block, determining the predicted value of the template, and determining the first prediction cost of the first intra-prediction mode based on the predicted value and reconstructed value of the template. Using this method, the first prediction cost corresponding to the first intra-prediction mode of each of the P first prediction blocks can be determined, and the first intra-prediction modes of the P first prediction blocks can be sorted based on the first prediction costs (for example, in ascending order of the first prediction costs) to obtain the sorted first intra-prediction modes.
[0586] In Example 2, if N prediction blocks contain Q second prediction blocks, the first intra-prediction modes of the Q second prediction blocks in the N prediction blocks are sorted to obtain the sorted first intra-prediction modes.
[0587] In other words, in Example 2, only the first intra-prediction modes of the Q second-order prediction blocks in the N prediction blocks are sorted, and if the N prediction blocks further contain first-order prediction blocks, the first intra-prediction modes of the first-order prediction blocks are not sorted.
[0588] In this example, a method for sorting the first intra-prediction modes of Q second prediction blocks may involve using the first intra-prediction mode of the second prediction block to predict the template of the current block, determining the predicted value of the template, and determining the first prediction cost of the first intra-prediction mode based on the predicted value and reconstructed value of the template. Using this method, the first prediction cost corresponding to the first intra-prediction mode of each of the Q second prediction blocks can be determined, and the first intra-prediction modes of the Q second prediction blocks can be sorted based on the first prediction cost (for example, in ascending order of the first prediction cost) to obtain the sorted first intra-prediction modes.
[0589] In Example 3, the first intra-prediction modes of N prediction blocks are sorted to obtain the sorted first intra-prediction modes.
[0590] In the embodiments of the present invention, both Example 1 and Example 2 above can be understood as methods for sorting some of the first intra-prediction modes in the first intra-prediction modes of N prediction blocks. Example 3 above can be understood as a method for sorting all of the first intra-prediction modes in the first intra-prediction modes of N prediction blocks.
[0591] In other words, in Example 3, whether the N prediction blocks are N first prediction blocks, N second prediction blocks, or N prediction blocks contain both first and second prediction blocks, the encoding side sorts all first intra-prediction modes of the N prediction blocks.
[0592] In this example, a method for sorting the first intra-prediction modes of N prediction blocks may involve using the first intra-prediction mode to predict the template of the current block, determining the predicted value of the template, and determining the first prediction cost of the first intra-prediction mode based on the predicted value and reconstructed value of the template. Using this method, the first prediction cost corresponding to each first intra-prediction mode can be determined, and the first intra-prediction modes of the N prediction blocks can be sorted based on the first prediction costs (for example, in ascending order of the first prediction costs) to obtain the sorted first intra-prediction modes.
[0593] In Example 4, R (where R is a positive integer less than N) first intra-prediction modes are selected from the N first intra-prediction modes of the prediction blocks, the R first intra-prediction modes are sorted, and the sorted first intra-prediction modes are obtained.
[0594] In Example 4, the encoding side first selects R first intra-prediction modes from the N first intra-prediction modes of the prediction blocks, for example, by selecting R first intra-prediction modes from the N first intra-prediction modes of the prediction blocks according to a predetermined order or rule. Next, the selected R first intra-prediction modes are sorted to obtain sorted first intra-prediction modes.
[0595] In this example, a method for sorting R first intra-prediction modes may involve using the first intra-prediction mode to predict the template of the current block, determining the predicted value of the template, and determining the first prediction cost of the first intra-prediction mode based on the predicted value and reconstructed value of the template. Using this method, the first prediction cost corresponding to each first intra-prediction mode can be determined, and the R first intra-prediction modes can be sorted based on the first prediction costs (for example, in ascending order of the first prediction costs) to obtain the sorted first intra-prediction modes.
[0596] In method 2, the encoding side sorts some or all of the first intra-prediction modes of the N prediction blocks based on the above steps, obtains sorted first intra-prediction modes, and then determines K first intra-prediction modes based on the sorted first intra-prediction modes. For example, by sorting the first intra-prediction modes in ascending order of first prediction cost and selecting the first K first intra-prediction modes from the sorted first intra-prediction modes, K first intra-prediction modes can be obtained.
[0597] In addition to determining K first intra-prediction modes using method 2 described above, the encoding side can also obtain K first intra-prediction modes by employing the following method 3.
[0598] In method 3, the above S202-B1 includes the following steps S202-B1-21 and S202-B1-22.
[0599] In S202-B1-21, the first intra-prediction mode corresponding to DIMD is determined.
[0600] In S202-B1-22, K first intra prediction modes are determined based on the first intra prediction mode corresponding to DIMD and the first intra prediction modes of N prediction blocks.
[0601] In method 3, K first intra-prediction modes are determined from the first intra-prediction mode corresponding to DIMD and the first intra-prediction modes of N prediction blocks. Here, the method for deriving the first intra-prediction modes using the DIMD method can be described by referring to the above technical explanation regarding DIMD. For example, one or more intra-prediction modes are derived using the DIMD technique within the template area of the current block, and these one or more intra-prediction modes are designated as the first intra-prediction modes corresponding to DIMD.
[0602] Next, K first intra-prediction modes are determined from the first intra-prediction modes corresponding to DIMD and the first intra-prediction modes of the N prediction blocks.
[0603] Here, the specific implementation of determining K first intra-prediction modes from the first intra-prediction mode corresponding to DIMD and the first intra-prediction modes of N prediction blocks includes at least the following implementations.
[0604] In one method, K first intra-prediction modes are selected from the first intra-prediction modes corresponding to DIMD and the first intra-prediction modes of N prediction blocks, according to a predetermined order or rule.
[0605] In another method, S (where S is a positive integer) first intra prediction modes are selected from the first intra prediction modes corresponding to DIMD and the first intra prediction modes of N prediction blocks, the S first intra prediction modes are sorted to obtain the sorted S first intra prediction modes, and K first intra prediction modes are determined based on the sorted S first intra prediction modes.
[0606] In this implementation, the encoding side first selects S first intra prediction modes from the first intra prediction modes corresponding to DIMD and the first intra prediction modes of N prediction blocks, according to a predetermined order or rule. Next, the S first intra prediction modes are sorted to obtain the sorted S first intra prediction modes. For example, the prediction value for the current block template is calculated for each of the S first intra prediction modes, and a first prediction cost corresponding to each of the S first intra prediction modes is obtained based on the template reconstruction value and the template prediction value corresponding to each first intra prediction mode. Then, the S first intra prediction modes are sorted based on the first prediction cost to obtain the sorted S first intra prediction modes. For example, the S first intra prediction modes are sorted in ascending order of the first prediction cost to obtain the sorted S first intra prediction modes. In this way, K first intra-prediction modes can be determined from S sorted first intra-prediction modes. For example, the first K first intra-prediction modes from the sorted S first intra-prediction modes can be determined as the K first intra-prediction modes.
[0607] Based on the steps described above, the encoding side determines K first intra-prediction modes based on the first intra-prediction modes of N prediction blocks, and then performs the steps of S202-B2 described above.
[0608] Here, determining the second intra-prediction mode corresponding to K first intra-prediction modes based on the first angular accuracy may involve several cases, such as the following:
[0609] In Case 1, if the angular accuracy of the i-th first intra-prediction mode among the K first intra-prediction modes matches the first angular accuracy, then the i-th first intra-prediction mode is determined to be the i-th second intra-prediction mode, where i is a positive integer less than or equal to N.
[0610] In Case 2, for the i-th first intra-prediction mode out of K first intra-prediction modes, if the angular accuracy corresponding to the i-th first intra-prediction mode is different from the first angular accuracy, the second intra-prediction mode corresponding to the i-th first intra-prediction mode with the first angular accuracy is determined.
[0611] In some embodiments, the correspondence between the angular direction and the conventional prediction mode index for 129 types of angular precision and 65 types of angular precision is shown in Figure 21. Here, ipmExt refers to the intra-prediction mode index for 129 types of angular precision, and ipm refers to the intra-prediction mode index for 65 types of angular precision.
[0612] For example, if ipmExt and ipm are 0, the corresponding intra-prediction mode is planar mode.
[0613] For example, if ipmExt and ipm are both 1, the corresponding intra-prediction mode is dc mode.
[0614] For example, if ipmExt is between 2 and 130, the corresponding intra-prediction modes are 129 angles, and the direction of the angles can be roughly compared to those shown in Figure 21.
[0615] For example, if the IPM is between 2 and 66, the corresponding intra-prediction modes are 65 angles, and the direction of the angles can be roughly compared to those shown in Figure 21.
[0616] In one example, the correspondence between ipm and ipmExt is as shown in equations (5) and (6).
[0617] For example, if the angular accuracy corresponding to the i-th first intra-prediction mode is 65 and the first angular accuracy is 129, then the second intra-prediction mode with an angular accuracy of 129 corresponding to the i-th first intra-prediction mode can be determined by equation (6) above.
[0618] As another example, if the angular precision corresponding to the i-th first intra-prediction mode is 129 and the first angular precision is 65, then the second intra-prediction mode with an angular precision of 65 corresponding to the i-th first intra-prediction mode can be determined by equation (5) above.
[0619] In some embodiments, in addition to constructing an intra-prediction mode candidate list based on the first intra-prediction mode of N prediction blocks surrounding the current block as shown in the above embodiment, the encoding side can construct an intra-prediction mode candidate list by the following steps S202-C to S202-E.
[0620] In S202-C, M intra-prediction modes (where M is a positive integer) are selected from the intra-prediction modes already present in the current intra-prediction mode candidate list.
[0621] In S202-D, for the j-th intra-prediction mode (where j is a positive integer less than or equal to M) out of M intra-prediction modes, an intra-prediction mode adjacent to the j-th intra-prediction mode is determined based on the first angular accuracy.
[0622] In S202-E, adjacent intra-prediction modes are added to the intra-prediction mode candidate list.
[0623] In this embodiment, the encoding side first obtains M intra-prediction modes from the intra-prediction modes already present in the current intra-prediction mode candidate list, and then determines intra-prediction modes adjacent to each of these M intra-prediction modes based on a first angular accuracy. Subsequently, these adjacent intra-prediction modes are added to the intra-prediction mode candidate list until the length of the intra-prediction mode candidate list becomes equal to a predetermined length.
[0624] In this embodiment, if the intra-prediction mode candidate list already contains at least one intra-prediction mode, that is, if the encoding side determines that the length of the current intra-prediction mode candidate list is less than a predetermined length, it obtains M intra-prediction modes from among the intra-prediction modes already present in the current intra-prediction mode candidate list.
[0625] In some embodiments, intra-prediction modes already present in the current intra-prediction mode candidate list may be some of the default intra-prediction modes, such as the PLANAR mode.
[0626] In some embodiments, the intra-prediction modes already present in the current intra-prediction mode candidate list may be the K second intra-prediction modes determined by the method described above. That is, the encoding side first obtains the first intra-prediction modes of N prediction blocks surrounding the current block based on the method described above, determines K first intra-prediction modes based on the first intra-prediction modes of the N prediction blocks, then determines the second intra-prediction modes corresponding to each of the K first intra-prediction modes based on a first angular accuracy, and then adds the different second intra-prediction modes from these K second intra-prediction modes to the intra-prediction mode candidate list. Next, it is determined whether the length of the intra-prediction mode candidate list at this time reaches a predetermined length, and if the length of the intra-prediction mode candidate list is less than the predetermined length, steps S202-C to S202-E described above are performed to determine at least one adjacent intra-prediction mode, and adds the intra-prediction mode that does not overlap with an existing intra-prediction mode from this at least one adjacent intra-prediction mode to the intra-prediction mode candidate list.
[0627] In the embodiments of this application, the method for determining the intra-prediction modes adjacent to each of the M intra-prediction modes is the same. For the sake of explanation, the j-th intra-prediction mode will be described as an example.
[0628] In some embodiments, the intra-prediction modes adjacent to the j-th intra-prediction mode include a first-nearest-nearest-prediction mode whose index is smaller than the first index of the j-th intra-prediction mode, and / or a second-nearest-nearest-prediction mode whose index is larger than the first index.
[0629] In some embodiments, determining the intra-prediction mode adjacent to the j-th intra-prediction mode based on the first angular accuracy in S202-D above includes the method shown in the following example.
[0630] In one example, if a predetermined mode adjacent to the j-th intra-prediction mode includes the first nearest-nearest-prediction mode, and the j-th intra-prediction mode is not the first angle prediction mode among the prediction modes corresponding to the first angle accuracy, then the prediction mode whose index is one value smaller than the first index among the prediction modes corresponding to the first angle accuracy is determined as the first nearest-nearest-prediction mode.
[0631] In one example, if the intra-prediction mode adjacent to the j-th intra-prediction mode includes the first nearest prediction mode, and the j-th prediction mode is the first angle prediction mode among the prediction modes corresponding to the first angle accuracy, then the prediction mode whose index is one value smaller than the index of the prediction mode in the opposite direction of the j-th intra-prediction mode is determined as the first nearest prediction mode. For example, if the first angle accuracy is 65 and the ipm of the j-th prediction mode is 2, then the first nearest prediction mode ipm - This is the index of the angular mode located on the opposite angular direction of the IPM, separated from it by a value of 1 (e.g., delta+1). As another example, if the first angular precision is 129 and the IPMExt of the j-th prediction mode is 2, then the first nearest-neighbor prediction mode IPMExt is - This is the index of the angular mode that is one value away (e.g., delta+1) from ipmExt in the opposite angular direction.
[0632] In one example, if a predetermined mode adjacent to the j-th intra-prediction mode includes a second-nearest-nearest-prediction mode, and the j-th intra-prediction mode is not the last angle prediction mode among the prediction modes corresponding to the first angle accuracy, then the prediction mode whose index is 1 value greater than the first index among the prediction modes corresponding to the first angle accuracy is determined as the second-nearest-nearest-nearest-prediction mode.
[0633] In one example, if a predetermined mode adjacent to the j-th intra-prediction mode includes a second-nearest-nearest-prediction mode, and the j-th intra-prediction mode is the last angle prediction mode among the prediction modes corresponding to the first angle accuracy, then the prediction mode whose index is one value greater than the index of the prediction mode in the opposite direction of the j-th intra-prediction mode is determined as the second-nearest-nearest-prediction mode. For example, if the first angle accuracy is 65 and the ipm of the j-th prediction mode is 66, then the first-nearest-nearest-prediction mode ipm + This is the index of the angular mode located on the opposite angular direction of the IPM, separated from it by a value of 1 (e.g., delta+1). As another example, if the first angular precision is 129 and the IPMExt of the j-th prediction mode is 130, then the first nearest-neighbor prediction mode IPMExt is... + This is the index of the angular mode that is one value away (e.g., delta+1) from ipmExt in the opposite angular direction.
[0634] The embodiments of this application do not limit the specific value of the first value described above.
[0635] In one possible embodiment, the above first value may be a predetermined value.
[0636] In another possible implementation, the above first value is the sum of a first predetermined value and 1. Here, the first predetermined value delta is a positive integer greater than or equal to 0, and in some embodiments, delta is less than 4.
[0637] In some embodiments, determining the intra-prediction mode adjacent to the j-th intra-prediction mode based on the first angular accuracy in S202-D above includes the following steps:
[0638] In S202-D1, the second and / or third values are determined based on the first angular accuracy.
[0639] In S202-D2, based on the second and / or third values, the first nearest neighbor prediction Determine the mode and / or the second nearest-neighbor prediction mode.
[0640] The embodiments of this application do not limit the specific method for determining the second and / or third values based on the first angular accuracy.
[0641] In one example, there are different second and / or third values corresponding to different angular accuracies, both of which are predetermined values. For example, if the first angular accuracy is 65, the second value is 61 and the third value is 64. In another example, if the first angular accuracy is 129, the second value is 125 and the third value is 128.
[0642] As another example, the second value is determined by subtracting 4 from the first angular accuracy, and the third value is determined by subtracting 1 from the first angular accuracy.
[0643] After determining the second and / or third digits, the encoding side uses the second and / or third digits to determine the first nearest neighbor. prediction Determine the mode and / or second-neighbor prediction mode. Specifically, the first-neighbor prediction mode is determined based on the second and third values. prediction Determine the mode and, based on the third value, the second nearest neighbor. prediction Determine the mode.
[0644] In some embodiments, the encoding side adds a second numerical value to the first index of the j-th intra prediction mode, then subtracts a first predetermined value to obtain a fourth numerical value, and then adds a second predetermined value to the remainder obtained by dividing the fourth numerical value by the third numerical value to obtain an index corresponding to the first proximity prediction mode, and based on the index corresponding to the first proximity prediction mode, the first proximity prediction mode is determined from among the prediction modes corresponding to the first angular accuracy.
[0645] In some other embodiments, the encoding side subtracts a third predetermined value from the index of the j-th intra-prediction mode, then adds a first predetermined value to obtain a fifth value, and then adds a second predetermined value to the remainder obtained by dividing the fifth value by the third value to obtain an index corresponding to the second proximity prediction mode, and based on the index corresponding to the second proximity prediction mode, the second proximity prediction mode is determined from among the prediction modes corresponding to the first angular accuracy.
[0646] For example, if the first angular accuracy is 65, the encoding side can determine the first and second nearest-neighbor prediction modes that are close to the j-th intra-prediction mode using equation (7).
[0647] As another example, if the first angular precision is 129, the encoding side can determine the first and second nearest-neighbor prediction modes that are close to the j-th intra-prediction mode by equation (8).
[0648] Based on the steps described above, it is possible to determine the intra-prediction modes adjacent to each of the M intra-prediction modes, and then add these adjacent intra-prediction modes to the intra-prediction mode candidate list until the length of the list reaches a predetermined length.
[0649] In some embodiments, if the length of the intra-prediction mode candidate list does not reach a predetermined length, the method defaults to an angle predictionThe process further includes determining a second angular accuracy corresponding to the mode, determining a second intra-prediction mode in the first angular accuracy that corresponds to the default angular prediction mode if the second angular accuracy differs from the first angular accuracy, and adding the second intra-prediction mode corresponding to the default angular prediction mode to the intra-prediction mode candidate list. Here, determining a second intra-prediction mode in the first angular accuracy that corresponds to the default angular prediction mode can be explained by referring to the relevant explanation in the above embodiment and will not be explained again here.
[0650] The process of constructing the intra-prediction mode candidate list in the embodiment of this application will be further explained below with an example.
[0651] Assume that the angular accuracy for TMRL and TIMD technologies is 129, and the angular accuracy for DIMD, MPM, SGPM, and GPM technologies is 65.
[0652] In Example 1, a list of MPM candidate lists is constructed, and the first angular precision corresponding to the MPM candidate list is 65.
[0653] In Method 1, the MPM candidate list is constructed by the following steps.
[0654] In step 11, the PLANAR mode is placed at the top of the MPM candidate list.
[0655] In step 12, in a specific order, one by one, non-overlapping second intra-prediction modes corresponding to the first intra-prediction modes of the P first prediction blocks corresponding to the encoded blocks at positions adjacent to the current block are added to the MPM candidate list. Illustratively, these P first prediction blocks are the prediction blocks at 11 adjacent positions around the current block in Figure 18. Specifically, the following process is performed on the i-th first prediction block among the 11 first prediction blocks.
[0656] If the i-th first prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th first prediction block is matched from an angular precision of 129 to an angular precision of 65, that is, it is matched from 129 types of angular prediction modes to 65 types of angular prediction modes, and the index of the intra-prediction mode is obtained.
[0657] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0658] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived from DIMD is obtained.
[0659] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is obtained.
[0660] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is the conventional intra prediction mode, the intra prediction mode index is obtained.
[0661] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is GPM mode, obtain the angle prediction mode index corresponding to the GPM division angle.
[0662] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is not GPM mode, retrieve the intra-prediction mode index cached in the current block's intra-prediction mode cache.
[0663] Furthermore, all intra-prediction mode indices obtained above can be understood as indices for the second intra-prediction mode.
[0664] In step 13, obtain one or more (e.g., two) angle mode indices that the current block has derived using the DIMD tool.
[0665] In step 14, an extension is performed on an existing angle prediction mode in the intra prediction candidate list to include similar angles, thereby obtaining at least one extended angle prediction mode.
[0666] In step 15, the intra-prediction candidate list is supplemented with the 65 angular-precision mode indices in the default mode list.
[0667] Furthermore, in steps 11 to 15 above, if the quantity of replenished mode reaches the required replenishment quantity, replenishment should be stopped.
[0668] In Method 2, the MPM candidate list is constructed by the following steps.
[0669] In step 21, the PLANAR mode is placed at the top of the MPM candidate list.
[0670] In step 22, in a specific order, one by one, non-overlapping second intra-prediction modes corresponding to the first intra-prediction modes of the P first prediction blocks corresponding to the encoded blocks at positions adjacent to the current block are added to the MPM candidate list. Illustratively, these P first prediction blocks are the prediction blocks at 11 adjacent positions around the current block in Figure 19. Specifically, the following process is performed on the i-th first prediction block among the 11 first prediction blocks.
[0671] If the i-th first prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th first prediction block is matched from an angular precision of 129 to an angular precision of 65, that is, it is matched from 129 types of angular prediction modes to 65 types of angular prediction modes, and the index of the intra-prediction mode is obtained.
[0672] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0673] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived from DIMD is obtained.
[0674] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is obtained.
[0675] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is the conventional intra prediction mode, the intra prediction mode index is obtained.
[0676] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is GPM mode, obtain the angle prediction mode index corresponding to the GPM division angle.
[0677] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is not GPM mode, retrieve the intra-prediction mode index cached in the current block's intra-prediction mode cache.
[0678] Furthermore, all intra-prediction mode indices obtained above can be understood as indices for the second intra-prediction mode.
[0679] In step 23, obtain one or more (e.g., two) angle mode indices that the current block has derived using the DIMD tool.
[0680] In step 24, in a specific order, one by one, non-overlapping second intra-prediction modes are added to the MPM candidate list from among the Q second prediction blocks corresponding to the first intra-prediction modes of the Q second prediction blocks corresponding to the encoded block at a location not adjacent to the current block. Illustratively, these Q second prediction blocks are the prediction blocks at 20 non-adjacent locations around the current block in Figure 19. Specifically, the following process is performed on the i-th second prediction block among the 20 second prediction blocks.
[0681] If the i-th second prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th second prediction block is matched from an angular precision of 129 to an angular precision of 65, that is, it is matched from 129 types of angular prediction modes to 65 types of angular prediction modes, and the index of the intra-prediction mode is obtained.
[0682] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0683] If the i-th second prediction block is an intra prediction block and the prediction mode of the i-th second prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived from DIMD is obtained.
[0684] If the i-th second prediction block is an intra prediction block and the prediction mode of the i-th second prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is obtained.
[0685] If the i-th second prediction block is an intra prediction block, and the prediction mode of the i-th second prediction block is the conventional intra prediction mode, then the intra prediction mode index is obtained.
[0686] If the i-th second prediction block is an interpretation block and the prediction mode of the i-th second prediction block is GPM mode, obtain the angle prediction mode index corresponding to the GPM division angle.
[0687] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is not GPM mode, retrieve the intra-prediction mode index cached in the current block's intra-prediction mode cache.
[0688] In step 25, an existing angle prediction mode in the intra prediction candidate list is extended to similar angles to obtain at least one extended angle prediction mode.
[0689] In step 26, the intra-prediction candidate list is supplemented with the 65 angular-precision mode indices in the default mode list.
[0690] Furthermore, in steps 21 to 26 above, if the quantity of replenished mode reaches the required replenishment quantity, replenishment should be stopped.
[0691] In Method 3, the MPM candidate list is constructed by following the steps below.
[0692] In step 31, the PLANAR mode is placed at the top of the MPM candidate list.
[0693] In step 32, in a specific order, one by one, non-overlapping second intra-prediction modes corresponding to the first intra-prediction modes of the P first prediction blocks corresponding to the encoded blocks at positions adjacent to the current block are added to the MPM candidate list. Illustratively, these P first prediction blocks are the prediction blocks at the five adjacent positions around the current block in Figure 20. Specifically, the following process is performed on the i-th first prediction block among the five first prediction blocks.
[0694] If the i-th first prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th first prediction block is matched from an angular precision of 129 to an angular precision of 65, that is, it is matched from 129 types of angular prediction modes to 65 types of angular prediction modes, and the index of the intra-prediction mode is obtained.
[0695] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0696] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived from DIMD is obtained.
[0697] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is obtained.
[0698] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is the conventional intra prediction mode, the intra prediction mode index is obtained.
[0699] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is GPM mode, obtain the angle prediction mode index corresponding to the GPM division angle.
[0700] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is not GPM mode, retrieve the intra-prediction mode index cached in the current block's intra-prediction mode cache.
[0701] Furthermore, all intra-prediction mode indices obtained above can be understood as indices for the second intra-prediction mode.
[0702] In step 33, obtain one or more (e.g., two) angle mode indices that the current block has derived using the DIMD tool.
[0703] In step 34, in a specific order, one by one, non-overlapping second intra-prediction modes from among the Q second prediction blocks corresponding to the first intra-prediction mode of the encoded block at a location not adjacent to the current block are added to the MPM candidate list. Illustratively, these Q second prediction blocks are the prediction blocks at 18 non-adjacent locations around the current block in Figure 20. Specifically, the following process is performed on the i-th second prediction block among the 18 second prediction blocks.
[0704] If the i-th second prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th second prediction block is matched from an angular precision of 129 to an angular precision of 65, that is, it is matched from 129 types of angular prediction modes to 65 types of angular prediction modes, and the index of the intra-prediction mode is obtained.
[0705] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0706] If the i-th second prediction block is an intra prediction block and the prediction mode of the i-th second prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived from DIMD is obtained.
[0707] If the i-th second prediction block is an intra prediction block and the prediction mode of the i-th second prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is obtained.
[0708] If the i-th second prediction block is an intra prediction block, and the prediction mode of the i-th second prediction block is the conventional intra prediction mode, then the intra prediction mode index is obtained.
[0709] If the i-th second prediction block is an interpretation block and the prediction mode of the i-th second prediction block is GPM mode, obtain the angle prediction mode index corresponding to the GPM division angle.
[0710] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is not GPM mode, retrieve the intra-prediction mode index cached in the current block's intra-prediction mode cache.
[0711] In step 35, an existing angle prediction mode in the intra prediction candidate list is extended to similar angles to obtain at least one extended angle prediction mode.
[0712] In step 36, the intra-prediction candidate list is supplemented with the 65 angular-precision mode indices in the default mode list. Furthermore, in steps 31 to 36 above, if the quantity of replenished mode reaches the required replenishment quantity, replenishment should be stopped.
[0713] In some embodiments, the total number of modes acquired at adjacent and non-adjacent positions and the modes derived by DIMD can be limited so as not to exceed a predetermined value. This predetermined value may be a standard value that is common to both the encoder and the decoder.
[0714] In Example 2, a list of TMRL candidates is constructed, and the first angular precision corresponding to the TMRL candidate list is 129. In Method 1, the TMRL candidate list is constructed by following the steps below.
[0715] In step 41, in a specific order, one by one, non-overlapping second intra-prediction modes corresponding to the first intra-prediction modes of the P first prediction blocks corresponding to the encoded blocks at positions adjacent to the current block are added to the TMRL candidate list. Illustratively, these P first prediction blocks are the prediction blocks at 11 adjacent positions around the current block in Figure 18. Specifically, the following process is performed on the i-th first prediction block among the 11 first prediction blocks.
[0716] If the i-th first prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th first prediction block is obtained. If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode. If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived by DIMD is matched to the intra prediction mode index with an angular precision of 129.
[0717] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is matched to an intra-prediction mode index with an angle precision of 129.
[0718] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is a conventional intra prediction mode, then the first intra prediction mode index of the i-th first prediction block is matched to an intra prediction mode index with an angular precision of 129.
[0719] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is GPM mode, the intraprediction mode index corresponding to the GPM division is matched to an intraprediction mode index with an angular precision of 129.
[0720] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is not GPM mode, then the intraprediction mode index cached in the current block's intraprediction mode cache is matched to an intraprediction mode index with an angular precision of 129.
[0721] Furthermore, all intra-prediction mode indices obtained above can be understood as indices for the second intra-prediction mode. In step 42, the current block obtains one or more (e.g., two) angular mode indices derived using the DIMD tool and matches them to an intra-predictive mode index with an angular precision of 129.
[0722] In step 43, an existing angle prediction mode in the intra prediction candidate list is extended to similar angles to obtain at least one extended angle prediction mode. In step 44, the 65 angular-precision mode indices in the default mode list are matched to the 129 angular-precision intra-predictive mode indices.
[0723] Furthermore, in steps 41 to 44 above, if the quantity of replenished mode reaches the required quantity for replenishment, replenishment should be stopped.
[0724] In Method 2, the TMRL candidate list is constructed by the following steps.
[0725] In step 51, in a specific order, one by one, non-overlapping second intra-prediction modes corresponding to the first intra-prediction modes of the P first prediction blocks corresponding to the encoded blocks at positions adjacent to the current block are added to the TMRL candidate list. Illustratively, these P first prediction blocks are the prediction blocks at 11 adjacent positions around the current block in Figure 19. Specifically, the following process is performed on the i-th first prediction block among the 11 first prediction blocks.
[0726] If the i-th first prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th first prediction block is obtained.
[0727] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0728] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived by DIMD is matched to the intra prediction mode index with an angular precision of 129.
[0729] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is matched to an intra-prediction mode index with an angle precision of 129.
[0730] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is a conventional intra prediction mode, then the first intra prediction mode index of the i-th first prediction block is matched to an intra prediction mode index with an angular precision of 129.
[0731] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is GPM mode, the intraprediction mode index corresponding to the GPM division is matched to an intraprediction mode index with an angular precision of 129.
[0732] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is not GPM mode, then the intraprediction mode index cached in the current block's intraprediction mode cache is matched to an intraprediction mode index with an angular precision of 129.
[0733] Furthermore, all intra-prediction mode indices obtained above can be understood as indices for the second intra-prediction mode. In step 52, the current block obtains one or more (e.g., two) angular mode indices derived using the DIMD tool and matches them to an intra-predictive mode index with an angular precision of 129.
[0734] In step 53, in a certain order, one by one, the second intra-prediction modes corresponding to the first intra-prediction mode of the Q second-prediction blocks corresponding to the encoded block at a position not adjacent to the current block are selected, in order of their respective second intra-prediction modes. TMRL Add to the candidate list. For example, these Q second prediction blocks are prediction blocks in 20 non-adjacent positions around the current block in Figure 19. Specifically, for the i-th second prediction block out of the 20 second prediction blocks, perform the following process:
[0735] If the i-th second prediction block is an intra prediction block and TIMD mode or TMRL mode is adopted, then the i-th 2 Get the index of the intra-prediction mode corresponding to the prediction block.
[0736] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0737] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is DIMD mode, then the intra-prediction mode index with an angular precision of 65 derived by DIMD is matched to the intra-prediction mode index with an angular precision of 129.
[0738] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is matched to an intra-prediction mode index with an angle precision of 129.
[0739] If the i-th second prediction block is an intra prediction block, and the prediction mode of the i-th second prediction block is the conventional intra prediction mode, then the i-th2 The first intra-prediction mode index of the prediction block is matched to an intra-prediction mode index with an angular precision of 129.
[0740] If the i-th second prediction block is an inter-prediction block and the prediction mode of the i-th second prediction block is GPM mode, the intra-prediction mode index corresponding to the GPM division is matched to an intra-prediction mode index with an angular precision of 129.
[0741] If the i-th second prediction block is an interpretation block and the prediction mode of the i-th second prediction block is not GPM mode, then the intraprediction mode index cached in the current block's intraprediction mode cache is matched to an intraprediction mode index with an angular precision of 129.
[0742] In step 54, an existing angle prediction mode in the intra prediction candidate list is extended to similar angles to obtain at least one extended angle prediction mode.
[0743] In step 55, the 65 angular-precision mode indices in the default mode list are matched to the 129 angular-precision intra-predictive mode indices.
[0744] Furthermore, in steps 51 to 55 above, if the quantity of replenished mode reaches the required replenishment quantity, replenishment should be stopped.
[0745] In Method 3, the following steps are taken: TMRL Build a list of candidates.
[0746] In step 61, in a specific order, one by one, non-overlapping second intra-prediction modes corresponding to the first intra-prediction modes of the P first prediction blocks corresponding to the encoded blocks at positions adjacent to the current block are added to the TMRL candidate list. Illustratively, these P first prediction blocks are the prediction blocks at the five adjacent positions around the current block in Figure 20. Specifically, the following process is performed on the i-th first prediction block among the five first prediction blocks.
[0747] If the i-th first prediction block is an intra-prediction block and either TIMD mode or TMRL mode is adopted, the index of the intra-prediction mode corresponding to that i-th first prediction block is obtained.
[0748] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0749] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is DIMD mode, then the intra prediction mode index with an angular precision of 65 derived by DIMD is matched to the intra prediction mode index with an angular precision of 129.
[0750] If the i-th first prediction block is an intra-prediction block and the prediction mode of the i-th first prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is matched to an intra-prediction mode index with an angle precision of 129.
[0751] If the i-th first prediction block is an intra prediction block and the prediction mode of the i-th first prediction block is a conventional intra prediction mode, then the first intra prediction mode index of the i-th first prediction block is matched to an intra prediction mode index with an angular precision of 129.
[0752] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is GPM mode, the intraprediction mode index corresponding to the GPM division is matched to an intraprediction mode index with an angular precision of 129.
[0753] If the i-th first prediction block is an interpretation block and the prediction mode of the i-th first prediction block is not GPM mode, then the intraprediction mode index cached in the current block's intraprediction mode cache is matched to an intraprediction mode index with an angular precision of 129.
[0754] Furthermore, all intra-prediction mode indices obtained above can be understood as indices for the second intra-prediction mode.
[0755] In step 62, the current block obtains one or more (e.g., two) angular mode indices derived using the DIMD tool and matches them to an intra-predictive mode index with an angular precision of 129.
[0756] In step 63, one by one, in a certain order, among the Q second prediction modes corresponding to the first intra prediction mode of the Q second prediction blocks corresponding to the encoded block at a position not adjacent to the current block, select the non-overlapping second intra prediction modes. TMRL Add to the candidate list. For example, these Q second prediction blocks are prediction blocks in 18 non-adjacent positions around the current block in Figure 20. Specifically, for the i-th second prediction block out of the 18 second prediction blocks, perform the following process:
[0757] If the i-th second prediction block is an intra prediction block and TIMD mode or TMRL mode is adopted, then the i-th 2Get the index of the intra-prediction mode corresponding to the prediction block.
[0758] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is MIP or IntraTMP, it is processed as an index in PLANAR mode.
[0759] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is DIMD mode, then the intra-prediction mode index with an angular precision of 65 derived by DIMD is matched to the intra-prediction mode index with an angular precision of 129.
[0760] If the i-th second prediction block is an intra-prediction block and the prediction mode of the i-th second prediction block is SGPM mode, the angle prediction mode index corresponding to the SGPM division angle is matched to an intra-prediction mode index with an angle precision of 129.
[0761] If the i-th second prediction block is an intra prediction block, and the prediction mode of the i-th second prediction block is the conventional intra prediction mode, then the i-th 2 The first intra-prediction mode index of the prediction block is matched to an intra-prediction mode index with an angular precision of 129.
[0762] If the i-th second prediction block is an inter-prediction block and the prediction mode of the i-th second prediction block is GPM mode, the intra-prediction mode index corresponding to the GPM division is matched to an intra-prediction mode index with an angular precision of 129.
[0763] If the i-th second prediction block is an interpretation block and the prediction mode of the i-th second prediction block is not GPM mode, then the intraprediction mode index cached in the current block's intraprediction mode cache is matched to an intraprediction mode index with an angular precision of 129.
[0764] In step 64, an existing angle prediction mode in the intra prediction candidate list is extended to similar angles to obtain at least one extended angle prediction mode.
[0765] In step 65, the 65 angular-precision mode indices in the default mode list are matched to the 129 angular-precision intra-predictive mode indices.
[0766] Furthermore, in steps 61 to 65 above, if the quantity of replenished mode reaches the required replenishment quantity, replenishment should be stopped. In some embodiments, the total number of modes acquired at adjacent and non-adjacent locations and modes derived by DIMD can be limited so as not to exceed a predetermined value.
[0767] The encoding side, after obtaining a list of intra-prediction mode candidates based on the method described above, then performs the following step S203.
[0768] In S203, the current block is predicted based on the intra prediction mode candidate list, and the predicted value for the current block is obtained.
[0769] The embodiments of this application do not limit the specific method for predicting the current block and obtaining the predicted value of the current block based on the intra-prediction mode candidate list.
[0770] In some embodiments, one intra-prediction mode is selected from the intra-prediction mode candidate list constructed above, and then the current block is predicted using that intra-prediction mode to obtain the predicted value of the current block. Furthermore, the index of the selected intra-prediction mode is written to the bitstream.
[0771] In some embodiments, the encoding side predicts the template of the current block using each candidate prediction mode in the intra-prediction mode list, obtains a template prediction value corresponding to each candidate prediction mode, and then determines the prediction cost corresponding to each candidate prediction mode based on each template prediction value and template reconstruction value. Next, the candidate prediction mode with the smallest prediction cost is determined as the intra-prediction mode for the current block, and the current block is predicted using that intra-prediction mode to obtain the prediction value for the current block.
[0772] In some embodiments, step S203 above includes steps S203-A and S203-B below.
[0773] In S203-A, the T candidate prediction modes (where T is a positive integer greater than 1) in the intra-prediction mode candidate list are sorted to obtain the sorted intra-prediction mode candidate list.
[0774] In S203-B, the current block is predicted based on the sorted intra-prediction mode candidate list, and the predicted value for the current block is obtained.
[0775] In one example, the above T candidate prediction modes may be some of the candidate prediction modes in the intra prediction mode list.
[0776] As another example, the T candidate prediction modes mentioned above could be all the candidate prediction modes in the intra prediction mode list.
[0777] In other words, the embodiment of the present invention sorts some or all of the candidate prediction modes in the constructed intra-prediction mode candidate list to obtain a sorted intra-prediction mode candidate list.
[0778] The embodiments of this application do not limit the specific method for sorting T candidate prediction modes in the intra-prediction mode candidate list to obtain the sorted intra-prediction mode candidate list.
[0779] In one possible implementation, T candidate prediction modes in the intra-prediction mode candidate list are sorted based on a predetermined sorting rule and order to obtain a sorted intra-prediction mode candidate list.
[0780] In another possible implementation, sorting is performed based on predicted cost, in which case S203-A above includes the following steps:
[0781] In S203-A1, for the t-th candidate prediction mode (where t is a positive integer less than or equal to T) out of T candidate prediction modes, the second prediction cost of the t-th candidate prediction mode when predicting the template of the current block is used.
[0782] In S203-A2, T candidate prediction modes are sorted based on the second prediction cost, and a sorted list of intra-prediction mode candidates is obtained.
[0783] In this implementation, for the t-th candidate prediction mode out of T candidate prediction modes, the template of the current block is predicted using the t-th candidate prediction mode, and the predicted value of the template in the t-th candidate prediction mode is obtained. Next, based on the reconstructed value of the template and the predicted value of the template in the t-th candidate prediction mode, a second prediction cost corresponding to the t-th candidate prediction mode is determined, and this second prediction cost may be an approximate cost such as SAD or SATD. In this way, the second prediction cost corresponding to each of the T candidate prediction modes can be determined, and the T candidate prediction modes are sorted based on the second prediction cost to obtain a sorted intra-prediction mode candidate list. For example, the T candidate prediction modes are sorted in ascending order of the second prediction cost to obtain a sorted intra-prediction mode candidate list.
[0784] In some embodiments, when determining the predicted values of the current block template, the reference pixel lines used by the current block template are at least one row and / or at least one column of reconstructed pixel lines adjacent to the current block template.
[0785] Exemplary, as shown in Figure 22, the template of the current block includes an upper template and / or a left template, where the upper template includes K rows of pixel lines and the left template includes K columns of pixel lines, where K is a positive integer. The reference pixel lines of the template of the current block include an upper reference pixel line and / or a left reference pixel column. In one example, the upper reference pixel line includes one row of pixel lines, e.g., the reconstructed pixel line of the (K+1)th row. In another example, the left reference pixel column is one column of pixel lines, e.g., the reconstructed pixel column of the (K+1)th column.
[0786] In some embodiments, the number of rows in the upper reference pixel line may differ from the number of columns in the left reference pixel column. In some embodiments, the number of rows in the upper reference pixel line and / or the number of columns in the left reference pixel column can be determined according to the difference in size of the current block.
[0787] In some embodiments, the upper template of the current block includes one or two rows of pixel lines, and / or the left template of the current block includes one or two columns of pixel rows.
[0788] For example, to reduce the complexity of calculating the second predicted cost described above, the upper template may contain one row of pixel lines, and / or the left template may contain one column of pixel lines.
[0789] As another example, the complexity of the calculation can be reduced by using the upper and / or left-side templates with two rows and / or two columns to calculate the second predicted cost described above.
[0790] In some embodiments, the complexity of prediction in templates can be simplified, for example, by not using PDPC or by reducing the number of taps in the interpolation filter.
[0791] In some embodiments, the number of pixel lines in the upper template may differ from the number of pixel columns in the left template. In some embodiments, the number of pixel lines in the upper template and the number of pixel columns in the left template can be determined based on the difference in block size.
[0792] In some embodiments, the current block template may include only the upper template and not the left template. Alternatively, the current block template may include only the left template and not the upper template.
[0793] The video coding method according to the embodiment of the present invention, when constructing an intra-prediction mode candidate list, first determines a first angular precision corresponding to the intra-prediction mode candidate list, and this first angular precision is used to indicate the search range of angular prediction modes in the intra-prediction mode candidate list. Next, the intra-prediction mode candidate list is constructed based on the first angular precision. Assuming that the intra-prediction mode candidate list is a TIMD list, and that the first angular precision corresponding to TIMD is 129, the embodiment of the present invention avoids loss of angular precision and improves the accuracy of constructing the intra-prediction mode candidate list by directly constructing an intra-prediction mode candidate list with an angular precision of 129, rather than first constructing an intra-prediction mode candidate list with an angular precision of 65 and then re-deriving the intra-prediction mode candidate list with an angular precision of 65 to an angular precision of 129. This improves the accuracy of the intra-prediction mode candidate list construction, thereby improving the prediction accuracy of the current block when making predictions based on the accurately constructed intra-prediction mode candidate list, and ultimately improving the effectiveness of video coding and decoding.
[0794] It should be understood that Figures 15 through 19 are merely examples of the present application and should not be understood as limiting the present application.
[0795] While preferred embodiments of the present application have been described above with reference to the drawings, the present application is not limited to the specific details of the above embodiments, and various simple modifications can be made to the technical solutions of the present application within the scope of the technical concept of the present application, and all such simple modifications are covered by the protection of the present application. For example, each specific technical feature described in the specific embodiments can be combined in any suitable manner, as long as it does not create a contradiction, and in order to avoid unnecessary repetition, the present application does not specifically describe all possible combinations. As another example, various different embodiments of the present application can be combined in any way, and as long as it does not contradict the spirit of the present application, these should also be considered as being disclosed in the present application.
[0796] Furthermore, it should be noted that in the various method embodiments of this application, the order of the numbering of the processes described above does not indicate the order of execution. The order of execution of each process should be determined based on its function and internal logic, and does not limit the implementation process of the embodiments of this application. Moreover, in the embodiments of this application, the term "and / or" is merely used to indicate the relationship between the associated objects, and it indicates that three relationships can exist. Specifically, A and / or B indicates that there are three cases: when only A exists, when both A and B exist, and when only B exists. Also, the symbol " / " in this application generally indicates that the relationship between the associated objects before and after it is an "or" relationship.
[0797] The embodiments of the method of the present application have been described in detail above with reference to Figures 16 to 23, and embodiments of the apparatus of the present application will be described below with reference to Figures 24 to 26.
[0798] Figure 24 is an exemplary block diagram of a video decoding device according to one embodiment of the present application, the video decoding device 10 being applied to the video decoder described above.
[0799] As shown in Figure 24, the video decoding device 10 is A decision unit 11 is currently configured to determine a first angular precision corresponding to a candidate intra-prediction mode list for a block, wherein the first angular precision is used to indicate the search range of angular prediction modes in the candidate intra-prediction mode list. A construction unit 12 is configured to construct the intra-prediction mode candidate list based on the first angular accuracy, The system includes a prediction unit 13 configured to predict the current block and obtain a predicted value for the current block based on the intra prediction mode candidate list.
[0800] In some embodiments, the decision unit 11 is configured to specifically determine a prediction method to be used when predicting the current block, to determine an angular accuracy corresponding to the prediction method if the prediction method is a template matching-based prediction method, and to determine the first angular accuracy based on the angular accuracy corresponding to the prediction method.
[0801] In some embodiments, the decision unit 11 is specifically configured to determine the angular accuracy corresponding to the prediction method as the first angular accuracy.
[0802] In some embodiments, the prediction method includes at least one of the following: template-based intra-mode derivation (TIMD), most probable prediction mode (MPM), template-based multi-reference row intra-prediction (TMRL), spatial geometric partitioning mode (SGPM), and decoder-side intra-mode derivation (DIMD).
[0803] In some embodiments, the construction unit 12 is configured to specifically acquire a first intra-prediction mode for N prediction blocks (where N is a positive integer) around the current block, and to construct the intra-prediction mode candidate list based on the first intra-prediction modes of the N prediction blocks and the first angular accuracy.
[0804] In some embodiments, the N prediction blocks include P first prediction blocks and / or Q second prediction blocks, where the first prediction blocks are prediction blocks corresponding to decoded blocks adjacent to the current block, and the second prediction blocks are prediction blocks corresponding to decoded blocks not adjacent to the current block, where P and Q are both positive integers less than or equal to N, and the sum of P and Q is equal to N.
[0805] In some embodiments, if the N prediction blocks include the P first prediction blocks, the construction unit 12 is configured to specifically determine a first access order for the P first prediction blocks and to obtain a first intra-prediction mode for the P first prediction blocks according to the first access order.
[0806] In some embodiments, the construction unit 12 is specifically configured to determine the first access order based on the size of the current block and the sizes of the P decrypted blocks, and / or the shape of the current block and the shapes of the P decrypted blocks.
[0807] In some embodiments, if the N prediction blocks include the Q second prediction blocks, the construction unit 12 is configured to specifically determine a second access order for the Q second prediction blocks and to obtain a first intra-prediction mode for the Q second prediction blocks according to the second access order.
[0808] In some embodiments, the construction unit 12 is specifically configured to determine the second access order based on the size of the current block and the sizes of the Q decrypted blocks, and / or the shape of the current block and the shapes of the Q decrypted blocks.
[0809] In some embodiments, the construction unit 12 is specifically configured to determine the prediction method used by the i-th prediction block (where i is a positive integer less than or equal to N) among the N prediction blocks, and to determine a first intra-prediction mode for the i-th prediction block based on the prediction method.
[0810] In some embodiments, the construction unit 12 is specifically configured such that, if the prediction method is one of template-based intra-mode derivation (TIMD), decoder-side intra-mode derivation (DIMD), template-based multi-reference-row intra-prediction (TMRL), and conventional intra-prediction modes, the intra-prediction mode derived by the prediction method is determined as the first intra-prediction mode of the i-th prediction block; if the prediction method is matrix-based intra-prediction mode (MIP) or intra-template matching prediction mode (intraTMP), the DIMD method is used to derive a first angle prediction mode and the first angle prediction mode is determined as the first intra-prediction mode of the i-th prediction block, or the planar mode is determined as the first intra-prediction mode of the i-th prediction block; and if the prediction method is geometric partitioning mode (GPM) or spatial geometric partitioning mode (SGPM), the angle prediction mode corresponding to the partitioning angle of the GPM or SGPM is determined as the first intra-prediction mode of the i-th prediction block.
[0811] In some embodiments, the build unit 12 is further configured to determine the intra-prediction mode in the current block's intra-prediction mode cache as the first intra-prediction mode of the i-th prediction block if the i-th prediction block is an inter-prediction block and the prediction mode used by the i-th prediction block during prediction is not GPM mode.
[0812] In some embodiments, the construction unit 12 is configured to specifically determine K (where K is a positive integer less than or equal to N) first intra-prediction modes based on the first intra-prediction modes of the N prediction blocks, determine second intra-prediction modes corresponding to the K first intra-prediction modes based on the first angular accuracy, and construct the intra-prediction mode candidate list based on the K second intra-prediction modes.
[0813] In some embodiments, the construction unit 12 is specifically configured to sort some or all of the first intra-prediction modes of the N prediction blocks to obtain sorted first intra-prediction modes, and to determine the K first intra-prediction modes based on the sorted first intra-prediction modes.
[0814] In some embodiments, if the N prediction blocks include the P first prediction blocks, the construction unit 12 is specifically configured to sort the first intra-prediction modes of the P first prediction blocks within the N prediction blocks to obtain the sorted first intra-prediction modes.
[0815] In some embodiments, if the N prediction blocks include the Q second prediction blocks, the construction unit 12 is specifically configured to sort the first intra-prediction modes of the Q second prediction blocks within the N prediction blocks to obtain the sorted first intra-prediction modes.
[0816] In some embodiments, the construction unit 12 is specifically configured to sort the first intra-prediction modes of the N prediction blocks to obtain the sorted first intra-prediction modes.
[0817] In some embodiments, the construction unit 12 is configured to specifically select R first intra-prediction modes (where R is a positive integer less than N) from the first intra-prediction modes of the N prediction blocks, sort the R first intra-prediction modes, and obtain the sorted first intra-prediction modes.
[0818] In some embodiments, the construction unit 12 is configured to specifically determine a first intra-prediction mode corresponding to a decoder-side intra-mode derivation (DIMD), and to determine the K first intra-prediction modes based on the first intra-prediction mode corresponding to the DIMD and the first intra-prediction modes of the N prediction blocks.
[0819] In some embodiments, the construction unit 12 is configured to specifically select S (where S is a positive integer) first intra prediction modes from the first intra prediction modes corresponding to the DIMD and the first intra prediction modes of the N prediction blocks, sort the S first intra prediction modes to obtain the sorted S first intra prediction modes, and determine the K first intra prediction modes from the sorted S first intra prediction modes.
[0820] In some embodiments, the construction unit 12 is configured to specifically determine a first prediction cost when the first intra prediction mode predicts the template of the current block, and to sort the first intra prediction mode based on the first prediction cost.
[0821] In some embodiments, the construction unit 12 is specifically configured such that, for the i-th first intra-prediction mode (where i is a positive integer less than or equal to N) among the K first intra-prediction modes, if the angular accuracy corresponding to the i-th first intra-prediction mode is different from the first angular accuracy, the i-th first intra-prediction mode determines a second intra-prediction mode that corresponds to the first angular accuracy.
[0822] In some embodiments, the construction unit 12 is configured to specifically acquire M intra-prediction modes (where M is a positive integer) from among the intra-prediction modes already present in the current intra-prediction mode candidate list, determine an intra-prediction mode adjacent to the j-th intra-prediction mode (where j is a positive integer less than or equal to M) based on the first angular accuracy, and add the adjacent intra-prediction mode to the intra-prediction mode candidate list.
[0823] In some embodiments, the construction unit 12 is specifically configured to acquire the M intra-prediction modes from among the intra-prediction modes already present in the current intra-prediction mode candidate list if the length of the current intra-prediction mode candidate list is less than a predetermined length.
[0824] In some embodiments, the intra-prediction modes adjacent to the j-th intra-prediction mode include a first proximity prediction mode whose index is smaller than the first index of the j-th intra-prediction mode, and / or a second proximity prediction mode whose index is larger than the first index.
[0825] In some embodiments, if a predetermined mode adjacent to the j-th intra-prediction mode includes the first proximity prediction mode, the construction unit 12 is configured to determine the first proximity prediction mode as the prediction mode whose index is one value smaller than the first index among the prediction modes corresponding to the first angular accuracy, if the j-th intra-prediction mode is not the first angular prediction mode among the prediction modes corresponding to the first angular accuracy.
[0826] In some embodiments, if an intra-prediction mode adjacent to the j-th intra-prediction mode includes the first proximity prediction mode, the construction unit 12 is configured to determine the first proximity prediction mode as the prediction mode whose index is one less than the index of the prediction mode in the opposite direction of the j-th intra-prediction mode, if the j-th intra-prediction mode is the first angular prediction mode among the prediction modes corresponding to the first angular accuracy.
[0827] In some embodiments, if a predetermined mode adjacent to the j-th intra-prediction mode includes the second proximity prediction mode, and the j-th intra-prediction mode is not the last angle prediction mode among the prediction modes corresponding to the first angle accuracy, the construction unit 12 is configured to specifically determine as the second proximity prediction mode a prediction mode among the prediction modes corresponding to the first angle accuracy whose index is one value greater than the first index.
[0828] In some embodiments, if an intra-p...
Claims
1. A video decoding method, The current block is to determine a first angular precision corresponding to the intra-prediction mode candidate list, wherein the first angular precision is used to indicate the search range of angular prediction modes in the intra-prediction mode candidate list. Based on the first angular accuracy, construct the intra-prediction mode candidate list, A video decoding method characterized by comprising predicting the current block based on the intra prediction mode candidate list and obtaining the predicted value of the current block.
2. Determining the first angular accuracy corresponding to the intra-prediction mode candidate list of the current block is: The prediction method to be used when predicting the current block is determined, If the prediction method is a prediction method based on template matching, then the angular accuracy corresponding to the prediction method is determined. The method is characterized by including determining the first angular accuracy based on the angular accuracy corresponding to the prediction method, The video decoding method according to claim 1.
3. Determining the first angular accuracy based on the angular accuracy corresponding to the prediction method is: This is characterized by including determining the angular accuracy corresponding to the prediction method as the first angular accuracy, The video decoding method according to claim 2.
4. The prediction method is characterized by including at least one of the following: template-based intra-mode derivation (TIMD), most probable prediction mode (MPM), template-based multi-reference row intra-prediction (TMRL), spatial geometric partitioning mode (SGPM), and decoder-side intra-mode derivation (DIMD). The video decoding method according to claim 2.
5. Constructing the intra-prediction mode candidate list based on the first angular accuracy is: The first intra-prediction mode is obtained for N prediction blocks (where N is a positive integer) surrounding the current block, The method is characterized by comprising constructing a list of candidate intra-prediction modes based on the first intra-prediction modes of the N prediction blocks and the first angular accuracy, The video decoding method according to any one of claims 1 to 4.
6. The N prediction blocks include P first prediction blocks and / or Q second prediction blocks, wherein the first prediction blocks are prediction blocks corresponding to decoded blocks adjacent to the current block, and the second prediction blocks are prediction blocks corresponding to decoded blocks not adjacent to the current block, and both P and Q are positive integers less than or equal to N, and the sum of P and Q is equal to N. The video decoding method according to claim 5.
7. If the N prediction blocks include the P first prediction blocks, then obtaining the first intra-prediction mode of the N prediction blocks surrounding the current block is: Determining the first access order of P first prediction blocks, The method is characterized by including obtaining the first intra-prediction mode of the P first prediction blocks in accordance with the first access sequence, The video decoding method according to claim 6.
8. Determining the first access order of the P first prediction blocks is: The method is characterized by determining the first access order based on the size of the current block and the sizes of the P decoded blocks, and / or the shape of the current block and the shapes of the P decoded blocks. The video decoding method according to claim 7.
9. If the N prediction blocks include the Q second prediction blocks, then obtaining the first intra-prediction mode of the N prediction blocks surrounding the current block is: Determining the second access order of Q second prediction blocks, The method is characterized by including obtaining the first intra-prediction mode of the Q second prediction blocks in accordance with the second access sequence, The video decoding method according to claim 6.
10. Determining the second access order of the Q second prediction blocks is: The method is characterized by determining the second access order based on the size of the current block and the sizes of the Q decrypted blocks, and / or the shape of the current block and the shapes of the Q decrypted blocks. The video decoding method according to claim 9.
11. Obtaining the first intra-prediction mode of N prediction blocks surrounding the current block is: For the i-th prediction block (where i is a positive integer less than or equal to N) among the N prediction blocks, the prediction method used by the i-th prediction block during prediction is determined. The method is characterized by determining the first intra-prediction mode of the i-th prediction block based on the prediction method, The video decoding method according to claim 5.
12. Determining the first intra-prediction mode of the i-th prediction block based on the prediction method is: If the prediction method is one of the following: template-based intra-mode derivation (TIMD), decoder-side intra-mode derivation (DIMD), template-based multi-reference-row intra-prediction (TMRL), and conventional intra-prediction modes, the intra-prediction mode derived by the prediction method is determined as the first intra-prediction mode of the i-th prediction block. If the prediction method is a matrix-based intra-prediction mode (MIP) or intra-template matching prediction mode (intraTMP), then a DIMD method is used to derive one first angle prediction mode and determine the first angle prediction mode as the first intra-prediction mode of the i-th prediction block, or the planar mode is determined as the first intra-prediction mode of the i-th prediction block. The prediction method is a geometric division mode (GPM) or a spatial geometric division mode (SGPM), and the angle prediction mode corresponding to the division angle of the GPM or SGPM is determined as the first intra-prediction mode of the i-th prediction block, and the prediction method is characterized by including this: The video decoding method according to claim 11.
13. The aforementioned video decoding method is If the i-th prediction block is an inter-prediction block and the prediction mode used by the i-th prediction block during prediction is not the GPM mode, the intra-prediction mode in the current block's intra-prediction mode cache is further determined as the first intra-prediction mode of the i-th prediction block. The video decoding method according to claim 11.
14. Constructing the intra-prediction mode candidate list based on the first intra-prediction mode of the N prediction blocks and the first angular accuracy is: Based on the first intra-prediction modes of the N prediction blocks, K (where K is a positive integer less than or equal to N) first intra-prediction modes are determined, Based on the first angular accuracy, a second intra-prediction mode corresponding to the K first intra-prediction modes is determined, The method is characterized by comprising constructing a list of candidate intra-prediction modes based on the K second intra-prediction modes, The video decoding method according to claim 6.
15. Determining K first intra-prediction modes based on the first intra-prediction modes of the N prediction blocks is: The process involves sorting some or all of the first intra-prediction modes of the N prediction blocks to obtain the sorted first intra-prediction modes. The method is characterized by determining the K first intra prediction modes based on the sorted first intra prediction modes, The video decoding method according to claim 14.
16. If the N prediction blocks include the P first prediction blocks, sorting some or all of the first intra prediction modes of the N prediction blocks and obtaining the sorted first intra prediction modes is: The method is characterized by including sorting the first intra-prediction modes of the P first prediction blocks within the N prediction blocks, and obtaining the sorted first intra-prediction modes. The video decoding method according to claim 15.
17. If the N prediction blocks include the Q second prediction blocks, sorting some or all of the first intra prediction modes of the N prediction blocks and obtaining the sorted first intra prediction modes is: The method is characterized by including sorting the first intra-prediction modes of the Q second prediction blocks within the N prediction blocks, and obtaining the sorted first intra-prediction modes. The video decoding method according to claim 15.
18. Sort some or all of the first intra-prediction modes of the N prediction blocks to obtain the sorted first intra-prediction modes. The method is characterized by including sorting the first intra-prediction modes of the N prediction blocks and obtaining the sorted first intra-prediction modes. The video decoding method according to claim 15.
19. Sort some or all of the first intra-prediction modes of the N prediction blocks to obtain the sorted first intra-prediction modes. From the N prediction blocks, select R first intra-prediction modes (where R is a positive integer less than N), The method is characterized by including sorting the R first intra-prediction modes and obtaining the sorted first intra-prediction modes, The video decoding method according to claim 15.
20. Determining K first intra-prediction modes based on the first intra-prediction modes of the N prediction blocks is: Determine the first intra-prediction mode corresponding to the decoder-side intra-mode derivation (DIMD), The method is characterized by determining the K first intra-prediction modes based on the first intra-prediction mode corresponding to the DIMD and the first intra-prediction modes of the N prediction blocks, The video decoding method according to claim 6.
21. Determining the K first intra-prediction modes based on the first intra-prediction mode corresponding to the DIMD and the first intra-prediction modes of the N prediction blocks is: Select S first intra-prediction modes (where S is a positive integer) from among the first intra-prediction modes corresponding to the DIMD and the first intra-prediction modes of the N prediction blocks, The S first intra prediction modes are sorted to obtain the sorted S first intra prediction modes. The method is characterized by including the determination of K first intra prediction modes from the sorted S first intra prediction modes, The video decoding method according to claim 20.
22. Sorting the first intra prediction mode is The first intra prediction mode determines the first prediction cost when predicting the template of the current block, The following is characterized by sorting the first intra prediction mode based on the first prediction cost: The video decoding method according to claim 19 or 21.
23. Determining a second intra-prediction mode corresponding to the K first intra-prediction modes based on the first angular accuracy is: The method is characterized in that, for the i-th first intra-prediction mode (where i is a positive integer less than or equal to N) among the K first intra-prediction modes, if the angular accuracy corresponding to the i-th first intra-prediction mode is different from the first angular accuracy, the method determines a second intra-prediction mode that corresponds to the first angular accuracy for the i-th first intra-prediction mode. The video decoding method according to claim 14.
24. Constructing the intra-prediction mode candidate list based on the first angular accuracy is: From the current intra-prediction mode candidate list, obtain M intra-prediction modes (where M is a positive integer), For the j-th intra-prediction mode (where j is a positive integer less than or equal to M) among the M intra-prediction modes, an intra-prediction mode adjacent to the j-th intra-prediction mode is determined based on the first angular accuracy; The following is characterized by adding the adjacent intra prediction mode to the intra prediction mode candidate list: The video decoding method according to claim 1.
25. To obtain M intra-prediction modes from the intra-prediction modes already present in the current intra-prediction mode candidate list, If the length of the current intra-prediction mode candidate list is less than a predetermined length, the method includes obtaining the M intra-prediction modes from among the intra-prediction modes already present in the current intra-prediction mode candidate list. The video decoding method according to claim 24.
26. The intra-prediction mode adjacent to the j-th intra-prediction mode is characterized by including a first proximity prediction mode whose index is smaller than the first index of the j-th intra-prediction mode, and / or a second proximity prediction mode whose index is larger than the first index. The video decoding method according to claim 24.
27. If a predetermined mode adjacent to the j-th intra-prediction mode includes the first proximity prediction mode, determining the intra-prediction mode adjacent to the j-th intra-prediction mode based on the first angular accuracy is: If the j-th intra-prediction mode is not the first angle prediction mode among the prediction modes corresponding to the first angle accuracy, the prediction mode whose index is one value smaller than the first index is determined as the first proximity prediction mode. The video decoding method according to claim 26.
28. If an intra-prediction mode adjacent to the j-th intra-prediction mode includes the first proximity prediction mode, determining the intra-prediction mode adjacent to the j-th intra-prediction mode based on the first angular accuracy is: If the j-th intra-prediction mode is the first angle prediction mode among the prediction modes corresponding to the first angle accuracy, the prediction mode corresponding to the first angle accuracy is characterized by determining the first proximity prediction mode to be a prediction mode whose index is one value smaller than the index of the prediction mode in the opposite direction of the j-th intra-prediction mode. The video decoding method according to claim 27.
29. If a predetermined mode adjacent to the j-th intra-prediction mode includes the second proximity prediction mode, determining the intra-prediction mode adjacent to the j-th intra-prediction mode based on the first angular accuracy is: If the j-th intra-prediction mode is not the last angle prediction mode among the prediction modes corresponding to the first angle accuracy, the second proximity prediction mode is determined to be a prediction mode among the prediction modes corresponding to the first angle accuracy whose index is one value greater than the first index. The video decoding method according to claim 27.
30. If an intra-prediction mode adjacent to the j-th intra-prediction mode includes the second proximity prediction mode, determining the intra-prediction mode adjacent to the j-th intra-prediction mode based on the first angular accuracy is: If the j-th intra-prediction mode is the last angle prediction mode among the prediction modes corresponding to the first angle accuracy, the second proximity prediction mode is determined to be a prediction mode among the prediction modes corresponding to the first angle accuracy whose index is one value greater than the index of the prediction mode in the opposite direction of the j-th intra-prediction mode. The video decoding method according to claim 27.
31. The first value is characterized by being the sum of a first predetermined value and 1. The video decoding method according to any one of claims 27 to 30.
32. Based on the first angular accuracy, determining an intra-prediction mode adjacent to the j-th intra-prediction mode is: Based on the first angular accuracy, a second and / or third numerical value is determined, The method is characterized by determining the first proximity predetermined mode and / or the second proximity prediction mode based on the second numerical value and / or the third numerical value, The video decoding method according to claim 26.
33. Determining the first proximity predetermined mode and / or the second proximity prediction mode based on the second numerical value and / or the third numerical value is: The method is characterized by including determining the first proximity predetermined mode based on the second and third numerical values. The video decoding method according to claim 32.
34. Determining the first proximity predetermined mode based on the second and third numerical values is: After adding the second numerical value to the first index of the j-th intra prediction mode, a first predetermined value is subtracted to obtain the fourth numerical value. The remainder obtained by dividing the fourth numerical value by the third numerical value is further added to the second predetermined value to obtain an index corresponding to the first proximity prediction mode, The method is characterized by including determining the first proximity prediction mode from among the prediction modes corresponding to the first angular accuracy based on an index corresponding to the first proximity prediction mode, The video decoding method according to claim 33.
35. Determining the first proximity predetermined mode and / or the second proximity prediction mode based on the second numerical value and / or the third numerical value is: The method is characterized by including determining the second proximity predetermined mode based on the third numerical value, The video decoding method according to claim 32.
36. Determining the second proximity predetermined mode based on the third numerical value is: After subtracting a third predetermined value from the index of the j-th intra prediction mode, a first predetermined value is added to obtain a fifth numerical value. The remainder obtained by dividing the fifth numerical value by the third numerical value is further added to the second predetermined value to obtain an index corresponding to the second proximity prediction mode, The method is characterized by including determining the second proximity prediction mode from among the prediction modes corresponding to the first angular accuracy based on an index corresponding to the second proximity prediction mode, The video decoding method according to claim 35.
37. Determining a second and / or third value based on the first angular accuracy is: The value obtained by subtracting 4 from the first angular accuracy is determined as the second numerical value, The following is a feature that includes determining the third numerical value as the value obtained by subtracting 1 from the first angular accuracy: The video decoding method according to claim 32.
38. Based on the intra prediction mode candidate list, predicting the current block and obtaining the predicted value of the current block is: The process involves sorting the T candidate prediction modes (where T is a positive integer greater than 1) in the intra prediction mode candidate list to obtain a sorted intra prediction mode candidate list. The method is characterized by including predicting the current block based on the sorted intra-prediction mode candidate list and obtaining the predicted value of the current block. The video decoding method according to claim 1.
39. Sorting the T candidate prediction modes in the intra-prediction mode candidate list and obtaining the sorted intra-prediction mode candidate list is: For the t-th candidate prediction mode (where t is a positive integer less than or equal to T) among the T candidate prediction modes, the second prediction cost used when the t-th candidate prediction mode predicts the template of the current block is used, The method is characterized by including sorting the T candidate prediction modes based on the second prediction cost and obtaining the sorted intra-prediction mode candidate list. The video decoding method according to claim 38.
40. Based on the second prediction cost, sorting the T candidate prediction modes and obtaining the sorted intra-prediction mode candidate list is: The method is characterized by sorting the T candidate prediction modes in ascending order of the second prediction cost, and obtaining the sorted intra-prediction mode candidate list. The video decoding method according to claim 39.
41. The reference pixel lines of the template of the current block are characterized in that they are at least one row and / or at least one column of reconstructed pixel lines adjacent to the template of the current block. The video decoding method according to claim 34.
42. If the length of the intra prediction mode candidate list does not reach a predetermined length, the video decoding method To determine the second angular accuracy corresponding to the default angle predetermined mode, If the second angular accuracy differs from the first angular accuracy, the default angular prediction mode determines the second intra prediction mode corresponding to the first angular accuracy. The following is a feature of adding the second intra prediction mode corresponding to the default angle prediction mode to the intra prediction mode candidate list: The video decoding method according to claim 1.
43. The template of the current block is characterized by including the upper template and / or left template of the current block. The video decoding method according to claim 23.
44. The upper template of the current block includes one or two rows of pixel lines, and / or the left template of the current block includes one or two columns of pixel rows. The video decoding method according to claim 43.
45. At least one decoded block among the decoded blocks adjacent to the current block and / or decoded blocks not adjacent to the current block corresponds to the same coding tree unit as the current block, The video decoding method according to claim 6.
46. A video encoding method, The current block is to determine a first angular precision corresponding to the intra-prediction mode candidate list, wherein the first angular precision is used to indicate the search range of angular prediction modes in the intra-prediction mode candidate list. Based on the first angular accuracy, construct the intra-prediction mode candidate list, A video encoding method characterized by comprising: predicting the current block based on the intra prediction mode candidate list and obtaining the predicted value of the current block.
47. Determining the first angular accuracy corresponding to the intra-prediction mode candidate list of the current block is: The prediction method to be used when predicting the current block is determined, If the prediction method is a prediction method based on template matching, then the angular accuracy corresponding to the prediction method is determined. The method is characterized by including determining the first angular accuracy based on the angular accuracy corresponding to the prediction method, The video encoding method according to claim 46.
48. Determining the first angular accuracy based on the angular accuracy corresponding to the prediction method is: This is characterized by including determining the angular accuracy corresponding to the prediction method as the first angular accuracy, The video encoding method according to claim 47.
49. The prediction method is characterized by including at least one of the following: template-based intra-mode derivation (TIMD), most probable prediction mode (MPM), template-based multi-reference row intra-prediction (TMRL), spatial geometric partitioning mode (SGPM), and coded-side intra-mode derivation (DIMD). The video encoding method according to claim 47.
50. Constructing the intra-prediction mode candidate list based on the first angular accuracy is: The first intra-prediction mode is obtained for N prediction blocks (where N is a positive integer) surrounding the current block, The method is characterized by comprising constructing a list of candidate intra-prediction modes based on the first intra-prediction modes of the N prediction blocks and the first angular accuracy, The video encoding method according to any one of claims 46 to 49.
51. The N prediction blocks include P first prediction blocks and / or Q second prediction blocks, wherein the first prediction blocks are prediction blocks corresponding to encoded blocks adjacent to the current block, and the second prediction blocks are prediction blocks corresponding to encoded blocks not adjacent to the current block, and both P and Q are positive integers less than or equal to N, and the sum of P and Q is equal to N. The video encoding method according to claim 50.
52. If the N prediction blocks include the P first prediction blocks, then obtaining the first intra-prediction mode of the N prediction blocks surrounding the current block is: Determining the first access order of P first prediction blocks, The method is characterized by including obtaining the first intra-prediction mode of the P first prediction blocks in accordance with the first access sequence, The video encoding method according to claim 51.
53. Determining the first access order of the P first prediction blocks is: The method is characterized by determining the first access order based on the size of the current block and the sizes of the P encoded blocks, and / or the shape of the current block and the shapes of the P encoded blocks. The video encoding method according to claim 52.
54. If the N prediction blocks include the Q second prediction blocks, then obtaining the first intra-prediction mode of the N prediction blocks surrounding the current block is: Determining the second access order of Q second prediction blocks, The method is characterized by including obtaining the first intra-prediction mode of the Q second prediction blocks in accordance with the second access sequence, The video encoding method according to claim 51.
55. Determining the second access order of the Q second prediction blocks is: The method is characterized by determining the second access order based on the size of the current block and the sizes of the Q encoded blocks, and / or the shape of the current block and the shapes of the Q encoded blocks. The video encoding method according to claim 54.
56. Obtaining the first intra-prediction mode of N prediction blocks surrounding the current block is: For the i-th prediction block (where i is a positive integer less than or equal to N) among the N prediction blocks, the prediction method used by the i-th prediction block during prediction is determined. The method is characterized by determining the first intra-prediction mode of the i-th prediction block based on the prediction method, The video encoding method according to claim 50.
57. Determining the first intra-prediction mode of the i-th prediction block based on the prediction method is: If the prediction method is one of template-based intra-mode derivation (TIMD), encoded-side intra-mode derivation (DIMD), template-based multi-reference-row intra-prediction (TMRL), and a conventional intra-prediction mode, the intra-prediction mode derived by the prediction method is determined as the first intra-prediction mode of the i-th prediction block. If the prediction method is a matrix-based intra-prediction mode (MIP) or intra-template matching prediction mode (intraTMP), then a DIMD method is used to derive one first angle prediction mode and determine the first angle prediction mode as the first intra-prediction mode of the i-th prediction block, or the planar mode is determined as the first intra-prediction mode of the i-th prediction block. The prediction method is a geometric division mode (GPM) or a spatial geometric division mode (SGPM), and the angle prediction mode corresponding to the division angle of the GPM or SGPM is determined as the first intra-prediction mode of the i-th prediction block, and the prediction method is characterized by including this: The video encoding method according to claim 56.
58. The aforementioned video encoding method is If the i-th prediction block is an inter-prediction block and the prediction mode used by the i-th prediction block during prediction is not the GPM mode, the intra-prediction mode in the current block's intra-prediction mode cache is further determined as the first intra-prediction mode of the i-th prediction block. The video encoding method according to claim 56.
59. Constructing the intra-prediction mode candidate list based on the first intra-prediction mode of the N prediction blocks and the first angular accuracy is: Based on the first intra-prediction modes of the N prediction blocks, K (where K is a positive integer less than or equal to N) first intra-prediction modes are determined, Based on the first angular accuracy, a second intra-prediction mode corresponding to the K first intra-prediction modes is determined, The method is characterized by comprising constructing a list of candidate intra-prediction modes based on the K second intra-prediction modes, The video encoding method according to claim 51.
60. Determining K first intra-prediction modes based on the first intra-prediction modes of the N prediction blocks is: The process involves sorting some or all of the first intra-prediction modes of the N prediction blocks to obtain the sorted first intra-prediction modes. The method is characterized by determining the K first intra prediction modes based on the sorted first intra prediction modes, The video encoding method according to claim 59.
61. If the N prediction blocks include the P first prediction blocks, sorting some or all of the first intra prediction modes of the N prediction blocks and obtaining the sorted first intra prediction modes is: The method is characterized by including sorting the first intra-prediction modes of the P first prediction blocks within the N prediction blocks, and obtaining the sorted first intra-prediction modes. The video encoding method according to claim 60.
62. If the N prediction blocks include the Q second prediction blocks, sorting some or all of the first intra prediction modes of the N prediction blocks and obtaining the sorted first intra prediction modes is: The method is characterized by including sorting the first intra-prediction modes of the Q second prediction blocks within the N prediction blocks, and obtaining the sorted first intra-prediction modes. The video encoding method according to claim 60.
63. Sort some or all of the first intra-prediction modes of the N prediction blocks to obtain the sorted first intra-prediction modes. The method is characterized by including sorting the first intra-prediction modes of the N prediction blocks and obtaining the sorted first intra-prediction modes. The video encoding method according to claim 60.
64. Sort some or all of the first intra-prediction modes of the N prediction blocks to obtain the sorted first intra-prediction modes. From the N prediction blocks, select R first intra-prediction modes (where R is a positive integer less than N), The method is characterized by including sorting the R first intra-prediction modes and obtaining the sorted first intra-prediction modes, The video encoding method according to claim 60.
65. Determining K first intra-prediction modes based on the first intra-prediction modes of the N prediction blocks is: Determining the first intra-prediction mode corresponding to the encoded intra-mode derivation (DIMD), The method is characterized by determining the K first intra-prediction modes based on the first intra-prediction mode corresponding to the DIMD and the first intra-prediction modes of the N prediction blocks, The video encoding method according to claim 51.
66. Determining the K first intra-prediction modes based on the first intra-prediction mode corresponding to the DIMD and the first intra-prediction modes of the N prediction blocks is: Select S first intra-prediction modes (where S is a positive integer) from among the first intra-prediction modes corresponding to the DIMD and the first intra-prediction modes of the N prediction blocks, The S first intra prediction modes are sorted to obtain the sorted S first intra prediction modes. The method is characterized by including the determination of K first intra prediction modes from the sorted S first intra prediction modes, The video encoding method according to claim 65.
67. Sorting the first intra prediction mode is The first intra prediction mode determines the first prediction cost when predicting the template of the current block, The following is characterized by sorting the first intra prediction mode based on the first prediction cost: The video encoding method according to claim 64 or 66.
68. Determining a second intra-prediction mode corresponding to the K first intra-prediction modes based on the first angular accuracy is: The method is characterized in that, for the i-th first intra-prediction mode (where i is a positive integer less than or equal to N) among the K first intra-prediction modes, if the angular accuracy corresponding to the i-th first intra-prediction mode is different from the first angular accuracy, the method determines a second intra-prediction mode that corresponds to the first angular accuracy for the i-th first intra-prediction mode. The video encoding method according to claim 59.
69. Constructing the intra-prediction mode candidate list based on the first angular accuracy is: From the current intra-prediction mode candidate list, obtain M intra-prediction modes (where M is a positive integer), For the j-th intra-prediction mode (where j is a positive integer less than or equal to M) among the M intra-prediction modes, an intra-prediction mode adjacent to the j-th intra-prediction mode is determined based on the first angular accuracy; The following is characterized by adding the adjacent intra prediction mode to the intra prediction mode candidate list: The video encoding method according to claim 46.
70. To obtain M intra-prediction modes from the intra-prediction modes already present in the current intra-prediction mode candidate list, If the length of the current intra-prediction mode candidate list is less than a predetermined length, the method includes obtaining the M intra-prediction modes from among the intra-prediction modes already present in the current intra-prediction mode candidate list. The video encoding method according to claim 69.
71. The intra-prediction mode adjacent to the j-th intra-prediction mode is characterized by including a first proximity prediction mode whose index is smaller than the first index of the j-th intra-prediction mode, and / or a second proximity prediction mode whose index is larger than the first index. The video encoding method according to claim 69.
72. If a predetermined mode adjacent to the j-th intra-prediction mode includes the first proximity prediction mode, determining the intra-prediction mode adjacent to the j-th intra-prediction mode based on the first angular accuracy is: If the j-th intra-prediction mode is not the first angle prediction mode among the prediction modes corresponding to the first angle accuracy, the prediction mode whose index is one value smaller than the first index is determined as the first proximity prediction mode. The video encoding method according to claim 71.
73. If an intra-prediction mode adjacent to the j-th intra-prediction mode includes the first proximity prediction mode, determining the intra-prediction mode adjacent to the j-th intra-prediction mode based on the first angular accuracy is: If the j-th intra-prediction mode is the first angle prediction mode among the prediction modes corresponding to the first angle accuracy, the prediction mode corresponding to the first angle accuracy is characterized by determining the first proximity prediction mode to be a prediction mode whose index is one value smaller than the index of the prediction mode in the opposite direction of the j-th intra-prediction mode. The video encoding method according to claim 72.
74. If a predetermined mode adjacent to the j-th intra-prediction mode includes the second proximity prediction mode, determining the intra-prediction mode adjacent to the j-th intra-prediction mode based on the first angular accuracy is: If the j-th intra-prediction mode is not the last angle prediction mode among the prediction modes corresponding to the first angle accuracy, the second proximity prediction mode is determined to be a prediction mode among the prediction modes corresponding to the first angle accuracy whose index is one value greater than the first index. The video encoding method according to claim 72.
75. If an intra-prediction mode adjacent to the j-th intra-prediction mode includes the second proximity prediction mode, determining the intra-prediction mode adjacent to the j-th intra-prediction mode based on the first angular accuracy is: If the j-th intra-prediction mode is the last angle prediction mode among the prediction modes corresponding to the first angle accuracy, the second proximity prediction mode is determined to be a prediction mode among the prediction modes corresponding to the first angle accuracy whose index is one value greater than the index of the prediction mode in the opposite direction of the j-th intra-prediction mode. The video encoding method according to claim 72.
76. The first value is characterized by being the sum of a first predetermined value and 1. The video encoding method according to any one of claims 72 to 75.
77. Based on the first angular accuracy, determining an intra-prediction mode adjacent to the j-th intra-prediction mode is: Based on the first angular accuracy, a second and / or third numerical value is determined, The method is characterized by determining the first proximity predetermined mode and / or the second proximity prediction mode based on the second numerical value and / or the third numerical value, The video encoding method according to claim 71.
78. Determining the first proximity predetermined mode and / or the second proximity prediction mode based on the second numerical value and / or the third numerical value is: The method is characterized by including determining the first proximity predetermined mode based on the second and third numerical values. The video encoding method according to claim 77.
79. Determining the first proximity predetermined mode based on the second and third numerical values is: After adding the second numerical value to the first index of the j-th intra prediction mode, a first predetermined value is subtracted to obtain the fourth numerical value. The remainder obtained by dividing the fourth numerical value by the third numerical value is further added to the second predetermined value to obtain an index corresponding to the first proximity prediction mode, The method is characterized by including determining the first proximity prediction mode from among the prediction modes corresponding to the first angular accuracy based on an index corresponding to the first proximity prediction mode, The video encoding method according to claim 78.
80. Determining the first proximity predetermined mode and / or the second proximity prediction mode based on the second numerical value and / or the third numerical value is: The method is characterized by including determining the second proximity predetermined mode based on the third numerical value, The video encoding method according to claim 77.
81. Determining the second proximity predetermined mode based on the third numerical value is: After subtracting a third predetermined value from the index of the j-th intra prediction mode, a first predetermined value is added to obtain a fifth numerical value. The remainder obtained by dividing the fifth numerical value by the third numerical value is further added to the second predetermined value to obtain an index corresponding to the second proximity prediction mode, The method is characterized by including determining the second proximity prediction mode from among the prediction modes corresponding to the first angular accuracy based on an index corresponding to the second proximity prediction mode, The video encoding method according to claim 80.
82. Determining a second and / or third value based on the first angular accuracy is: The value obtained by subtracting 4 from the first angular accuracy is determined as the second numerical value, The following is a feature that includes determining the third numerical value as the value obtained by subtracting 1 from the first angular accuracy: The video encoding method according to claim 77.
83. Based on the intra prediction mode candidate list, predicting the current block and obtaining the predicted value of the current block is: The process involves sorting the T candidate prediction modes (where T is a positive integer greater than 1) in the intra prediction mode candidate list to obtain a sorted intra prediction mode candidate list. The method is characterized by including predicting the current block based on the sorted intra-prediction mode candidate list and obtaining the predicted value of the current block. The video encoding method according to claim 46.
84. Sorting the T candidate prediction modes in the intra-prediction mode candidate list and obtaining the sorted intra-prediction mode candidate list is: For the t-th candidate prediction mode (where t is a positive integer less than or equal to T) among the T candidate prediction modes, the second prediction cost used when the t-th candidate prediction mode predicts the template of the current block is used, The method is characterized by including sorting the T candidate prediction modes based on the second prediction cost and obtaining the sorted intra-prediction mode candidate list. The video encoding method according to claim 83.
85. Based on the second prediction cost, sorting the T candidate prediction modes and obtaining the sorted intra-prediction mode candidate list is: The method is characterized by sorting the T candidate prediction modes in ascending order of the second prediction cost, and obtaining the sorted intra-prediction mode candidate list. The video encoding method according to claim 84.
86. The reference pixel lines of the template of the current block are characterized in that they are at least one row and / or at least one column of reconstructed pixel lines adjacent to the template of the current block. The video encoding method according to claim 79.
87. If the length of the intra prediction mode candidate list has not reached a predetermined length, the video encoding method Determining the second angular accuracy corresponding to the default angle predetermined mode, If the second angular accuracy differs from the first angular accuracy, the default angular prediction mode determines the second intra prediction mode corresponding to the first angular accuracy. The following is a feature of adding the second intra prediction mode corresponding to the default angle prediction mode to the intra prediction mode candidate list: The video encoding method according to claim 46.
88. The template of the current block is characterized by including the upper template and / or left template of the current block. The video encoding method according to claim 68.
89. The upper template of the current block includes one or two rows of pixel lines, and / or the left template of the current block includes one or two columns of pixel rows. The video encoding method according to claim 88.
90. At least one encoded block among the encoded blocks adjacent to the current block and / or encoded blocks not adjacent to the current block corresponds to the same encoded tree unit as the current block, The video encoding method according to claim 51.
91. A video decoding device, A decision unit configured to determine a first angular precision corresponding to a current block's intra-prediction mode candidate list, wherein the first angular precision is used to indicate the search range of angular prediction modes in the intra-prediction mode candidate list. A construction unit configured to construct the intra-prediction mode candidate list based on the first angular accuracy, A video decoding device comprising: a prediction unit configured to predict the current block and obtain a predicted value for the current block based on the intra prediction mode candidate list.
92. A video encoding device, A decision unit configured to determine a first angular precision corresponding to a current block's intra-prediction mode candidate list, wherein the first angular precision is used to indicate the search range of angular prediction modes in the intra-prediction mode candidate list. A construction unit configured to construct the intra-prediction mode candidate list based on the first angular accuracy, A video encoding apparatus comprising: a prediction unit configured to predict the current block and obtain a predicted value for the current block based on the intra prediction mode candidate list.
93. An electronic device comprising a processor and memory, The memory is configured to store computer programs, The electronic device is characterized in that the processor is configured to realize the video decoding method according to any one of claims 1 to 45, or the video encoding method according to any one of claims 46 to 90, by calling and executing a computer program stored in the memory.
94. A video encoding and decoding system including a video encoder and a video decoder, The video decoder is configured to implement the video decoding method described in any one of claims 1 to 45. A video encoding and decoding system characterized in that the video encoder is configured to implement the video encoding method described in any one of claims 46 to 90.
95. A computer-readable storage medium storing a computer program that causes a computer to perform a video decoding method according to any one of claims 1 to 45, or a video encoding method according to any one of claims 46 to 90.