Coding method, decoding method, coder, decoder and storage medium

By adaptively selecting the second intra prediction mode and combining the first intra prediction mode to perform fusion prediction of sub-blocks, the problem of reducing prediction accuracy caused by different content characteristics of sub-blocks in video encoding is solved, and the encoding and decoding performance is improved.

WO2025145426A9PCT designated stage expired Publication Date: 2025-08-28GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/070818
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-01-05
Publication Date
2025-08-28

AI Technical Summary

Technical Problem

During the video encoding process, sub-blocks divided by the same encoding block have different content characteristics. The sharing of the same intra prediction mode of each sub-block will reduce the prediction accuracy and affect the encoding efficiency.

Method used

Adaptively selecting the second intra prediction mode, combining the first intra prediction mode to perform fusion prediction of sub-blocks, making full use of the content characteristics of the reconstructed area, and improving the prediction accuracy of the intra-block division mode.

Benefits of technology

By adaptively selecting the second intra prediction mode and combining the first intra prediction mode, the prediction accuracy of the intra sub-block division mode is improved, thereby improving the encoding and decoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024070818_28082025_PF_FP_ABST
    Figure CN2024070818_28082025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a coding method, a decoding method, a coder, a decoder and a storage medium. No matter at a coding end or a decoding end, the coding / decoding method comprises: according to a first intra-frame prediction mode, determining a first intra-frame prediction value of a target sub-block in a current block; on the basis of a reference sample value of the target sub-block, determining a second intra-frame prediction mode of the target sub-block; according to the second intra-frame prediction mode, determining a second intra-frame prediction value of the target sub-block; and, on the basis of the first intra-frame prediction value and the second intra-frame prediction value, determining an intra-frame prediction value of the target sub-block. Thus, when the current block uses an intra-frame sub-block partition mode, the present application fully utilizes content characteristics of a reconstructed area to adaptively select the second intra-frame prediction mode, and takes into account the first intra-frame prediction mode to perform combined prediction on the sub-blocks, thereby improving prediction accuracy of the intra-frame sub-block partition mode, and further improving coding and decoding performance.
Need to check novelty before this filing date? Find Prior Art

Description

Coding and decoding method, encoder, decoder and storage medium Technical Field

[0001] The present application relates to the field of video coding and decoding technology, and in particular to a coding and decoding method, an encoder, a decoder, and a storage medium. Background Art

[0002] Intra Sub-Partitions (ISP) technology divides a coding block into several sub-blocks, so that the reconstructed pixels after encoding the previous sub-block can provide reference for the next sub-block, and each sub-block shares the same intra prediction mode.

[0003] However, in the actual encoding process, the sub-blocks divided into the same coding block may have different content characteristics. If the sub-blocks share the same intra-frame prediction mode for prediction, the prediction accuracy will be reduced, thereby affecting the coding efficiency.

[0004] Summary of the Invention

[0005] The present application provides a coding and decoding method, an encoder, a decoder, and a storage medium, which fully utilize the content characteristics of the reconstructed area, adaptively select a second intra-frame prediction mode, and perform fusion prediction on the sub-blocks in combination with the first intra-frame prediction mode, thereby improving the prediction accuracy of the intra-frame sub-block division mode, thereby further improving the coding and decoding performance.

[0006] The technical solution of this application can be implemented as follows:

[0007] In a first aspect, an embodiment of the present application provides a decoding method, applied to a decoder, the method comprising:

[0008] Decoding a bitstream to determine prediction parameters of a current block, wherein the prediction parameters include a first intra-frame prediction mode;

[0009] Determining a first intra-frame prediction value of a target subblock in the current block according to the first intra-frame prediction mode;

[0010] Determining a second intra prediction mode of the target subblock based on a reference sample value of the target subblock, wherein the second intra prediction mode includes one or more intra prediction modes;

[0011] Determine, according to the second intra prediction mode, a second intra prediction value of the target subblock, wherein the second intra prediction value includes one or more intra prediction values ​​determined according to one or more intra prediction modes included in the second intra prediction mode;

[0012] Determining an intra-frame prediction value of the target subblock based on the first intra-frame prediction value and the second intra-frame prediction value;

[0013] A reconstructed value of the target subblock is determined based on the intra prediction value of the target subblock.

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

[0015] determining a first intra prediction mode for a current block;

[0016] Determining a first intra-frame prediction value of a target subblock in the current block according to the first intra-frame prediction mode;

[0017] Determining a second intra prediction mode of the target subblock based on a reference sample value of the target subblock, wherein the second intra prediction mode includes one or more intra prediction modes;

[0018] Determine, according to the second intra prediction mode, a second intra prediction value of the target subblock, wherein the second intra prediction value includes one or more intra prediction values ​​determined according to one or more intra prediction modes included in the second intra prediction mode;

[0019] Determining an intra-frame prediction value of the target subblock based on the first intra-frame prediction value and the second intra-frame prediction value;

[0020] Determining a reconstructed value of the target sub-block based on the intra-frame prediction value of the target sub-block;

[0021] Performing a coding decision based on the reconstructed value of the target sub-block to determine prediction parameters of the current block, wherein the prediction parameters include the first intra prediction mode;

[0022] The prediction parameters are encoded, and the obtained encoded bits are written into a bitstream.

[0023] In a third aspect, an embodiment of the present application provides an encoder, comprising a first determination unit, a first prediction unit, a decision unit, and an encoding unit; wherein:

[0024] The first determining unit is configured to determine a first intra prediction mode of the current block;

[0025] The first prediction unit is configured to determine a first intra prediction value of a target subblock in the current block according to the first intra prediction mode;

[0026] The first determining unit is further configured to determine a second intra prediction mode of the target subblock based on a reference sample value of the target subblock, wherein the second intra prediction mode includes one or more intra prediction modes;

[0027] The first prediction unit is further configured to determine a second intra-frame prediction value of the target subblock according to the second intra-frame prediction mode, wherein the second intra-frame prediction value includes one or more intra-frame prediction values ​​determined according to one or more intra-frame prediction modes included in the second intra-frame prediction mode;

[0028] The first prediction unit is further configured to determine an intra-frame prediction value of the target sub-block based on the first intra-frame prediction value and the second intra-frame prediction value; and determine a reconstructed value of the target sub-block based on the intra-frame prediction value of the target sub-block;

[0029] The decision unit is configured to make a coding decision based on the reconstructed value of the target sub-block to determine prediction parameters of the current block, wherein the prediction parameters include the first intra prediction mode;

[0030] The encoding unit is configured to encode the prediction parameters and write the obtained encoded bits into a bitstream.

[0031] In a fourth aspect, an embodiment of the present application provides an encoder, comprising a first memory and a first processor; wherein:

[0032] a first memory for storing a computer program capable of running on the first processor;

[0033] The first processor is configured to execute the method according to the second aspect when running a computer program.

[0034] In a fifth aspect, an embodiment of the present application provides a decoder, comprising a decoding unit, a second determining unit, and a second predicting unit; wherein:

[0035] The decoding unit is configured to decode the code stream and determine prediction parameters of the current block, wherein the prediction parameters include a first intra-frame prediction mode;

[0036] The second prediction unit is configured to determine a first intra prediction value of a target subblock in the current block according to the first intra prediction mode;

[0037] The second determining unit is configured to determine a second intra prediction mode of the target subblock based on a reference sample value of the target subblock, wherein the second intra prediction mode includes one or more intra prediction modes;

[0038] The second prediction unit is further configured to determine a second intra-frame prediction value of the target subblock according to the second intra-frame prediction mode, wherein the second intra-frame prediction value includes one or more intra-frame prediction values ​​determined according to one or more intra-frame prediction modes included in the second intra-frame prediction mode;

[0039] The second prediction unit is further configured to determine the intra-frame prediction value of the target subblock based on the first intra-frame prediction value and the second intra-frame prediction value; and determine the reconstructed value of the target subblock based on the intra-frame prediction value of the target subblock.

[0040] In a sixth aspect, an embodiment of the present application provides a decoder, including a second memory and a second processor; wherein:

[0041] a second memory for storing a computer program capable of running on the second processor;

[0042] The second processor is configured to execute the method according to the first aspect when running a computer program.

[0043] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a code stream generated by the encoding method as described.

[0044] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed, implements the method described in the first aspect or the method described in the second aspect.

[0045] The embodiments of the present application provide a coding and decoding method, an encoder, a decoder, and a storage medium. Whether at the encoding end or the decoding end, a first intra-frame prediction value of a target sub-block in a current block is determined based on a first intra-frame prediction mode; a second intra-frame prediction mode of the target sub-block is determined based on a reference sample value of the target sub-block; a second intra-frame prediction value of the target sub-block is determined based on the second intra-frame prediction mode; and an intra-frame prediction value of the target sub-block is determined based on the first intra-frame prediction value and the second intra-frame prediction value. In this way, when the current block uses the intra-frame sub-block division mode, the content characteristics of the reconstructed area are fully utilized to adaptively select the second intra-frame prediction mode, and the sub-block is combined with the first intra-frame prediction mode to perform a fusion prediction on the sub-block, thereby improving the prediction accuracy of the intra-frame sub-block division mode, thereby further improving the coding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] FIG1 is a block diagram of an encoder according to an embodiment of the present application;

[0047] FIG2 is a block diagram of a decoder according to an embodiment of the present application;

[0048] FIG3 is a schematic diagram of a network architecture of a coding and decoding system provided in an embodiment of the present application;

[0049] FIG4 is a schematic diagram of a flow chart of a decoding method provided in an embodiment of the present application;

[0050] FIG5 is a schematic diagram of sub-block division within a frame provided by an embodiment of the present application;

[0051] FIG6 is a schematic diagram showing the positions of sub-blocks and the current block under horizontal partitioning according to an embodiment of the present application;

[0052] FIG7 is a schematic diagram of the positions of sub-blocks and the current block under vertical partitioning according to an embodiment of the present application;

[0053] FIG8 is a schematic diagram of a gradient histogram provided in an embodiment of the present application;

[0054] FIG9 is a schematic diagram of a template area provided in an embodiment of the present application;

[0055] FIG10 is a schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application;

[0056] FIG11 is a flow chart of an encoding method and a decoding method provided in an embodiment of the present application;

[0057] FIG12 is a schematic diagram of the structure of an encoder provided in an embodiment of the present application;

[0058] FIG13 is a schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application;

[0059] FIG14 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application;

[0060] FIG15 is a schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application;

[0061] FIG16 is a schematic diagram of the composition structure of a coding and decoding system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below with reference to the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.

[0063] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0064] In the following description, reference is made to "some embodiments," which describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. It should also be noted that the terms "first, second, and third" in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that "first, second, and third" may be interchanged in a specific order or sequential order where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0065] Before further explaining the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained first. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:

[0066] Coding Block (CB);

[0067] Block Matching (BM);

[0068] Coding Unit (CU);

[0069] Block Vector (BV);

[0070] Motion Vector (MV);

[0071] Sum of Absolute Difference (SAD);

[0072] Sum of Absolute Transformed Difference (SATD);

[0073] Mean Square Error (MSE);

[0074] Sum of Squared Differences (SSD);

[0075] Mean Absolute Deviation (MAD);

[0076] Mean Square Differences (MSD);

[0077] Normalized Correlation Coefficient (NCC);

[0078] H.266 / Versatile Video Coding (VVC);

[0079] VVC Test Model (VTM), a reference software testing platform for VVC;

[0080] Template Matching (TM);

[0081] Intra Template Matching Prediction (Intra TMP);

[0082] Intra block copy (IBC);

[0083] Beyond VVC's reference software testing platform (Enhanced Compression Model, ECM).

[0084] It can be understood that in a video image, a first color component, a second color component, and a third color component are generally used to represent a coding block. These three color components are a luminance component, a blue chrominance component, and a red chrominance component. Specifically, the luminance component is usually represented by the symbol Y, the blue chrominance component is usually represented by the symbol Cb or U, and the red chrominance component is usually represented by the symbol Cr or V. Thus, a video image can be represented in either the YCbCr format or the YUV format.

