NON-TRANSIENTIAL COMPUTER-READABLE DECODING METHOD AND ENCODING METHOD

BR112025021566A2Pending Publication Date: 2026-09-08
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
BR112025021566
Authority / Receiving Office
BR · BR
Patent Type
Applications
Publication Date
2026-09-08

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader
Need to check novelty before this filing date? Find Prior Art

Description

1 / 103 NON-TRANSIENTIAL COMPUTER-READABLE DECODING METHOD AND ENCODING METHOD FIELD OF TECHNIQUE

[001] The modalities of this application relate to the field of coding technologies, and, more specifically, to a decoding method, an coding method, a decoder and an encoder. BACKGROUND

[002] Digital video compression technologies primarily compress large amounts of digital image and video data to facilitate efficient transmission and storage. With the proliferation of videos on the Internet and ever-increasing requirements for video definition, although current digital video compression standards can perform video decompression, better digital video decompression technologies still need to be developed to reduce the bandwidth and traffic pressure of digital video transmission, in order to improve the decoding performance of a decoder. SUMMARY

[003] The embodiments of this application provide a decoding method, an encoding method, a decoder and an encoder, to enhance the decoding performance of the decoder.

[004] According to a first aspect, one embodiment of this application provides a method of decoding, including:

[005] determine a maximum number of reference lines allowed to be used by a current block; Petition 870250090822, dated 06 / 10 / 2025, page 14 / 141 2 / 103

[006] determine, based on the maximum number of lines, whether the current block uses a multi-line reference TMRL mode based on templates;

[007] if the current block uses TMRL mode, determine a reference line used by the current block and a prediction mode used by the current block; and

[008] execute the prediction on the current block based on the reference line used by the current block and using the prediction mode used by the current block, to obtain a prediction block.

[009] according to a second aspect, an embodiment of this application provides a coding method, including:

[0010] determine a maximum number of reference lines allowed to be used by a current block; and

[0011] encode the maximum number of lines.

[0012] According to a third aspect, one embodiment of this application provides a decoder, including:

[0013] a first determination unit, configured to determine a maximum number of reference lines allowed for use by a current block;

[0014] a second determination unit, configured to determine, based on the maximum number of lines, whether the current block uses a model-based multi-line reference TMRL mode;

[0015] a third determination unit, configured to: if the current block uses TMRL mode, determine a reference line used by the current block and a prediction mode used by the current block; and Petition 870250090822, dated 06 / 10 / 2025, page 15 / 141 3 / 103

[0016] a prediction unit, configured to perform prediction on the current block based on the reference line used by the current block and using the prediction mode used by the current block, to obtain a prediction block.

[0017] According to a fourth aspect, one embodiment of this application provides an encoder, including:

[0018] a determination unit, configured to determine a maximum number of reference lines allowed to be used by a current block; and

[0019] an encoding unit, configured to encode the maximum number of lines.

[0020] According to a fifth aspect, one embodiment of this application provides a decoder, including:

[0021] a processor, adapted to implement computer instructions; and

[0022] a computer-readable storage medium, where the computer-readable storage medium stores computer instructions, and the computer instructions are adapted to be loaded by the processor to execute the decoding method according to the first aspect or implementations of the first aspect described above.

[0023] In an implementation, there is one or more processors, and there is one or more memories.

[0024] In one implementation, the computer-readable storage media may be integrated into the processor, or the computer-readable storage media may be disposed of separately from the processor.

[0025] According to a sixth aspect, a Petition 870250090822, dated 06 / 10 / 2025, page 16 / 141 4 / 103 of this order provides an encoder, including:

[0026] a processor, adapted to implement computer instructions; and

[0027] a computer-readable storage medium, where the computer-readable storage medium stores computer instructions, and the computer instructions are adapted to be loaded by the processor to execute the encoding method according to the second aspect or the second aspect implementations described above.

[0028] In an implementation, there is one or more processors, and there is one or more memories.

[0029] In one implementation, the computer-readable storage media may be integrated into the processor, or the computer-readable storage media may be disposed of separately from the processor.

[0030] According to a seventh aspect, an embodiment of this application provides a computer-readable storage medium. The computer-readable storage medium stores computer instructions, and when the computer instructions are read and executed by a processor of a computer device, the computer device is enabled to perform the decoding method in the first aspect described above or the encoding method in the second aspect described above.

[0031] According to an eighth aspect, an embodiment of this application provides a computer program product or a computer program, wherein the computer program product or computer program includes computer instructions, and the computer instructions are Petition 870250090822, dated 06 / 10 / 2025, page 17 / 141 5 / 103 stored on a computer-readable storage medium. A computer device's processor reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs either the decoding method described in the first aspect above or the encoding method described in the second aspect above.

[0032] According to a ninth aspect, an embodiment of this request provides a bitstream, wherein the bitstream is a bitstream related to the method in the first aspect described above or a bitstream generated by the method in the second aspect described above.

[0033] Based on previous technical solutions, when performing prediction on a current block, a decoder first determines a maximum number of reference lines allowed to be used by the current block; then, based on the maximum number of lines, it determines whether the current block uses a TMRL mode; if the current block uses the TMRL mode, it determines a reference line used by the current block and a prediction mode used by the current block; and then, it performs prediction on the current block based on the reference line used by the current block and using the prediction mode used by the current block, to obtain a prediction block. That is, when predicting the current block, the decoder determines whether the current block uses the TMRL mode based on the maximum number of lines, so that the current block uses the TMRL mode when a condition for the maximum number of lines is met, thus improving decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS Petition 870250090822, dated 06 / 10 / 2025, page 18 / 141 6 / 103

[0034] Figure 1 is a schematic block diagram of a coding structure, according to an embodiment of this application.

[0035] Figure 2 is a schematic block diagram of a decoding structure, according to one embodiment of this application.

[0036] Figure 3 shows an example of four reconstructed lines located around an actual block according to one embodiment of this application.

[0037] Figure 4 is an example of a model and reference lines located around an actual block according to an embodiment of this application.

[0038] Figure 5 is a schematic flowchart of a decoding method according to one embodiment of this request.

[0039] Figure 6 is a schematic flowchart of a coding method according to one modality of this request.

[0040] Figure 7 is a schematic block diagram of a decoder, according to an embodiment of this application.

[0041] Figure 8 is a schematic block diagram of an encoder, according to an embodiment of this application.

[0042] Figure 9 is a schematic block diagram of an electronic device, according to an embodiment of this application. DESCRIPTION OF MODALITIES

[0043] The technical solutions in the modalities of this application are described below with reference to the drawings. Petition 870250090822, dated 06 / 10 / 2025, page 19 / 141 7 / 103 attachments.

[0044] The solutions provided in embodiments of this application can be applied to the technical field of digital video coding, for example, including but not limited to: the field of image encoding and decoding, the field of video encoding and decoding, the field of hardware video encoding and decoding, the field of dedicated circuit video encoding and decoding, and the field of real-time video encoding and decoding. Furthermore, the solutions provided in embodiments of this application can be combined with the Audio Video Coding Standard (Audio Video Coding Standard, AVS), the second-generation AVS standard (AVS2), or the third-generation AVS standard (AVS3), for example, including but not limited to: the H.264 / audio video coding standard (Audio Video Coding, AVC), the H.265 / high-efficiency video coding standard (High-Efficiency Video Coding, HEVC), and the H.265 video coding standard.266 / versatile (versatile video coding, VVC). Furthermore, the solutions provided in embodiments of this application can be used to perform lossy compression on images or can be used to perform lossless compression on images. Lossless compression can be visually lossless compression or mathematically lossless compression.

[0045] Video encoding and decoding standards all use a hybrid block-based encoding structure.

[0046] Each frame in a video is partitioned into Petition 870250090822, dated 06 / 10 / 2025, page 20 / 141 8 / 103 largest coding units (LCUs), or coding tree units (CTUs), which are square and have the same size (e.g., 128 x 128 or 64 x 64). Each largest coding unit or coding tree unit can be partitioned into rectangular coding units (CUs) according to a rule. A coding unit can be further partitioned into a prediction unit (PU), a transformation unit (TU), and the like. The hybrid coding structure includes a prediction module, a transform module, a quantization module, an entropy coding module, an in-loop filter module, and the like. The prediction module includes intraprediction and interprediction.Interprediction includes motion estimation and motion compensation. Due to the strong correlation between neighboring samples within a video frame, an intraprediction method is used in video coding technologies to eliminate spatial redundancy between neighboring samples. Intraprediction predicts sample information in a current block by referencing only information about the same image frame. Due to the strong similarity between neighboring frames in a video, temporal redundancy between neighboring frames is eliminated using an interprediction method in a video coding technology, thus improving coding efficiency. Interprediction can reference image information from different frames and seek. Petition 870250090822, dated 06 / 10 / 2025, page 21 / 141 9 / 103 motion vector information that best matches the current block using motion estimation. The transform is performed to convert a predicted image block in the frequency domain so that energy is redistributed. In combination with quantization, information imperceptible to the human eye can be removed, thus eliminating visual redundancy. Entropy coding can eliminate character redundancy based on a current context model and probability information from a binary bitstream.

[0047] A basic video codec process is as follows:

[0048] At the end of encoding, an image frame is divided into blocks. For a current block, intraprediction or interprediction is used to generate a prediction block of the current block. The prediction block is subtracted from an original block of the current block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix. Then, the quantized coefficient matrix is ​​entropy-encoded and sent to a bitstream. At the decoding end, for the current block, intraprediction or interprediction is used to generate a prediction block of the current block. A bitstream is analyzed to obtain a quantization coefficient matrix, which is then dequantized and inversely transformed to obtain a residual block. The prediction block and the residual block are summed to obtain a reconstructed block.The reconstructed blocks form a reconstructed image, and the reconstructed image is subjected to loop filtering based on an image or block to obtain an image. Petition 870250090822, dated 06 / 10 / 2025, page 22 / 141 10 / 103 decoded. The encoding end needs to perform operations similar to those of the decoding side to obtain the decoded image. The decoded image can be used as a reference frame for subsequent frames in interprediction. Block partitioning information, mode information such as prediction, transform, quantization, entropy coding and loop filtering, or parameter information determined by the encoding end needs to be sent to the bitstream if necessary. A decoding end determines, through analysis or analysis based on existing information, block partitioning information, mode information such as prediction, transform, quantization, entropy coding and loop filtering, or parameter information that is the same as the encoding end.This ensures that a decoded image obtained at the encoding end is the same as a decoded image obtained at the decoding end. The decoded image obtained on the encoding side is usually called the reconstructed image. During prediction, the current block can be partitioned into prediction units. During transformation, the current block can be partitioned into transformation units. The partitioning of prediction units may differ from that of transformation units. The basic process of a video codec under a block-based hybrid encoding framework is described above. With the development of technologies, some modules or steps of the framework or process may be optimized, which is not specifically limited in this application.

[0049] The current block (current block) can be a Petition 870250090822, dated 06 / 10 / 2025, page 23 / 141 11 / 103 current coding unit (CU), a current prediction unit (PU), or something similar.

[0050] It is worth noting that the encoding end needs to perform operations similar to those of the decoding end to obtain a decoded image. The decoded image can be used as a reference frame for subsequent frames in interprediction. Block partitioning information, mode information such as prediction, transform, quantization, entropy coding and loop filtering, or parameter information determined by the encoding end needs to be sent to the bitstream, if necessary. A decoding end determines, through analysis or analysis based on existing information, block partitioning information, mode information such as prediction, transform, quantization, entropy coding and loop filtering, or parameter information that is the same as the encoding end.This ensures that a decoded image obtained at the encoding end is the same as a decoded image obtained at the decoding end. The decoded image obtained on the encoding side is usually called the reconstructed image. During prediction, the current block can be partitioned into prediction units. During transformation, the current block can be partitioned into transformation units. The partitioning of prediction units may be the same as or different from that of transformation units. The basic process of a video codec under a hybrid block-based encoding framework is described above. With the development of technologies, some modules of the framework... Petition 870250090822, dated 06 / 10 / 2025, page 24 / 141 12 / 103 or some steps of the process can be optimized. This request is applicable to the basic video codec process under the block-based hybrid coding framework.

[0051] Figure 1 is a schematic block diagram of a 100 coding structure according to an embodiment of this application.

[0052] As shown in Figure 1, the coding framework 100 may include an intraprediction unit 180, an interprediction unit 170, a residual unit 110, a transform and quantization unit 120, an entropy coding unit 130, an inverse transform and dequantization unit 140, and an in-circuit filtering unit 150. Optionally, the coding framework 100 may also include a temporary decoded image storage unit 160. The coding framework 100 may also be referred to as a hybrid framework coding mode.

[0053] The intraprediction unit 180 or the interprediction unit 170 can predict an image block to be encoded, in order to generate a prediction block. The residual unit 110 can calculate a residual block, that is, a difference between the prediction block and the image block to be encoded, based on the prediction block and the image block to be encoded. The transform and quantization unit 120 is used to perform operations such as transform and quantization on the residual block in order to remove information imperceptible to the human eye, thus eliminating visual redundancy. Optionally, a residual block that is not subjected to transform and quantization by the transform and quantization unit 120 can be termed a domain residual block. Petition 870250090822, dated 06 / 10 / 2025, page 25 / 141 13 / 103 of the time, and a residual block subjected to transform and quantization by the transform and quantization unit 120 can be termed a frequency residual block or a frequency domain residual block. After receiving a transform quantization coefficient generated by the transform and quantization unit 120, the entropy encoding unit 130 can generate a bit stream based on the transform quantization coefficient. For example, the entropy encoding unit 130 can eliminate character redundancy based on a target context model and probability information from a binary bit stream. For example, the entropy encoding unit 130 can be used to perform context-based adaptive binary arithmetic coding (CABAC). The entropy encoding unit 130 can also be referred to as a header information encoding unit.Optionally, in this application, the image block to be encoded may also be called the original image block or target image block, and the prediction block may also be called the prediction image block or image prediction block, or it may also be called the prediction signal or prediction information. The reconstructed block may also be referred to as the reconstructed image block or image reconstruction block, and it may also be referred to as the reconstructed signal or reconstructed information. Furthermore, for the encoding side, the image block to be encoded may also be referred to as the encoding block or encoding image block, and for the decoding side, the image block to be encoded may also be referred to as the decoded block or decoded image block. The image block. Petition 870250090822, dated 06 / 10 / 2025, page 26 / 141 14 / 103 to be coded can be a CTU or a CU.

[0054] The 100 encoding structure calculates a residual between the prediction block and the image block to be encoded to obtain a residual block, performs processing such as transform and quantization on the residual block, and transmits the processed residual block to the decoding side. Similarly, after receiving and analyzing the bitstream, the decoding side performs operations such as inverse transform and dequantization to obtain a residual block, where the residual block is added to a prediction block obtained through prediction by the decoding side to obtain a reconstructed block.

[0055] It should be noted that the inverse transform and dequantization unit 140, the filtering unit in the circuit 150, and the temporary storage unit for decoded images 160 in the encoding structure 100 can be used to form a decoder. This is equivalent to the fact that the intraprediction unit 180 or the interprediction unit 170 can perform prediction on the image block to be encoded based on an existing reconstructed block, to ensure that the encoding side and the decoding side have a consistent understanding of a frame of reference. In other words, an encoder can duplicate a decoder's processing circuit and, in turn, can generate the same prediction as the decoding end.Specifically, the inverse transform and dequantization unit 140 performs the inverse transform and dequantization on a quantized transform coefficient to replicate an approximate residual block from the decoding end. After a prediction block is added to... Petition 870250090822, dated 06 / 10 / 2025, page 27 / 141 15 / 103 approximate residual block, the prediction block can be processed by the filtering unit in circuit 150, to smoothly filter out impacts such as the block effect generated due to block-based processing and quantization. An image block generated by the filtering unit in circuit 150 can be stored in the decoded temporary image storage unit 160 for the prediction of a subsequent image.

[0056] It should be understood that Figure 1 is only an example of this request and should not be interpreted as a limitation of this request.