[0085] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0086] Referring to Figure 1, which shows a schematic block diagram of the composition of an encoder provided in an embodiment of the present application. As shown in Figure 1, the encoder (specifically, a "video encoder") 100 may include a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoded image cache unit 110, etc., wherein the filtering unit 108 can implement deblocking filtering and sample adaptive offset (SAO) filtering, and the encoding unit 109 can implement header information encoding and context-based adaptive binary arithmetic coding (CABAC).For the input original video signal, a video coding block can be obtained by dividing the coding tree unit (CTU). Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transformation and quantization unit 101, including transforming the residual information from the pixel domain to the transform domain and quantizing the obtained transform coefficients to further reduce the bit rate; the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to perform intra-frame prediction on the video coding block. Specifically, the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to determine the intra-frame prediction mode to be used to encode the video coding block; the motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-frame prediction coding on the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information; the motion estimation performed by the motion estimation unit 105 is the process of generating a motion vector, which can estimate the motion of the video coding block. The motion compensation unit 104 then calculates the motion vector based on the motion vector determined by the motion estimation unit 105. After determining the intra-frame prediction mode, the intra-frame prediction unit 103 is further configured to provide the selected intra-frame prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated motion vector data to the encoding unit 109. In addition, the inverse transform and inverse quantization unit 106 is configured to reconstruct the video coding block and reconstruct a residual block in the pixel domain. The reconstructed residual block is subjected to the filter control analysis unit 107 and the filtering unit 108 to remove the block effect artifacts. The reconstructed residual block is then added to a predictive block in the frame of the decoded image buffer unit 110 to generate a reconstructed video coding block. The encoding unit 109 is configured to encode various coding parameters and quantized transform coefficients. In the CABAC-based coding algorithm, the context content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra-frame prediction mode, and output the code stream of the video signal. The decoded image buffer unit 110 is configured to store the reconstructed video coding block for prediction reference. As the video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoded image buffer unit 110 .

[0087] Referring to Figure 2, which shows a schematic block diagram of a decoder provided in an embodiment of the present application, as shown in Figure 2, the decoder (specifically, a "video decoder") 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image buffer unit 206. The decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering. After the input video signal is encoded as shown in FIG1 , a code stream of the video signal is output; the code stream is input to the decoder 200 and first passes through the decoding unit 201 to obtain the decoded transform coefficients; the transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate a residual block in the pixel domain; the intra-frame prediction unit 203 can be used to generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and the data of the previously decoded block from the current frame or picture; the motion compensation unit 204 determines the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and uses The prediction information is used to generate a predictive block for the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 with the corresponding predictive block generated by the intra-frame prediction unit 203 or the motion compensation unit 204; the decoded video signal passes through the filtering unit 205 to remove blocking artifacts, thereby improving video quality; the decoded video block is then stored in the decoded image buffer unit 206, which stores reference images used for subsequent intra-frame prediction or motion compensation, and is also used for outputting the video signal, thereby obtaining the restored original video signal.

[0088] Furthermore, an embodiment of the present application also provides a network architecture of a coding and decoding system including an encoder and a decoder, wherein FIG3 shows a schematic diagram of a network architecture of a coding and decoding system provided by an embodiment of the present application. As shown in FIG3 , the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. During implementation, the electronic device can be various types of devices with video coding and decoding functions. For example, the electronic device can include a smart phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensing device, a server, etc., which are not specifically limited here. In addition, the decoder or encoder described in the embodiment of the present application can be the above-mentioned electronic device.

[0089] In order to fully improve the prediction accuracy, VVC uses the intra-frame sub-block partitioning mode to divide the coding block into several sub-blocks. In this way, the reconstructed pixels after the previous sub-block is encoded can provide a reference for the next sub-block, and each sub-block shares the same intra-frame prediction mode. However, in the actual encoding process, the sub-blocks divided into the same coding block may have different content characteristics. If each sub-block uses the same intra-frame prediction mode for prediction, it will reduce the prediction accuracy and thus affect the coding efficiency.

[0090] Based on this, an embodiment of the present application provides a coding and decoding method. Regardless of whether it is the encoding end or the decoding end, when the current block uses the intra-frame sub-block division mode, it fully utilizes the content characteristics of the reconstructed area, adaptively selects the second intra-frame prediction mode, and combines the first intra-frame prediction mode to perform fusion prediction on the sub-block, thereby improving the prediction accuracy of the intra-frame sub-block division mode, thereby further improving the coding and decoding performance.

[0091] It should be noted that the method of the embodiment of the present application is mainly applied to the intra-frame prediction unit 103 shown in Figure 1 and the intra-frame prediction unit 203 shown in Figure 2. In other words, the embodiment of the present application can be applied to both the encoder and the decoder, or even to both the encoder and the decoder at the same time, but the embodiment of the present application is not specifically limited thereto.

[0092] It should also be noted that when applied to the encoding end, the "current block" specifically refers to the encoding block currently to be intra-frame predicted; when applied to the decoding end, the "current block" specifically refers to the decoding block currently to be intra-frame predicted.

[0093] In one embodiment of the present application, referring to FIG4 , a schematic flow chart of a decoding method provided by an embodiment of the present application is shown. As shown in FIG4 , the method may include:

[0094] S401: Decoding a bitstream to determine prediction parameters of a current block, wherein the prediction parameters include a first intra-frame prediction mode;

[0095] The prediction parameters further include any one or more parameters for decoding the current block except the first intra prediction mode.

[0096] In some embodiments, the prediction parameters further include a first syntax element, which is used to indicate whether the current block uses an intra sub-block partitioning mode. Exemplarily, decoding the bitstream to determine the prediction parameters for the current block includes: decoding the bitstream to determine a first syntax element for the current block; and, if the current block is determined to use an intra sub-block partitioning mode based on the first syntax element, decoding the bitstream to determine a first intra prediction mode. That is, if the current block is determined to use an intra sub-block partitioning mode or a derivative of the intra sub-block partitioning mode, decoding the bitstream to determine the first intra prediction mode. Here, the first intra prediction mode may be the optimal intra prediction mode for the current block. The optimal intra prediction mode may be determined by the encoder and written into the bitstream for reading by the encoder. Alternatively, the optimal intra prediction mode may be derived by the decoder based on reconstructed neighboring blocks of the current block. The derived intra sub-block partitioning mode may be a new prediction mode based on intra sub-block partitioning. Unlike traditional intra sub-block partitioning modes, the encoder can make coding decisions for different modes, select the optimal prediction mode, and transmit the syntax element information via the bitstream for reading by the decoder.

[0097] Furthermore, when it is determined according to the first syntax element that the current block does not use the intra subblock partitioning mode, the code stream is decoded to determine other intra prediction modes, where the other intra prediction modes are modes different from the intra subblock partitioning mode.

[0098] In some embodiments, the prediction parameters also include a second syntax element, and the second syntax element is used to indicate the partition type of the current block. Exemplarily, decoding the code stream and determining the prediction parameters of the current block further includes: in the case where it is determined that the current block uses the intra-frame sub-block partition mode according to the first syntax element, decoding the code stream and determining the second syntax element. That is to say, in the case where it is determined that the current block uses the intra-frame sub-block partition mode or a derivative mode of the intra-frame sub-block partition mode, it is also necessary to decode the second syntax element to determine the partition type of the current block, so as to divide the current block into several sub-blocks according to the partition type, and predict and reconstruct them in sequence from left to right or from top to bottom. Exemplarily, the partition type of the current block includes vertical partitioning or horizontal partitioning, as shown in Figure 5. The intra-frame sub-block partition mode (ISP) enables intra-frame prediction coding to be performed based on the sub-blocks in the CU, and the reconstructed pixels after the encoding of the previous sub-block provide reference samples for the next sub-block.

[0099] In some embodiments, the method further includes: determining a partition type of the current block based on the second syntax element; determining a number of sub-block partitions in the current block based on the size of the current block; determining a decoding order of the sub-blocks in the current block based on the partition type and number of partitions of the current block; and determining a target sub-block in the current block based on the decoding order. That is, when it is determined that the current block uses an intra-frame sub-block partition mode or a derivative of the intra-frame sub-block partition mode, it is also necessary to determine the number of partitions based on the size of the current block. Exemplarily, the number of partitions is 2 or 4.

[0100] Exemplarily, the variable intra_subpartitions_mode_flag is the first syntax element, used to indicate whether the current block uses the intra sub-block partitioning mode.

[0101] The variable intra_subpartitions_split_flag is the second syntax element, used to indicate whether the partition type of the intra-frame sub-blocks is horizontal or vertical.

[0102] The variable IntraSubPartitionsSplitType specifies the specific partition type used for the current luma coding block, as shown in Table 1.

[0103] The derivation process of IntraSubPartitionsSplitType is as follows:

[0104] – If intra_subpartitions_mode_flag is equal to 0, IntraSubPartitionsSplitType is set to 0.

[0105] – Otherwise, IntraSubPartitionsSplitType is set to 1 + intra_subpartitions_split_flag.

[0106] Table 1 Correspondence between the value and name of the variable IntraSubPartitionsSplitType

[0107] The variable NumIntraSubPartitions is used to specify the number of sub-blocks into which the intra luminance coding block is divided. The derivation process of NumIntraSubPartitions is as follows:

[0108] – If IntraSubPartitionsSplitType is equal to ISP_NO_SPLIT, NumIntraSubPartitions is set to 1.

[0109] – Otherwise, NumIntraSubPartitions is set to 2 if one of the following conditions is true:

[0110] –cbWidth equals 4, cbHeight equals 8

[0111] –cbWidth equals 8, cbHeight equals 4

[0112] – Otherwise, NumIntraSubPartitions is set equal to 4.

[0113] The current block can be divided into NumIntraSubPartitions sub-blocks, and prediction and reconstruction of each sub-block are completed according to the preset decoding order. As shown in Figure 6, under horizontal partitioning, the number of sub-blocks is 4, that is, the variable intra_subpartitions_split_flag is 0, IntraSubPartitionsSplitType is 1, the variable NumIntraSubPartitions is 4, and the sub-blocks are numbered from 0 to 3 according to the decoding order of the sub-blocks. As shown in Figure 7, under vertical partitioning, the number of sub-blocks is 4, that is, the variable intra_subpartitions_split_flag is 1, IntraSubPartitionsSplitType is 2, the variable NumIntraSubPartitions is 4, and the sub-blocks are numbered from 0 to 3 according to the decoding order of the sub-blocks.

[0114] For the current sub-block, prediction is performed using the first intra-frame prediction mode to determine a first intra-frame prediction value of the current sub-block; prediction is performed using the second intra-frame prediction mode to determine a second intra-frame prediction value of the current sub-block; and an intra-frame prediction value of the current sub-block is determined based on the first intra-frame prediction value and the second intra-frame prediction value.

[0115] S402: Determine a first intra prediction value of a target subblock in a current block according to a first intra prediction mode;

[0116] It should be noted that the first intra-frame prediction mode can be any intra-frame prediction mode. Exemplarily, the first intra-frame prediction mode includes but is not limited to: planar mode (PLANAR mode), direct current mode (DC mode), 65 angle prediction modes, and other intra-frame prediction modes.

[0117] It should also be noted that the target sub-block may be one or more sub-blocks in the current block. Exemplarily, the target sub-block may be any sub-block in the current block, or may be some specific sub-blocks in the current block.

[0118] S403: Determine a second intra prediction mode of the target subblock based on a reference sample value of the target subblock, where the second intra prediction mode includes one or more intra prediction modes;

[0119] Reference samples are the values ​​of reconstructed samples of adjacent blocks of the target subblock, specifically the reconstructed sample values ​​of blocks adjacent to the target subblock. The present embodiment fully utilizes the reference sample values ​​of the target subblock to determine the second intra-frame prediction mode for the target subblock, and performs a weighted fusion prediction on the target subblock in combination with the first intra-frame prediction mode, thereby improving the prediction accuracy of the intra-frame subblock division mode.

[0120] In some embodiments, the reconstructed neighboring blocks of the first subblock in the current block include at least one of the following: a left neighboring block of the first subblock, and an upper neighboring block of the first subblock, wherein the first subblock is the first decoded subblock determined according to the decoding order of the subblocks in the current block. In other embodiments, the reconstructed neighboring blocks of the first subblock also include at least one of the following: a lower-left neighboring block of the first subblock, a top-left neighboring block, a top-right neighboring block, other neighboring blocks, and non-neighboring blocks.

[0121] In some embodiments, the reconstructed neighboring blocks of other sub-blocks in the current block include: one or more reconstructed sub-blocks in the current block, using part or all of the reconstructed values ​​of the one or more reconstructed sub-blocks as reference sample values ​​to adaptively derive the second intra-frame prediction mode. The other sub-blocks are one or more sub-blocks other than the first sub-block determined based on the decoding order of the sub-blocks in the current block. For example, taking the sub-block numbered 2 in Figures 6 and 7 as an example, the reconstructed neighboring blocks include but are not limited to the sub-block numbered 0, or the sub-block numbered 1, or the sub-blocks numbered 0 and 1.

[0122] In some other embodiments, the reconstructed adjacent blocks of other sub-blocks may further include at least one of the following: other adjacent blocks and non-adjacent blocks reconstructed from other sub-blocks.

[0123] In some embodiments, the prediction parameters also include a third syntax element, and the third syntax element is used to indicate whether the current block uses the second intra-frame prediction mode for fusion prediction; accordingly, decoding the code stream and determining the prediction parameters of the current block also includes: when determining that the current block uses the intra-frame sub-block partitioning mode according to the first syntax element, decoding the code stream and determining the third syntax element.

[0124] Furthermore, the method also includes: determining the second intra-frame prediction mode of the target sub-block based on the reference sample value when it is determined according to the value of the third syntax element that the current block uses the second intra-frame prediction mode for fusion prediction; and determining the intra-frame prediction value of the target sub-block based on the first intra-frame prediction value when it is determined according to the value of the third syntax element that the current block does not use the second intra-frame prediction mode for fusion prediction.

[0125] Exemplarily, the variable intra_subpartitions_fusion_flag is the third syntax element, used to indicate whether fusion prediction is performed on the intra sub-block. When intra_subpartitions_fusion_flag is equal to 0, fusion prediction is not performed. When intra_subpartitions_fusion_flag is equal to 1, fusion prediction is performed, that is, the second intra prediction mode is determined according to the reference sample value of the current sub-block.

[0126] In some embodiments, determining a second intra-frame prediction mode for a target sub-block based on a reference sample value includes: determining prediction performance parameters of multiple candidate intra-frame prediction modes using a first derivation mode based on the reference sample value; and determining one or more intra-frame prediction modes included in the second intra-frame prediction mode based on the prediction performance parameters. The prediction performance parameters are used to indicate the performance of the candidate intra-frame prediction modes when predicting the reference sample value and can be used as a basis for mode selection.

[0127] In some embodiments, the first derivation mode may be a derivation mode preset by the codec. In other embodiments, the method further includes: decoding the bitstream to determine the first derivation mode. Specifically, the codec determines the optimal derivation mode from among multiple candidate derivation modes through coding decision making, and writes the optimal derivation mode into the bitstream for reading by the decoder.

[0128] Exemplarily, the first derivation mode includes a gradient derivation mode; the mode derivation method of the gradient derivation mode may include: performing gradient analysis on the reference sample value to determine the gradient strengths of multiple candidate intra-frame prediction modes in the first mode set; when the gradient strengths of multiple candidate intra-frame prediction modes contain non-zero items, determining at least one gradient strength according to the order of gradient strengths from large to small; determining at least one mode index according to the gradient angle corresponding to the at least one gradient strength; and determining one or more intra-frame prediction modes included in the second intra-frame prediction mode according to the at least one mode index. The first mode set includes multiple candidate intra-frame prediction modes when performing gradient derivation. Exemplarily, the first mode set includes: PLANAR mode, DC mode, and 65 angle prediction modes. The first mode set may also include other intra-frame prediction modes.

[0129] The mode derivation method of the gradient derivation mode may further include: when the gradient strengths of multiple candidate intra-frame prediction modes do not contain non-zero items, determining that the second intra-frame prediction mode includes the first preset mode; when the gradient strengths of multiple candidate intra-frame prediction modes contain non-zero items and the second intra-frame prediction mode includes the second preset mode, updating the gradient strength of the second preset mode to the first gradient strength, and re-searching other modes of the second intra-frame prediction mode based on the updated gradient strength.

[0130] That is, when performing gradient derivation, when the gradient strengths of all candidate intra-frame prediction modes are all 0, the first preset mode can be selected as the second intra-frame prediction mode, and the first preset mode can be the PLANAR mode or other default mode. When the gradient strengths of all candidate intra-frame prediction modes are not all 0, and the second preset mode is searched, the gradient strength of the second preset mode can be set to the first gradient strength (for example, -1), so that the second intra-frame prediction mode does not include the second preset mode, and the second preset mode can be the first intra-frame prediction mode, ensuring that the second intra-frame prediction mode searched based on the gradient derivation mode does not include the first intra-frame prediction mode.

[0131] Exemplarily, the variable baseMode is the first intra-frame prediction mode, the variable fusionMode is the second intra-frame prediction mode, and when fusionMode includes more than two intra-frame prediction modes, the variable NumFusionMode is the number of elements in fusionMode.

[0132] For example, take the horizontally divided sub-block numbered 1 as an example. Assume that the coordinates of the upper left corner pixel position of the current sub-block relative to the upper left corner pixel position of the image are (x, y), the width of the sub-block is Width, and the height is Height.

[0133] Input: The luminance pixels of the sub-block in the reconstructed area of ​​the current coding block are p[x][y], where x = 0...Width-1, y = -1...-Height, i.e., the sub-block area coded as 0. The origin [0][0] is the pixel coordinate of the upper left corner of sub-block 0. Taking sub-block 2 as an example, the input includes but is not limited to the reconstructed values ​​of the pixels in sub-block 0, sub-block 1, or sub-blocks 0 and 1. Taking sub-block 0 as an example, the input includes but is not limited to the reconstructed values ​​of the pixels in the left adjacent block and / or the upper adjacent block.

[0134] The gradient derivation process is as follows:

[0135] Let mapHgV={{2,1},{1,2}},mapVgH={{3,4},{4,3}}

[0136] Let angTable = {0,2048,4096,6144,8192,12288,16384,20480,24576,28672,32768,36864,40960,47104,53248,59392,65536}

[0137] Let angOffset = {18, 18, 50, 50}

[0138] Let HoG

[0067] be an array containing the gradient magnitudes for each intra prediction mode. Initialized to zero at the beginning of this process.

[0139] For p[x][y], x=1...Width-2, y=-2..-Height+1, that is, only the gradients of the internal pixel positions of the reconstructed area are calculated.

[0140] calculate:

[0141] The vertical gradient of each pixel is gHor[x][y] = p[x-1][y-1] + 2×p[x-1][y] + p[x-1][y+1] – p[x+1][y-1] – 2×p[x+1][y] – p[x+1][y+1]

[0142] The horizontal gradient of each pixel gVer[x][y] = p[x-1][y-1] + 2×p[x][y-1] + p[x+1][y-1] – p[x-1][y+1] – 2×p[x][y+1] – p[x+1][y+1]

[0143] signH[x][y]=gHor[x][y]<0?1:0

[0144] signV[x][y]=gVer[x][y]<0?1:0

[0145] HgV[x][y]=(abs(gHor[x][y])>abs(gVer[x][y])?1:0)

[0146] region[x][y]=(HgV[x][y]==1?mapHgV[signH[x][y]][signV[x][y]]:mapVgH[signH[x][y]][signV[x][y]])

[0147] grad[x][y]=(HgV[x][y]==1?abs(gVer[x][y]) / abs(gHor[x][y]):abs(gVer[x][y]) / abs(gHor[x][y]))

[0148] grad[x][y]=round(grad[x][y]*(1<<16))

[0149] Calculate the closest intra prediction mode index angIdx[x][y] = argmin i(abs(angTable[i] – grad[x][y]))

[0150] Calculate the intra prediction mode ipm[x][y]=angOffset[region[x][y]]+angIdx[x][y]

[0151] Gradient strength iAmp[x][y]=abs(gHor[x][y])+abs(gVer[x][y])

[0152] The gradient intensity iAmp is accumulated according to the corresponding intra prediction mode ipm, and a gradient histogram is established with the intra prediction mode ipm as the horizontal coordinate and the gradient intensity iAmp as the vertical coordinate, as shown in FIG8 .

[0153] The Weight array is a copy variable of HOG, which is used to calculate the weighted weights.

[0154] If the histogram HOG does not contain non-zero items, the amplitudes in Figure 8 are all 0, and fusionMode is set to PLANAR mode or other default mode.

[0155] Otherwise, set fusionMode to argmax i(HoG[i]), and fusionMode is equal to baseMode, and set HoG[fusionMode] to -1;

[0156] If fusionMode is equal to baseMode, search again and set fusionMode to argmax i(HoG[i]).

[0157] If NumFusionMode is greater than 1, it is necessary to search again until the array fusionMode is filled.

[0158] Output: The second intra prediction mode fusionMode obtained by gradient derivation, with a mode index range of [0,66].

[0159] Exemplarily, the first derivation mode includes a template derivation mode; the mode derivation method of the template derivation mode may include: predicting a reference sample value based on multiple candidate intra-frame prediction modes in the second mode set to determine a predicted sample value of the reference sample value; determining error values ​​of multiple candidate intra-frame prediction modes in the second mode set based on the reference sample value and the predicted sample value; and determining one or more intra-frame prediction modes included in the second intra-frame prediction mode according to the order of the error values ​​from small to large. The second mode set includes multiple candidate intra-frame prediction modes when performing template derivation. Exemplarily, the second mode set may include: PLANAR mode, DC mode, and 65 angular prediction modes. The second mode set may also include other intra-frame prediction modes.

[0160] It should be noted that when pattern derivation is performed based on TM technology, the reference sample value can be the reconstructed sample value in the sub-block template area. Based on the reference sample value of the template area, multiple candidate intra-frame prediction modes in the second mode set are used to predict the target sub-block template area to obtain the predicted sample value of the template area. For example, as shown in Figure 9, when both the upper reference pixel and the left reference pixel are available, the template shape is shown in Figure 9 (a); when only the left reference pixel is available, the template shape is shown in Figure 9 (b); when only the upper reference pixel is available, the template shape is shown in Figure 9 (c). The template area may also include at least one of the following: an upper left adjacent block, a lower left adjacent block, and an upper right adjacent block.

[0161] Traverse the second mode set, make predictions on the sub-block template area, and calculate certain error values ​​between the predicted value and the reconstructed value, including but not limited to the sum of absolute error (SAD), the sum of absolute error (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), the mean squared error (MSE), the rate-distortion cost (RDO), etc., and select NumFusionMode intra-frame prediction modes according to the error values ​​and assign them to the array fusionMode.

[0162] Take the sub-block numbered 1 of the horizontal division as an example.

[0163] Traverse the second mode set, perform prediction on the sub-block area numbered 0, calculate certain error values ​​between the predicted value and the reconstructed value, including but not limited to the sum of absolute error (SAD), the sum of absolute difference (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), the mean squared error (MSE), etc., select NumFusionMode intra-frame prediction modes according to the error values, and assign them to the array fusionMode.

[0164] Take the sub-block numbered 2 of the horizontal division as an example.

[0165] Traverse the second mode set, perform prediction on areas including but not limited to numbered 0 or 1 or 0 and 1, calculate certain error values ​​between the predicted value and the reconstructed value, including but not limited to the sum of absolute error (SAD), the sum of absolute difference (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), the mean squared error (MSE), etc., select NumFusionMode intra-frame prediction modes according to the error values, and assign them to the array fusionMode.

[0166] Taking the absolute error and ΔS as an example, the intra prediction mode with the smallest NumFusionMode SAD is selected as fusionMode.

[0167] In some embodiments, the second intra-frame prediction mode further includes a third preset mode. That is, the second intra-frame prediction mode may include certain fixed modes, or, when the first intra-frame prediction mode and the derived second intra-frame prediction mode meet certain conditions, the second intra-frame prediction mode is determined to include the third preset mode. Exemplarily, the third preset mode may be a planar mode (PLANAR mode).

[0168] S404: determining a second intra prediction value of the target subblock according to the second intra prediction mode, wherein the second intra prediction value includes one or more intra prediction values ​​determined according to one or more intra prediction modes included in the second intra prediction mode;

[0169] It can be understood that when the second intra-frame prediction mode includes one intra-frame prediction mode, an intra-frame prediction value of the target subblock is determined according to the second intra-frame prediction mode; when the second intra-frame prediction mode includes multiple (more than two) intra-frame prediction modes, multiple second intra-frame prediction values ​​of the target subblock are determined according to the second intra-frame prediction mode.