[0057] For example, the filtering unit in loop 150 in the coding framework 100 may include a deblocking filter (DBF) and a sample-adaptive offset filter (SAO). A function of the DBF is to deblock, and a function of the SAO is to remove scratches. In another embodiment of this application, the coding framework 100 may use a neural network-based loop filtering algorithm to improve video compression efficiency. In other words, the coding framework 100 may be a hybrid video coding framework based on a deep learning neural network. In one implementation, based on the deblocking filter and the sample-adaptive offset filter, a convolutional neural network-based model may be used to compute a result obtained after sample filtering. The network structures of the in-loop filtering unit 150 may be the same or different in terms of a luma component and a chroma component.Given that the luma component includes more visual information, the luma component can also be used to guide filtering. Petition 870250090822, dated 06 / 10 / 2025, page 28 / 141 16 / 103 chroma component, in order to improve the reconstruction quality of the chroma component.

[0058] Figure 2 is a schematic block diagram of a 200 decoding structure according to an embodiment of this application.

[0059] As shown in Figure 2, the decoding framework 200 may include an entropy decoding unit 210, an inverse transform and dequantization unit 220, a residual unit 230, an intraprediction unit 240, an interprediction unit 250, an in-circuit filtering unit 260, and a temporary decoded image storage unit 270.

[0060] After receiving and analyzing a bitstream, the entropy decoding unit 210 obtains a prediction block and a residual block in the frequency domain. The inverse transform and dequantization unit 220 performs operations such as inverse transform and dequantization on the residual block in the frequency domain to obtain a residual block in the time domain. The residual unit 230 adds a prediction block obtained by the intraprediction unit 240 or the interprediction unit 250 to the residual block in the time domain obtained by performing inverse transform and dequantization by the inverse transform and dequantization unit 220 to obtain a reconstructed block. For example, the intraprediction unit 240 or the interprediction unit 250 can obtain the prediction block by decoding the header information of the bitstream.

[0061] The international video coding standards organization JVET established a group to study a coding model beyond H.266 / VVC and named the model as Petition 870250090822, dated 06 / 10 / 2025, page 29 / 141 17 / 103 ECM, or platform testing software. ECM has started receiving newer and more efficient compression algorithms based on VTM 10.0 and has now surpassed VVC's encoding performance by approximately 13%. ECM not only expands the size of an encoding unit with a specific resolution, but also integrates many intraprediction and interprediction technologies.

[0062] Next, we describe the technologies related to this application. (1) MOST LIKELY MODES (MOST LIKELY MODES, MPM)

[0063] MPM is an intraprediction mode and generally includes some modes that are most likely to be selected for the current block. An MPM list usually includes one or more of the following modes:

[0064] (a) a prediction mode selected for an adjacent surrounding prediction block;

[0065] (b) a prediction mode selected for a surrounding non-adjacent prediction block;

[0066] (c) a prediction mode derived from the surrounding reconstructed pixels using a decoder-side intra-mode derivation (DIMD);

[0067] d) Some angles close to the angular modes obtained in (a) and (b); or

[0068] (e) an intraprediction mode commonly used by default.

[0069] The prediction mode selected for the surrounding adjacent prediction block may be a prediction mode used by the adjacent prediction block. Similarly, the prediction mode selected for the non-adjacent prediction block. Petition 870250090822, dated 06 / 10 / 2025, page 30 / 141 18 / 103 around may be a prediction mode used by the non-adjacent prediction block.

[0070] The MPM in ECM includes 22 prediction modes, the first 6 modes are primary MPM modes and the last 16 modes are secondary MPM modes. Among the 22 MPM modes, a planar mode is located at the 1' position.

[0071] A process for analyzing syntax elements related to LMR is shown in an approximate way in Table 1 below. TABLE 1 if(!mrl_flag){ non-multiple reference line intraprediction mode (multiple reference line, MRL) (no need to expand a reference line) mpm_flag decode mpm_flag} else{ mpm_flag = 1 mpm_flag is set to 1 by default} if(mpm_flag){ mpm_idx = 0 if(multiRefIdx == 0){ mpm_idx = decodeBin() decode a binary flag from a context model} else{ Mpm_idx = 1 Petition 870250090822, dated 06 / 10 / 2025, p. 31 / 141 19 / 103 } if(mpm_idx > 0){ mpm_idx += decodeBin() decode a binary flag from a context model if(mpm_idx > 1) mpm_idx += decodeEPBin() decode an equally likely binary flag if(mpm_idx > 2) mpm_idx += decodeEPBin() decode an equally likely binary flag if(mpm_idx > 3) mpm_idx += decodeEPBin() decode an equally likely binary flag}} decodes a non-MPM part

[0072] As shown in Table 1, if !mrl_flag, the decoder determines that it is not a multi-reference line (MRL) intraprediction mode (there is no need to expand a reference line) and mpm_flag is decoded; otherwise, mpm_flag is set to 1 by default. Additionally, if mpm_flag is true, mpm_idx is parsed. (2) MULTIPLE REFERENCE LINE MODE (MULTIPLE REFERENCE LINE, MRL)

[0073] The MRL mode not only allows a reconstructed line (reference line 0) closer to the current block to be used as the reference line for intraprediction, but also allows a reconstructed line not adjacent to the current block to be used as the reference line for the Petition 870250090822, dated 06 / 10 / 2025, page 32 / 141 20 / 103 intraprediction. The MRL mode can use more reference pixels to improve coding efficiency.

[0074] Figure 3 shows an example of four reference lines located around an actual block according to one embodiment of this application.

[0075] As shown in Figure 3, in VVC, the reference lines not adjacent to the current block can be reference lines (reference line) 1 and 2; in ECM, the reference lines not adjacent to the current block can be reference lines (reference line) 1, 3, 5, 7 and 12. Figure 3 shows four reference lines: reference lines 0 to 3. The four reference lines can be divided into segments (Segment) A to F.

[0076] A process for analyzing UC-level syntax elements related to LMR is shown approximately in Table 2 below. TABLE 2 if( !sps_mrl_flag || .timd || .dimd || isFirstLineOfCtu || cu.bdpcmMode || !cu.Y().valid){ if a sequence-level flag does not allow the use of LMR, or if a current encoding unit chooses to use a template-based intra-mode derivation (TIMD), or the current encoding unit chooses to use decoder-side intra-mode derivation (DIMD), or the current encoding unit is the 1st line of the encoding tree unit, or the encoding unit Petition 870250090822, dated 06 / 10 / 2025, page 33 / 141 21 / 103 The current method chooses to use a block differential pulse code modulation (BDPCM) mode, or the current encoding unit does not include a luma component. multiRefIdx = 0 LMR is not used.} else{ idx += decodeBin() decode a binary flag from a context model if(idx > 0) idx += decodeBin() decode a binary flag from a context model if(idx > 1) idx += decodeBin() decode a binary flag from a context model if(idx > 2) idx += decodeBin() decode a binary flag from a context model if(idx > 3) idx += decodeBin() decode a binary flag from a context model if(idx > 4) idx += decodeBin() decode a binary flag from a context model multiRefIdx = MULTI_REF_LINE_IDX[idx] obtain multiRefIdx} Petition 870250090822, dated 06 / 10 / 2025, page 34 / 141 22 / 103

[0077] As shown in Table 2, if !sps_mrl_flag || cu.timd || cu.dimd || isFirstLineOfCtu || cu.bdpcmMode || !cu.Y().valid, multiRefIdx = 0, i.e., the decoder determines not to use the MRL; otherwise, the decoder obtains multiRefIdx by parsing the bitstream, where multiRefIdx is used to indicate a reference line being used. MULTI_REF_LINE_IDX is an array with a length of 6 and the array is {0, 1, 3, 5, 7, 12}. The decoding end can obtain an index of a current reference line based on the obtained multiRefIdx and the array.