[0170] S405: Determine an intra prediction value of a target subblock based on the first intra prediction value and the second intra prediction value;

[0171] Exemplarily, the first intra-frame prediction value and the second intra-frame prediction value are weightedly fused to determine the intra-frame prediction value of the target sub-block, wherein the weighted fusion includes weighted fusion based on different weights and averaging based on the same weight.

[0172] In some embodiments, the method further includes: determining a first weight value for the first intra-frame prediction value and a second weight value for the second intra-frame prediction value based on a preset weight allocation strategy, wherein the second weight value includes one or more weight values ​​corresponding to one or more intra-frame prediction values ​​included in the second intra-frame prediction value. In other words, when the second intra-frame prediction mode includes multiple (more than two) intra-frame prediction modes, the second weight value also includes multiple weight values.

[0173] Exemplarily, the weight allocation strategy includes: the second intra prediction mode includes a first preset mode, determining the first weight value to be 1 and the second weight value to be 0. For example, the first preset mode may be a PLANAR mode or other default mode, and the other default mode may be an angular prediction mode.

[0174] Exemplarily, the weight allocation strategy includes: the second intra prediction mode does not include the first preset mode, and determining that the first weight value and the second weight value are equal. For example, each weight value is a constant 1 / n, where n is the number of modes involved in weighted fusion.

[0175] Exemplarily, the weight allocation strategy may include determining a weight value based on a prediction performance parameter of an intra-frame prediction mode, wherein the prediction performance parameter is used to indicate the performance of the first intra-frame prediction mode and the second intra-frame prediction mode when predicting a reference sample value, and can be used as a basis for weight allocation to improve the prediction accuracy of the current block.

[0176] Specifically, the weight allocation strategy includes: adding the prediction performance parameters of the first intra-frame prediction mode and the prediction performance parameters of the second intra-frame prediction mode to obtain a total prediction performance parameter; dividing the prediction performance parameters of the first intra-frame prediction mode by the total prediction performance parameter to obtain a first coefficient; dividing the prediction performance parameters of the second intra-frame prediction mode by the total prediction performance parameter to obtain a second coefficient; and performing weight allocation according to the first coefficient and the second coefficient to obtain a first weight value and a second weight value.

[0177] In some embodiments, performing weight allocation according to the first coefficient and the second coefficient to obtain the first weight value and the second weight value includes: calculating the product of the first coefficient and the total weight value to obtain the first weight value; calculating the product of the second coefficient and the total weight value to obtain the second weight value;

[0178] In other embodiments, weight allocation is performed based on the first coefficient and the second coefficient to obtain the first weight value and the second weight value, including: dividing the total weight value into a third weight value and a fourth weight value; calculating the product of the first coefficient and the third weight value, and adding the fourth weight value to obtain the first weight value; calculating the product of the second coefficient and the third weight value to obtain the second weight value.

[0179] For example, the variable baseMode is the first intra prediction mode, the variable baseModeWeight is the first weight value, the variable fusionMode is the second intra prediction mode, the array fusionModeWeight is the second weight value, and the variable NumFusionMode is the number of elements in fusionMode and fusionModeWeight.

[0180] When the prediction performance parameter is the gradient strength, the calculation process of the first weight value baseModeWeight and the second weight value fusionModeWeight includes but is not limited to the following:

[0181] Assume the total weight sum is sumOfWeight.

[0182] If fusionMode is PLANAR mode or other default mode, baseModeWeight is sumOfWeight and fusionModeWeight is 0;

[0183] If HOG[baseMode] is 0, baseModeWeight is sumOfWeight and fusionModeWeight is 0, or if NumFusionMode is 1, both baseModeWeight and fusionModeWeight are

[0184] If fusionMode is not PLANAR mode or other default mode, assuming NumFusionMode is 1, then both baseModeWeight and fusionModeWeight are Or baseModeWeight and fusionModeWeight are and Or baseModeWeight and fusionModeWeight are and etc.

[0185] Exemplarily, when the prediction performance parameter is a certain error value between the predicted value and the reconstructed value, taking the absolute error and SAD as an example, the calculation process of the first weight value baseModeWeight and the second weight value fusionModeWeight includes but is not limited to the following:

[0186] Assume the total weight sum is sumOfWeight.

[0187] If fusionMode is PLANAR mode or other default mode, baseModeWeight is sumOfWeight and fusionModeWeight is 0;

[0188] If fusionMode is not PLANAR mode or other default mode, assuming NumFusionMode is 1, then both baseModeWeight and fusionModeWeight are Or baseModeWeight and fusionModeWeight are and Or baseModeWeight and fusionModeWeight are and etc.

[0189] Furthermore, intra-frame weighted fusion prediction is performed for the current sub-block. It should be noted that when performing weighted prediction, the prediction values ​​of all modes can be weighted directly or one by one. When weighting one by one, the prediction values ​​of each mode are weighted using the weight values ​​of (1-p) and p when incorporated, (1-p) is the weight value of the previous weighted result, and p is the weight value of the newly incorporated mode, where p can be obtained as a constant or a value related to the prediction performance parameter. When p is a value related to the prediction performance parameter, (1-p) can be the cumulative sum of the prediction performance parameters of the previous weighted modes, and p is the prediction performance parameter of the new incorporated prediction mode.

[0190] In some embodiments, the method further includes: storing at least one of a first intra-frame prediction mode, a second intra-frame prediction mode, a first weight value, and a second weight value of the target sub-block. To fully utilize the mode information of the current block in subsequent coding blocks, the second intra-frame prediction mode and weight information may be stored in the prediction information of each sub-block, and the first intra-frame prediction mode may be stored in the prediction information of the current block as reference information for subsequent coding blocks to assist in the prediction of subsequent coding blocks.

[0191] S406: Determine a reconstructed value of the target sub-block based on the intra-frame prediction value of the target sub-block.

[0192] Exemplarily, the method further includes: decoding the code stream to determine the residual coefficient of the target sub-block; inverse quantizing and inverse transforming the residual coefficient, and combining it with the intra-frame prediction value of the sub-block to obtain a reconstructed value of the sub-block.

[0193] It should be noted that if all sub-blocks in the current block are reconstructed, the intra-frame sub-block division mode of the current block will be exited, and the decoding process of subsequent image blocks will be continued.

[0194] It should be noted that the target subblock decoded using the decoding method provided in the embodiments of the present application can be one or more subblocks in the current block. Exemplarily, the target subblock can be any subblock in the current block, or can be certain specific subblocks in the current block. Exemplarily, the specific subblock can be a subblock other than the first subblock. When the subblock is the first subblock, the intra-frame prediction value of the first subblock is determined based on the first intra-frame prediction value. When the subblock is another subblock, weighted prediction is performed using both the first intra-frame prediction mode and the second intra-frame prediction mode.

[0195] By adopting the above technical solution, at the decoding end, when the current block uses the intra-frame sub-block division mode, the content characteristics of the reconstructed area are fully utilized, the second intra-frame prediction mode is adaptively selected, and the sub-blocks are fused and predicted in combination with the first intra-frame prediction mode, thereby improving the prediction accuracy of the intra-frame sub-block division mode and further improving the decoding performance.

[0196] In another embodiment of the present application, see Figure 10, which shows a schematic flow chart of an encoding method provided in an embodiment of the present application. As shown in Figure 10, the encoding method may include:

[0197] S1001: Determine a first intra prediction mode for a current block;

[0198] Exemplarily, upon determining that the current block allows the use of an intra sub-block partitioning mode, a first intra prediction mode for the current block is determined. The syntax element used to indicate whether the current block allows the use of an intra sub-block partitioning mode may include at least one of the following: a coding tree unit-level syntax element, a picture-level syntax element, a sequence-level syntax element, etc. Upon determining, based on the syntax element, that the current block allows the use of an intra sub-block partitioning mode or a derivative of an intra sub-block partitioning mode, the first intra prediction mode is determined. The first intra prediction mode can be any candidate intra prediction mode. The encoder, after making a coding decision, selects the optimal intra prediction mode for the current block and writes it into the bitstream as a prediction parameter for the current block for reading by the decoder. The first intra prediction mode can also be derived by the encoder based on reconstructed neighboring blocks of the current block. The derivative of the intra sub-block partitioning mode can be a new prediction mode based on intra sub-block partitioning. Unlike traditional intra sub-block partitioning modes, the encoder can make coding decisions for different modes, select the optimal prediction mode, and transmit the syntax element information via the bitstream for reading by the decoder.

[0199] In some embodiments, the method further includes: determining multiple candidate partition types for the current block; determining the number of sub-block partitions in the current block based on the size of the current block; determining multiple candidate coding orders for the sub-blocks in the current block based on the multiple candidate partition types and the number of partitions of the current block; and determining a target sub-block in the current block based on the candidate coding orders. That is, if it is determined that the current block uses the intra sub-block partition mode or a derivative of the intra sub-block partition mode, the current block needs to be divided into a number of sub-blocks based on the multiple candidate partition types, and prediction and reconstruction are performed sequentially from left to right or from top to bottom. Exemplarily, the candidate partition types include vertical partitioning or horizontal partitioning, as shown in FIG5 . The intra sub-block partition mode (ISP) enables intra prediction coding to be performed based on sub-blocks in the CU, with reconstructed pixels after the encoding of the previous sub-block providing reference samples for the next sub-block. Furthermore, the number of partitions needs to be determined based on the size of the current block. Exemplarily, the number of partitions is 2 or 4.

[0200] S1002: Determine a first intra prediction value of a target subblock in a current block according to a first intra prediction mode;

[0201] It should be noted that the first intra-frame prediction mode can be any candidate intra-frame prediction mode. Exemplarily, the first intra-frame prediction mode includes but is not limited to: planar mode (PLANAR mode), direct current mode (DC mode), 65 angle prediction modes, and other intra-frame prediction modes.

[0202] It should also be noted that the target sub-block may be one or more sub-blocks in the current block. Exemplarily, the target sub-block may be any sub-block in the current block, or may be some specific sub-blocks in the current block.

[0203] S1003: Determine a second intra prediction mode of the target subblock based on a reference sample value of the target subblock, where the second intra prediction mode includes one or more intra prediction modes;

[0204] In some embodiments, when it is determined that the current block allows the use of the second intra-frame prediction mode for fusion prediction, the second intra-frame prediction mode of the target sub-block is determined based on the reference sample value of the target sub-block; when it is determined that the current block does not allow the use of the second intra-frame prediction mode for fusion prediction, the intra-frame prediction value of the target sub-block is determined based on the first intra-frame prediction value.

[0205] Among them, the syntax elements used to indicate whether the current block is allowed to use the second intra-frame prediction mode for fusion prediction may include at least one of the following: coding tree unit level syntax elements, image level syntax elements, sequence level syntax elements, etc. Based on the syntax elements, it is determined whether the current block is allowed to use the second intra-frame prediction mode for fusion prediction in the intra-frame sub-block division mode or the derivative mode of the intra-frame sub-block division mode. If allowed, the encoding end uses the prediction mode provided in the embodiment of the present application to predict and reconstruct the current block, and compares the reconstructed value with the reconstructed value of other prediction modes to determine whether to use the prediction mode provided in the embodiment of the present application. If not allowed, the traditional ISP mode can be used for prediction and reconstruction.

[0206] Reference samples are the values ​​of reconstructed samples of adjacent blocks of the target subblock, specifically the reconstructed sample values ​​of blocks adjacent to the target subblock. The present embodiment fully utilizes the reference sample values ​​of the target subblock to determine the second intra-frame prediction mode for the target subblock, and performs a weighted fusion prediction on the target subblock in combination with the first intra-frame prediction mode, thereby improving the prediction accuracy of the intra-frame subblock division mode.

[0207] In some embodiments, the reconstructed neighboring blocks of the first sub-block in the current block include at least one of the following: a left neighboring block of the first sub-block, and an upper neighboring block of the first sub-block, wherein the first sub-block is the first sub-block to be encoded according to the encoding order of the sub-blocks in the current block. In other embodiments, the reconstructed neighboring blocks of the first sub-block also include at least one of the following: a lower-left neighboring block of the first sub-block, a top-left neighboring block, a top-right neighboring block, other neighboring blocks, and non-neighboring blocks.

[0208] In some embodiments, the reconstructed neighboring blocks of other sub-blocks in the current block include: one or more reconstructed sub-blocks in the current block, and a second intra-frame prediction mode is adaptively derived using some or all of the reconstructed values ​​of the one or more reconstructed sub-blocks as reference sample values. The other sub-blocks are one or more sub-blocks other than the first sub-block determined based on the coding order of the sub-blocks in the current block. For example, taking the sub-block numbered 2 in Figures 6 and 7 as an example, the reconstructed neighboring blocks include but are not limited to the sub-block numbered 0, or the sub-block numbered 1, or the sub-blocks numbered 0 and 1.

[0209] In some other embodiments, the reconstructed adjacent blocks of other sub-blocks may further include at least one of the following: other adjacent blocks and non-adjacent blocks reconstructed from other sub-blocks.

[0210] In some embodiments, determining a second intra-frame prediction mode for a target sub-block based on a reference sample value includes: determining prediction performance parameters of multiple candidate intra-frame prediction modes using a first derivation mode based on the reference sample value; and determining one or more intra-frame prediction modes included in the second intra-frame prediction mode based on the prediction performance parameters. The prediction performance parameters are used to indicate the performance of the candidate intra-frame prediction modes when predicting the reference sample value and can be used as a basis for mode selection.

[0211] In some embodiments, the first derivation mode may be a derivation mode preset by the codec. In other embodiments, the method further includes encoding the first derivation mode. Specifically, the codec determines the optimal derivation mode from among multiple candidate derivation modes through coding decision making, and writes the optimal derivation mode into the bitstream for reading by the decoder.

[0212] Exemplarily, the first derivation mode includes a gradient derivation mode; the mode derivation method of the gradient derivation mode may include: performing gradient analysis on the reference sample value to determine the gradient strengths of multiple candidate intra-frame prediction modes in the first mode set; when the gradient strengths of multiple candidate intra-frame prediction modes contain non-zero items, determining at least one gradient strength according to the order of gradient strengths from large to small; determining at least one mode index according to the gradient angle corresponding to the at least one gradient strength; and determining one or more intra-frame prediction modes included in the second intra-frame prediction mode according to the at least one mode index. The first mode set includes multiple candidate intra-frame prediction modes when performing gradient derivation. Exemplarily, the first mode set includes: PLANAR mode, DC mode, and 65 angle prediction modes. The first mode set may also include other intra-frame prediction modes.

[0213] The mode derivation method of the gradient derivation mode may further include: when the gradient strengths of multiple candidate intra-frame prediction modes do not contain non-zero items, determining that the second intra-frame prediction mode includes the first preset mode; when the gradient strengths of multiple candidate intra-frame prediction modes contain non-zero items and the second intra-frame prediction mode includes the second preset mode, updating the gradient strength of the second preset mode to the first gradient strength, and re-searching other modes of the second intra-frame prediction mode based on the updated gradient strength.

[0214] That is, when performing gradient derivation, when the gradient strengths of all candidate intra-frame prediction modes are all 0, the first preset mode can be selected as the second intra-frame prediction mode, and the first preset mode can be the PLANAR mode or other default mode. When the gradient strengths of all candidate intra-frame prediction modes are not all 0, and the second preset mode is searched, the gradient strength of the second preset mode can be set to the first gradient strength (for example, -1), so that the second intra-frame prediction mode does not include the second preset mode, and the second preset mode can be the first intra-frame prediction mode, ensuring that the second intra-frame prediction mode searched based on the gradient derivation mode does not include the first intra-frame prediction mode.

[0215] Exemplarily, the first derivation mode includes a template derivation mode; the mode derivation method of the template derivation mode may include: predicting a reference sample value based on multiple candidate intra-frame prediction modes in the second mode set to determine a predicted sample value of the reference sample value; determining error values ​​of multiple candidate intra-frame prediction modes in the second mode set based on the reference sample value and the predicted sample value; and determining one or more intra-frame prediction modes included in the second intra-frame prediction mode according to the order of the error values ​​from small to large. The second mode set includes multiple candidate intra-frame prediction modes when performing template derivation. Exemplarily, the second mode set may include: PLANAR mode, DC mode, and 65 angular prediction modes. The second mode set may also include other intra-frame prediction modes.

[0216] It should be noted that when pattern derivation is performed based on TM technology, the reference sample value can be the reconstructed sample value in the sub-block template area. Based on the reference sample value of the template area, multiple candidate intra-frame prediction modes in the second mode set are used to predict the target sub-block template area to obtain the predicted sample value of the template area. Exemplarily, as shown in Figure 9, the template area may include one of the following: when the upper left reference pixel, the upper reference pixel, and the left reference pixel are all available, the template shape is as shown in (a) of Figure 9; when only the left reference pixel is available, the template shape is as shown in (b) of Figure 9; when only the upper reference pixel is available, the template shape is as shown in (c) of Figure 9. The template area may also include at least one of the following: an upper left adjacent block, a lower left adjacent block, and an upper right adjacent block.

[0217] Traverse the second mode set, make predictions on the sub-block template area, and calculate certain error values ​​between the predicted value and the reconstructed value, including but not limited to the sum of absolute error (SAD), the sum of absolute error (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), the mean squared error (MSE), the rate-distortion cost (RDO), etc., and select NumFusionMode intra-frame prediction modes according to the error values ​​and assign them to the array fusionMode.

[0218] In some embodiments, the second intra-frame prediction mode further includes a third preset mode. That is, the second intra-frame prediction mode may include certain fixed modes, or, when the first intra-frame prediction mode and the derived second intra-frame prediction mode meet certain conditions, the second intra-frame prediction mode is determined to include the third preset mode. Exemplarily, the third preset mode may be a planar mode (PLANAR mode).

[0219] S1004: determining a second intra prediction value of the target subblock according to the second intra prediction mode, wherein the second intra prediction value includes one or more intra prediction values ​​determined according to one or more intra prediction modes included in the second intra prediction mode;

[0220] It can be understood that when the second intra-frame prediction mode includes one intra-frame prediction mode, an intra-frame prediction value of the target subblock is determined according to the second intra-frame prediction mode; when the second intra-frame prediction mode includes multiple (more than two) intra-frame prediction modes, multiple second intra-frame prediction values ​​of the target subblock are determined according to the second intra-frame prediction mode.

[0221] S1005: Determine an intra prediction value of a target subblock based on the first intra prediction value and the second intra prediction value;

[0222] Exemplarily, the first intra-frame prediction value and the second intra-frame prediction value are weightedly fused to determine the intra-frame prediction value of the target sub-block, wherein the weighted fusion includes weighted fusion based on different weights and averaging based on the same weight.

[0223] In some embodiments, the method further includes: determining a first weight value for the first intra-frame prediction value and a second weight value for the second intra-frame prediction value based on a preset weight allocation strategy, wherein the second weight value includes one or more weight values ​​corresponding to one or more intra-frame prediction values ​​included in the second intra-frame prediction value. In other words, when the second intra-frame prediction mode includes multiple (more than two) intra-frame prediction modes, the second weight value also includes multiple weight values.

[0224] Exemplarily, the weight allocation strategy includes: the second intra prediction mode includes a first preset mode, determining the first weight value to be 1 and the second weight value to be 0. For example, the first preset mode may be a PLANAR mode or other default mode, and the other default mode may be an angular prediction mode.

[0225] Exemplarily, the weight allocation strategy includes: the second intra prediction mode does not include the first preset mode, and determining that the first weight value and the second weight value are equal. For example, each weight value is a constant 1 / n, where n is the number of modes involved in weighted fusion.

[0226] Exemplarily, the weight allocation strategy may include determining a weight value based on a prediction performance parameter of an intra-frame prediction mode, wherein the prediction performance parameter is used to indicate the performance of the first intra-frame prediction mode and the second intra-frame prediction mode when predicting a reference sample value, and can be used as a basis for weight allocation to improve the prediction accuracy of the current block.

[0227] Specifically, the weight allocation strategy includes: adding the prediction performance parameters of the first intra-frame prediction mode and the prediction performance parameters of the second intra-frame prediction mode to obtain a total prediction performance parameter; dividing the prediction performance parameters of the first intra-frame prediction mode by the total prediction performance parameter to obtain a first coefficient; dividing the prediction performance parameters of the second intra-frame prediction mode by the total prediction performance parameter to obtain a second coefficient; and performing weight allocation according to the first coefficient and the second coefficient to obtain a first weight value and a second weight value.

[0228] In some embodiments, performing weight allocation according to the first coefficient and the second coefficient to obtain the first weight value and the second weight value includes: calculating the product of the first coefficient and the total weight value to obtain the first weight value; calculating the product of the second coefficient and the total weight value to obtain the second weight value;

[0229] In other embodiments, weight allocation is performed based on the first coefficient and the second coefficient to obtain the first weight value and the second weight value, including: dividing the total weight value into a third weight value and a fourth weight value; calculating the product of the first coefficient and the third weight value, and adding the fourth weight value to obtain the first weight value; calculating the product of the second coefficient and the third weight value to obtain the second weight value.

[0230] In some embodiments, the method further includes: storing at least one of a first intra-frame prediction mode, a second intra-frame prediction mode, a first weight value, and a second weight value of the target sub-block. To fully utilize the mode information of the current block in subsequent coding blocks, the second intra-frame prediction mode and weight information may be stored in the prediction information of each sub-block, and the first intra-frame prediction mode may be stored in the prediction information of the current block as reference information for subsequent coding blocks to assist in the prediction of subsequent coding blocks.

[0231] S1006: Determine a reconstructed value of the target sub-block based on the intra-frame prediction value of the target sub-block;

[0232] Exemplarily, the method also includes: obtaining residual information based on the original value and intra-frame prediction value of the sub-block, transforming and quantizing the residual information to obtain residual coefficients, then dequantizing and detransforming the residual coefficients, and combining them with the intra-frame prediction value of the sub-block to obtain the reconstructed value of the sub-block.

[0233] It should be noted that if all sub-blocks in the current block are reconstructed, the intra-frame sub-block division mode of the current block will be exited, and the encoding process of other modes will be continued, or the encoding process of subsequent image blocks will be continued.

[0234] S1007: Making an encoding decision based on the reconstructed value of the target sub-block to determine prediction parameters of the current block, where the prediction parameters include a first intra-frame prediction mode;

[0235] In some embodiments, it is determined that all sub-blocks within the current block have been reconstructed, and a coding decision is made based on the reconstructed value and the original value of the current block to determine whether to use the first intra-frame prediction mode as the optimal intra-frame prediction mode for the current block. Prediction parameters for the current block are determined based on the decision result. In other words, the first intra-frame prediction mode included in the prediction parameters is the optimal intra-frame prediction mode for the current block. The optimal intra-frame prediction mode can be determined by the encoder and written into the bitstream for reading by the encoder. The optimal intra-frame prediction mode can also be derived by the encoder based on reconstructed neighboring blocks of the current block. The decoder can also derive the first intra-frame prediction mode based on reconstructed neighboring blocks of the current block.

[0236] S1008: Encode the prediction parameters and write the obtained coded bits into the bitstream.

[0237] In some embodiments, the prediction parameter further includes a first syntax element, the first syntax element being used to indicate whether the current block uses an intra subblock partitioning mode. Encoding the prediction parameter may include: encoding the first syntax element; and encoding a first intra prediction mode when determining, based on the first syntax element, that the current block uses an intra subblock partitioning mode.

[0238] In some embodiments, the prediction parameters further include a second syntax element, which is used to indicate a partition type of the current block. Encoding the prediction parameters further includes: encoding the second syntax element when determining, based on the first syntax element, that the current block uses an intra sub-block partitioning mode. Here, the second syntax element is used to indicate an optimal partition type for the current block. For example, the encoder determines the optimal partition type for the current block from horizontal and vertical partitioning based on a decision result, and determines the value of the second syntax element based on the optimal partition type.

[0239] In some embodiments, the prediction parameters further include a third syntax element, the third syntax element being used to indicate whether the current block uses the second intra prediction mode for fusion prediction. Encoding the prediction parameters further includes: encoding the third syntax element when it is determined, based on the first syntax element, that the current block uses the intra subblock partitioning mode.