[0078] In addition, LMR mode and TIMD mode can be used simultaneously. When the current block uses TIMD mode, a process of parsing UC-level syntax elements related to MRL is shown approximately in Table 3. TABLE 3 if( (!sps_mrl_flag || .dimd || isFirstLineOfCtu || .bdpcmMode || !cu.Y().valid)){ if a sequence-level flag does not allow the use of LMR, or the current encoding unit chooses to use DIMD mode, or the current encoding unit is the 1st line of the encoding tree unit, or the current encoding unit chooses to use BDPCM mode, or the current encoding unit does not include a luma component multiRefIdx = 0 the LMR in TIMD mode is not used} else if(cu.timd){ if the current encoding unit Petition 870250090822, dated 06 / 10 / 2025, page 35 / 141 23 / 103 Choose to use TIMD mode. `idx += decodeBin()` decodes a binary flag from a context model. `if(idx > 0) idx += decodeBin()` decodes a binary flag from a context model. `multiRefIdx = MULTI_REF_LINE_IDX[idx]` obtain `multiRefIdx`.

[0079] As shown in Table 3, if !sps_mrl_flag || cu.timd || cu.dimd || isFirstLineOfCtu || cu.bdpcmMode || !cu.Y().valid, the decoder determines not to use the MRL in TIMD mode; otherwise, if the current encoding unit chooses to use TIMD mode, the decoder obtains multiRefIdx when analyzing the bitstream, where multiRefIdx is used to indicate a reference line being used. MULTI_REF_LINE_IDX is an array with a length of 6 and the array is {0, 1, 3, 5, 7, 12}. The decoding end can obtain an index of a current reference line based on the obtained multiRefIdx and the array.

[0080] Note that MPM technology is a technology used to determine a prediction mode, MRL technology is a technology used to determine a reference line, and MPM technology and MRL technology can be used together or separately, which is not specifically limited in this application. (3) MODEL-BASED MULTIPLE REFERENCE LINE (TMRL) MODE

[0081] TMRL mode is an extension of MRL technology. TMRL mode uses a matching technology of Petition 870250090822, dated 06 / 10 / 2025, page 36 / 141 The 24 / 103 model classifies reconstruction lines and prediction modes that can be used for the current block, and builds a list of TMRL candidates based on a combination of the most likely reconstruction lines and prediction modes. The decoder analyzes candidate indices to select, from the TMRL candidate list, a reconstructed line and a selected prediction mode for the current block, and executes the prediction.

[0082] For TMRL mode, the decoder needs to complete the following steps:

[0083] 1. Obtain reconstructed lines that can be used and possible intraprediction modes.

[0084] 2. Perform intraprediction on a model area using each possible reconstruction row and intraprediction mode, and calculate a difference between a prediction result and a reconstruction result for each combination. For example, the difference could be a sum of absolute differences (SAD).

[0085] 3. Sort the SAD values ​​of all combinations in ascending order and select combinations with lower SAD values ​​as a TMRL candidate list.

[0086] If the reconstructed rows that can be used are {0, 1, 3, 5, 7, 12} and the possible intraprediction modes include 10 prediction modes, the decoder performs intraprediction on the model area using each possible reconstructed row and intraprediction mode, and calculates a SAD from a prediction result and a reconstruction result for each combination, to obtain 50 SADs. Then, the decoder sorts the 50 SADs in ascending order and selects 20 combinations with the lowest SAD values ​​as the TMRL candidate list. Petition 870250090822, dated 06 / 10 / 2025, page 37 / 141 25 / 103

[0087] It should be noted that, as the TMRL mode is configured to obtain 10 possible intraprediction modes for each intraprediction block, and a TMRL candidate list length of 20, TMRL can function normally only when there are at least two reconstructed lines available for the current block.

[0088] Figure 4 is an example of a model and reference lines located around an actual block according to an embodiment of this application.

[0089] As shown in Figure 4, an area in which a reference line 0 is located is a model area of ​​the current block, and the reconstructed lines of the current block include reference lines (reference line) 1 through 6.

[0090] An approximate process for analyzing the CU-level syntax elements related to TMRL mode is shown in Table 4 below. TABLE 4 if( (sps_mrl_flag && !dimd && !timd && !isFirstLineOfCtu && !bdpcmMode && cu.Y().valid)){ if a sequence-level reference allows the use of LMR, and the current block does not use DIMD mode, and does not use TIMD mode, and does not use BDPCM mode, and the current block is not located on the 1st line of a CTU, and the current block is a luma block decode(tmrlFlag) decode tmrlFlag if(tmrlFlag) decode(tmrlListldx) decode an index of a candidate in the TMRL candidate list} Petition 870250090822, dated 06 / 10 / 2025, page 38 / 141 26 / 103

[0091] As shown in Table 4, if sps_mrl_flag && !dimd && !timd && !isFirstLineOfCtu && !bdpcmMode && cu.Y().valid, the decoder decodes tmrlFlag; otherwise, if tmrlFlag is true, the decoder obtains tmrlListIdx by parsing the bitstream, where tmrlListIdx is used to indicate a candidate in the TMRL candidate list.

[0092] Figure 5 is a schematic flowchart of a 300 decoding method according to an embodiment of this application. It should be understood that the 300 decoding method can be executed by a decoder, and the decoding method is applied, for example, to the 200 decoding framework shown in Figure 2. For ease of description, the following uses a decoder as an example.

[0093] As shown in Figure 5, decoding method 300 may include the following steps S310 to S340.

[0094] S310: The decoder determines a maximum number of reference lines allowed to be used by a current block. For example, if the current block is not the first line of a current CTU, the current block does not use a DIMD mode, the current block does not use a BDPCM mode, and the current block is a luma block, the decoder determines the maximum number of lines by decoding a bit stream.

[0095] For example, the decoder determines the maximum number of lines by decoding the bit stream.

[0096] For example, a reference line used by the current block may be a reference line that is not (or not adjacent to) the current block.

[0097] For example, a reference line used by the current block can be a reference line formed Petition 870250090822, dated 06 / 10 / 2025, page 39 / 141 27 / 103 by reconstructed samples located above and to the left of the current block.

[0098] It should be understood that the “maximum number of reference lines allowed for use by the current block” is intended to describe a number of reference lines for the current block. The decoder can select a reference line actually used by the current block from among the “reference lines that can be used by the current block”. That is, the decoder can select, from among the “lines that can be used as reference lines for the current block”, the reference line used to predict the current block.In other words, the maximum number of reference lines allowed to be used by the current block can be understood or equivalently replaced by: the maximum number of reference lines allowed to be used for the current block, the number of lines that can be used as reference lines for the current block, the maximum number of lines allowed to be used by the current block, the maximum number of reference lines that can be used by the current block, the maximum number of reference lines that can be used by the current block, and other terms or descriptions with similar meanings, which are not specifically limited in this application.

[0099] S320: The decoder determines, based on the maximum number of lines, whether the current block uses a template-based Multiple Reference Line (TMRL) mode.

[00100] For example, if the maximum number of lines satisfies a condition for using TMRL mode, the decoder determines that the current block uses TMRL mode; Petition 870250090822, dated 06 / 10 / 2025, page 40 / 141 28 / 103 otherwise, the decoder determines that the current block does not use the TMRL mode. For example, if the maximum number of lines satisfies the condition for using the TMRL mode, the decoder determines, when decoding the bit stream, that the current block uses the TMRL mode; otherwise, the decoder determines that the current block does not use the TMRL mode, that is, the decoder determines, when decoding the bit stream, that the current block uses a prediction mode different from the TMRL mode. The maximum number of lines that satisfies the condition for using the TMRL mode can be understood as that in which the maximum number of lines satisfies a list of TMRL modes of specific length constructed by the decoder.

[00101] S330: If the current block uses TMRL mode, the decoder determines a reference line used by the current block and a prediction mode used by the current block.

[00102] For example, if the current block uses TMRL mode, the decoder determines, decodes the bit stream, the reference line used by the current block, and the prediction mode used by the current block.

[00103] S340: The decoder performs prediction on the current block based on the reference line used by the current block and using the prediction mode used by the current block, to obtain a prediction block.

[00104] For example, if the prediction mode used by the current block is the angular prediction mode, the decoder can determine, based on an angle indicated by the angular prediction mode, a reconstructed sample on the reference line used by the current block as a predicted sample in the current block, in order to obtain the prediction block of the current block. Petition 870250090822, dated 06 / 10 / 2025, p. 41 / 141 29 / 103

[00105] In the embodiments of this application, when performing prediction on a current block, a decoder first determines a maximum number of reference lines allowed to be used by the current block; then, the decoder determines, based on the maximum number of lines, whether the current block uses a TMRL mode; if the current block uses the TMRL mode, the decoder determines a reference line used by the current block and a prediction mode used by the current block; and then, the decoder performs prediction on the current block based on the reference line used by the current block and using the prediction mode used by the current block, to obtain a prediction block. That is, when predicting the current block, the decoder determines whether the current block uses the TMRL mode based on the maximum number of lines, so that the current block uses the TMRL mode when a condition for the maximum number of lines is met, thus improving decoding performance.

[00106] In some configurations, the S310 may include:

[00107] obtain, by the decoder, a first indication,

[00108] where the value of the first flag being a first value indicates that a current sequence to which the current block belongs does not use a multi-line reference MRL mode; or the value of the first flag being a second value different from the first value indicates that the current sequence uses the MRL mode and indicates the maximum number of lines.

[00109] For example, the first flag can be denoted as sps_mrl_enabled_flag, that is, Petition 870250090822, dated 06 / 10 / 2025, p. 42 / 141 30 / 103 sps_mrl_enabled_flag is a sequence-level MRL control flag. The value of sps_mrl_enabled_flag ranges from 0 to x (x is a positive integer). When the value of sps_mrl_enabled_flag is 0, it indicates that sequence-level MRL is disabled. When the value of sps_mrl_enabled_flag is 1 to x, it indicates that the current sequence uses MRL mode and indicates the maximum number of lines. For example, when the value of sps_mrl_enabled_flag is i (1 < i < x), it indicates that the current sequence uses LMR mode and indicates that the maximum number of lines is a value determined according to i. For example, in ECM, the value of the second flag ranges from 0 to 5, and the second flag can be represented by a 3-bit fixed-length code u(3).

[00110] For example, when the first flag does not exist in the bit stream obtained by the decoder, the value of the first flag may be 0 or another numeric value by default.

[00111] For example, when the value of the first flag is the second value, the decoder directly determines the second value as the maximum number of lines. For example, when the value of the first flag is 5, the decoder determines the value of the first flag (i.e., 5) as the maximum number of lines.

[00112] For example, when the value of the first flag is the second value, the decoder can determine, based on a match between at least one value and at least one number of lines, a number of lines corresponding to the second value as the maximum number of Petition 870250090822, dated 06 / 10 / 2025, page 43 / 141 31 / 103 lines. At least one value includes the second value. For example, when the value of the first flag is 4, the decoder determines, based on a match between at least one value and at least one line quantity, a line quantity (e.g., 5) corresponding to 4 as the maximum line quantity.

[00113] Certainly, in another alternative embodiment, the first flag may be an image level flag or an image block level flag.

[00114] For example, if the first flag is an image level flag, the value of the first flag being the first value indicates that a current image to which the current block belongs does not use the multi-line reference MRL mode, or the value of the first flag being the second value different from the first value indicates that the current image uses the MRL mode and indicates the maximum number of lines.

[00115] As another example, if the first flag is an image block level flag, the value of the first flag being the first value indicates that the current block does not use the multi-line reference MRL mode, or the value of the first flag being the second value different from the first value indicates that the current block uses the MRL mode and indicates the maximum number of lines.

[00116] Note that when the value of the first flag is the second value, the value of the first flag can be used to indicate that the current sequence uses MRL mode and indicates the maximum number of lines, and can also be used to indicate an allowed reference line to be used by the current block. In other words, Petition 870250090822, dated 06 / 10 / 2025, page 44 / 141 32 / 103 The value of the first flag is used to indicate the following content: the current sequence using MRL mode, the maximum number of lines, and the reference line allowed to be used by the current block.

[00117] For example, if a maximum value of the first flag is 5,

[00118] When the value of the first flag is 0, this indicates that the current sequence does not use MRL mode; when the value of the first flag is 1, the following content is indicated: the current sequence uses MRL mode, the maximum number of lines is 1, and the reference line allowed for use by the current block is reference line 1; when the value of the first flag is 2, the following content is indicated: the current sequence uses MRL mode, the maximum number of lines is 2, and the reference lines allowed for use by the current block include reference lines 1 and 3; when the value of the first flag is 3, the following content is indicated: the current sequence uses MRL mode, the maximum number of lines is 3, and the reference lines allowed for use by the current block include reference lines 1, 3, and 5;When the value of the first flag is 4, the following is indicated: the current sequence uses MRL mode, the maximum number of lines is 4, and the reference lines allowed for use by the current block include reference lines 1, 3, 5, and 7; or when the value of the first flag is 5, the following is indicated: the current sequence uses MRL mode, the maximum number of lines is 5, and the reference lines allowed for use by the current block include reference lines 1, 3, 5, 7, and 12.

[00119] Certainly, in another modality Petition 870250090822, dated 06 / 10 / 2025, page 45 / 141 33 / 103 Alternatively, there may be another match between the second value and the reference line allowed to be used by the current block, which is not specifically limited in this request.

[00120] In some configurations, the S310 may include:

[00121] obtain, by the decoder, a second beacon; and

[00122] determine, by the decoder, a line quantity indicated by the second flag as the maximum line quantity.

[00123] For example, the first flag can be indicated as num_non_adjacent_ref_line. A value of num_non_adjacent_ref_line ranges from 0 to x (x is a positive integer), indicating the maximum number of lines. For example, when the value of sps_mrl_enabled_flag is i (1 < i < x), this indicates that the maximum number of lines is a value determined according to i. For example, in ECM, the value of the second flag ranges from 0 to 5, and the second flag can be represented by a 3-bit fixed-length code u(3).

[00124] For example, when the second flag does not exist in the bitstream obtained by the decoder, the value of the second flag may be 0 or another numeric value by default.

[00125] For example, the decoder directly determines the value of the second flag as the maximum number of lines. For example, when the value of the second flag is 5, the decoder determines the value of the second flag (i.e., 5) as the maximum number of lines.

[00126] As an example, the decoder can Petition 870250090822, dated 06 / 10 / 2025, page 46 / 141 34 / 103 determine, based on a match between at least one value and at least one line count, a line count corresponding to the value of the second flag as the maximum line count. At least one value includes the value of the second flag. For example, when the value of the second flag is 4, the decoder determines, based on a match between at least one value and at least one line count, a line count (e.g., 5) corresponding to 4 as the maximum line count.

[00127] For example, the second flag is a sequence-level flag.

[00128] Certainly, in another alternative embodiment, the second flag may be an image level flag or an image block level flag.

[00129] For example, if the second flag is an image level flag, the second flag indicates a number of reference lines allowed to be used by a current image to which the current block belongs.

[00130] As another example, if the second flag is an image block level flag, the second flag indicates a number of reference lines allowed to be used by the current block.

[00131] It should be noted that the second flag can be used to indicate the maximum number of lines and can also be used to indicate an allowed reference line to be used by the current block. In other words, the value of the second flag is used to indicate the following: the maximum number of lines and the allowed reference line to be used by the current block.

[00132] For example, if a maximum value of the second Petition 870250090822, dated 06 / 10 / 2025, page 47 / 141 35 / 103 signal for 5,

[00133] When the value of the second flag is 0, the following content is indicated: the maximum number of lines is 0, and the reference line allowed to be used by the current block is empty; when the value of the second flag is 1, the following content is indicated: the maximum number of lines is 1, and the reference line allowed to be used by the current block is a reference line 1; when the value of the second flag is 2, the following content is indicated: the maximum number of lines is 2, and the reference lines allowed to be used by the current block include reference lines 1 and 3; when the value of the second flag is 3, the following content is indicated: the maximum number of lines is 3, and the reference lines allowed to be used by the current block include reference lines 1, 3, and 5;When the value of the second flag is 4, the following content is displayed: the maximum number of lines is 4, and the reference lines allowed to be used by the current block include reference lines 1, 3, 5, and 7; or when the value of the second flag is 5, the following content is displayed: the maximum number of lines is 5, and the reference lines allowed to be used by the current block include reference lines 1, 3, 5, 7, and 12.

[00134] Certainly, in another alternative embodiment, there may be another correspondence between the value of the second flag and the reference line allowed to be used by the current block, which is not specifically limited in this application.

[00135] In some configurations, the S320 may include: Petition 870250090822, dated 06 / 10 / 2025, page 48 / 141 36 / 103

[00136] if the maximum number of lines exceeds a first predefined threshold, obtaining a third signal from the decoder; and

[00137] if the third flag indicates that the current sequence to which the current block belongs is allowed to use TMRL mode, obtain, by the decoder, a fourth flag,

[00138] where the fourth flag indicates whether the current block uses TMRL mode.

[00139] For example, if the maximum number of lines is greater than the first predefined limit, the decoder decodes the bit stream to obtain the third flag; and if the third flag indicates that the current sequence to which the current block belongs is allowed to use TMRL mode, the decoder decodes the bit stream to obtain the fourth flag, where the fourth flag indicates whether the current block uses TMRL mode.

[00140] For example, the first predefined limit may be a limit predefined by the protocol.

[00141] For example, the first predefined limit can be 1, 2, or another value, which is not specifically limited in this request.

[00142] For example, the third flag can be indicated as sps_tmrl_enabled_flag and the fourth flag can be indicated as cu_tmrl_flag.

[00143] If the maximum number of lines is greater than the first predefined limit (for example, the first predefined limit is 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag; and if sps_tmrl_enabled_flag indicates that the current sequence to which the Petition 870250090822, dated 06 / 10 / 2025, page 49 / 141 37 / 103 The current block belongs to the TMRL mode (for example, the value of sps_tmrl_enabled_flag is 1), the decoder decodes the bitstream to obtain cu_tmrl_flag. When a value of cu_tmrl_flag is 1, it indicates that the current block uses TMRL mode, or when a value of cu_tmrl_flag is 0, it indicates that the current block does not use TMRL mode.

[00144] In some modes, if the third flag indicates that the current sequence is allowed to use TMRL mode and the current block does not use TIMD mode, the decoder will obtain the fourth flag.

[00145] For example, the decoder can determine, by decoding the bit stream, whether the current block uses TIMD mode.

[00146] For example, the third flag can be indicated as sps_tmrl_enabled_flag and the fourth flag can be indicated as cu_tmrl_flag.

[00147] If the maximum number of lines is greater than the first predefined limit (for example, the first predefined limit is 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag; and if sps_tmrl_enabled_flag indicates that the current sequence to which the current block belongs is allowed to use TMRL mode (for example, the value of sps_tmrl_enabled_flag is 1) and the current block does not use TIMD mode, the decoder decodes the bitstream to obtain cu_tmrl_flag. When a cu_tmrl_flag value is 1, it indicates that the current block uses TMRL mode, or when a cu_tmrl_flag value is 0, it indicates that the current block does not use TMRL mode.

[00148] In some configurations, the S320 may include: Petition 870250090822, dated 06 / 10 / 2025, page 50 / 141 38 / 103

[00149] obtain, by the decoder, from a third signaler; and

[00150] if the third flag indicates that the current sequence to which the current block belongs can use TMRL mode and the maximum number of lines is greater than a first predefined limit, obtain, by the decoder, a fourth flag,

[00151] where the fourth flag indicates whether the current block uses TMRL mode.

[00152] For example, the decoder decodes the bit stream to obtain the third flag; and if the third flag indicates that the current sequence to which the current block belongs is allowed to use TMRL mode and the maximum number of lines is greater than the first predefined limit, the decoder decodes the bit stream to obtain the fourth flag, where the fourth flag indicates whether the current block uses TMRL mode.

[00153] For example, the first predefined limit may be a limit predefined by the protocol.

[00154] For example, the first predefined limit can be 1, 2, or another value, which is not specifically limited in this request.

[00155] For example, the third flag can be indicated as sps_tmrl_enabled_flag and the fourth flag can be indicated as cu_tmrl_flag.

[00156] The decoder decodes the bitstream to obtain sps_tmrl_enabled_flag; and if sps_tmrl_enabled_flag indicates that the current sequence to which the current block belongs is allowed to use TMRL mode (for example, a value of sps_tmrl_enabled_flag is 1) and the maximum number of lines is Petition 870250090822, dated 06 / 10 / 2025, page 51 / 141 39 / 103 greater than the first predefined limit (for example, the first predefined limit is 1), the decoder decodes the bitstream to obtain cu_tmrl_flag. When a cu_tmrl_flag value is 1, it indicates that the current block uses TMRL mode, or when a cu_tmrl_flag value is 0, it indicates that the current block does not use TMRL mode.

[00157] In some modes, if the third flag indicates that the current sequence is allowed to use TMRL mode, the maximum line count is greater than the first predefined limit, and the current block does not use a model-based intramode derivation TIMD mode, it is determined that the current block uses TMRL mode.

[00158] For example, the third flag can be indicated as sps_tmrl_enabled_flag and the fourth flag can be indicated as cu_tmrl_flag.

[00159] The decoder decodes the bitstream to obtain sps_tmrl_enabled_flag; and if sps_tmrl_enabled_flag indicates that the current sequence to which the current block belongs is allowed to use TMRL mode (for example, a value of sps_tmrl_enabled_flag is 1), the maximum number of lines is greater than the first predefined limit (for example, the first predefined limit is 1), and the current block does not use TIMD mode, the decoder decodes the bitstream to obtain cu_tmrl_flag. When a value of cu_tmrl_flag is 1, it indicates that the current block uses TMRL mode, or when a value of cu_tmrl_flag is 0, it indicates that the current block does not use TMRL mode.

[00160] In some modes, if the current sequence is allowed to use MRL mode, the decoder obtains the third flag.

[00161] For example, if the decoder Petition 870250090822, dated 06 / 10 / 2025, page 52 / 141 40 / 103 To determine, when decoding the bitstream, that the current sequence can use MRL mode, the decoder obtains the third flag and determines, based on the third flag, whether the current sequence can use TMRL mode. Otherwise, the decoder determines that the current sequence does not use TMRL mode. Alternatively, if the decoder determines, when decoding the bitstream, that the current sequence is allowed to use MRL mode, the decoder obtains the third flag and determines, based on the third flag, whether the current sequence is allowed to use TMRL mode. Otherwise, the decoder determines that the current block does not use TMRL mode, that is, the decoder determines, by decoding the bitstream, that the current block uses a prediction mode other than TMRL mode.

[00162] For example, the third flag can be indicated as sps_tmrl_enabled_flag, and a flag that indicates whether the current sequence can use MRL mode can be indicated as sps_mrl_enabled_flag.

[00163] If the current sequence is allowed to use MRL mode (for example, sps_mrl_enabled_flag is set to 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag and determines, based on a value of sps_tmrl_enabled_flag, whether the current sequence is allowed to use TMRL mode. For example, when the value of sps_tmrl_enabled_flag is 1, this indicates that the current sequence is allowed to use TMRL mode, or when the value of sps_tmrl_enabled_flag is 0, this indicates that the current sequence is not allowed to use TMRL mode.

[00164] In some modes, the decoder obtains a fifth signal; and if the fifth signal indicates Petition 870250090822, dated 06 / 10 / 2025, page 53 / 141 41 / 103 if a value of the third flag is not restricted or the fifth flag does not restrict a value of a flag used to indicate whether the current sequence can use the MRL multi-reference line mode, the decoder obtains the third flag.

[00165] For example, the decoder decodes the bit stream to obtain the fifth flag; and if the fifth flag indicates that the value of the third flag is not restricted, or the fifth flag does not restrict the value of the flag used to indicate whether the current sequence is allowed to use MRL mode, the decoder decodes the bit stream to obtain the third flag.

[00166] For example, the fifth flag is general constraints information (GCI) for the third flag and is used to restrict the value of the third flag.

[00167] The third flag can be indicated as sps_tmrl_enabled_flag, and the GCI of the third flag can be indicated as gci_no_tmrl_constraint_flag, where gci_no_tmrl_constraint_flag indicates whether sps_tmrl_enabled_flag is constrained. For example, when a value of gci_no_tmrl_constraint_flag is 1, a value of sps_tmrl_enabled_flag must be equal to 0. Otherwise, the value of sps_tmrl_enabled_flag is not constrained.

[00168] The decoder decodes the bitstream to obtain gci_no_tmrl_constraint_flag; and if gci_no_tmrl_constraint_flag indicates that the value of sps_tmrl_enabled_flag is not constrained (for example, the value of gci_no_tmrl_constraint_flag is 0), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag and determines, Petition 870250090822, dated 06 / 10 / 2025, page 54 / 141 42 / 103 based on the value of sps_tmrl_enabled_flag, whether the current sequence is allowed to use TMRL mode. For example, when the value of sps_tmrl_enabled_flag is 1, this indicates that the current sequence is allowed to use TMRL mode, or when the value of sps_tmrl_enabled_flag is 0, this indicates that the current sequence is not allowed to use TMRL mode.

[00169] For example, the fifth flag is a GCI of a flag used to indicate whether the current sequence can use the multi-reference line MRL mode, to restrict a value of the flag used to indicate whether the current sequence can use the multi-reference line MRL mode.

[00170] The third flag can be indicated as sps_tmrl_enabled_flag, and the GCI of the third flag can be indicated as gci_no_mrl_constraints_flag, where gci_no_mrl_constraints_flag indicates whether sps_tmrl_enabled_flag and sps_mrl_enabled_flag are constrained. For example, when the value of gci_no_tmrl_constraint_flag is 1, both the value of sps_tmrl_enabled_flag and the value of sps_mrl_enabled_flag must be equal to 0. Otherwise, the values ​​of sps_tmrl_enabled_flag and sps_mrl_enabled_flag are not constrained.

[00171] The decoder decodes the bitstream to obtain gci_no_mrl_constraints_flag; and if gci_no_mrl_constraints_flag indicates that sps_tmrl_enabled_flag and sps_mrl_enabled_flag are not constrained (for example, the value of gci_no_mrl_constraints_flag is 0), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag and determines, based on the value of sps_tmrl_enabled_flag, whether the current sequence is allowed to use TMRL mode. By Petition 870250090822, dated 06 / 10 / 2025, page 55 / 141 43 / 103 For example, when the value of sps_tmrl_enabled_flag is 1, this indicates that the current sequence is allowed to use TMRL mode; or when the value of sps_tmrl_enabled_flag is 0, this indicates that the current sequence is not allowed to use TMRL mode.

[00172] In some modes, the decoder obtains a sixth flag; and if the sixth flag indicates that the current sequence is allowed to use a model-based mode, the decoder obtains the third flag.

[00173] For example, the decoder decodes the bitstream to obtain the sixth flag; and if the sixth flag indicates that the current sequence is allowed to use the model-based mode, the decoder decodes the bitstream to obtain the third flag.

[00174] For example, the third flag can be indicated as sps_tmrl_enabled_flag and the sixth flag can be indicated as sps_tm_enabled_flag.

[00175] The decoder decodes the bitstream to obtain sps_tm_enabled_flag; and if sps_tm_enabled_flag indicates that the current sequence is allowed to use model-based mode (for example, the value of sps_tm_enabled_flag is 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag and determines, based on the value of sps_tmrl_enabled_flag, whether the current sequence is allowed to use TMRL mode. For example, when the value of sps_tmrl_enabled_flag is 1, this indicates that the current sequence is allowed to use TMRL mode; or when the value of sps_tmrl_enabled_flag is 0, this indicates that the current sequence is not allowed to use TMRL mode.

[00176] In some modes, the decoder Petition 870250090822, dated 06 / 10 / 2025, page 56 / 141 44 / 103 obtains a seventh flag; and if the seventh flag indicates that a value of the sixth flag is not restricted, the decoder obtains the sixth flag.

[00177] For example, the seventh flag is general constraint information (General Constraint Information, GCI) for the sixth flag and is used to restrict the value of the sixth flag.

[00178] The third flag can be denoted as sps_tmrl_enabled_flag, the sixth flag can be denoted as sps_tm_enabled_flag, and the seventh flag can be denoted as gci_no_tm_constraints_flag, where gci_no_tm_constraints_flag indicates whether sps_tm_enabled_flag is constrained. For example, when a value of gci_no_tm_constraints_flag is 1, the value of sps_tm_enabled_flag must be equal to 0. Otherwise, the value of sps_tm_enabled_flag is not constrained.

[00179] The decoder decodes the bitstream to obtain gci_no_tm_constraints_flag; if gci_no_tm_constraints_flag indicates that the value of sps_tm_enabled_flag is not restricted (for example, a value of gci_no_tm_constraints_flag is 0), the decoder decodes the bitstream to obtain sps_tm_enabled_flag; if sps_tm_enabled_flag indicates that the current sequence is allowed to use model-based mode (for example, the value of sps_tm_enabled_flag is 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag and determines, based on the value of sps_tmrl_enabled_flag, whether the current sequence is allowed to use TMRL mode. For example, when the value of sps_tmrl_enabled_flag is 1, this indicates that the current sequence is allowed to use TMRL mode; or when Petition 870250090822, dated 06 / 10 / 2025, page 57 / 141 45 / 103 If the value of sps_tmrl_enabled_flag is 0, this indicates that the current sequence is not allowed to use TMRL mode.

[00180] In some configurations, the S330 may include:

[00181] determine, by the decoder, a reference line corresponding to the maximum number of lines allowed as a reference line to be used by the current block;

[00182] construct, by the decoder, a list of TMRL modes based on the reference line allowed for use by the current block and a prediction mode allowed for use by the current block;

[00183] obtain, by the decoder, a first index; and

[00184] determine, by the decoder, a reference line and a prediction mode that are included in a combination indicated by the first index in the TMRL mode list as the reference line used by the current block and the prediction mode used by the current block.

[00185] By way of example, the decoder can determine, based on a match between at least one line count and at least one reference line set, the reference lines in a reference line set corresponding to the maximum number of lines allowed as reference lines to be used by the current block, where at least one line count includes the maximum number of lines.

[00186] For example, if a value for the maximum number of lines ranges from 0 to 5,

[00187] when the maximum number of lines is Petition 870250090822, dated 06 / 10 / 2025, p. 58 / 141 46 / 103 When the maximum number of lines is 0, the reference line allowed for use by the current block will be empty; when the maximum number of lines is 1, the reference line allowed for use by the current block is reference line 1; when the maximum number of lines is 2, the reference lines allowed for use by the current block may include reference lines 1 and 3; when the maximum number of lines is 3, the reference lines allowed for use by the current block may include reference lines 1, 3, and 5; when the maximum number of lines is 4, the reference lines allowed for use by the current block include reference lines 1, 3, 5, and 7; or when the maximum number of lines is 5, the reference lines allowed for use by the current block may include reference lines 1, 3, 5, 7, and 12.

[00188] Certainly, in another alternative embodiment, there may be another correspondence between the maximum number of lines and the reference line allowed for use by the current block, which is not specifically limited in this application.

[00189] For example, the decoder decodes the bit stream to obtain the first index.

[00190] In some implementations, for each of at least one combination obtained using the reference line allowed to be used by the current block and the prediction mode allowed to be used by the current block, the decoder predicts a model of the current block based on a reference line of the combination and using a prediction mode of the combination, to obtain a prediction cost for each combination; based on the prediction cost of each combination, the decoder classifies at least one Petition 870250090822, dated 06 / 10 / 2025, page 59 / 141 47 / 103 combination in ascending order of prediction costs, to obtain a ranked combination; and the decoder determines a ranked combination in a high position in the ranked combination as a combination in the TMRL mode list.

[00191] For example, assuming that the reference lines allowed to be used by the current block include {0, 1, 3, 5, 7, 12}, and that the prediction modes allowed to be used by the current block include 10 prediction modes, the reference lines allowed to be used by the current block and the prediction modes allowed to be used by the current block can form 50 combinations. The decoder performs the prediction on a model area of ​​the current block based on a reference line included in each of the 50 combinations and using a prediction mode included in each combination (i.e., predicts the model of the current block) and calculates a difference value between a prediction result from a model of the current block and a reconstructed result from the model of the current block for each combination. For example, the difference value could be a sum of absolute differences (SAD).After obtaining 50 SADs, the decoder can sort the 50 SADs in ascending order and select a plurality of combinations with smaller SAD values ​​as the TMRL mode list. The number of combinations selected by the decoder can be determined based on the length of the TMRL mode list.

[00192] In some modalities, method 300 may additionally include:

[00193] determine, by the decoder based on whether the current block uses TIMD mode, the reference line used by the current block, if the current block does not use TMRL mode. Petition 870250090822, dated 06 / 10 / 2025, page 60 / 141 48 / 103

[00194] For example, if the maximum number of lines is greater than the first predefined limit (for example, the first predefined limit is 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag; if sps_tmrl_enabled_flag indicates that the current sequence to which the current block belongs is allowed to use TMRL mode (for example, the value of sps_tmrl_enabled_flag is 1) and the current block does not use TIMD mode, the decoder decodes the bitstream to obtain cu_tmrl_flag; and if cu_tmrl_flag indicates that the current block does not use TMRL mode (for example, the value of cu_tmrl_flag is 0), the decoder determines, based on the fact that the current block uses TIMD mode, the reference line used by the current block.

[00195] For example, the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag; if sps_tmrl_enabled_flag indicates that the current sequence to which the current block belongs is allowed to use TMRL mode (for example, the value of sps_tmrl_enabled_flag is 1), the maximum number of lines is greater than the first predefined limit (for example, the first predefined limit is 1), and the current block does not use TIMD mode, the decoder decodes the bitstream to obtain cu_tmrl_flag; and if cu_tmrl_flag indicates that the current block does not use TMRL mode (for example, the value of cu_tmrl_flag is 0), the decoder determines, based on whether the current block uses TIMD mode, the reference line used by the current block.

[00196] Certainly, in another alternative embodiment, when determining that the current sequence does not use TMRL mode or the current block does not satisfy a condition for using TMRL mode, the decoder determines that the current block does not use Petition 870250090822, dated 06 / 10 / 2025, p. 61 / 141 49 / 103 the TMRL mode. In this case, the decoder can directly determine, based on whether the current block uses TIMD mode, the reference line used by the current block. In other words, when determining that the current sequence does not use TMRL mode or the current block does not satisfy the TMRL mode usage condition, the decoder can skip decoding cu_tmrl_flag and directly determine, based on whether the current block uses TIMD mode, the reference line used by the current block. For example, if sps_tmrl_enabled_flag indicates that the current sequence to which the current block belongs does not use TMRL mode (for example, the value of sps_tmrl_enabled_flag is 0), the decoder can skip decoding cu_tmrl_flag and directly determine, based on whether the current block uses TIMD mode, the reference line used by the current block.As another example, if the current block uses TIMD mode, the decoder can skip decoding cu_tmrl_flag and directly decode the bitstream to determine a reference line used when the current block uses TIMD mode.

[00197] For example, if the current block uses TIMD mode, the decoder decodes the bit stream to determine a reference line used when the current block uses TIMD mode; or if the current block does not use TIMD mode, the decoder decodes the bit stream to determine a reference line used when the current block does not use TIMD mode.

[00198] In some modes, if the current block uses TIMD mode, the decoder obtains a second index; or if the current block does not use TIMD mode, the decoder obtains a third index, where the second index indicates a reference line used when the current block uses TIMD mode and the Petition 870250090822, dated 06 / 10 / 2025, page 62 / 141 50 / 103 third index indicates a reference line used when the current block does not use TIMD mode.

[00199] For example, the second index may be multiRefIdx shown in Table 3. To avoid repetition, the details are not described again in this document.

[00200] For example, the third index may be multiRefIdx shown in Table 2. To avoid repetition, the details are not described again in this document.

[00201] In some embodiments, the decoder obtains an eighth flag; and if the eighth flag indicates that the current sequence to which the current block belongs is allowed to use MRL mode and the current block does not use TMRL mode, the decoder determines, based on whether the current block uses TIMD mode, the reference line used by the current block.

[00202] For example, the decoder decodes the bit stream to obtain the eighth flag; and if the eighth flag indicates that the current sequence to which the current block belongs is allowed to use MRL mode and the current block does not use TMRL mode, the decoder determines, based on the fact that the current block uses TIMD mode, the reference line used by the current block.

[00203] For example, the eighth flag can be indicated as sps_mrl_enabled_flag.

[00204] The decoder decodes the bitstream to obtain sps_mrl_enabled_flag; and if sps_mrl_enabled_flag indicates that the current sequence to which the current block belongs is allowed to use MRL mode (for example, the value of sps_mrl_enabled_flag is 1) and the current block does not use TMRL mode, the decoder determines, based on whether the current block uses the Petition 870250090822, dated 06 / 10 / 2025, page 63 / 141 51 / 103 TIMD mode, the reference line used by the current block.

[00205] In some modes, if the maximum number of lines is greater than or equal to a second predefined limit, the decoder obtains the eighth flag.

[00206] For example, the second predefined limit may be a limit predefined by the protocol.

[00207] For example, the second predefined limit can be 0 or another value, which is not specifically limited in this request.

[00208] If the maximum number of lines is greater than or equal to the second predefined limit, the decoder decodes the bitstream to obtain sps_mrl_enabled_flag; and if sps_mrl_enabled_flag indicates that the current sequence to which the current block belongs is allowed to use MRL mode (for example, the value of sps_mrl_enabled_flag is 1) and the current block does not use TMRL mode, the decoder determines, based on the fact that the current block uses TIMD mode, the reference line used by the current block.

[00209] In some modes, if the eighth flag indicates that the current sequence is allowed to use the MRL mode with multiple reference lines, the maximum number of lines is greater than or equal to a second predefined limit, and the current block does not use the TMRL mode, the decoder determines, based on whether the current block uses the TIMD mode, the reference line used by the current block.

[00210] The decoder decodes the bitstream to obtain sps_mrl_enabled_flag; and if sps_mrl_enabled_flag indicates that the current sequence to which the current block belongs is authorized to use MRL mode (for example, the value of sps_mrl_enabled_flag is 1), the maximum number of lines is Petition 870250090822, dated 06 / 10 / 2025, page 64 / 141 If 52 / 103 is greater than or equal to the second preset limit and the current block does not use TMRL mode, the decoder determines, based on whether the current block uses TIMD mode, the reference line used by the current block.

[00211] Next, we describe by way of example a sequence-level flag in this request. The syntax elements in bold in the following tables are syntax elements that can be obtained by decoding a bitstream.

[00212] 1. sps_mrl_enabled_flag. TABLE 5 seq_parameter_set_rbsp( ) { Descriptor sps_mrl_enabled_flag u(1)}

[00213] As shown in Table 5, the sequence parameter set (seq_parameter_set_rbsp) can include sps_mrl_enabled_flag. sps_mrl_enabled_flag is used to control whether the MRL should be enabled for the current sequence. For example, when sps_mrl_enabled_flag is set to 1, the MRL is controlled to be enabled for the current sequence; or when sps_mrl_enabled_flag is set to 0, the MRL is controlled to be disabled for the current sequence.

[00214] 2. sps_tmrl_enabled_flag. TABLE 6 seq_parameter_set_rbsp( ) { Descriptor sps_mrl_enabled_flag u(1) if( sps_mrl_enabled_flag ) { Petition 870250090822, dated 06 / 10 / 2025, page 65 / 141 53 / 103 sps_tmrl_enabled_flag u(1)}}

[00215] As shown in Table 6, the sequence parameter set (seq_parameter_set_rbsp) includes sps_mrl_enabled_flag and sps_tmrl_enabled_flag.

[00216] Where sps_mrl_enabled_flag is used to control whether the MRL should be enabled for the current sequence. For example, when sps_mrl_enabled_flag is set to 1, the MRL is controlled to be enabled for the current sequence; or when sps_mrl_enabled_flag is set to 0, the MRL is controlled to be disabled for the current sequence.

[00217] Where sps_tmrl_enabled_flag indicates whether the current sequence is allowed to use TMRL mode. For example, when sps_tmrl_enabled_flag is set to 1, it indicates that the current sequence is allowed to use TMRL mode; or when sps_tmrl_enabled_flag is set to 0, it indicates that the current sequence is not allowed to use TMRL mode.

[00218] Furthermore, there is a dependency relationship between sps_mrl_enabled_flag and sps_tmrl_enabled_flag. That is, if the current sequence is allowed to use MRL mode (for example, sps_mrl_enabled_flag is set to 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag. TABLE 7 seq_parameter_set_rbsp( ) { Descriptor sps_mrl_enabled_flag u(1) Petition 870250090822, dated 06 / 10 / 2025, page 66 / 141 54 / 103 sps_tmrl_enabled_flag u(1)}

[00219] As shown in Table 7, there may also be no dependency relationship between sps_mrl_enabled_flag and sps_tmrl_enabled_flag, i.e., the decoder decodes the bitstream to obtain sps_mrl_enabled_flag and sps_tmrl_enabled_flag.

[00220] When sps_mrl_enabled_flag and sps_tmrl_enabled_flag are introduced, the changes to the syntax elements at the CU level are shown in Table 8 below. TABLE 8 coding_unit (x0,y0,cbWidth,cbHeight,cqtDepth,treeType,modeType ) { Described r ... ... if(((y0%CtbSizeY)>0) / / not the first line of a current CTU && !dimd / / not dimd mode && !bdpcmMode / / not bdpcm mode && isLuma / / is a luma block ) { if(sps_tmrl_enabled_flag / / sequence-level tmrl allowed && !timd / / not timd mode ) { _tmrl_flag / / if it's tmrl mode ae(v) if(cu_tmrl_flag) tmrl_list_idx / / Index of the TMRL candidate list ae(v)} else if(sps_mrl_enabled_flag && !cu_tmrl_flag) { Petition 870250090822, dated 06 / 10 / 2025, page 67 / 141 55 / 103 if(timd) intra_luma_ref_idx / / MRL index in TIMD mode ae(v) else intra_luma_ref_idx / / MRL index in non-TIMD mode ae(v)}} ...... / / other syntax elements

[00221] As shown in Table 8, when sps_mrl_enabled_flag and sps_tmrl_enabled_flag are introduced, and if the current block is not the first line of the current CTU, the current block does not use DIMD mode, the current block does not use BDPCM mode, and the current block is a luma block, the decoder continues to decode the bitstream based on sps_tmrl_enabled_flag.

[00222] In this mode, sps_tmrl_enabled_flag is used to indicate the switching between TMRL and MRL.

[00223] If sps_tmrl_enabled_flag indicates that the current sequence is allowed to use TMRL mode (for example, the value of sps_tmrl_enabled_flag is 1) and the current block does not use TIMD mode, the decoder decodes the bitstream to obtain cu_tmrl_flag. If cu_tmrl_flag indicates that the current block uses TMRL mode (for example, cu_tmrl_flag is set to 1), the decoder decodes the bitstream to obtain tmrl_list_idx, determines a reference line and a prediction mode included in a combination indicated by tmrl_list_idx in the TMRL mode list as the reference line used by the current block and the prediction mode used by the current block. Then, the decoder performs prediction on the current block based on the reference line used by the current block. Petition 870250090822, dated 06 / 10 / 2025, page 68 / 141 56 / 103 and using the prediction mode used by the current block, to obtain a prediction block.

[00224] If sps_tmrl_enabled_flag indicates that the current sequence to which the current block belongs is not allowed to use TMRL mode (for example, the value of sps_tmrl_enabled_flag is 0) or the current block uses TIMD mode, or cu_tmrl_flag indicates that the current block does not use TMRL mode (for example, cu_tmrl_flag is set to 0), and furthermore, if sps_mrl_enabled_flag indicates that the current sequence is allowed to use MRL mode (for example, the value of sps_mrl_enabled_flag is 1) and the current block does not use TMRL mode, the decoder determines, based on whether the current block uses TIMD mode, the reference line used by the current block.For example, if the current block uses TIMD mode, the decoder decodes the bitstream to obtain intra_luma_ref_idx, where intra_luma_ref_idx indicates a reference line used when the current block uses TIMD mode; or if the current block does not use TIMD mode, the decoder decodes the bitstream to obtain intra_luma_ref_idx, where intra_luma_ref_idx indicates a reference line used when the current block does not use TIMD mode.

[00225] 3. gci_no_mrl_constraint_flag and gci_no_tmrl_constraint_flag.

[00226] The GCI includes a series of flags and is used to restrict whether certain sequence-level flags exist in the bitstream. When the GCI of a specific flag is greater than 0, this means that the specific flag in the bitstream is restricted. For example, when GCI is greater than 0, a specific encoding tool is restricted in the bitstream; and when Petition 870250090822, dated 06 / 10 / 2025, page 69 / 141 57 / 103 If GCI equals 0, it means that no restriction is imposed on a portion of the bitstream (for example, a specific encoding tool). For example, in standard text, gci_no_mrl_constraint_flag indicates whether sps_mrl_enabled_flag is restricted; and when gci_no_mrl_constraint_flag equals 1, sps_mrl_enabled_flag must equal 0; otherwise, the value of sps_mrl_enabled_flag is not restricted.

[00227] Due to the introduction of a TMRL tool, LMR is enhanced. For use with TMRL and MRL, this application introduces a sequence-level flag sps_tmrl_enabled_flag indicating the switching between modes. In this case, the GCI can also be adjusted accordingly. For example, when the decoding of sps_tmrl_enabled_flag does not depend on the value of sps_mrl_enabled_flag, a tmrl GCI flag can be added. For example, the adjustment can be performed as shown in Table 9 below. TABLE 9 general_constraints_info() { Descriptor gci_present_flag u(1) if( gci_present_flag ) { / * intra * / gci_no_mrl_constraint_flag u(1) gci_no_tmrl_constraint_flag u(1) / * inter* / / * transform, quantization, residual * / Petition 870250090822, dated 06 / 10 / 2025, page 70 / 141 58 / 103 / * loop filter * / } while( !byte_aligned( ) ) gci_alignment_zero_bit f(1)}

[00228] As shown in Table 9, gci_no_mrl_constraint_flag indicates whether sps_mrl_enabled_flag is restricted; and when gci_no_mrl_constraint_flag equals 1, sps_mrl_enabled_flag must equal 0; otherwise, the value of sps_mrl_enabled_flag is not restricted.

[00229] Additionally, a gci_no_tmrl_constraint_flag can be added to restrict the value of sps_tmrl_enabled_flag. In which, gci_no_tmrl_constraint_flag indicates whether sps_tmrl_enabled_flag is restricted; and when gci_no_tmrl_constraint_flag is equal to 1, sps_tmrl_enabled_flag must be equal to 0; otherwise, the value of sps_tmrl_enabled_flag is not restricted.

[00230] Certainly, in another alternative embodiment, when the decoding of sps_tmrl_enabled_flag depends on the value of sps_mrl_enabled_flag, gci_no_mrl_constraints_flag can still be used to control both sps_mrl_enabled_flag and sps_tmrl_enabled_flag. This is not specifically limited in this application.

[00231] 4. sps_tm_enabled_flag and gci_no_tm_constraints_flag.

[00232] There are a large number of model-based technologies in ECM, for example, DIMD in mode of Petition 870250090822, dated 06 / 10 / 2025, page 71 / 141 59 / 103 Prediction. TIMD also uses models as prediction tools. This application can introduce a unified flag to control all model-based technologies. That is, a sequence-level flag sps_tm_enabled_flag can be introduced to control whether a model-based encoding tool is enabled at the sequence level, and there can also be a gci_no_tm_constraints_flag to control whether a constraint is imposed on sps_tm_enabled_flag in the bitstream. If gci_no_tm_constraints_flag is equal to 1, sps_tm_enabled_flag must be equal to 0. Otherwise, the value of sps_tm_enabled_flag is not constrained.

[00233] In this case, the decoding of sps_tmrl_enabled_flag depends on the value of sps_tm_enabled_flag. TABLE 10 general_constraints_info( ) { Descriptor gci_present_flag u(1) if( gci_present_flag ) { gci_no_tm_constraint_flag u(1)} while( !byte_aligned( ) ) gci_alignment_zero_bit f(1)}

[00234] As shown in Table 10, the decoder decodes the bit stream to obtain gci_no_tm_constraints_flag; and if gci_no_tm_constraints_flag is equal to 1, sps_tm_enabled_flag must be equal to 0; otherwise, the value of sps_tm_enabled_flag is not constrained. Petition 870250090822, dated 06 / 10 / 2025, page 72 / 141 60 / 103 TABLE 11 seq_parameter_set_rbsp( ) { Descriptor sps_tm_enabled_flag u(1) sps_mrl_enabled_flag u(1) if(sps_tm_enabled_flag) { sps_tmrl_enabled_flag u(1)}}

[00235] As shown in Table 11, the decoder decodes the bitstream to obtain sps_tm_enabled_flag and sps_mrl_enabled_flag; and if the current sequence is allowed to use a template-based mode (for example, sps_tm_enabled_flag is set to 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag. TABLE 12 seq_parameter_set_rbsp( ) { Descriptor sps_tm_enabled_flag u(1) sps_mrl_enabled_flag u(1) if(sps tm enabled flag && sps mrl enabled flag) { _ _ _ - - - sps_tmrl_enabled_flag u(1)}} Petition 870250090822, dated 06 / 10 / 2025, page 73 / 141 61 / 103

[00236] As shown in Table 12, the decoder decodes the bitstream to obtain sps_tm_enabled_flag and sps_mrl_enabled_flag; and if the current sequence is allowed to use model-based mode (e.g., sps_tm_enabled_flag is set to 1) and the current sequence is allowed to use MRL mode (e.g., sps_mrl_enabled_flag is set to 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag.

[00237] Since the MRL tool being enabled indicates that non-adjacent reference lines are allowed to be used, sps_mrl_enabled_flag can be expanded to indicate a number of non-adjacent reference lines that can be used (i.e., the maximum number of lines mentioned above). After the maximum number of lines is introduced, the implementation of syntax elements at the CU level needs to be adjusted according to different sets of sequence parameters. What follows describes an exemplary method for adjusting it. METHOD 1:

[00238] The sequence parameter set (seq_parameter_set_rbsp) can be as shown in Table 13 below. TABLE 13 seq_parameter_set_rbsp() { Descriptor sps_mrl_enabled_flag u(3) if ( sps_mrl_enabled_flag > n ) sps_tmrl_enabled_flag u(1) Petition 870250090822, dated 06 / 10 / 2025, p. 74 / 141 62 / 103 }

[00239] As shown in Table 13, the sequence parameter set includes sps_mrl_enabled_flag and sps_tmrl_enabled_flag.

[00240] The value of sps_mrl_enabled_flag ranges from 0 to x (x is a positive integer). When a value of sps_mrl_enabled_flag is 0, this indicates that MRL at the sequence level is disabled. When the value of sps_mrl_enabled_flag ranges from 1 to x, this indicates that the current sequence uses MRL mode and indicates the maximum number of rows. For example, when the value of sps_mrl_enabled_flag is i (1 < i < x), it indicates that the current sequence uses LMR mode and indicates that the maximum number of rows is a value determined according to i. When sps_mrl_enabled_flag does not exist in the bitstream, sps_mrl_enabled_flag is 0 by default.

[00241] For example, if a maximum value of sps_mrl_enabled_flag is 5,

[00242] When sps_mrl_enabled_flag is set to 0, it indicates that the current sequence does not use MRL mode; when sps_mrl_enabled_flag is 1, the following content is indicated: the current sequence uses MRL mode, the maximum number of lines is 1, and the reference line allowed to be used by the current block is reference line 1; when sps_mrl_enabled_flag is 2, the following content is indicated: the current sequence uses MRL mode, the maximum number of lines is 2, and the reference lines allowed to be used by the current block include reference lines 1 and 3; Petition 870250090822, dated 06 / 10 / 2025, page 75 / 141 63 / 103 when sps_mrl_enabled_flag is 3, the following content is displayed: the current sequence uses MRL mode, the maximum number of lines is 3, and the reference lines allowed to be used by the current block include reference lines 1, 3, and 5; when sps_mrl_enabled_flag is 4, the following content is displayed: the current sequence uses MRL mode, the maximum number of lines is 4, and the reference lines allowed to be used by the current block include reference lines 1, 3, 5, and 7; or when sps_mrl_enabled_flag is 5, the following content is displayed: the current sequence uses MRL mode, the maximum number of lines is 5, and the reference lines allowed to be used by the current block include reference lines 1, 3, 5, 7, and 12.

[00243] In which sps_tmrl_enabled_flag indicates whether the current sequence is allowed to use TMRL mode. For example, when sps_tmrl_enabled_flag is set to 1, this indicates that the current sequence is allowed to use TMRL mode, or when sps_tmrl_enabled_flag is set to 0, this indicates that the current sequence is not allowed to use TMRL mode. When sps_tmrl_enabled_flag does not exist in the bitstream, sps_tmrl_enabled_flag is 0 by default.

[00244] There is a dependency relationship between sps_mrl_enabled_flag and sps_tmrl_enabled_flag, that is, if sps_mrl_enabled_flag > n (for example, n is 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag.

[00245] Based on the sequence parameter set shown in Table 13, the implementation of syntax elements at the CU level can be shown in Table 14 below. TABLE 14 Petition 870250090822, dated 06 / 10 / 2025, page 76 / 141 64 / 103 coding_unit (x0,y0,cbWidth,cbHeight,cqtDepth,treeType,modeType ) { Described r ...... if(((y0%CtbSizeY)>0) / / not the first line of a current CTU && !dimd / / not dimd mode && !bdpcmMode / / not bdpcm mode && isLuma / / is a luma block ) { if(sps_tmrl_enabled_flag / / sequence-level tmrl allowed && !timd / / not timd mode ) { _tmrl_flag / / if it's tmrl mode ae(v) if(cu_tmrl_flag) tmrl_list_idx / / Index of the TMRL candidate list ae(v)} else if(sps_mrl_enabled_flag && !cu_tmrl_flag) { if(timd) intra_luma_ref_idx / / MRL index in TIMD mode ae(v) else intra_luma_ref_idx / / MRL index in non-TIMD mode ae(v)}} ...... / / other syntax elements

[00246] As shown in Table 14, when a maximum number of lines syntax element is introduced, and if the current block is not the first line of the current CTU, the current block does not use DIMD mode, the current block does not use BDPCM mode, and the current block is a luma block, the decoder continues to decode the bitstream based on Petition 870250090822, dated 06 / 10 / 2025, page 77 / 141 65 / 103 in sps_tmrl_enabled_flag.

[00247] In this mode, sps_tmrl_enabled_flag is used to indicate the switching between TMRL and MRL.

[00248] If sps_tmrl_enabled_flag indicates that the current sequence is allowed to use TMRL mode (for example, the value of sps_tmrl_enabled_flag is 1) and the current block does not use TIMD mode, the decoder decodes the bitstream to obtain cu_tmrl_flag. If cu_tmrl_flag indicates that the current block uses TMRL mode (for example, cu_tmrl_flag is set to 1), the decoder decodes the bitstream to obtain tmrl_list_idx, determines a reference line and a prediction mode included in a combination indicated by tmrl_list_idx in the TMRL mode list as the reference line used by the current block and the prediction mode used by the current block. Then, the decoder performs prediction on the current block based on the reference line used by the current block and using the prediction mode used by the current block, to obtain a prediction block.

[00249] If sps_tmrl_enabled_flag indicates that the current sequence to which the current block belongs is not allowed to use TMRL mode (for example, the value of sps_tmrl_enabled_flag is 0) or the current block uses TIMD mode, or cu_tmrl_flag indicates that the current block does not use TMRL mode (for example, cu_tmrl_flag is set to 0), and furthermore, if sps_mrl_enabled_flag indicates that the current sequence is allowed to use MRL mode (for example, the value of sps_mrl_enabled_flag is 1) and the current block does not use TMRL mode, the decoder determines, based on whether the current block uses TIMD mode, the reference line used by the current block. For example, if the current block uses TIMD mode, the decoder Petition 870250090822, dated 06 / 10 / 2025, page 78 / 141 66 / 103 decodes the bitstream to obtain intra_luma_ref_idx, where intra_luma_ref_idx indicates a reference line used when the current block uses TIMD mode. If the current block does not use TIMD mode, the decoder decodes the bitstream to obtain intra_luma_ref_idx, where intra_luma_ref_idx indicates a reference line used when the current block does not use TIMD mode. METHOD 2:

[00250] The sequence parameter set (seq_parameter_set_rbsp) can be as shown in Table 15 below. TABLE 15 seq_parameter_set_rbsp() { Descriptor sps_mrl_enabled_flag u(3) sps_tmrl_enabled_flag u(1)}

[00251] As shown in Table 13, the sequence parameter set includes sps_mrl_enabled_flag and sps_tmrl_enabled_flag.

[00252] The value of sps_mrl_enabled_flag ranges from ax (x is a positive integer). When the value of sps_mrl_enabled_flag is 0, this indicates that MRL at the sequence level is disabled. When the value of sps_mrl_enabled_flag is 1 ax, it indicates that the current sequence uses MRL mode and indicates the maximum number of rows. For example, when the value of sps_mrl_enabled_flag is i (1 < i < x), it indicates that the current sequence uses LMR mode and indicates Petition 870250090822, dated 06 / 10 / 2025, page 79 / 141 67 / 103 that the maximum number of lines is a value determined according to i. When sps_mrl_enabled_flag does not exist in the bitstream, sps_mrl_enabled_flag is 0 by default.

[00253] For example, if a maximum value of sps_mrl_enabled_flag is 5,

[00254] When sps_mrl_enabled_flag is set to 0, it indicates that the current sequence does not use MRL mode; when sps_mrl_enabled_flag is 1, the following content is indicated: the current sequence uses MRL mode, the maximum number of lines is 1, and the reference line allowed to be used by the current block is reference line 1; when sps_mrl_enabled_flag is 2, the following content is indicated: the current sequence uses MRL mode, the maximum number of lines is 2, and the reference lines allowed to be used by the current block include reference lines 1 and 3; when sps_mrl_enabled_flag is 3, the following content is indicated: the current sequence uses MRL mode, the maximum number of lines is 3, and the reference lines allowed to be used by the current block include reference lines 1, 3, and 5;When sps_mrl_enabled_flag is 4, the following content is displayed: the current sequence uses MRL mode, the maximum number of lines is 4, and the reference lines allowed to be used by the current block include reference lines 1, 3, 5, and 7; or when sps_mrl_enabled_flag is 5, the following content is displayed: the current sequence uses MRL mode, the maximum number of lines is 5, and the reference lines allowed to be used by the current block include reference lines 1, 3, 5, 7, and 12.

[00255] In which sps_tmrl_enabled_flag indicates whether the current sequence is allowed to use TMRL mode. By Petition 870250090822, dated 06 / 10 / 2025, p. 80 / 141 68 / 103 For example, when sps_tmrl_enabled_flag is set to 1, it indicates that the current sequence is allowed to use TMRL mode; or when sps_tmrl_enabled_flag is set to 0, it indicates that the current sequence is not allowed to use TMRL mode. When sps_tmrl_enabled_flag does not exist in the bitstream, sps_tmrl_enabled_flag is 0 by default.

[00256] There may be no dependency relationship between sps_mrl_enabled_flag and sps_tmrl_enabled_flag, i.e., the decoder decodes the bitstream to obtain sps_mrl_enabled_flag and sps_tmrl_enabled_flag.

[00257] Based on the sequence parameter set shown in Table 15, the implementation of syntax elements at the CU level can be shown in Table 16 below: TABLE 16 coding_unit (x0,y0,cbWidth,cbHeight,cqtDepth,treeType,modeType ) { Described r ... ... if(((y0%CtbSizeY)>0) / / not the first line of a current CTU && !dimd / / not dimd mode && !bdpcmMode / / not bdpcm mode && isLuma / / is a luma block ) { if(sps_tmrl_enabled_flag / / sequence-level tmrl allowed && !timd / / not timd mode && num non adjacent ref line > n ) ' “ “ _tmrl_flag / / if it is tmrl mode ae(v) if(cu_tmrl_flag) tmrl_list_idx / / Index of the TMRL candidate list ae(v)} Petition 870250090822, dated 06 / 10 / 2025, page 81 / 141 69 / 103 else if(sps_mrl_enabled_flag && !cu_tmrl_flag) { if(timd) intra_luma_ref_idx / / MRL index in TIMD mode ae(v) else intra_luma_ref_idx / / MRL index in non-TIMD mode ae(v)}} ...... / / other syntax elements

[00258] As shown in Table 16, when a maximum number of lines syntax element is introduced, and if the current block is not the first line of the current CTU, the current block does not use DIMD mode, the current block does not use BDPCM mode, and the current block is a luma block, the decoder continues to decode the bitstream based on sps_tmrl_enabled_flag.

[00259] In this mode, sps_tmrl_enabled_flag is used to indicate the switching between TMRL and MRL.

[00260] If sps_tmrl_enabled_flag indicates that the current sequence is allowed to use TMRL mode (for example, the value of sps_tmrl_enabled_flag is 1), the current block does not use TIMD mode, and num_non_adjacent_ref_line > n (for example, n is 1), the decoder decodes the bitstream to obtain cu_tmrl_flag. If cu_tmrl_flag indicates that the current block uses TMRL mode (for example, cu_tmrl_flag is set to 1), the decoder decodes the bitstream to obtain tmrl_list_idx, determines a reference line and a prediction mode included in a combination indicated by tmrl_list_idx in the TMRL mode list as the reference line used by the current block and the prediction mode used by the block. Petition 870250090822, dated 06 / 10 / 2025, page 82 / 141 70 / 103 current. Next, the decoder performs the prediction on the current block based on the reference line used by the current block and using the prediction mode used by the current block, to obtain a prediction block.

[00261] The variable num_non_adjacent_ref_line is equal to the value of sps_mrl_enabled_flag, which is used to indicate the maximum number of lines.

[00262] If sps_tmrl_enabled_flag indicates that the current sequence to which the current block belongs is not allowed to use TMRL mode (for example, the value of sps_tmrl_enabled_flag is 0) or the current block uses TIMD mode, or cu_tmrl_flag indicates that the current block does not use TMRL mode (for example, cu_tmrl_flag is set to 0), and furthermore, if sps_mrl_enabled_flag indicates that the current sequence is allowed to use MRL mode (for example, the value of sps_mrl_enabled_flag is 1) and the current block does not use TMRL mode, the decoder determines, based on whether the current block uses TIMD mode, the reference line used by the current block.For example, if the current block uses TIMD mode, the decoder decodes the bitstream to obtain intra_luma_ref_idx, where intra_luma_ref_idx indicates a reference line used when the current block uses TIMD mode; or if the current block does not use TIMD mode, the decoder decodes the bitstream to obtain intra_luma_ref_idx, where intra_luma_ref_idx indicates a reference line used when the current block does not use TIMD mode. METHOD 3:

[00263] The sequence parameter set (seq_parameter_set_rbsp) can be as shown in Table 17 below. Petition 870250090822, dated 06 / 10 / 2025, p. 83 / 141 71 / 103 TABLE 17 seq_parameter_set_rbsp() { Descriptor num_non_adjacent_ref_line u(3) sps_mrl_enabled_flag u(1) sps_tmrl_enabled_flag u(1)}

[00264] As shown in Table 17, sps_mrl_enabled_flag is still just a sequence-level flag used only to control whether the MRL should be enabled for the current sequence. For example, when sps_mrl_enabled_flag is set to 1, the MRL is controlled to be enabled for the current sequence; or when sps_mrl_enabled_flag is set to 0, the MRL is controlled to be disabled for the current sequence.

[00265] In which, num_non_adjacent_ref_line is used to indicate the maximum number of lines. For example, in ECM, a value of num_non_adjacent_ref_line can range from 0 to 5, which can be represented by a 3-bit fixed-length code u(3). Certainly, when num_non_adjacent_ref_line does not exist in the bitstream, the value of num_non_adjacent_ref_line can be 0 by default.

[00266] Based on the sequence parameter set shown in Table 17, the implementation of syntax elements at the UC level can be shown in Table 18 below. TABLE 18 coding_unit Description Petition 870250090822, dated 06 / 10 / 2025, page 84 / 141 72 / 103 (x0,y0,cbWidth,cbHeight,cqtDepth,treeType,modeType) { or ...... if(((y0%CtbSizeY)>0) / / not the first line of a current CTU && !dimd / / not dimd mode && !bdpcmMode / / not bdpcm mode && isLuma / / is a luma block ) { if(sps_tmrl_enabled_flag / / sequence-level tmrl allowed && !timd / / not timd mode && num non adjacent ref line > n ) ' “ “ _tmrl_flag / / if it is tmrl mode ae(v) if(cu_tmrl_flag) tmrl_list_idx / / Index of the TMRL candidate list ae(v)} else if(sps_mrl_enabled_flag && num_non_adjacent_ref_line > m && !cu_tmrl_flag) { if(timd) intra_luma_ref_idx / / MRL index in TIMD mode ae(v) else intra_luma_ref_idx / / MRL index in non-TIMD mode ae(v)}} ...... / / other syntax elements

[00267] As shown in Table 18, when a maximum number of lines syntax element is introduced, and if the current block is not the first line of the current CTU, the current block does not use DIMD mode, the current block does not use BDPCM mode, and the current block is a luma block, the Petition 870250090822, dated 06 / 10 / 2025, page 85 / 141 The 73 / 103 decoder continues to decode the bitstream based on the sps_tmrl_enabled_flag.

[00268] In this mode, sps_tmrl_enabled_flag is used to indicate the switching between TMRL and MRL.

[00269] If sps_tmrl_enabled_flag indicates that the current sequence is allowed to use TMRL mode (for example, the value of sps_tmrl_enabled_flag is 1), the current block does not use TIMD mode, and num_non_adjacent_ref_line > n (for example, n is 1), the decoder decodes the bitstream to obtain cu_tmrl_flag. If cu_tmrl_flag indicates that the current block uses TMRL mode (for example, cu_tmrl_flag is set to 1), the decoder decodes the bitstream to obtain tmrl_list_idx, determines a reference line and a prediction mode included in a combination indicated by tmrl_list_idx in the TMRL mode list as the reference line used by the current block and the prediction mode used by the current block. Next, the decoder performs the prediction on the current block based on the reference line used by the current block and using the prediction mode used by the current block, to obtain a prediction block.

[00270] The variable num_non_adjacent_ref_line is equal to the value of sps_mrl_enabled_flag, which is used to indicate the maximum number of lines.

[00271] If sps_tmrl_enabled_flag indicates that the current sequence to which the current block belongs is not allowed to use TMRL mode (for example, the value of sps_tmrl_enabled_flag is 0) or the current block uses TIMD mode, or cu_tmrl_flag indicates that the current block does not use TMRL mode (for example, cu_tmrl_flag is set to 0) and, in addition, if sps_tmrl_enabled_flag indicates that the current sequence has Petition 870250090822, dated 06 / 10 / 2025, page 86 / 141 74 / 103 permission to use MRL mode (for example, the value of sps_mrl_enabled_flag is 1), num_non_adjacent_ref_line > m (for example, m is 0) and the current block does not use TMRL mode, the decoder determines, based on whether the current block uses TIMD mode, the reference line used by the current block. For example, if the current block uses TIMD mode, the decoder decodes the bitstream to obtain intra_luma_ref_idx, where intra_luma_ref_idx indicates a reference line used when the current block uses TIMD mode. If the current block does not use TIMD mode, the decoder decodes the bitstream to obtain intra_luma_ref_idx, where intra_luma_ref_idx indicates a reference line used when the current block does not use TIMD mode.

[00272] Since there is no dependency relationship between num_non_adjacent_ref_line and sps_mrl_enabled_flag and no dependency relationship between num_non_adjacent_ref_line and sps_tmrl_enabled_flag, it is necessary to determine, based on num_non_adjacent_ref_line, whether the image block-level flag should be decoded. METHOD 4:

[00273] The sequence parameter set (seq_parameter_set_rbsp) can be as shown in Table 19 below. TABLE 19 seq_parameter_set_rbsp() { Descriptor num_non_adjacent_ref_line u(3) if (num_non_adjacent_ref_line > m) u(1) sps_mrl_enabled_flag if (num_non_adjacent_ref_line > n ) Petition 870250090822, dated 06 / 10 / 2025, p. 87 / 141 75 / 103 sps_tmrl_enabled_flag}

[00274] As shown in Table 19, sps_mrl_enabled_flag is still only a sequence-level flag used only to control whether the MRL should be enabled for the current sequence. For example, when sps_mrl_enabled_flag is set to 1, the MRL is controlled to be enabled for the current sequence; or when sps_mrl_enabled_flag is set to 0, the MRL is controlled to be disabled for the current sequence. A new syntax num_non_adjacent_ref_line is introduced and used to indicate the maximum number of lines. For example, in ECM, a value of num_non_adjacent_ref_line can range from 0 to 5, which can be represented by a 3-bit fixed-length code u(3). Certainly, when num_non_adjacent_ref_line does not exist in the bitstream, the value of num_non_adjacent_ref_line can be 0 by default.

[00275] Wherein sps_mrl_enabled_flag and sps_tmrl_enabled_flag may separately have a dependency relationship with num_non_adjacent_ref_line. If num_non_adjacent_ref_line > m (for example, n is 0), the decoder decodes the bitstream to obtain sps_mrl_enabled_flag. If num_non_adjacent_ref_line > n (for example, n is 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag.

[00276] Based on the sequence parameter set shown in Table 19, the implementation of syntax elements at the CU level can be shown in Table 20. Petition 870250090822, dated 06 / 10 / 2025, p. 88 / 141 76 / 103 below: TABLE 20 coding_unit (x0,y0,cbWidth,cbHeight,cqtDepth,treeType,modeType ) { Described r ...... if(((y0%CtbSizeY)>0) / / not the first line of a current CTU && !dimd / / not dimd mode && !bdpcmMode / / not bdpcm mode && isLuma / / is a luma block ) { if(sps_tmrl_enabled_flag / / sequence-level tmrl allowed && !timd / / not timd mode ) { _tmrl_flag / / if it's tmrl mode ae(v) if(cu_tmrl_flag) tmrl_list_idx / / Index of the TMRL candidate list ae(v)} else if(sps_mrl_enabled_flag && !cu_tmrl_flag) { if(timd) intra_luma_ref_idx / / MRL index in TIMD mode ae(v) else intra_luma_ref_idx / / MRL index in non-TIMD mode ae(v)}} ...... / / other syntax elements

[00277] As shown in Table 20, when a maximum number of lines syntax element is introduced, and if the current block is not the first line of the current CTU, the current block does not use DIMD mode, the current block Petition 870250090822, dated 06 / 10 / 2025, page 89 / 141 77 / 103 does not use BDPCM mode and the current block is a luma block, the decoder continues to decode the bitstream based on sps_tmrl_enabled_flag.

[00278] In this mode, sps_tmrl_enabled_flag is used to indicate the switching between TMRL and MRL.

[00279] If sps_tmrl_enabled_flag indicates that the current sequence is allowed to use TMRL mode (for example, the value of sps_tmrl_enabled_flag is 1) and the current block does not use TIMD mode, the decoder decodes the bitstream to obtain cu_tmrl_flag. If cu_tmrl_flag indicates that the current block uses TMRL mode (for example, cu_tmrl_flag is set to 1), the decoder decodes the bitstream to obtain tmrl_list_idx, determines a reference line and a prediction mode included in a combination indicated by tmrl_list_idx in the TMRL mode list as the reference line used by the current block and the prediction mode used by the current block. Then, the decoder performs prediction on the current block based on the reference line used by the current block and using the prediction mode used by the current block, to obtain a prediction block.

[00280] If sps_tmrl_enabled_flag indicates that the current sequence to which the current block belongs is not allowed to use TMRL mode (for example, the value of sps_tmrl_enabled_flag is 0) or the current block uses TIMD mode, or cu_tmrl_flag indicates that the current block does not use TMRL mode (for example, cu_tmrl_flag is set to 0), and furthermore, if sps_mrl_enabled_flag indicates that the current sequence is allowed to use MRL mode (for example, the value of sps_mrl_enabled_flag is 1) and the current block does not use TMRL mode, the decoder determines, based on whether the current block uses the Petition 870250090822, dated 06 / 10 / 2025, pp. 90 / 141 78 / 103 TIMD mode, the reference line used by the current block. For example, if the current block uses TIMD mode, the decoder decodes the bitstream to obtain intra_luma_ref_idx, where intra_luma_ref_idx indicates a reference line used when the current block uses TIMD mode. If the current block does not use TIMD mode, the decoder decodes the bitstream to obtain intra_luma_ref_idx, where intra_luma_ref_idx indicates a reference line used when the current block does not use TIMD mode.

[00281] It should be understood that the previous implementation of CU-level syntax elements in the sequence parameter set is only an example of this application and should not be understood as a limitation of this request. For example, in another alternative embodiment, a cu_tmrl_flag, intra_luma_ref_idx parsing condition, or an intra_luma_ref_idx parsing condition can be constructed based on flags in the sequence parameter set according to an actual requirement, which is not specifically limited in this request. Furthermore, as described above, when the value of a flag is 1, the current sequence is controlled or indicated to use a specific technology or mode; or when the value of a flag is 0, the current sequence is controlled or indicated not to use a specific technology or mode.In another alternative embodiment, when the value of a flag is 0, the current sequence can be controlled or indicated to use a specific technology or mode; or when the value of a flag is 1, the current sequence can be controlled or indicated not to use a specific technology or mode. This is not specifically limited in this application. Petition 870250090822, dated 06 / 10 / 2025, pp. 91 / 141 79 / 103

[00282] The above describes in detail the decoding method according to the embodiment of this application from the perspective of a decoder. Next, an encoding method according to an embodiment of this application is described from the perspective of an encoder with reference to Figure 7.

[00283] Figure 6 is a schematic flowchart of a 400 encoding method according to one embodiment of this application. It should be understood that the 400 encoding method can be executed by an encoder, which is applied, for example, to the 100 encoding framework shown in Figure 1.

[00284] As shown in Figure 6, the 400 coding method may include the following steps S410 and S420.

[00285] S410: A maximum number of reference lines allowed to be used by a current block is determined.

[00286] S420: the maximum number of lines is encoded.

[00287] In some configurations, S410 may include:

[00288] encode a first flag,

[00289] where the value of the first flag being a first value indicates that a current sequence to which the current block belongs does not use a multi-line reference MRL mode; or the value of the first flag being a second value different from the first value indicates that the current sequence uses MRL mode and indicates the maximum number of lines.

[00290] In some configurations, S410 may include:

[00291] encodes a second flag,

[00292] where the second flag indicates the maximum number of lines.

[00293] In some modalities, the 400 method may Petition 870250090822, dated 06 / 10 / 2025, p. 92 / 141 80 / 103 additionally include:

[00294] if the maximum number of lines exceeds a first predefined limit, encoding a third flag; and

[00295] if the third flag indicates that the current sequence allows a model-based multi-reference line TMRL mode, encoding a fourth flag,

[00296] where the fourth flag indicates whether the current block uses TMRL mode.

[00297] In some embodiments, if the third flag indicates that the current sequence is allowed to use TMRL mode and the current block does not use a model-based intramode derivation TIMD mode, the fourth flag is encoded.

[00298] In some modalities, method 400 may additionally include:

[00299] encode a third flag; and

[00300] if the third flag indicates that the current sequence allows a model-based multi-line reference TMRL mode and the maximum number of lines is greater than a first predefined threshold, encoding a fourth flag,

[00301] where the fourth flag indicates whether the current block uses TMRL mode.

[00302] In some modes, if the third flag indicates that the current sequence is allowed to use TMRL mode, the maximum number of lines is greater than the first predefined limit, and the current block does not use a model-based intramode TIMD derivation mode, the fourth Petition 870250090822, dated 06 / 10 / 2025, page 93 / 141 81 / 103 signal is coded.

[00303] In some modes, if the current sequence is allowed to use the multi-reference line MRL mode, the third flag is encoded.

[00304] In some embodiments, a fifth flag is encoded; and if the fifth flag indicates that a value of the third flag is not restricted or the fifth flag does not restrict a value of a flag used to indicate whether the current sequence is allowed to use the multi-reference line LMR mode, the third flag is encoded.

[00305] In some modes, a sixth flag is encoded; and if the sixth flag indicates that the current sequence is allowed to use a model-based mode, the third flag is encoded.

[00306] In some embodiments, a seventh flag is encoded; and if the seventh flag indicates that a value of the sixth flag is not restricted, the sixth flag is encoded.

[00307] In some modalities, method 400 may additionally include:

[00308] determine a reference line corresponding to the maximum number of lines allowed as a reference line to be used by the current block;

[00309] construct a list of TMRL modes based on the reference line allowed to be used by the current block and a prediction mode allowed to be used by the current block; and

[00310] encode a first index,

[00311] in which a reference line and a mode Petition 870250090822, dated 06 / 10 / 2025, pp. 94 / 141 82 / 103 predictions included in a combination indicated by the first index in the TMRL mode list are the reference line used by the current block and the prediction mode used by the current block.

[00312] In some implementations, for each of at least one combination obtained using the reference line allowed to be used by the current block and the prediction mode allowed to be used by the current block, a model of the current block is predicted based on a reference line of the combination and using a prediction mode of the combination, to obtain a prediction cost for each combination; based on the prediction cost of each combination, at least one combination is ranked in ascending order of prediction costs, to obtain a ranked combination; and a ranked combination in a high position in the ranked combination is determined as a combination in the TMRL mode list.

[00313] In some modalities, method 400 may additionally include:

[00314] determine, based on whether the current block uses the TIMD model-based intramode derivation mode, the reference line used by the current block, if the current block does not use the TMRL model-based multiple reference line mode.

[00315] In some modalities, method 400 may additionally include:

[00316] if the current block uses TIMD mode, encode a second index; or

[00317] If the current block does not use TIMD mode, encode a third index,

[00318] where the second index indicates a line of Petition 870250090822, dated 06 / 10 / 2025, page 95 / 141 83 / 103 is a reference used when the current block uses TIMD mode, and the third index indicates a reference line used when the current block does not use TIMD mode.

[00319] In some embodiments, an eighth flag is encoded; and if the eighth flag indicates that the current sequence to which the current block belongs is permitted to use the MRL multi-reference line mode and the current block does not use the TMRL mode, the reference line used by the current block is determined based on whether the current block uses the TIMD mode.

[00320] In some modes, if the maximum number of lines is greater than or equal to a second predefined limit, the eighth flag is encoded.

[00321] In some modes, if the eighth flag indicates that the current sequence is allowed to use the MRL mode with multiple reference lines, the maximum number of lines is greater than or equal to a second predefined limit, and the current block does not use the TMRL mode, the reference line used by the current block is determined based on whether the current block uses the TIMD mode.

[00322] It should be understood that the encoding method can be understood as a reverse process of a decoding method. Therefore, for a specific solution of encoding method 400, one can consult the relevant content of decoding method 300. For ease of description, the details are not described again in this application.

[00323] The foregoing describes in detail the preferred implementations of this application with reference to the attached drawings. However, this application is not limited to Petition 870250090822, dated 06 / 10 / 2025, page 96 / 141 84 / 103 specific details in the previous implementation. Within the scope of the technical concept of this application, a plurality of simple variations of the technical solutions of this application may be made, and these simple variations are all within the scope of protection of this application. For example, specific technical features described in the specific implementations above may be combined in any suitable manner without contradiction. To avoid unnecessary repetition, various possible ways of combination are not described separately in this application. As another example, any combination of different implementations of this application may be made, provided that the combination is not contrary to the idea of ​​this application; the combination shall also be considered as the content disclosed in this application. It should also be understood that, in the method modalities of this application, the sequence numbers of the processes mentioned above do not signify execution sequences.The sequence in which processes are executed must be determined according to the functions and internal logic of the processes, and should not be interpreted as any limitation on the implementation processes of the modalities of this request.

[00324] The method embodiments of this application are described in detail above. The apparatus embodiments of this application are described below in detail with reference to Figure 7 through Figure 9.

[00325] Figure 7 is a schematic block diagram of a 500 decoder according to an embodiment of this application.

[00326] As shown in Figure 7, the 500 decoder may include:

[00327] a first unit of determination 510, Petition 870250090822, dated 06 / 10 / 2025, page 97 / 141 85 / 103 is configured to determine a maximum number of reference lines allowed to be used by a current block;

[00328] a second determination unit 520, configured to determine, based on the maximum number of lines, whether the current block uses a model-based multi-line reference TMRL mode;

[00329] a third determination unit 530, configured to: if the current block uses TMRL mode, determine a reference line used by the current block and a prediction mode used by the current block; and

[00330] A 540 prediction unit, configured to perform prediction on the current block based on the reference line used by the current block and using the prediction mode used by the current block, to obtain a prediction block.

[00331] In some embodiments, the first unit of determination 510 is specifically configured for:

[00332] obtain a first flag,

[00333] where the value of the first flag is a first value indicating that the current sequence to which the current block belongs does not use a multi-line reference MRL mode; or the value of the first flag being a second value different from the first value indicates that the current sequence uses the MRL mode and indicates the maximum number of lines.

[00334] In some embodiments, the first unit of determination 510 is specifically configured for:

[00335] obtain a second beacon; and

[00336] determine a line quantity indicated by the second flag as the maximum line quantity.

[00337] In some modalities, the second unit Petition 870250090822, dated 06 / 10 / 2025, pp. 98 / 141 Determination 86 / 103 520 is specifically configured for:

[00338] if the maximum number of lines exceeds a first predefined threshold, obtain a third flag; and

[00339] if the third flag indicates that the current sequence to which the current block belongs can use TMRL mode, obtain a fourth flag,

[00340] where the fourth flag indicates whether the current block uses TMRL mode.

[00341] In some embodiments, the second unit of determination 520 is specifically configured for:

[00342] if the third flag indicates that the current sequence is allowed to use TMRL mode and the current block does not use a model-based intramodal derivation TIMD mode, obtain the fourth flag.

[00343] In some embodiments, the second unit of determination 520 is specifically configured for:

[00344] obtain a third signal; and

[00345] if the third flag indicates that the current sequence to which the current block belongs can use TMRL mode and the maximum number of lines is greater than a first predefined limit, obtain a fourth flag,

[00346] where the fourth flag indicates whether the current block uses TMRL mode.

[00347] In some embodiments, the second unit of determination 520 is specifically configured for:

[00348] if the third flag indicates that the current sequence is allowed to use TMRL mode, the maximum number of lines is greater than the first predefined limit, and the current block does not use a TIMD derivation mode. Petition 870250090822, dated 06 / 10 / 2025, pp. 99 / 141 87 / 103 intramode based on model, determine that the current block uses TMRL mode.

[00349] In some embodiments, the second unit of determination 520 is specifically configured for:

[00350] if the current sequence can use the LMR multi-reference line mode, obtain the third flag.

[00351] In some embodiments, the second unit of determination 520 is specifically configured for:

[00352] obtain a fifth signal; and

[00353] if the fifth flag indicates that a value of the third flag is not restricted or the fifth flag does not restrict a value of a flag used to indicate whether the current sequence can use the multi-reference line LMR mode, obtain the third flag.

[00354] In some embodiments, the second unit of determination 520 is specifically configured for:

[00355] obtain a sixth signal; and

[00356] if the sixth flag indicates that the current sequence is allowed to use a model-based mode, obtain the third flag.

[00357] In some embodiments, the second unit of determination 520 is specifically configured for:

[00358] obtain a seventh beacon; and

[00359] if the seventh flag indicates that a value of the sixth flag is not restricted, obtain the sixth flag.

[00360] In some embodiments, the third unit of determination 530 is specifically configured for:

[00361] determine a reference line Petition 870250090822, dated 06 / 10 / 2025, pp. 100 / 141 88 / 103 corresponds to the maximum number of lines allowed as a reference line to be used by the current block;

[00362] construct a list of TMRL modes based on the reference line allowed to be used by the current block and a prediction mode allowed to be used by the current block;

[00363] obtain a first index; and

[00364] determine a reference line and a prediction mode that are included in a combination indicated by the first index in the TMRL mode list as the reference line used by the current block and the prediction mode used by the current block.

[00365] In some embodiments, the third unit of determination 530 is specifically configured for:

[00366] for each of at least one combination obtained using the reference line allowed to be used by the current block and the prediction mode allowed to be used by the current block, predict a model of the current block based on a reference line of the combination and using a prediction mode of the combination, to obtain a prediction cost for each combination;

[00367] classify, based on the prediction cost of each combination, at least one combination in ascending order of prediction costs, to obtain a ranked combination; and

[00368] determine a combination with a high ranking in the combination classified as a combination in the TMRL mode list.

[00369] In some modes, the 540 prediction unit is additionally configured to: Petition 870250090822, dated 06 / 10 / 2025, pp. 101 / 141 89 / 103

[00370] determine, based on whether the current block uses TIMD mode, the reference line used by the current block, if the current block does not use the model-based multiple reference line TMRL mode.

[00371] In some modes, the 540 prediction unit is specifically configured to:

[00372] if the current block uses TIMD mode, obtain a second index; or

[00373] if the current block does not use TIMD mode, obtain a third index,

[00374] where the second index indicates a reference line used when the current block uses TIMD mode, and the third index indicates a reference line used when the current block does not use TIMD mode.

[00375] In some modes, the 540 prediction unit is specifically configured to:

[00376] obtain an eighth signal; and

[00377] if the eighth flag indicates that the current sequence to which the current block belongs is allowed to use the MRL multi-reference line mode and the current block does not use the TMRL mode, determine, based on the fact that the current block uses the TIMD mode, the reference line used by the current block.

[00378] In some modes, the 540 prediction unit is specifically configured to:

[00379] if the maximum number of lines is greater than or equal to a second predefined limit, obtain the eighth flag.

[00380] In some modes, the 540 prediction unit is specifically configured to: Petition 870250090822, dated 06 / 10 / 2025, pp. 102 / 141 90 / 103

[00381] If the eighth flag indicates that the current sequence can use the MRL multi-reference line mode, the maximum number of lines is greater than or equal to a second predefined limit, and the current block does not use the TMRL mode, determine, based on whether the current block uses the TIMD mode, the reference line used by the current block.

[00382] Figure 8 is a schematic block diagram of a 600 encoder, according to an embodiment of this application.

[00383] As shown in Figure 8, the 600 encoder may include:

[00384] a determination unit 610, configured to determine a maximum number of reference lines that can be used by a current block; and

[00385] a 620 encoding unit, configured to encode the maximum number of lines.

[00386] In some embodiments, the unit of determination 610 is specifically configured for:

[00387] encode a first flag,

[00388] where the value of the first flag is a first value indicating that the current sequence to which the current block belongs does not use a multi-line reference MRL mode; or the value of the first flag being a second value different from the first value indicates that the current sequence uses the MRL mode and indicates the maximum number of lines.

[00389] In some forms, the unit of determination 610 is specifically configured for:

[00390] encode a second flag,

[00391] where the second flag indicates the maximum number of lines. Petition 870250090822, dated 06 / 10 / 2025, pp. 103 / 141 91 / 103

[00392] In some modes, the 620 encoding unit is additionally configured for:

[00393] if the maximum number of lines exceeds a first predefined limit, encode a third flag; and

[00394] If the third flag indicates that the current sequence is allowed to use a model-based multi-reference TMRL mode, encode a fourth flag,

[00395] where the fourth flag indicates whether the current block uses TMRL mode.

[00396] In some modes, the 620 encoding unit is specifically configured for:

[00397] if the third flag indicates that the current sequence is allowed to use TMRL mode and the current block does not use a model-based intramodal derivation TIMD mode, encode the fourth flag.

[00398] In some modes, the 620 encoding unit is additionally configured for:

[00399] encode a third flag; and

[00400] If the third flag indicates that the current sequence is allowed to use a model-based multi-line reference TMRL mode and the maximum number of lines is greater than a first predefined limit, encode a fourth flag,

[00401] where the fourth flag indicates whether the current block uses TMRL mode.

[00402] In some modes, the 620 encoding unit is specifically configured for:

[00403] if the third flag indicates that the Petition 870250090822, dated 06 / 10 / 2025, pp. 104 / 141 92 / 103 current sequence is allowed to use TMRL mode, the maximum number of lines is greater than the first predefined limit and the current block does not use a model-based intramodal derivation TIMD mode, encode the fourth flag.

[00404] In some modes, the 620 encoding unit is specifically configured for:

[00405] if the current sequence is allowed to use the multi-line reference MRL mode, encode the third flag.

[00406] In some modes, the 620 encoding unit is specifically configured for:

[00407] encode a fifth flag; and

[00408] if the fifth flag indicates that a value of the third flag is not restricted or the fifth flag does not restrict a value of a flag used to indicate whether the current sequence can use the multi-reference line MRL mode, encode the third flag.

[00409] In some modes, the 620 encoding unit is specifically configured for:

[00410] encode a sixth flag; and

[00411] if the sixth flag indicates that the current sequence is allowed to use a model-based mode, encode the third flag.

[00412] In some modes, the 620 encoding unit is specifically configured for:

[00413] encode a seventh flag; and

[00414] if the seventh flag indicates that a value of the sixth flag is not restricted, encode the sixth flag.

[00415] In some modalities, the unit of Petition 870250090822, dated 06 / 10 / 2025, pp. 105 / 141 93 / 103 encoding 620 is additionally configured for:

[00416] determine a reference line corresponding to the maximum number of lines allowed as a reference line to be used by the current block;

[00417] construct a list of TMRL modes based on the reference line allowed to be used by the current block and a prediction mode allowed to be used by the current block;

[00418] encode a first index,

[00419] where a reference line and a prediction mode included in a combination indicated by the first index in the TMRL mode list are the reference line used by the current block and the prediction mode used by the current block.

[00420] In some modes, the 620 encoding unit is specifically configured for:

[00421] for each of at least one combination obtained using the reference line allowed to be used by the current block and the prediction mode allowed to be used by the current block, predict a model of the current block based on a reference line of the combination and using a prediction mode of the combination, to obtain a prediction cost for each combination;

[00422] classify, based on the prediction cost of each combination, at least one combination in ascending order of prediction costs, to obtain a ranked combination; and

[00423] determine a combination with a high ranking in the combination classified as a combination in the TMRL mode list.

[00424] In some modalities, the unit of Petition 870250090822, dated 06 / 10 / 2025, pp. 106 / 141 94 / 103 determination 610 is additionally configured to:

[00425] determine, based on whether the current block uses the TIMD model-based intramodal derivation mode, the reference line used by the current block, if the current block does not use the TMRL model-based multiple reference line mode.

[00426] In some modes, the 620 encoding unit is additionally configured for:

[00427] if the current block uses TIMD mode, encode a second index; or

[00428] If the current block does not use TIMD mode, encode a third index,

[00429] where the second index indicates a reference line used when the current block uses TIMD mode, and the third index indicates a reference line used when the current block does not use TIMD mode.

[00430] In some modes, the 620 encoding unit is specifically configured for:

[00431] encode an eighth flag;

[00432] where the determination unit 610 is specifically configured for:

[00433] if the eighth flag indicates that the current sequence to which the current block belongs is allowed to use the MRL multi-reference line mode and the current block does not use the TMRL mode, determine, based on the fact that the current block uses the TIMD mode, the reference line used by the current block.

[00434] In some embodiments, the unit of determination 610 is additionally configured for:

[00435] if the maximum number of lines is greater Petition 870250090822, dated 06 / 10 / 2025, pp. 107 / 141 95 / 103 or equal to a second predefined limit, encode the eighth flag.

[00436] In some embodiments, the unit of determination 610 is additionally configured for:

[00437] If the eighth flag indicates that the current sequence can use the MRL multi-reference line mode, the maximum number of lines is greater than or equal to a second predefined limit, and the current block does not use the TMRL mode, determine, based on whether the current block uses the TIMD mode, the reference line used by the current block.

[00438] It should be understood that the apparatus embodiments may correspond to the embodiments of the method. For similar descriptions, one may refer to the embodiments of the method. To avoid repetition, the details are not described again in this document. Specifically, the 500 decoder shown in Figure 7 may correspond to a corresponding implementing organ in method 300 in embodiments of this application. Furthermore, the operations and / or functions mentioned and others of the units in the 500 decoder are used separately to implement corresponding procedures in methods such as method 300. The 600 encoder shown in Figure 8 may correspond to a corresponding implementing organ in method 400 in embodiments of this application. That is, the operations and / or functions mentioned above and others of the units in the 600 encoder are used separately to implement corresponding procedures in methods such as method 400.

[00439] It should also be understood that the units in the 500 decoder or the 600 encoder in embodiments of this application may be separately or fully combined into one or more additional units, or some unit(s) in Petition 870250090822, dated 06 / 10 / 2025, pp. 108 / 141 The 96 / 103 encoder 500 or decoder 600 can be further divided into a plurality of smaller functional units. This can perform the same operations without affecting the implementation of the technical effects of the embodiments of this application. The aforementioned units are obtained through partitioning based on logical functions. In actual application, a function of one unit can also be implemented by a plurality of units, or a function of a plurality of units can be implemented by one unit. In another embodiment of this application, the decoder 500 or encoder 600 can also include other units. In actual application, these functions can also be implemented with the assistance of the other units and can be implemented by a plurality of units in a cooperative manner.According to another embodiment of this application, the 500 decoder or the 600 encoder in embodiments of this application may be constructed and the encoding method or the decoding method in embodiments of this application may be implemented by executing a computer program (including program code) capable of performing the steps of the corresponding method on a general-purpose computing device of a general-purpose computer, including processing elements and storage elements, such as a central processing unit (CPU), a random access storage medium (RAM), and a read-only storage medium (ROM). The computer program may be written to, for example, a computer-readable storage medium, loaded onto an electronic device via the computer-readable storage medium, and executed on it to implement the corresponding method. Petition 870250090822, dated 06 / 10 / 2025, pp. 109 / 141 97 / 103 modalities of this request.

[00440] In other words, the units mentioned above can be implemented in hardware form, can be implemented in the form of software instructions, or can be implemented in the form of a combination of hardware and software. Specifically, the steps of the method embodiments in the embodiments of this application can be accomplished by means of a hardware integrated logic circuit in a processor and / or instructions in software form. The steps of the methods disclosed in reference to the embodiments of this application can be performed directly by a hardware decoding processor, or can be performed using a combination of hardware in the decoding processor and software.Optionally, the software may be located on 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, or a register. The storage medium is located in memory. The processor reads information from memory and executes the related steps in the previously mentioned method modalities in combination with the processor hardware.

[00441] Figure 9 is a schematic diagram of the structure of an electronic device 700 according to an embodiment of this application.

[00442] As shown in Figure 9, the electronic device 700 includes at least one processor 710 and a computer-readable storage medium 720. The processor 710 and the computer-readable storage medium 720 can be connected via a bus. Petition 870250090822, dated 06 / 10 / 2025, pp. 110 / 141 98 / 103 or otherwise. The computer-readable storage medium 720 is configured to store a computer program 721. The computer program 721 includes computer instructions. The processor 710 is configured to execute the computer instructions stored on the computer-readable storage medium 720. The processor 710 is a computing core and control core of the electronic device 700, and is adapted to implement one or more computer instructions, and specifically adapted to load and execute one or more computer instructions to implement corresponding method procedures or corresponding functions.

[00443] For example, the 710 processor may also be referred to as a Central Processing Unit (CPU). The 710 processor may include, but is not limited to: 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 device, a transistor logic device, or a discrete hardware component.

[00444] For example, the computer-readable storage medium 720 may be high-speed RAM, or it may be non-volatile memory, for example, at least magnetic disk memory; and optionally, it may be at least one computer-readable storage medium that is located away from the aforementioned processor 710. Specifically, the computer-readable storage medium 720 includes, Petition 870250090822, dated 06 / 10 / 2025, pp. 111 / 141 99 / 103, however, without limitation: volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM) and is used as an external cache.By way of example, and not as a limiting description, many forms of RAM are available, for example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchlink dynamic random access memory (SLDRAM), and direct rambus random access memory (DR RAM).

[00445] For example, electronic device 700 may be an encoder or related encoding structure in embodiments of this application; a first computer instruction is stored on computer-readable storage media 720; and processor 710 loads and executes the first computer instruction stored on computer-readable storage media 720 to implement the corresponding steps in the encoding method provided in embodiments of this application. In other words, the first computer instruction on computer-readable storage media Petition 870250090822, dated 06 / 10 / 2025, pp. 112 / 141 The 100 / 103 computer 720 is loaded by the 710 processor and the corresponding steps are executed. To avoid repetition, the details are not described in this document.

[00446] For example, the electronic device 700 may be a decoder or a related decoding structure in embodiments of this application; a second computer instruction is stored in the computer-readable storage medium 720; and the processor 710 loads and executes the second computer instruction stored in the computer-readable storage medium 720 to implement the corresponding steps in the decoding method provided in embodiments of this application. In other words, the second computer instruction in the computer-readable storage medium 720 is loaded by the processor 710 and the corresponding steps are executed. To avoid repetition, the details are not described herein.

[00447] According to another aspect of this application, this application further provides an encoding and decoding system, including the encoder and decoder mentioned above.

[00448] According to another aspect of this application, this application further provides a computer-readable storage medium (Memory), wherein the computer-readable storage medium is a memory device in the electronic device 700 and is configured to store programs and data, for example, a computer-readable storage medium 720. It may be understood that the computer-readable storage medium 720 in the present document may include both a storage medium embedded in the electronic device 700 and an extended storage medium with Petition 870250090822, dated 06 / 10 / 2025, pp. 113 / 141 101 / 103 support in the electronic device 700. The computer-readable storage media provides a storage space in which an operating system of the electronic device 700 is stored. In addition, one or more computer instructions suitable for loading and execution by the processor 710 are also stored in the storage space. These computer instructions may be one or more computer programs 721 (including program code).

[00449] According to another aspect of this application, this application also provides a computer program product or a computer program, wherein the computer program product or computer program includes computer instructions, stored on a computer-readable storage medium and is, for example, a computer program 721. In this case, the data processing device 700 may be a computer, the processor 710 reads the computer instructions from a computer-readable storage medium 720, and the processor 710 executes the computer instructions, such that the computer executes the provided encoding method or decoding method in various optional ways mentioned above.

[00450] In other words, when software is used to implement the modalities, the above modalities may be implemented wholly or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, procedures of the modalities of this application are executed wholly or partially, or functions of the modalities of this application are performed. The computer may be Petition 870250090822, dated 06 / 10 / 2025, pp. 114 / 141 102 / 103 a general-purpose computer, a dedicated computer, a computer network, or other programmable device. Computer instructions may be stored on a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from one site, computer, server, or data center to another site, computer, server, or data center in a wired manner (e.g., via coaxial cable, fiber optic cable, or digital subscriber line (DSL)) or in a wireless manner (e.g., infrared, wireless, and microwave).

[00451] A person with ordinary skill in the art may be aware that, in combination with the examples described in the embodiments disclosed in this descriptive report, units and procedural steps may be implemented by electronic hardware or by a combination of computer software and electronic hardware. Whether the functions are performed by hardware or software depends on particular applications and the design constraints of the technical solutions. A person skilled in the art may use different methods to implement the described functions for each specific application, but the implementation should not be considered to go beyond the scope of this application.

[00452] Finally, it should be noted that the above content constitutes only specific implementations of this application, but is not intended to limit the scope of protection of this application. Any variation or substitution readily determined by a person skilled in the art within the scope of the art. Petition 870250090822, dated 06 / 10 / 2025, pp. 115 / 141 103 / 103 disclosed in this application. The application must be within the scope of protection. Therefore, the scope of protection of this application is within the scope of protection of the claims. Petition 870250090822, dated 06 / 10 / 2025, pp. 116 / 141

Claims

1 / 5 CLAIMS 1. DECODING METHOD characterized by comprising: determining a maximum number of reference lines allowed to be used by a current block; determining, based on the maximum number of lines, whether the current block uses a multi-reference-line model-based TMRL mode; if the current block uses the TMRL mode, determining a reference line used by the current block and a prediction mode used by the current block; and performing prediction on the current block based on the reference line used by the current block and using the prediction mode used by the current block, to obtain a prediction block.

2. METHOD, according to claim 1, characterized by determining the maximum number of reference lines that can be used by the current block comprising: obtaining a first flag, wherein a value of the first flag being a first value indicates that a current sequence to which the current block belongs does not use a multiple reference line MRL mode; or the value of the first flag being a second value different from the first value indicates that the current sequence uses the MRL mode and indicates the maximum number of lines.

3. METHOD, according to claim 1, characterized by determining the maximum number of reference lines that can be used by the current block comprising: obtaining a second flag; and Petition 870250090822, dated 06 / 10 / 2025, page 8 / 141 2 / 5 determining a line quantity indicated by the second flag as the maximum line quantity.

4. METHOD, according to any one of claims 1 to 3, characterized by determining, based on the maximum number of lines, whether the current block uses the model-based multi-line reference TMRL mode, comprising: obtaining a third flag; and if the third flag indicates that the current sequence to which the current block belongs is allowed to use the TMRL mode and the maximum number of lines is greater than a first predefined limit, obtaining a fourth flag, wherein the fourth flag indicates whether the current block uses the TMRL mode.

5. METHOD, according to claim 4, characterized by obtaining the fourth flag understanding: if the third flag indicates that the current sequence to which the current block belongs is allowed to use TMRL mode, and if the current block is not located in a first line of a CTU, obtain the fourth flag.

6. METHOD, according to claim 4, characterized by obtaining the fourth flag comprising: if the third flag indicates that the current sequence is allowed to use TMRL mode, the maximum line quantity is greater than the first predefined limit and the current block does not use a model-based intramode derivation TIMD mode, determine that the current block uses TMRL mode.

7. METHOD, according to any one of claims 1 to 6, characterized in that the method further comprises: Petition 870250090822, dated 06 / 10 / 2025, page 9 / 141 3 / 5 determining, based on whether the current block uses the model-based intramode TIMD derivation mode, the reference line used by the current block, if the current block does not use the TMRL mode.

8. METHOD, according to claim 7, characterized by determining, based on whether the current block uses the TIMD model-based intramode derivation mode, the reference line used by the current block if the current block does not use the TMRL mode, comprising: obtaining an eighth beacon; and if the eighth beacon indicates that the current sequence to which the current block belongs may use the MRL multi-reference line mode and the current block does not use the TMRL mode, determining, based on whether the current block uses the TIMD mode, the reference line used by the current block.

9. CODING METHOD characterized by comprising: determining a maximum number of reference lines allowed to be used by a current block; and encoding the maximum number of lines.

10. METHOD, according to claim 9, characterized by encoding the maximum number of lines comprising: encoding a first flag, wherein a value of the first flag being a first value indicates that a current sequence to which the current block belongs does not use a multi-reference line MRL mode; or the value of the first flag being a second value different from the first value indicates that the current sequence uses the MRL mode and indicates the maximum number of lines. Petition 870250090822, dated 06 / 10 / 2025, p. 10 / 141 4 / 5 11. METHOD, according to claim 9, characterized by encoding the maximum number of lines comprising: encoding a second flag, wherein the second flag indicates the maximum number of lines.

12. METHOD, according to any one of claims 9 to 11, characterized in that the method further comprises: encoding a third flag; and if the third flag indicates that the current sequence may use a model-based multi-line reference TMRL mode and the maximum number of lines is greater than a first predefined limit, encoding a fourth flag, wherein the fourth flag indicates whether the current block uses the TMRL mode.

13. METHOD, according to claim 12, characterized by encoding the fourth flag comprising: if the third flag indicates that the current sequence to which the current block belongs is allowed to use TMRL mode, and if the current block is not located on a first line of a CTU, encode the fourth flag; or if the third flag indicates that the current sequence is allowed to use TMRL mode, the maximum line quantity is greater than the first predefined threshold, and the current block does not use a model-based intramodal derivation TIMD mode, encode the fourth flag. Petition 870250090822, dated 06 / 10 / 2025, p. 11 / 141 5 / 5 14. METHOD, according to any one of claims 9 to 13, characterized in that the method further comprises: determining, based on whether the current block uses the model-based intramode TIMD derivation mode, the reference line used by the current block if the current block does not use the model-based multi-reference line TMRL mode; wherein determining, based on whether the current block uses the model-based intramode TIMD derivation mode, the reference line used by the current block if the current block does not use the TMRL mode comprises: encoding an eighth flag; and if the eighth flag indicates that the current sequence to which the current block belongs is allowed to use the multi-reference line MRL mode and the current block does not use the TMRL mode, determining, based on whether the current block uses the TIMD mode, the reference line used by the current block.

15. NON-TRANSIENT COMPUTER-READABLE STORAGE MEDIA characterized by storing computer instructions and a bitstream wherein the computer instructions are executed on a computer to perform the method, as defined in any one of claims 9 to 14, to generate the bitstream. Petition 870250090822, dated 10 / 06 / 2025, p. 12 / 141