[0240] It should be noted that the target subblock encoded using the encoding method provided in the embodiments of the present application can be one or more subblocks in the current block. Exemplarily, the target subblock can be any subblock in the current block, or can be certain specific subblocks in the current block. Exemplarily, the specific subblock can be a subblock other than the first subblock. When the subblock is the first subblock, the intra-frame prediction value of the first subblock is determined based on the first intra-frame prediction value. When the subblock is another subblock, weighted prediction is performed using both the first intra-frame prediction mode and the second intra-frame prediction mode.

[0241] By adopting the above technical solution, at the encoding end, when the current block uses the intra-frame sub-block division mode, the content characteristics of the reconstructed area are fully utilized, the second intra-frame prediction mode is adaptively selected, and the sub-blocks are fused and predicted in combination with the first intra-frame prediction mode, thereby improving the prediction accuracy of the intra-frame sub-block division mode, reducing the bit rate, and improving the encoding performance.

[0242] In another embodiment of the present application, referring to FIG11 , a schematic flow chart of an encoding method and a decoding method provided in an embodiment of the present application is shown. As shown in FIG11 , whether at the encoding end or the decoding end, the method may include:

[0243] S1101: Obtain the partition type of the current block;

[0244] The variable intra_subpartitions_mode_flag is the first syntax element, used to indicate whether the current block uses the intra sub-block partitioning mode.

[0245] The variable intra_subpartitions_split_flag is the second syntax element, used to indicate whether the partition type of the intra-frame sub-blocks is horizontal or vertical.

[0246] The variable IntraSubPartitionsSplitType specifies the specific partition type used for the current luma coding block, as shown in Table 1.

[0247] The derivation process of IntraSubPartitionsSplitType is as follows:

[0248] – If intra_subpartitions_mode_flag is equal to 0, IntraSubPartitionsSplitType is set to 0.

[0249] – Otherwise, IntraSubPartitionsSplitType is set to 1 + intra_subpartitions_split_flag.

[0250] The variable NumIntraSubPartitions is used to specify the number of sub-blocks into which the intra luminance coding block is divided. The derivation process of NumIntraSubPartitions is as follows:

[0251] – If IntraSubPartitionsSplitType is equal to ISP_NO_SPLIT, NumIntraSubPartitions is set to 1.

[0252] – Otherwise, NumIntraSubPartitions is set to 2 if one of the following conditions is true:

[0253] –cbWidth equals 4, cbHeight equals 8

[0254] –cbWidth equals 8, cbHeight equals 4

[0255] – Otherwise, NumIntraSubPartitions is set equal to 4.

[0256] S1102: Determine whether all sub-blocks of the current block have been reconstructed. If not, execute step S1103; if yes, execute step S1108;

[0257] The current block can be divided into NumIntraSubPartitions sub-blocks. Steps S1103 to S1107 complete the prediction and reconstruction of each sub-block according to the preset decoding order. This step determines whether all NumIntraSubPartitions sub-blocks of the current coding block have completed steps S1103 to S1107. If so, step S1108 is performed; if not, the prediction and reconstruction of steps S1103 to S1107 are continued for the next sub-block.

[0258] S1103: Determine whether it is the first sub-block. If not, execute step S1104; if yes, execute step S1106;

[0259] As shown in Figure 6, under horizontal partitioning, the number of sub-blocks is 4, that is, the variable intra_subpartitions_split_flag is 0, IntraSubPartitionsSplitType is 1, and the variable NumIntraSubPartitions is 4. The sub-blocks are numbered from 0 to 3 in the decoding order of the sub-blocks, and the sub-block numbered 0 is the first sub-block. As shown in Figure 7, under vertical partitioning, the number of sub-blocks is 4, that is, the variable intra_subpartitions_split_flag is 1, IntraSubPartitionsSplitType is 2, and the variable NumIntraSubPartitions is 4. The sub-blocks are numbered from 0 to 3 in the decoding order of the sub-blocks, and the sub-block numbered 0 is the first sub-block.

[0260] S1104: deriving a second intra prediction mode according to the reference sample value of the current sub-block;

[0261] For example, the variable baseMode is the first intra prediction mode, the variable baseModeWeight is the first weight value, the variable fusionMode is the second intra prediction mode, the array fusionModeWeight is the second weight value, and the variable NumFusionMode is the number of elements in fusionMode and fusionModeWeight.

[0262] Method 1: Gradient derivation mode.

[0263] Take the sub-block numbered 1 of the horizontal division as an example.

[0264] Assume that the coordinates of the upper left corner pixel position of the current sub-block relative to the upper left corner pixel position of the image are (x, y), the width of the sub-block is Width, and the height is Height.

[0265] Input: The luminance pixels of the sub-block in the reconstructed area of ​​the current coding block are p[x][y], where x=0...Width-1, y=-1..-Height, i.e., the sub-block area coded as 0. The origin [0][0] is the pixel coordinate of the upper left corner of sub-block 0. If the sub-block numbered 2 is taken as an example, the input includes but is not limited to the reconstructed values ​​of the pixels in the sub-block numbered 0, or the sub-block numbered 1, or the sub-blocks numbered 0 and 1. If the sub-block numbered 0 is taken as an example, the input includes but is not limited to the reconstructed values ​​of the pixels in the left adjacent block and / or the upper adjacent block.

[0266] The specific gradient derivation process can be found in the previous article and will not be repeated here.

[0267] Output: The second intra prediction mode fusionMode obtained by gradient derivation, with a mode index range of [0,66].

[0268] Method 2: Template deduction mode.

[0269] Take the sub-block numbered 1 of the horizontal division as an example.

[0270] Traverse the intra prediction mode, make predictions on the sub-block area numbered 0, calculate certain error values ​​between the predicted value and the reconstructed value, including but not limited to the sum of absolute error (SAD), the sum of absolute difference (SATD), the sum of squared differences (SSE), the mean absolute difference (MAD), the mean absolute error (MAE), the mean squared error (MSE), etc., select NumFusionMode intra prediction modes by the error value, and assign them to the array fusionMode.

[0271] S1105: Determine a second intra-frame prediction value according to the second intra-frame prediction mode;

[0272] S1106: Determine a first intra-frame prediction value according to the first intra-frame prediction mode;

[0273] Furthermore, if the current block is not the first sub-block, the intra-frame prediction value of the current block is determined based on the first intra-frame prediction value and the second intra-frame prediction value; if the current block is the first sub-block, the intra-frame prediction value of the current block is determined based on the first intra-frame prediction value. Exemplarily, the value of baseModeWeight and the values ​​of each element in fusionModeWeight are determined based on a preset weight allocation strategy. The first intra-frame prediction value and the second intra-frame prediction value are weightedly fused according to baseModeWeight and fusionModeWeight to obtain a prediction value for the sub-block.

[0274] For sub-blocks other than the first sub-block, intra-frame weighted fusion prediction is performed. The specific process is:

[0275] Assume that predBase is the predicted value of baseMode, predFusion is the predicted value of fusionMode, predFusion[i] is the predicted value of fusionMode[i]. Log2sumOfWeight is the logarithm of sumOfWeight to base 2.

[0276] The calculation process of the predicted value pred of intra-frame weighted fusion is:

[0277] The above calculation order and calculation method include but are not limited to the above forms.

[0278] Subsequent processing of the predicted value pred includes but is not limited to performing a Clip operation, etc.

[0279] Here, the calculation process of the prediction value pred of the intra-frame weighted fusion can also be:

[0280] Assume that predBase is the predicted value of baseMode, predFusion is the predicted value of fusionMode, predFusion[i] is the predicted value of fusionMode[i], predPlanar is the predicted value of Planar mode, planarWeight is the weighted weight of Planar mode, and Log2planarWeight is the logarithm to base 2 of planarWeight.

[0281] S1107: reconstruction of sub-blocks;

[0282] Reconstruction is performed for the current sub-block. On the encoding side: the residual information of the sub-block is transformed and quantized to obtain residual coefficients, which are then dequantized and inversely transformed. Combined with the intra-frame prediction value of the sub-block, the reconstructed value of the sub-block is obtained. On the decoding side: the bitstream is decoded to obtain residual coefficients, which are dequantized and inversely transformed. Combined with the intra-frame prediction value of the sub-block, the reconstructed value of the sub-block is obtained.

[0283] S1108: Exit the ISP process.

[0284] The embodiments of the present application can improve the accuracy of ISP prediction while maintaining the bit-saving advantages of ISP technology. By analyzing the reconstructed sub-blocks, fully utilizing the content characteristics of the reconstructed sub-blocks, adaptively selecting the second intra-frame prediction mode for subsequent sub-blocks, and using a weighted prediction method, it can better adapt to blurred content and diverse textures in the image, improve sub-block prediction accuracy, and ensure the universal applicability of ISP technology.

[0285] In yet another embodiment of the present application, based on the same inventive concept as the previous embodiment, see FIG12 , which shows a schematic diagram of the structure of an encoder provided by an embodiment of the present application. As shown in FIG12 , the encoder 120 may include a first determination unit 1201, a first prediction unit 1202, a decision unit 1203, and an encoding unit 1204; wherein:

[0286] A first determining unit 1201 is configured to determine a first intra prediction mode of a current block;

[0287] A first prediction unit 1202 is configured to determine a first intra prediction value of a target subblock in a current block according to a first intra prediction mode;

[0288] The first determining unit 1201 is further configured to determine a second intra prediction mode of the target subblock based on a reference sample value of the target subblock, wherein the second intra prediction mode includes one or more intra prediction modes;

[0289] The first prediction unit 1202 is further configured to determine a second intra-frame prediction value of the target subblock according to the second intra-frame prediction mode, wherein the second intra-frame prediction value includes one or more intra-frame prediction values ​​determined according to one or more intra-frame prediction modes included in the second intra-frame prediction mode;

[0290] The first prediction unit 1202 is further configured to determine an intra-frame prediction value of a target sub-block based on the first intra-frame prediction value and the second intra-frame prediction value; and determine a reconstructed value of the target sub-block based on the intra-frame prediction value of the target sub-block;

[0291] A decision unit 1203 is configured to make an encoding decision based on the reconstructed value of the target sub-block, and determine prediction parameters of the current block, wherein the prediction parameters include a first intra prediction mode;

[0292] The encoding unit 1204 is configured to encode the prediction parameters and write the obtained coded bits into the bitstream.

[0293] It can be understood that each functional unit of the encoder also executes the encoding method of any one of the aforementioned embodiments.

[0294] It is understandable that in the embodiments of the present application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the various components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional modules.

[0295] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the portion that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0296] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 120. The computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the method of any one of the aforementioned embodiments.

[0297] An embodiment of the present application provides a computer-readable storage medium, which stores a code stream generated by the encoding method.

[0298] Based on the composition of the encoder 120 and the computer-readable storage medium, refer to Figure 13, which shows a specific hardware structure diagram of the encoder 130 provided in an embodiment of the present application. As shown in Figure 13, the encoder 120 may include: a first communication interface 1301, a first memory 1302 and a first processor 1303; each component is coupled together through a first bus system 1304. It can be understood that the first bus system 1304 is used to achieve connection and communication between these components. In addition to the data bus, the first bus system 1304 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the first bus system 1304 in Figure 13. Among them,

[0299] The first communication interface 1301 is used to receive and send signals when sending and receiving information with other external network elements;

[0300] A first memory 1302 is used to store computer programs that can be run on the first processor 1303;

[0301] The first processor 1303 is configured to, when running the computer program, execute:

[0302] determining a first intra prediction mode for a current block;

[0303] Determining a first intra-frame prediction value of a target sub-block in a current block according to a first intra-frame prediction mode;

[0304] Determining a second intra-frame prediction mode of the target sub-block based on a reference sample value of the target sub-block, wherein the second intra-frame prediction mode includes one or more intra-frame prediction modes;

[0305] Determine a second intra-frame prediction value of the target subblock according to the second intra-frame prediction mode, wherein the second intra-frame prediction value includes one or more intra-frame prediction values ​​determined according to one or more intra-frame prediction modes included in the second intra-frame prediction mode;

[0306] Determining an intra-frame prediction value of a target subblock based on the first intra-frame prediction value and the second intra-frame prediction value;

[0307] Determining a reconstructed value of the target sub-block based on the intra-frame prediction value of the target sub-block;

[0308] Making a coding decision based on the reconstructed value of the target sub-block to determine prediction parameters of the current block, wherein the prediction parameters include a first intra-frame prediction mode;

[0309] Encode the prediction parameters and write the resulting coded bits into the bitstream.

[0310] It is understood that the first memory 1302 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The first memory 1302 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0311] The first processor 1303 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the first processor 1303. The above-mentioned first processor 1303 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the first memory 1302 , and the first processor 1303 reads the information in the first memory 1302 and completes the steps of the above method in combination with its hardware.

[0312] It is understood that the embodiments described herein can be implemented with hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSP devices, DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions of the present application or a combination thereof. For software implementation, the technology of the present application can be implemented by a module (such as a process, a function, etc.) that performs the functions of the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0313] Optionally, as another embodiment, the first processor 1303 is further configured to execute any one of the methods in the foregoing embodiments when running a computer program.

[0314] This embodiment provides an encoder in which a target adjustment factor is used to adjust a virtual reference frame to improve the quality of the virtual reference frame, thereby improving the current frame prediction accuracy and improving encoding performance.

[0315] In yet another embodiment of the present application, based on the same inventive concept as the aforementioned embodiment, FIG14 is a schematic diagram showing the structure of a decoder 140 provided in an embodiment of the present application. As shown in FIG14 , the decoder 140 may include: a decoding unit 1401, a second determination unit 1402, and a second prediction unit 1403; wherein:

[0316] The decoding unit 1401 is configured to decode the code stream and determine prediction parameters of the current block, wherein the prediction parameters include a first intra-frame prediction mode;

[0317] The second prediction unit 1403 is configured to determine a first intra prediction value of a target subblock in the current block according to the first intra prediction mode;

[0318] A second determining unit 1402 is configured to determine a second intra prediction mode of the target subblock based on a reference sample value of the target subblock, wherein the second intra prediction mode includes one or more intra prediction modes;

[0319] The second prediction unit 1403 is further configured to determine a second intra-frame prediction value of the target subblock according to the second intra-frame prediction mode, wherein the second intra-frame prediction value includes one or more intra-frame prediction values ​​determined according to one or more intra-frame prediction modes included in the second intra-frame prediction mode;

[0320] The second prediction unit 1403 is further configured to determine an intra-frame prediction value of the target sub-block based on the first intra-frame prediction value and the second intra-frame prediction value; and determine a reconstructed value of the target sub-block based on the intra-frame prediction value of the target sub-block.

[0321] It can be understood that each functional unit of the decoder also executes the decoding method of any one of the aforementioned embodiments.

[0322] Based on the composition of the decoder 140 and the computer-readable storage medium, refer to Figure 15, which shows a specific hardware structure diagram of the decoder 140 provided in an embodiment of the present application. As shown in Figure 15, the decoder 140 may include: a second communication interface 1501, a second memory 1502 and a second processor 1503; each component is coupled together through a second bus system 1504. It can be understood that the second bus system 1504 is used to achieve connection and communication between these components. In addition to the data bus, the second bus system 1504 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the second bus system 1504 in Figure 15. Among them,

[0323] The second communication interface 1501 is used to receive and send signals during the process of sending and receiving information between other external network elements;

[0324] The second memory 1502 is used to store computer programs that can be run on the second processor 1503;

[0325] The second processor 1503 is configured to, when running the computer program, execute:

[0326] Decoding the bitstream to determine prediction parameters of the current block, wherein the prediction parameters include a first intra-frame prediction mode;

[0327] Determining a first intra-frame prediction value of a target sub-block in a current block according to a first intra-frame prediction mode;

[0328] Determining a second intra-frame prediction mode of the target sub-block based on a reference sample value of the target sub-block, wherein the second intra-frame prediction mode includes one or more intra-frame prediction modes;

[0329] Determine a second intra-frame prediction value of the target subblock according to the second intra-frame prediction mode, wherein the second intra-frame prediction value includes one or more intra-frame prediction values ​​determined according to one or more intra-frame prediction modes included in the second intra-frame prediction mode;

[0330] Determining an intra-frame prediction value of a target subblock based on the first intra-frame prediction value and the second intra-frame prediction value;

[0331] A reconstructed value of the target subblock is determined based on the intra prediction value of the target subblock.

[0332] Optionally, as another embodiment, the second processor 1503 is further configured to execute any one of the methods in the foregoing embodiments when running the computer program.

[0333] It can be understood that the hardware functions of the second memory 1502 are similar to those of the first memory 1302, and the hardware functions of the second processor 1503 are similar to those of the first processor 1303; they will not be described in detail here.

[0334] This embodiment provides a decoder in which a target adjustment factor is used to adjust a virtual reference frame to improve the quality of the virtual reference frame, thereby improving the current frame prediction accuracy and decoding performance.

[0335] In yet another embodiment of the present application, referring to FIG16 , a schematic diagram of the structure of a coding and decoding system provided by an embodiment of the present application is shown. As shown in FIG16 , the coding and decoding system 160 may include an encoder 1601 and a decoder 1602 .

[0336] In the embodiment of the present application, the encoder 1601 may be the encoder of any one of the aforementioned embodiments, and the decoder 1602 may be the decoder of any one of the aforementioned embodiments.

[0337] It should be noted that, in this application, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0338] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0339] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0340] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0341] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0342] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims. Industrial Applicability

[0343] The embodiments of the present application provide a coding and decoding method, an encoder, a decoder, and a storage medium. Whether at the encoding end or the decoding end, a first intra-frame prediction value of a target sub-block in a current block is determined based on a first intra-frame prediction mode; a second intra-frame prediction mode of the target sub-block is determined based on a reference sample value of the target sub-block; a second intra-frame prediction value of the target sub-block is determined based on the second intra-frame prediction mode; and an intra-frame prediction value of the target sub-block is determined based on the first intra-frame prediction value and the second intra-frame prediction value. In this way, when the current block uses the intra-frame sub-block division mode, the content characteristics of the reconstructed area are fully utilized to adaptively select the second intra-frame prediction mode, and the sub-block is combined with the first intra-frame prediction mode to perform a fusion prediction on the sub-block, thereby improving the prediction accuracy of the intra-frame sub-block division mode, thereby further improving the coding and decoding performance.

Claims

1. A decoding method, applied to a decoder, comprising: Decoding a bitstream to determine prediction parameters of a current block, wherein the prediction parameters include a first intra-frame prediction mode; Determining a first intra-frame prediction value of a target subblock in the current block according to the first intra-frame prediction mode; Determining a second intra prediction mode of the target subblock based on a reference sample value of the target subblock, wherein the second intra prediction mode includes one or more intra prediction modes; Determine, according to the second intra prediction mode, a second intra prediction value of the target subblock, wherein the second intra prediction value includes one or more intra prediction values ​​determined according to one or more intra prediction modes included in the second intra prediction mode; Determining an intra-frame prediction value of the target subblock based on the first intra-frame prediction value and the second intra-frame prediction value; A reconstructed value of the target subblock is determined based on the intra prediction value of the target subblock.

2. The method according to claim 1, wherein The prediction parameter further includes a first syntax element, where the first syntax element is used to indicate whether the current block uses an intra sub-block partitioning mode; The decoding bitstream determines the prediction parameters of the current block, including: Decoding a code stream to determine the first syntax element of a current block; When it is determined according to the first syntax element that the current block uses the intra subblock partitioning mode, the code stream is decoded to determine the first intra prediction mode.

3. The method according to claim 2, wherein: The prediction parameter further includes a second syntax element, where the second syntax element is used to indicate a partition type of the current block; The decoding code stream to determine the prediction parameters of the current block also includes: When it is determined according to the first syntax element that the current block uses the intra sub-block partitioning mode, the code stream is decoded to determine the second syntax element.

4. The method according to claim 3, wherein: The method further comprises: determining a partition type of the current block according to the second syntax element; Determine the number of sub-blocks to be divided in the current block according to the size of the current block; Determining a decoding order of sub-blocks in the current block according to the partition type and the number of partitions of the current block; The target sub-block in the current block is determined according to the decoding order.

5. The method according to claim 2 or 3, wherein: The prediction parameters further include a third syntax element, and the third syntax element is used to indicate whether the current block uses the second intra prediction mode for fusion prediction; The decoding code stream to determine the prediction parameters of the current block also includes: When it is determined according to the first syntax element that the current block uses the intra sub-block partitioning mode, the code stream is decoded to determine the third syntax element.

6. The method according to claim 5, wherein: The method further comprises: When determining, according to the value of the third syntax element, that the current block uses the second intra prediction mode for fusion prediction, determining the second intra prediction mode of the target subblock based on the reference sample value of the target subblock; When it is determined according to the value of the third syntax element that the current block does not use the second intra prediction mode for fusion prediction, the intra prediction value of the target subblock is determined based on the first intra prediction value.

7. The method according to claim 1, wherein The reference sample values ​​include: adjacent reconstructed sample values ​​of the target sub-block.

8. The method according to claim 7, wherein: The method further includes determining adjacent reconstructed sample values ​​of the target subblock from reconstructed adjacent blocks of the target subblock.

9. The method according to claim 8, wherein The reconstructed neighboring blocks of the first sub-block in the current block include at least one of the following: a left neighboring block of the first sub-block and an upper neighboring block of the first sub-block, wherein the first sub-block is the first decoded sub-block determined according to the decoding order of the sub-blocks in the current block.

10. The method according to claim 8, wherein The reconstructed neighboring blocks of other subblocks in the current block include: one or more reconstructed subblocks in the current block, wherein the other subblocks are one or more subblocks other than the first subblock determined according to the decoding order of the subblocks in the current block.

11. The method according to claim 10, wherein: The reconstructed adjacent blocks of the other sub-blocks further include: other adjacent blocks reconstructed by the other sub-blocks.

12. The method according to any one of claims 1 to 11, wherein: The determining, based on the reference sample value of the target subblock, a second intra prediction mode of the target subblock includes: Determining prediction performance parameters of a plurality of candidate intra prediction modes using a first derivation mode based on the reference sample value; One or more intra-frame prediction modes included in the second intra-frame prediction mode are determined according to the prediction performance parameter.

13. The method according to claim 12, wherein: The method further comprises: Decode the code stream and determine the first derivation mode.

14. The method according to claim 12, wherein: The first derivation mode includes a gradient derivation mode; The mode derivation method of the gradient derivation mode includes: Performing gradient analysis on the reference sample value to determine gradient strengths of a plurality of candidate intra prediction modes in a first mode set; When the gradient strengths of the multiple candidate intra prediction modes contain non-zero items, determining at least one gradient strength according to the order of gradient strengths from large to small; determining at least one mode index according to a gradient angle corresponding to the at least one gradient intensity; One or more intra prediction modes included in the second intra prediction mode are determined according to the at least one mode index.

15. The method according to claim 14, wherein The mode derivation method of the gradient derivation mode also includes: When the gradient strengths of the plurality of candidate intra-frame prediction modes do not contain any non-zero item, determining that the second intra-frame prediction mode includes the first preset mode; When the gradient strengths of the multiple candidate intra prediction modes include non-zero entries and the second intra prediction mode includes a second preset mode, updating the gradient strength of the second preset mode to the first gradient strength, and re-searching other modes of the second intra prediction mode based on the updated gradient strength.

16. The method according to claim 12, wherein: The first derivation mode includes a template derivation mode; The pattern derivation method of the template derivation pattern includes: Predicting the reference sample value according to a plurality of candidate intra prediction modes in a second mode set to determine a predicted sample value of the reference sample value; determining error values ​​of a plurality of candidate intra prediction modes in the second mode set according to the reference sample value and the predicted sample value; One or more intra-frame prediction modes included in the second intra-frame prediction mode are determined according to the order of the error values ​​from small to large.

17. The method according to claim 1, wherein The second intra-frame prediction mode further includes a third preset mode.

18. The method according to any one of claims 1 to 17, wherein: The determining the intra prediction value of the target subblock based on the first intra prediction value and the second intra prediction value includes: The first intra-frame prediction value and the second intra-frame prediction value are weightedly fused to determine the intra-frame prediction value of the target sub-block.

19. The method according to claim 18, wherein The method further comprises: Based on a preset weight allocation strategy, a first weight value of the first intra-frame prediction value and a second weight value of the second intra-frame prediction value are determined, wherein the second weight value includes one or more weight values ​​corresponding to one or more intra-frame prediction values ​​included in the second intra-frame prediction value.

20. The method according to claim 19, wherein The weight distribution strategy includes: Adding the prediction performance parameter of the first intra prediction mode and the prediction performance parameter of the second intra prediction mode to obtain a total prediction performance parameter; Dividing the prediction performance parameter of the first intra prediction mode by the total prediction performance parameter to obtain a first coefficient; Dividing the prediction performance parameter of the second intra prediction mode by the total prediction performance parameter to obtain a second coefficient; Weight allocation is performed according to the first coefficient and the second coefficient to obtain the first weight value and the second weight value.

21. The method according to claim 20, wherein The performing weight distribution according to the first coefficient and the second coefficient to obtain the first weight value and the second weight value includes: Calculating the product of the first coefficient and the total weight value to obtain the first weight value; Calculating the product of the second coefficient and the total weight value to obtain the second weight value; or, The performing weight distribution according to the first coefficient and the second coefficient to obtain the first weight value and the second weight value includes: Splitting the total weight value into a third weight value and a fourth weight value; Calculating a product of the first coefficient and the third weight value, and adding the product to the fourth weight value to obtain the first weight value; The product of the second coefficient and the third weight value is calculated to obtain the second weight value.

22. The method according to claim 19, wherein The weight distribution strategy includes: The second intra-frame prediction mode includes a first preset mode, and the first weight value is determined to be 1 and the second weight value is determined to be 0; The second intra prediction mode does not include the first preset mode, and the first weight value and the second weight value are determined to be equal.

23. The method according to claim 19, wherein The method further comprises: At least one of the first intra prediction mode, the second intra prediction mode, the first weight value, and the second weight value of the target subblock is saved.

24. A coding method, applied to an encoder, comprising: determining a first intra prediction mode for a current block; Determining a first intra-frame prediction value of a target subblock in the current block according to the first intra-frame prediction mode; Determining a second intra prediction mode of the target subblock based on a reference sample value of the target subblock, wherein the second intra prediction mode includes one or more intra prediction modes; Determine, according to the second intra prediction mode, a second intra prediction value of the target subblock, wherein the second intra prediction value includes one or more intra prediction values ​​determined according to one or more intra prediction modes included in the second intra prediction mode; Determining an intra-frame prediction value of the target subblock based on the first intra-frame prediction value and the second intra-frame prediction value; Determining a reconstructed value of the target sub-block based on the intra-frame prediction value of the target sub-block; Performing a coding decision based on the reconstructed value of the target sub-block to determine prediction parameters of the current block, wherein the prediction parameters include the first intra prediction mode; The prediction parameters are encoded, and the obtained encoded bits are written into a bitstream.

25. The method according to claim 24, wherein The prediction parameter further includes a first syntax element, where the first syntax element is used to indicate whether the current block uses an intra sub-block partitioning mode; The encoding of the prediction parameters comprises: encoding the first syntax element; In a case where it is determined according to the first syntax element that the current block uses an intra subblock partitioning mode, the first intra prediction mode is encoded.

26. The method according to claim 25, wherein The prediction parameter further includes a second syntax element, where the second syntax element is used to indicate a partition type of the current block; The encoding of the prediction parameters further comprises: In a case where it is determined according to the first syntax element that the current block uses the intra subblock partitioning mode, the second syntax element is encoded.

27. The method according to claim 25, wherein The method further comprises: Determining multiple candidate partition types for the current block; Determine the number of sub-blocks to be divided in the current block according to the size of the current block; Determining, based on the multiple candidate partition types and the number of partitions of the current block, multiple candidate coding orders of sub-blocks in the current block; The target sub-block in the current block is determined according to the candidate coding order.

28. The method according to claim 25 or 26, wherein The prediction parameters further include a third syntax element, and the third syntax element is used to indicate whether the current block uses the second intra prediction mode for fusion prediction; The encoding of the prediction parameters further comprises: In a case where it is determined according to the first syntax element that the current block uses the intra subblock partitioning mode, the third syntax element is encoded.

29. The method according to claim 28, wherein The method further comprises: In a case where it is determined that the current block allows the use of the second intra prediction mode for fusion prediction, determining the second intra prediction mode of the target subblock based on the reference sample value of the target subblock; In a case where it is determined that the current block does not allow fusion prediction using the second intra prediction mode, the intra prediction value of the target subblock is determined based on the first intra prediction value.

30. The method of claim 24, wherein: The reference sample values ​​include: adjacent reconstructed sample values ​​of the target sub-block.

31. The method according to claim 30, wherein The determining the reference sample value of the target sub-block includes: Determine adjacent reconstructed sample values ​​of the target sub-block from reconstructed adjacent blocks of the target sub-block.

32. The method according to claim 31, wherein The reconstructed neighboring blocks of the first sub-block in the current block include at least one of the left neighboring block of the first sub-block and the upper neighboring block of the first sub-block, wherein the first sub-block is the first coded sub-block determined according to the coding order of the sub-blocks in the current block.

33. The method according to claim 31, wherein The reconstructed neighboring blocks of other subblocks in the current block include: one or more reconstructed subblocks in the current block, wherein the other subblocks are one or more subblocks other than the first subblock determined according to the candidate coding order of the subblocks in the current block.

34. The method according to claim 33, wherein The reconstructed adjacent blocks of the other sub-blocks further include: other adjacent blocks reconstructed by the other sub-blocks.

35. The method according to any one of claims 24 to 34, wherein: The determining, based on the reference sample value of the target subblock, a second intra prediction mode of the target subblock includes: Determining prediction performance parameters of a plurality of candidate intra prediction modes using a first derivation mode based on the reference sample value; One or more intra-frame prediction modes included in the second intra-frame prediction mode are determined according to the prediction performance parameter.

36. The method according to claim 35, wherein The method further comprises: The first derivation mode is encoded, and the obtained encoded bits are written into a bitstream.

37. The method according to claim 35, wherein The first derivation mode includes a gradient derivation mode; The mode derivation method of the gradient derivation mode includes: Performing gradient analysis on the reference sample value to determine gradient strengths of a plurality of candidate intra prediction modes in a first mode set; When the gradient strengths of the multiple candidate intra prediction modes contain non-zero items, determining at least one gradient strength according to the order of gradient strengths from large to small; determining at least one mode index according to a gradient angle corresponding to the at least one gradient intensity; One or more intra prediction modes included in the second intra prediction mode are determined according to the at least one mode index.

38. The method of claim 37, wherein: The mode derivation method of the gradient derivation mode also includes: When the gradient strengths of the plurality of candidate intra-frame prediction modes do not contain any non-zero item, determining that the second intra-frame prediction mode includes the first preset mode; When the gradient strengths of the multiple candidate intra prediction modes include non-zero entries and the second intra prediction mode includes a second preset mode, updating the gradient strength of the second preset mode to the first gradient strength, and re-searching other modes of the second intra prediction mode based on the updated gradient strength.

39. The method of claim 35, wherein: The first derivation mode includes a template derivation mode; The pattern derivation method of the template derivation pattern includes: Predicting the reference sample value according to a plurality of candidate intra prediction modes in a second mode set to determine a predicted sample value of the reference sample value; determining error values ​​of a plurality of candidate intra prediction modes in the second mode set according to the reference sample value and the predicted sample value; One or more intra-frame prediction modes included in the second intra-frame prediction mode are determined according to the order of the error values ​​from small to large.

40. The method of claim 24, wherein The second intra-frame prediction mode further includes a third preset mode.

41. The method according to any one of claims 24 to 41, wherein The determining the intra prediction value of the target subblock based on the first intra prediction value and the second intra prediction value includes: The first intra-frame prediction value and the second intra-frame prediction value are weightedly fused to determine the intra-frame prediction value of the target sub-block.

42. The method according to claim 41, wherein The method further comprises: Based on a preset weight allocation strategy, a first weight value of the first intra-frame prediction value and a second weight value of the second intra-frame prediction value are determined, wherein the second weight value includes one or more weight values ​​corresponding to one or more intra-frame prediction values ​​included in the second intra-frame prediction value.

43. The method according to claim 42, wherein The weight distribution strategy includes: Adding the prediction performance parameter of the first intra prediction mode and the prediction performance parameter of the second intra prediction mode to obtain a total prediction performance parameter; Dividing the prediction performance parameter of the first intra prediction mode by the total prediction performance parameter to obtain a first coefficient; Dividing the prediction performance parameter of the second intra prediction mode by the total prediction performance parameter to obtain a second coefficient; Weight allocation is performed according to the first coefficient and the second coefficient to obtain the first weight value and the second weight value.

44. The method according to claim 43, wherein The performing weight distribution according to the first coefficient and the second coefficient to obtain the first weight value and the second weight value includes: Calculating the product of the first coefficient and the total weight value to obtain the first weight value; Calculating the product of the second coefficient and the total weight value to obtain the second weight value; or, The performing weight distribution according to the first coefficient and the second coefficient to obtain the first weight value and the second weight value includes: Splitting the total weight value into a third weight value and a fourth weight value; Calculating a product of the first coefficient and the third weight value, and adding the product to the fourth weight value to obtain the first weight value; The product of the second coefficient and the third weight value is calculated to obtain the second weight value.

45. The method of claim 42, wherein The weight distribution strategy includes: The second intra-frame prediction mode includes a first preset mode, and the first weight value is determined to be 1 and the second weight value is determined to be 0; The second intra prediction mode does not include the first preset mode, and the first weight value and the second weight value are determined to be equal.

46. ​​The method of claim 42, wherein The method further includes: saving at least one of the first intra-frame prediction mode, the second intra-frame prediction mode, the first weight value, and the second weight value of the target subblock.

47. An encoder comprising a first determining unit, a first predicting unit, a decision unit, and an encoding unit; wherein: The first determining unit is configured to determine a first intra prediction mode of the current block; The first prediction unit is configured to determine a first intra prediction value of a target subblock in the current block according to the first intra prediction mode; The first determining unit is further configured to determine a second intra prediction mode of the target subblock based on a reference sample value of the target subblock, wherein the second intra prediction mode includes one or more intra prediction modes; The first prediction unit is further configured to determine a second intra-frame prediction value of the target subblock according to the second intra-frame prediction mode, wherein the second intra-frame prediction value includes one or more intra-frame prediction values ​​determined according to one or more intra-frame prediction modes included in the second intra-frame prediction mode; The first prediction unit is further configured to determine an intra-frame prediction value of the target sub-block based on the first intra-frame prediction value and the second intra-frame prediction value; and determine a reconstructed value of the target sub-block based on the intra-frame prediction value of the target sub-block; The decision unit is configured to make a coding decision based on the reconstructed value of the target sub-block to determine prediction parameters of the current block, wherein the prediction parameters include the first intra prediction mode; The encoding unit is configured to encode the prediction parameters and write the obtained encoded bits into a bitstream.

48. An encoder comprising a first memory and a first processor; wherein: The first memory is used to store a computer program that can be run on the first processor; The first processor is configured to execute the method according to any one of claims 24 to 46 when running the computer program.

49. A decoder comprising a decoding unit, a second determining unit, and a second predicting unit; wherein: The decoding unit is configured to decode the code stream and determine prediction parameters of the current block, wherein the prediction parameters include a first intra-frame prediction mode; The second prediction unit is configured to determine a first intra prediction value of a target subblock in the current block according to the first intra prediction mode; The second determining unit is configured to determine a second intra prediction mode of the target subblock based on a reference sample value of the target subblock, wherein the second intra prediction mode includes one or more intra prediction modes; The second prediction unit is further configured to determine a second intra-frame prediction value of the target subblock according to the second intra-frame prediction mode, wherein the second intra-frame prediction value includes one or more intra-frame prediction values ​​determined according to one or more intra-frame prediction modes included in the second intra-frame prediction mode; The second prediction unit is further configured to determine the intra-frame prediction value of the target subblock based on the first intra-frame prediction value and the second intra-frame prediction value; and determine the reconstructed value of the target subblock based on the intra-frame prediction value of the target subblock.

50. A decoder comprising a second memory and a second processor; wherein: The second memory is used to store a computer program that can be run on the second processor; The second processor is configured to execute the method according to any one of claims 1 to 23 when running the computer program.

51. A computer-readable storage medium, wherein: The computer-readable storage medium stores a code stream generated by the encoding method according to any one of claims 24 to 46.

52. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 23 or the method according to any one of claims 24 to 46 is implemented.