Decoding method, encoding method, decoder, and encoder
The decoding method optimizes digital video compression by determining reference lines and using TMRL mode to enhance decoding efficiency and reduce bandwidth in high-resolution video transmission.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2023-04-11
- Publication Date
- 2026-04-14
AI Technical Summary
Existing digital video compression standards face challenges in reducing bandwidth and traffic pressure while improving decoding performance, particularly in high-resolution video transmission.
Implementing a decoding method that determines the maximum number of reference lines and uses a template-based multi-reference line (TMRL) mode to predict blocks, enhancing decoding efficiency.
Improves decoding performance by optimizing the use of reference lines and prediction modes, thereby reducing bandwidth and traffic pressure in digital video transmission.
Smart Images

Figure 2026512086000001_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of encoding and decoding technologies, and more specifically, to a decoding method, an encoding method, a decoder, and an encoder.
Background Art
[0002] Digital video compression technology mainly compresses huge digital video data so as to facilitate transmission and storage, etc. With the rapid increase of Internet videos and the increasing demand for video resolution by people, although the existing digital video compression standards can realize video restoration technology, currently, there is still a need for a better digital video restoration technology to reduce the bandwidth and traffic pressure of digital video transmission and improve the decoding performance of the decoder.
Summary of the Invention
Problems to be Solved by the Invention
[0003] [[ID=2I]] Embodiments of the present invention provide a decoding method, an encoding method, a decoder, and an encoder, which can improve the decoding performance of the decoder.
Means for Solving the Problems
[0004] As a first aspect, embodiments of the present invention include: determining the maximum number of reference lines permitted to be used in the current block; determining whether a template-based multi-reference line TMRL mode is used in the current block based on the maximum number of lines; if the TMRL mode is used in the current block, determining the reference lines used in the current block and the prediction mode used in the current block; predicting the current block using the prediction mode used in the current block based on the reference lines used in the current block to obtain a predicted block. A decoding method including the above is provided.
[0005] In a second aspect, the embodiments of the present invention are as follows: Currently, the maximum number of reference rows allowed in a block is determined, The present invention provides an encoding method that includes encoding the maximum number of lines.
[0006] In a third aspect, the embodiment of the present invention is as follows: A first decision unit configured to determine the maximum number of reference rows currently allowed to be used in a block, A second decision unit configured to determine whether a template-based multi-reference row TMRL mode is used in the current block based on the maximum number of rows, If the TMRL mode is used in the current block, a third decision unit is configured to determine the reference row used in the current block and the prediction mode used in the current block, A decoder is provided which includes a prediction unit configured to predict the current block using the prediction mode used in the current block, based on the reference row used in the current block, in order to obtain a predicted block.
[0007] In a fourth aspect, the embodiment of the present invention is as follows: A decision unit configured to determine the maximum number of reference rows currently allowed in a block, The present invention provides an encoder including an encoding unit configured to encode the maximum number of lines.
[0008] In a fifth aspect, the embodiment of the present invention is as follows: A processor suitable for implementing computer instructions, A computer-readable storage medium and a decoder are provided, A computer-readable storage medium stores computer instructions, which are loaded by a processor and are suitable for executing the decoding method in the first embodiment or each implementation thereof described above.
[0009] In one implementation, the processor is one or more, and the memory is one or more.
[0010] In one implementation, the computer-readable storage medium may be integrated with the processor, or it may be provided separately from the processor.
[0011] In a sixth aspect, the embodiment of the present invention is as follows: A processor suitable for implementing computer instructions, A computer-readable storage medium and an encoder are provided, Computer-readable storage media store computer instructions, which are loaded by a processor and are suitable for executing the encoding methods in the second embodiment or each implementation thereof described above.
[0012] In one implementation, the processor is one or more, and the memory is one or more.
[0013] In one implementation, the computer-readable storage medium may be integrated with the processor, or it may be provided separately from the processor.
[0014] In a seventh aspect, an embodiment of the present invention provides a computer-readable storage medium in which computer instructions are stored, and when the computer instructions are read and executed by the processor of a computer device, the computer device is made to execute the decoding method according to the first aspect or the encoding method according to the second aspect mentioned above.
[0015] In an eighth aspect, an embodiment of the present invention provides a computer program product or computer program, the computer program product or computer program including computer instructions, the computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, thereby causing the computer device to execute the decoding method according to the first aspect or the encoding method according to the second aspect mentioned above.
[0016] In a ninth aspect, an embodiment of the present invention provides a bitstream which is a bitstream according to the method of the first aspect mentioned above or a bitstream generated by the method of the second aspect mentioned above. [Effects of the Invention]
[0017] Based on the above technical embodiments, when a decoder predicts the current block, it first determines the maximum number of reference lines permitted to be used in the current block, then determines whether or not TMRL mode is used in the current block based on the maximum number of lines, and if TMRL mode is used in the current block, it determines the reference lines used in the current block and the prediction mode used in the current block, and then predicts the current block using the prediction mode used in the current block based on the reference lines used in the current block to obtain a predicted block. In other words, when a decoder decides whether or not to predict the current block using TMRL mode, it is necessary to determine whether or not TMRL mode is used in the current block based on the maximum number of lines, so that when TMRL mode is used in the current block, the maximum number of lines can satisfy the usage condition, and decoding performance can be further improved. [Brief explanation of the drawing]
[0018] [Figure 1] This is a schematic block diagram of an encoding framework according to an embodiment of the present invention. [Figure 2] It is a schematic block diagram of a decoding framework according to an embodiment of the present invention. [Figure 3] It is an example of four reconstructed rows located around the current block according to an embodiment of the present invention. [Figure 4] It is an example of a template and each reference row located around the current block according to an embodiment of the present invention. [Figure 5] It is a schematic flowchart of a decoding method according to an embodiment of the present invention. [Figure 6] It is a schematic flowchart of an encoding method according to an embodiment of the present invention. [Figure 7] It is a schematic block diagram of a decoder according to an embodiment of the present invention. [Figure 8] It is a schematic block diagram of an encoder according to an embodiment of the present invention. [Figure 9] It is a schematic block diagram of an electronic device according to an embodiment of the present invention.
Mode for Carrying Out the Invention
[0019] Hereinafter, referring to the drawings, the technical aspects in the embodiments of the present invention will be described.
[0020] Embodiments of the present invention are applicable to the field of digital video coding, which includes, but is not limited to, the field of image coding and decoding, video coding and decoding, hardware video coding and decoding, dedicated circuit video coding and decoding, and real-time video coding and decoding. Furthermore, embodiments of the present invention are compatible with Audio Video Coding Standards (AVS), second-generation AVS standards (AVS2), or third-generation AVS standards (AVS3). This includes, but is not limited to, the H.264 / Audio Video Coding (AVC) standard, the H.265 / High Efficiency Video Coding (HEVC) standard, and the H.266 / Versatile Video Coding (VVC) standard. Moreover, embodiments of the present invention can be used to perform lossy compression on images, and can also be used to perform lossless compression on images. In this case, the lossless compression may be visually lossless compression or mathematically lossless compression.
[0021] All video coding and decoding standards employ a block-based hybrid coding framework.
[0022] Each frame in a video is divided into square largest coding units (LCUs) or coding tree units (CTUs) of the same size (e.g., 128x128, 64x64, etc.). Each largest coding unit or coding tree unit can be divided into rectangular coding units (CUs) according to rules. Coding units can be further divided into prediction units (PUs), transform units (TUs), etc. The hybrid coding framework includes modules such as prediction, transform, quantization, entropy coding, and in-loop filtering. The prediction module includes intra-prediction and inter-prediction. Inter-prediction includes motion estimation and motion compensation. Because there is a strong correlation between adjacent pixels in a single frame of video, intra-prediction methods are used in video coding and decoding techniques to remove spatial redundancy between adjacent pixels. Intra-prediction refers only to image information from the same frame and predicts pixel information within the currently divided block. Because there is strong similarity between adjacent frames in video, inter-prediction methods are used in video coding and decoding techniques to remove temporal redundancy between adjacent frames, thereby improving coding efficiency. Inter-prediction can refer to image information from different frames and utilizes motion estimation to find the motion vector information that best matches the currently divided block. Regarding transformation, the predicted image block can be transformed into the frequency domain, the energy redistributed, and combined with quantization to remove information that is not sensitive to the human eye; this is used to remove visual redundancy. Entropy coding can remove code redundancy based on the current context model and the probabilistic information of the binary bitstream.
[0023] The basic flow of a video encoder and decoder is as follows:
[0024] On the encoding side, the image of one frame is divided into blocks, intra-prediction or inter-prediction is used on the current block to generate a predicted block of the current block, the predicted block is subtracted from the original image block of the current block to obtain a residual block, transformation and quantization are performed on the residual block to obtain a quantization coefficient matrix, entropy coding is performed on the quantization coefficient matrix and output to the bitstream. On the decoding side, intra-prediction or inter-prediction is used on the current block to generate a predicted block of the current block, while simultaneously analyzing the bitstream to obtain a quantization coefficient matrix, inverse quantization and inverse transformation are performed on the quantization coefficient matrix to obtain a residual block, and the predicted block and residual block are added to obtain a reconstructed block. The reconstructed block constitutes a reconstructed image, and intra-loop filtering is performed on the reconstructed image based on the image or block to obtain a decoded image. On the encoding side, it is necessary to obtain a decoded image by operations similar to those on the decoding side. The decoded image may be used as a reference frame for inter-prediction for subsequent frames. Mode information or parameter information such as block division information, prediction, transformation, quantization, entropy coding, and intra-loop filtering determined by the encoding side should be output to the bitstream as needed. The decoding side determines the same block partitioning information, prediction, transformation, quantization, entropy coding, and mode or parameter information such as intra-loop filtering as the encoding side through analysis and analysis based on existing information, thereby ensuring that the decoded image obtained by the decoding side is the same as the decoded image obtained by the encoding side. The decoded image obtained by the encoding side is usually also called the reconstructed image. During prediction, the current block can be partitioned into prediction units, and during transformation, the current block can be partitioned into transformation units, although the partitioning of the prediction units and transformation units may differ. The above is the basic flow of a video encoder and decoder in a block-based hybrid coding framework, and as technology advances, some modules or steps of this framework or flow may be optimized, and the present invention is not specifically limited thereto.
[0025] The current block may be the current coding unit (CU) or the current prediction unit (PU), etc.
[0026] The encoding side must similarly obtain the decoded image using operations similar to those of the decoding side. The decoded image may be used as a reference frame for interpretation for subsequent frames. Mode information or parameter information such as block partitioning information, prediction, transformation, quantization, entropy coding, and intra-loop filtering determined by the encoding side must be output to the bitstream as needed. The decoding side determines the same block partitioning information, prediction, transformation, quantization, entropy coding, and intra-loop filtering mode information or parameter information as the encoding side through analysis and analysis based on existing information, thereby ensuring that the decoded image obtained by the decoding side is the same as the decoded image obtained by the encoding side. The decoded image obtained by the encoding side is usually also called the reconstructed image. During prediction, the current block can be divided into prediction units, and during transformation, the current block can be divided into transformation units, and the division of the prediction units and transformation units may be the same or different. Of course, the above is merely a basic flow of a video encoder and decoder in a block-based hybrid coding framework, and as technology advances, some modules of the framework or some steps of the flow may be optimized. The present invention applies to the basic flow of a video encoder and decoder in said block-based hybrid coding framework.
[0027] Figure 1 is a schematic block diagram of an encoding framework 100 according to an embodiment of the present invention.
[0028] As shown in Figure 1, the coding framework 100 may include an intra-prediction unit 180, an inter-prediction unit 170, a residual unit 110, a transform / quantization unit 120, an entropy coding unit 130, an inverse transform / inverse quantization unit 140, and an in-loop filtering unit 150. Selectively, the coding framework 100 may further include a decoded image buffering unit 160. The coding framework 100 may be called a hybrid framework coding mode.
[0029] Of these, the intra-prediction unit 180 or inter-prediction unit 170 can make predictions on the image block to be encoded and output the predicted block. The residual unit 110 can calculate the residual block, i.e., the difference between the predicted block and the image block to be encoded, based on the predicted block and the image block to be encoded. The transformation / quantization unit 120 is used to remove visual redundancy by performing operations such as transformation and quantization on the residual block and removing information that is not sensitive to the human eye. Selectively, the residual block before transformation and quantization by the transformation / quantization unit 120 may be called a time-domain residual block, and the time-domain residual block after transformation and quantization by the transformation / quantization unit 120 may be called a frequency residual block or frequency-domain residual block. The entropy coding unit 130 can receive the transformation / quantization coefficients output from the transformation / quantization unit 120 and output a bitstream based on the transformation / quantization coefficients. For example, the entropy coding unit 130 can remove code redundancy based on the target context model and the probability information of the binary bitstream. For example, the entropy coding unit 130 can be used for context-based adaptive binary arithmetic entropy coding (CABAC). The entropy coding unit 130 may also be called a header information coding unit. Optionally, in the present invention, the image block to be coded may be called an original image block or a target image block, the prediction block may be called a prediction image block or an image prediction block, or a prediction signal or prediction information, and the reconstruction block may be called a reconstruction image block or an image reconstruction block, or a reconstruction signal or reconstruction information. Furthermore, with respect to the coding side, the image block to be coded may be called a coding block or a coded image block, and with respect to the decoding side, the image block to be coded may be called a decoding block or a decoded image block. The image block to be coded may be a CTU or a CU.
[0030] The encoding framework 100 calculates residuals from the prediction block and the image block to be encoded, and transmits the resulting residual block to the decoding side through processes such as transformation and quantization. Correspondingly, the decoding side receives and analyzes the bitstream, obtains a residual block through steps such as inverse transformation and inverse quantization, and superimposes the residual block onto the prediction block obtained by the decoding side to obtain a reconstructed block.
[0031] Furthermore, the inverse transform / inverse quantization unit 140, the in-loop filtering unit 150, and the decoded image buffering unit 160 in the encoding framework 100 can be used to form a decoder. This corresponds to the intra-prediction unit 180 or inter-prediction unit 170 being able to predict the image block to be encoded based on existing reconstruction blocks, thereby ensuring that the encoding and decoding sides have a consistent understanding of the reference frame. In other words, the encoder can copy the decoder's processing loop, thereby enabling it to produce the same predictions as the decoding side. Specifically, the quantized transformation coefficients are copied to the approximate residual block on the decoding side by the inverse transform and inverse quantization of the inverse transform / inverse quantization unit 140. After the approximate residual block is added to the prediction block, it passes through the in-loop filtering unit 150, where it can be smoothed and filtered to remove effects such as blocking artifacts caused by processing and quantization based on the block. The image block output from the in-loop filtering unit 150 can be stored in the decoded image buffering unit 160 for use in predicting subsequent images.
[0032] It should be understood that Figure 1 is merely an example of the present invention and does not limit the present invention.
[0033] For example, the in-loop filtering unit 150 in the encoding framework 100 may include a deblocking filter (DBF) and sample-adaptive offset filtering (SAO). The role of the DBF is to remove blocking artifacts, and the role of the SAO is to remove ringing artifacts. In other embodiments of the present invention, the encoding framework 100 may employ a neural network-based in-loop filtering algorithm to improve the video compression efficiency. Alternatively, the encoding framework 100 may be a deep learning-based neural network video encoding hybrid framework. In one implementation, the result after filtering pixels based on the deblocking filter and sample-adaptive offset filtering can be calculated by employing a convolutional neural network-based model. The network structures in the luminance and chroma components of the in-loop filtering unit 150 may be the same or different. Considering that the luminance component contains more visual information, the reconstruction quality of the chroma component can be improved by further guiding the filtering of the chroma component with the luminance component.
[0034] Figure 2 is a schematic block diagram of the decoding framework 200 according to an embodiment of the present invention.
[0035] As shown in Figure 2, the decoding framework 200 may include an entropy decoding unit 210, an inverse transform inverse quantization unit 220, a residual unit 230, an intra prediction unit 240, an inter prediction unit 250, an intra-loop filtering unit 260, and a decoded image buffering unit 270.
[0036] The entropy decoding unit 210 receives and analyzes the bitstream to obtain prediction blocks and frequency-domain residual blocks. It can then obtain time-domain residual blocks from the frequency-domain residual blocks through steps such as inverse transformation and inverse quantization by the inverse transformation and inverse quantization unit 220. The residual unit 230 can obtain reconstructed blocks by superimposing the prediction blocks obtained by the intra-prediction unit 240 or inter-prediction unit 250 onto the time-domain residual blocks after inverse transformation and inverse quantization by the inverse transformation and inverse quantization unit 220. For example, the intra-prediction unit 240 or inter-prediction unit 250 can obtain prediction blocks by decoding the header information of the bitstream.
[0037] The International Video Encoding Standards Organization (JVET) has already established a research group for encoding models that surpass H.266 / VVC, and named this model, or platform test software, ECM. Based on VTM10.0, ECM has begun to incorporate updated and more efficient compression algorithms, and currently already surpasses VVC encoding performance by approximately 13%. ECM has not only enlarged the size of encoding units for specific resolutions, but has also integrated many intra-prediction and inter-prediction techniques.
[0038] The following describes related technologies according to the present invention.
[0039] (1) Most probable modes (MPM) MPM is a type of intra-predictive mode that typically includes the most likely modes to be selected for several current blocks, and the list usually contains the following: a) The prediction mode selected for the surrounding adjacent prediction blocks, b) A prediction mode selected for surrounding non-adjacent prediction blocks, c) The predicted mode derived from the surrounding reconstructed pixels using the Decoder-side Intra-Mode Derivation (DIMD) mode, d) Some close angles of the angle modes obtained in a and b, e) This includes one or more of the default, more commonly used intra-predictive modes.
[0040] Among these, the prediction mode selected for surrounding adjacent prediction blocks may be the prediction mode used by those surrounding adjacent prediction blocks. Similarly, the prediction mode selected for surrounding non-adjacent prediction blocks may be the prediction mode used by those surrounding non-adjacent prediction blocks.
[0041] In ECM, the MPM includes 22 predictive modes, with the first six modes being primary MPMs and the latter 16 being second MPMs. Of the 22 modes in the MPM, the planar mode is in the first position.
[0042] The analysis process for syntax elements related to MRL is roughly as shown in Table 1 below.
[0043] [Table 1]
[0044] As shown in Table 1, if !mrl_flag is true, the decoder determines that it is not in multiple reference line (MRL) intra-prediction mode (there is no need to expand the reference lines) and decodes mpm_flag; otherwise, it defaults to setting mpm_flag to 1, and if mpm_flag is true, it further parses mpm_idx.
[0045] (2) Multiple reference line (MRL) mode MRL mode allows intra-prediction using a reconstruction line that is not adjacent to the current block as the reference line, in addition to allowing intra-prediction using the reconstruction line closest to the current block (Reference line 0) as the reference line. MRL mode can improve coding efficiency by using more reference pixels.
[0046] Figure 3 shows an example of four reference rows located around the current block according to an embodiment of the present invention.
[0047] As shown in Figure 3, in VCC, reference lines that are not currently adjacent to a block may be Reference lines 1 and 2, and in ECM, reference lines that are not currently adjacent to a block may be Reference lines 1, 3, 5, 7, and 12. Of these, Figure 3 shows four reference lines, Reference lines 0 to 3, and these four reference lines can be divided into Segment A to Segment F.
[0048] The analysis process for syntax elements related to CU-level MRL is roughly as shown in Table 2 below.
[0049] [Table 2]
[0050] As shown in Table 2, if !sps_mrl_flag||cu.timd||cu.dimd||isFirstLineOfCtu||cu.bdpcmMode||!cu.Y().valid, then multiRefIdx=0, meaning the decoder decides not to use MRL. Otherwise, multiRefIdx is obtained by parsing the bitstream, which indicates which reference line to use. Of these, MULTI_REF_LINE_IDX is a single array of length 6, with the contents of the array being {0,1,3,5,7,12}, and the decoding side can obtain the index of the current reference line based on the parsed multiRefIdx and array.
[0051] Furthermore, MRL mode can be used simultaneously with TIMD mode, and if the block is currently in TIMD mode, the analysis process of syntax elements related to CU-level MRL is roughly as shown in Table 3 below.
[0052] [Table 3]
[0053] As shown in Table 3, if !sps_mrl_flag||cu.timd||cu.dimd||isFirstLineOfCtu||cu.bdpcmMode||!cu.Y().valid, the decoder decides not to use MRL in TIMD mode; otherwise, the current encoding unit chooses to use TIMD mode and obtains multiRefIdx by parsing the bitstream, which indicates which reference line to use. Of these, MULTI_REF_LINE_IDX is a single array of length 6 with the contents of the array {0,1,3,5,7,12}, and the decoding side can obtain the index of the current reference line based on the parsed multiRefIdx and array.
[0054] Furthermore, MPM technology is a technology for determining the prediction mode, and MRL technology is a technology for determining the reference row. MPM technology and MRL technology may be used in combination or individually, and the present invention is not specifically limited to this.
[0055] (3) Template-based Multiple Reference Line (TMRL) mode TMRL mode is an extension of MRL technology, which uses template matching technology to sort the reconstructed rows and prediction modes that are likely to be used for the current block, constructs a TMRL candidate list of the most likely combinations of reconstructed rows and prediction modes, and a decoder analyzes the candidate index to select the reconstructed rows and prediction modes chosen for the current block from the TMRL candidate list and makes a prediction.
[0056] For TMRL mode, the decoder needs to complete the following steps:
[0057] 1. Obtain available reconstruction rows and possible intra-prediction modes.
[0058] 2. Perform intra-prediction in the template area using each possible reconstructed row and intra-prediction mode, and calculate the difference between the predicted result and the reconstructed result for each combination. For example, this difference may be the Sum of Absolute Differences (SAD).
[0059] 3. Sort all combinations of SAD values from smallest to largest, and select the combinations with relatively small SAD values as the TMRL candidate list.
[0060] If the available reconstruction rows are {0,1,3,5,7,12} and the possible intra-prediction modes include 10 different prediction modes, the decoder uses each possible reconstruction row and intra-prediction mode to perform intra-prediction in the template area, calculates the SAD of the prediction result and reconstruction result for each combination, and obtains 50 SADs. The decoder then sorts these 50 SADs from smallest to largest and selects the 20 relatively small combinations from among them as the TMRL candidate list.
[0061] Furthermore, the TMRL mode is designed to acquire 10 possible intra-prediction modes for each intra-prediction block, and since the length of the TMRL candidate list is 20, TMRL can only function correctly if there are two or more reconstruction rows currently available in the block.
[0062] Figure 4 shows an example of a template and reference row located around the current block according to an embodiment of the present invention.
[0063] As shown in Figure 4, the area where reference line 0 is located is the template area of the current block, and the reconstruction lines of the current block include reference lines 1 through 6.
[0064] The analysis process for the relevant syntax elements of the CU-level TMRL mode is roughly as shown in Table 4 below.
[0065] [Table 4]
[0066] 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, it obtains tmrlListIdx by parsing the bitstream, which is used to indicate the candidate in the TMRL candidate list.
[0067] Figure 5 is a schematic flowchart of a decoding method 300 according to an embodiment of the present invention. It should be understood that the decoding method 300 can be executed by a decoder. This applies, for example, to the decoding framework 200 shown in Figure 2. For the sake of clarity, the decoder will be described below as an example.
[0068] As shown in Figure 5, the decoding method 300 may include the following:
[0069] In S310, the decoder determines the maximum number of reference lines that are permitted to be used in the current block. For example, if the current block is not the first line of the current CTU, and DIMD mode is not used in the current block, and BDPCM mode is not used in the current block, and the current block is a luminance block, the decoder determines this maximum number of lines by decoding the bitstream.
[0070] For example, the decoder determines the maximum number of lines by decoding the bitstream.
[0071] For example, the referenced rows used in the current block may be referenced rows that are not adjacent to (or do not have adjacent to) the current block.
[0072] For example, the reference rows used in the current block may be reference rows formed by the reconstructed samples located above and to the left of the current block.
[0073] It should be understood that "the maximum number of reference lines permitted to be used in the current block" is intended to describe the number of reference lines that can serve in the current block. The decoder can select the reference lines that will actually be used in the current block from "the reference lines that can serve in the current block," that is, the decoder can select the reference lines that will be used to predict the current block from "the reference lines that can serve in the current block." In other words, "the maximum number of reference lines permitted to be used in the current block" can be understood as or replaced with similar terms or descriptions such as "the maximum number of reference lines permitted to be used in the current block," "the number of reference lines that can serve in the current block," "the maximum number of lines permitted to be used in the current block," "the maximum number of reference lines available in the current block," or "the number of reference lines that are most available in the current block," and the present invention does not specifically limit this.
[0074] In S320, the decoder determines, based on the maximum number of lines, whether or not template-based multiple reference line (TMRL) mode is used in the current block.
[0075] For example, if the maximum number of rows satisfies the usage conditions for the TMRL mode, the decoder determines that the TMRL mode is used in the current block; otherwise, the decoder determines that the TMRL mode is not used in the current block. For instance, if the maximum number of rows satisfies the usage conditions for the TMRL mode, the decoder decodes the bitstream to determine that the TMRL mode is used in the current block; otherwise, the decoder determines that the TMRL mode is not used in the current block, i.e., decodes the bitstream to determine that another prediction mode other than the TMRL mode is used in the current block. The maximum number of rows satisfying the usage conditions for the TMRL mode can be understood as the maximum number of rows satisfying a specific length of TMRL mode list constructed by the decoder.
[0076] In S330, if the TMRL mode is used in the current block, the decoder determines the reference row used in the current block and the prediction mode used in the current block.
[0077] For example, if the TMRL mode is used in the current block, the decoder decodes the bitstream to determine the reference row used in the current block and the prediction mode used in the current block.
[0078] In S340, the decoder predicts the current block using the prediction mode used in the current block, based on the reference row used in the current block, and obtains a predicted block.
[0079] For example, if the prediction mode used in the current block is an angle prediction mode, the decoder can determine the reconstructed sample in the reference row used in the current block as the prediction sample in the current block according to the angle indicated by the angle prediction mode, thereby obtaining the prediction block for the current block.
[0080] In this embodiment, when the decoder predicts the current block, it first determines the maximum number of reference lines permitted to be used in the current block, then determines whether or not TMRL mode is used in the current block based on the maximum number of lines, and if TMRL mode is used in the current block, it determines the reference lines used in the current block and the prediction mode used in the current block, and then predicts the current block using the prediction mode used in the current block based on the reference lines used in the current block to obtain a predicted block. In other words, when the decoder decides whether or not to predict the current block using TMRL mode, it is necessary to determine whether or not TMRL mode is used in the current block based on the maximum number of reference lines permitted to be used in the current block, and this ensures that the maximum number of reference lines permitted to be used in the current block satisfies the usage condition when TMRL mode is used in the current block, and furthermore, decoding performance can be improved.
[0081] In some embodiments, S310 is, The decoder may include obtaining a first flag. Of these, the first flag indicates that if the value is a first number, the multi-reference row MRL mode will not be used in the current sequence to which the current block belongs, and if the value is a second number other than the first number, the MRL mode will be used in the current sequence and the maximum number of rows will be indicated.
[0082] Exemplary, the first flag may be denoted as sps_mrl_enabled_flag, i.e., sps_mrl_enabled_flag is a sequence-level MRL control flag. The range of values for sps_mrl_enabled_flag is 0 to x (where x is a positive integer). If sps_mrl_enabled_flag takes a value of 0, it indicates that sequence-level MRL is off. If the value is between 1 and x, it indicates that the MRL mode is currently used in the sequence and that the maximum number of rows is determined based on i. For example, if sps_mrl_enabled_flag takes a value of i (1 ≤ i ≤ x), it indicates that the MRL mode is currently used in the sequence and that the maximum number of rows is determined based on i. For example, in an ECM, the range of values for the second flag is 0 to 5, and the second flag may be represented by a 3-bit fixed-length code "u(3)".
[0083] For example, if the bitstream acquired by the decoder does not contain the first flag, the value of the first flag may default to 0 or another numerical value.
[0084] For example, if the value of the first flag is a second numerical value, the decoder directly determines the second numerical value as the maximum number of rows. For instance, if 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 rows.
[0085] For example, if the value of the first flag is a second number, the decoder can determine the number of rows corresponding to the second number as the maximum number of rows, based on the correspondence between at least one number and at least one number of rows, where the at least one number includes the second number. For example, if the value of the first flag is 4, the decoder determines the number of rows corresponding to 4 (e.g., 5) as the maximum number of rows, based on the correspondence between at least one number and at least one number of rows.
[0086] Of course, in other alternative embodiments, the first flag may be an image-level flag or an image block-level flag.
[0087] For example, if the first flag is an image-level flag, the first flag indicates that if its value is a first number, the multi-reference row MRL mode will not be used in the current image to which the current block belongs, and if its value is a second number other than the first number, the MRL mode will be used in the current image, and the maximum number of rows will be specified.
[0088] Furthermore, if the first flag is, for example, an image block-level flag, the first flag indicates that if its value is a first number, the multi-reference row MRL mode will not be used in the current block; and if its value is a second number other than the first number, it indicates that the MRL mode will be used in the current block and also indicates the maximum number of rows.
[0089] Furthermore, if the value taken by the first flag is a second numerical value, the value taken by the first flag may simply be used to indicate that the MRL mode is used in the current sequence and to indicate the maximum number of rows, or it may indicate that the MRL mode is used in the current sequence and the maximum number of rows, in addition to indicating the reference rows for which the current block is permitted to be used. In other words, the value taken by the first flag is not solely for indicating that the MRL mode is used in the current sequence, the maximum number of rows, and the reference rows for which the current block is permitted to be used.
[0090] For example, if the maximum value of the first flag is 5, then it will be as follows: If the first flag takes a value of 0, it indicates that the MRL mode is not used in the current sequence. If the first flag takes a value of 1, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 1, and the reference row permitted to use the current block is reference row 1. If the first flag takes a value of 2, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 2, and the reference rows permitted to use the current block include reference rows 1 and 3. If the first flag takes a value of 3, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 3, and the reference rows permitted to use the current block include reference rows 1, 3, and 5. If the first flag takes a value of 4, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 4, and the reference rows permitted to use the current block include reference rows 1, 3, 5, and 7. If the value of the first flag is 5, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 5, and the reference rows permitted to be used in the current block include reference rows 1, 3, 5, 7, and 12.
[0091] Of course, in other alternative embodiments, the reference rows that are permitted to use the second numerical value and the current block may have other correspondences, and the present invention is not specifically limited thereto.
[0092] In some embodiments, S310 is, The decoder obtains the second flag, The decoder may also include determining the number of lines indicated by the second flag as the maximum number of lines.
[0093] For example, the first flag may be denoted as num_non_adjacent_ref_line, where num_non_adjacent_ref_line takes values in the range 0 to x (where x is a positive integer) and indicates its maximum number of lines. For example, sps_mrl_enabled_flag indicates that if the value is i (1 ≤ i ≤ x), its maximum number of lines is a value determined based on i. For example, in ECM, the range of values for the second flag is 0 to 5, and the second flag may be represented by a 3-bit fixed-length code "u(3)".
[0094] For example, if the bitstream acquired by the decoder does not contain the second flag, the value of the second flag may default to 0 or another numerical value.
[0095] For example, the decoder directly determines the value of the second flag as the maximum number of rows. For instance, if 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 rows.
[0096] Exemplary, the decoder may determine the number of rows corresponding to the value of the second flag as the maximum number of rows based on the correspondence between at least one numerical value and at least one row number, where the at least one numerical value includes the value of the second flag. For example, if the value of the second flag is 4, the decoder may determine the number of rows corresponding to 4 (e.g., 5) as the maximum number of rows based on the correspondence between at least one numerical value and at least one row number.
[0097] For example, the second flag is a sequence-level flag.
[0098] Of course, in other alternative embodiments, the second flag may be an image-level flag or an image block-level flag.
[0099] For example, if the second flag is an image-level flag, it indicates the number of reference lines that are permitted to be used in the current image to which the current block belongs.
[0100] Furthermore, if the second flag is an image block-level flag, for example, it indicates the number of reference rows for which the current block is permitted to be used.
[0101] The second flag may be used simply to indicate the maximum number of rows, or it may indicate the maximum number of rows as well as the referenced rows that are permitted to be used in the current block. In other words, the value that the second flag takes is not limited to indicating only the maximum number of rows and the referenced rows that are permitted to be used in the current block.
[0102] For example, if the maximum value of the second flag is 5, it will be as follows: If the second flag takes 0, it indicates that the maximum number of rows is 0 and the referenced row for which the current block is permitted to be used is blank. If the second flag takes 1, it indicates that the maximum number of rows is 1 and the referenced row for which the current block is permitted to be used is referenced row 1. If the second flag takes 2, it indicates that the maximum number of rows is 2 and the referenced rows for which the current block is permitted to be used include referenced rows 1 and 3. If the second flag takes 3, it indicates that the maximum number of rows is 3 and the referenced rows for which the current block is permitted to be used include referenced rows 1, 3 and 5. If the second flag takes 4, it indicates that the maximum number of rows is 4 and the referenced rows for which the current block is permitted to be used include referenced rows 1, 3, 5 and 7. If the second flag takes 5, it indicates that the maximum number of rows is 5 and the referenced rows for which the current block is permitted to be used include referenced rows 1, 3, 5, 7 and 12.
[0103] Of course, in other alternative embodiments, the values of the second flag and the referenced rows that are permitted to use the current block may have different correspondences, and the present invention is not specifically limited thereto.
[0104] In some embodiments, this S320 is, If the maximum number of rows is greater than the first preset threshold, the decoder acquires the third flag. The decoder may also obtain a fourth flag if the third flag indicates that the use of the TMRL mode is permitted in the current sequence to which the current block belongs. Of these, the fourth flag indicates whether the TMRL mode is used in the current block.
[0105] For example, if the maximum number of rows is greater than a first preset threshold, the decoder decodes the bitstream to obtain a third flag. If the third flag indicates that the use of the TMRL mode is permitted in the current sequence to which the current block belongs, the decoder decodes the bitstream to obtain a fourth flag, of which the fourth flag indicates whether or not the TMRL mode is used in the current block.
[0106] For example, the first preset threshold may be a threshold predefined in the protocol.
[0107] For example, the first preset threshold may be 1, 2, or any other numerical value, and the present invention is not specifically limited thereto.
[0108] For example, the third flag may be denoted as sps_tmrl_enabled_flag, and the fourth flag may be denoted as cu_tmrl_flag.
[0109] If the maximum number of rows is greater than a first preset threshold (for example, the first preset threshold is 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag, and if sps_tmrl_enabled_flag indicates that the use of the TMRL mode is permitted in the current sequence to which the current block belongs (for example, the value of sps_tmrl_enabled_flag is 1), the decoder decodes the bitstream to obtain cu_tmrl_flag. If the value of cu_tmrl_flag is 1, it indicates that the TMRL mode is used in the current block, and if the value is 0, it indicates that the TMRL mode is not used in the current block.
[0110] In some embodiments, the decoder obtains the fourth flag if the third flag indicates that the use of the TMRL mode is permitted in the current sequence and the TIMD mode is not used in the current block.
[0111] For example, a decoder can determine whether TIMD mode is used in the current block by decoding the bitstream.
[0112] For example, the third flag may be denoted as sps_tmrl_enabled_flag, and the fourth flag may be denoted as cu_tmrl_flag.
[0113] If the maximum number of rows is greater than a first preset threshold (for example, the first preset threshold is 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag, and if sps_tmrl_enabled_flag indicates that the use of the TMRL mode is permitted in the current sequence to which the current block belongs (for example, the value of sps_tmrl_enabled_flag is 1), and the TIMD mode is not used in the current block, the decoder decodes the bitstream to obtain cu_tmrl_flag. If the value of cu_tmrl_flag is 1, it indicates that the TMRL mode is used in the current block, and if the value is 0, it indicates that the TMRL mode is not used in the current block.
[0114] In some embodiments, this S320 is, The decoder obtains the third flag, The decoder may also obtain a fourth flag if the third flag indicates that the use of the TMRL mode is permitted in the current sequence to which the current block belongs, and the maximum number of rows is greater than a first preset threshold. Of these, the fourth flag indicates whether the TMRL mode is used in the current block.
[0115] For example, if the decoder decodes the bitstream to obtain a third flag, which indicates that the use of the TMRL mode is permitted in the current sequence to which the current block belongs, and the maximum number of rows is greater than a first preset threshold, the decoder decodes the bitstream to obtain a fourth flag, which indicates whether or not the TMRL mode is used in the current block.
[0116] For example, the first preset threshold may be a threshold predefined in the protocol.
[0117] For example, the first preset threshold may be 1, 2, or any other numerical value, and the present invention is not specifically limited thereto.
[0118] For example, the third flag may be denoted as sps_tmrl_enabled_flag, and the fourth flag may be denoted as cu_tmrl_flag.
[0119] The decoder decodes the bitstream to obtain sps_tmrl_enabled_flag. If sps_tmrl_enabled_flag indicates that the use of the TMRL mode is permitted in the current sequence to which the current block belongs (for example, sps_tmrl_enabled_flag takes a value of 1) and the maximum number of rows is greater than a first preset threshold (for example, the first preset threshold is 1), the decoder decodes the bitstream to obtain cu_tmrl_flag. If cu_tmrl_flag takes a value of 1, it indicates that the TMRL mode is used in the current block; if it takes a value of 0, it indicates that the TMRL mode is not used in the current block.
[0120] In some embodiments, the third flag indicates that the use of the TMRL mode is permitted in the current sequence, and it is determined that the TMRL mode is used in the current block if the maximum number of rows is greater than the first preset threshold and the template-based intra-mode derived TIMD mode is not used in the current block.
[0121] For example, the third flag may be denoted as sps_tmrl_enabled_flag, and the fourth flag may be denoted as cu_tmrl_flag.
[0122] The decoder decodes the bitstream to obtain sps_tmrl_enabled_flag. If sps_tmrl_enabled_flag indicates that the use of the TMRL mode is permitted in the current sequence to which the current block belongs (for example, sps_tmrl_enabled_flag takes a value of 1), and the maximum number of rows is greater than a first preset threshold (for example, the first preset threshold is 1), and the TMRL mode is not used in the current block, the decoder decodes the bitstream to obtain cu_tmrl_flag. If cu_tmrl_flag takes a value of 1, it indicates that the TMRL mode is used in the current block; if it takes a value of 0, it indicates that the TMRL mode is not used in the current block.
[0123] In some embodiments, the decoder acquires the third flag if the use of MRL mode is permitted in the current sequence.
[0124] Exemplary, if the decoder decodes the bitstream and determines that the use of MRL mode is permitted in the current sequence, it obtains the third flag and, based on the third flag, determines whether the use of TMRL mode is permitted in the current sequence; otherwise, it determines that TMRL mode is not used in the current sequence. In other words, if the decoder decodes the bitstream and determines that the use of MRL mode is permitted in the current sequence, it obtains the third flag and, based on the third flag, determines whether the use of TMRL mode is permitted in the current sequence; otherwise, it determines that TMRL mode is not used in the current block, i.e., by decoding the bitstream, it determines another predictive mode other than TMRL mode to be used in the current block.
[0125] For example, the third flag may be denoted as sps_tmrl_enabled_flag, and the flag indicating whether or not MRL mode is used in the current sequence may also be denoted as sps_mrl_enabled_flag.
[0126] If the use of MRL mode is permitted in the current sequence (for example, sps_mrl_enabled_flag is 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag and, based on the value taken by sps_tmrl_enabled_flag, determines whether the use of TMRL mode is permitted in the current sequence. For example, if sps_tmrl_enabled_flag takes a value of 1, it indicates that the use of TMRL mode is permitted in the current sequence, and if it takes a value of 0, it indicates that the use of TMRL mode is not permitted in the current sequence.
[0127] In some embodiments, the decoder acquires a fifth flag and, if the fifth flag does not impose any restrictions on the values that the third flag takes, or does not impose any restrictions on the values that the flag takes to indicate whether the use of multi-reference row MRL mode is permitted in the current sequence, then the decoder acquires the third flag.
[0128] For example, the decoder decodes the bitstream to obtain the fifth flag, and if the fifth flag does not impose any restrictions on the possible values of the third flag, or does not impose any restrictions on the possible values of the flag indicating whether or not the use of MRL mode is permitted in the current sequence, the decoder decodes the bitstream to obtain the third flag.
[0129] For example, the fifth flag is the general constraints information (GCI) for the third flag, and is used to impose restrictions on the values that the third flag can take.
[0130] The third flag may be denoted as sps_tmrl_enabled_flag, and the GCI of the third flag may be denoted as gci_no_tmrl_constraint_flag, where gci_no_tmrl_constraint_flag indicates whether sps_tmrl_enabled_flag is restricted or not. For example, if the value of gci_no_tmrl_constraint_flag is 1, then the value of sps_tmrl_enabled_flag must be equal to 0; otherwise, there is no restriction on the value of sps_tmrl_enabled_flag.
[0131] The decoder decodes the bitstream to obtain gci_no_tmrl_constraint_flag, and if gci_no_tmrl_constraint_flag indicates that there is no restriction on the values of sps_tmrl_enabled_flag (for example, the value of gci_no_tmrl_constraint_flag is 0), it decodes the bitstream to obtain sps_tmrl_enabled_flag and determines whether the use of the TMRL mode is permitted in the current sequence based on the value of sps_tmrl_enabled_flag. For example, if sps_tmrl_enabled_flag has a value of 1, it indicates that the use of the TMRL mode is permitted in the current sequence, and if it has a value of 0, it indicates that the use of the TMRL mode is not permitted in the current sequence.
[0132] Exemplary, the fifth flag is a GCI of the flags for indicating whether the use of multi-reference row MRL mode is permitted in the current sequence, and is used to restrict the values that the flags for indicating whether the use of multi-reference row MRL mode is permitted in the current sequence can take.
[0133] The third flag may be denoted as sps_tmrl_enabled_flag, and the GCI of the third flag may be denoted as gci_no_mrl_constraints_flag, where gci_no_mrl_constraints_flag indicates whether sps_tmrl_enabled_flag and sps_mrl_enabled_flag are restricted or not. For example, if the value of gci_no_tmrl_constraint_flag is 1, then the values of sps_tmrl_enabled_flag and sps_mrl_enabled_flag must both be equal to 0; otherwise, there are no restrictions on the values of sps_tmrl_enabled_flag and sps_mrl_enabled_flag.
[0134] The decoder decodes the bitstream to obtain gci_no_mrl_constraints_flag, and if gci_no_mrl_constraints_flag indicates that there are no restrictions on sps_tmrl_enabled_flag and sps_mrl_enabled_flag (for example, the value of gci_no_mrl_constraints_flag is 0), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag, and based on the value of sps_tmrl_enabled_flag, determines whether the use of the TMRL mode is permitted in the current sequence. For example, if sps_tmrl_enabled_flag has a value of 1, it indicates that the use of the TMRL mode is permitted in the current sequence, and if it has a value of 0, it indicates that the use of the TMRL mode is not permitted in the current sequence.
[0135] In some embodiments, the decoder obtains a sixth flag, and if the sixth flag indicates that the use of a template-based mode is permitted in the current sequence, it obtains the third flag.
[0136] For example, the decoder decodes the bitstream to obtain the sixth flag, and if the sixth flag indicates that the use of a template-based mode is permitted in the current sequence, it decodes the bitstream to obtain the third flag.
[0137] For example, the third flag may be denoted as sps_tmrl_enabled_flag, and the sixth flag may be denoted as sps_tm_enabled_flag.
[0138] The decoder decodes the bitstream to obtain sps_tm_enabled_flag, and if sps_tm_enabled_flag indicates that the use of a template-based mode is permitted in the current sequence (for example, sps_tm_enabled_flag takes the value 1), it decodes the bitstream to obtain sps_tmrl_enabled_flag, and based on the value of sps_tmrl_enabled_flag, it determines whether the use of the TMRL mode is permitted in the current sequence. For example, if sps_tmrl_enabled_flag takes the value 1, it indicates that the use of the TMRL mode is permitted in the current sequence, and if it takes the value 0, it indicates that the use of the TMRL mode is not permitted in the current sequence.
[0139] In some embodiments, the decoder acquires the seventh flag, and if the seventh flag indicates that there is no restriction on the value of the sixth flag, it acquires the sixth flag.
[0140] For example, the seventh flag is the general constraints information (GCI) for the sixth flag, and is used to impose restrictions on the values that the sixth flag can take.
[0141] The third flag may be denoted as sps_tmrl_enabled_flag, the sixth flag may be denoted as sps_tm_enabled_flag, and the seventh flag may be denoted as gci_no_tm_constraints_flag, where gci_no_tm_constraints_flag indicates whether sps_tm_enabled_flag is restricted or not. For example, if the value of gci_no_tm_constraints_flag is 1, then the value of sps_tm_enabled_flag must be equal to 0; otherwise, there is no restriction on the value of sps_tm_enabled_flag.
[0142] The decoder decodes the bitstream to obtain gci_no_tm_constraints_flag, and if gci_no_tm_constraints_flag indicates that there is no restriction on the values of sps_tm_enabled_flag (for example, the value of gci_no_tm_constraints_flag is 0), it decodes the bitstream to obtain sps_tm_enabled_flag, and if sps_tm_enabled_flag indicates that the use of a template-based mode is permitted in the current sequence (for example, the value of sps_tm_enabled_flag is 1), it decodes the bitstream to obtain sps_tmrl_enabled_flag, and based on the value of sps_tmrl_enabled_flag, it determines whether the use of the TMRL mode is permitted in the current sequence. For example, if sps_tmrl_enabled_flag has a value of 1, it indicates that the use of the TMRL mode is permitted in the current sequence, and if it has a value of 0, it indicates that the use of the TMRL mode is not permitted in the current sequence.
[0143] In some embodiments, this S330 is, The decoder determines the reference row corresponding to the maximum number of rows as the reference row permitted for use in the current block, The decoder constructs a TMRL mode list based on the reference lines permitted for use in the current block and the predictive modes permitted for use in the current block. The decoder obtains the first index, The decoder may also determine the reference row and predictive mode included in the combination indicated by the first index in the TMRL mode list as the reference row and predictive mode used in the current block.
[0144] Exemplary, the decoder may determine, based on the correspondence between at least one row number and at least one set of reference rows, that the reference row in the set of reference rows corresponding to the maximum reference row is a reference row permitted for use in the current block, of which at least one row number includes the maximum row number.
[0145] For example, if the range of values for the maximum number of rows is 0 to 5, it will be as follows: If the maximum number of rows is 0, the reference row permitted for use in the current block is blank. If the maximum number of rows is 1, the reference row permitted for use in the current block is reference row 1. If the maximum number of rows is 2, the reference rows permitted for use in the current block may include reference rows 1 and 3. If the maximum number of rows is 3, the reference rows permitted for use in the current block may include reference rows 1, 3 and 5. If the maximum number of rows is 4, the reference rows permitted for use in the current block include reference rows 1, 3, 5 and 7. If the maximum number of rows is 5, the reference rows permitted for use in the current block may include reference rows 1, 3, 5, 7 and 12.
[0146] Of course, in other alternative embodiments, the maximum number of rows and the reference rows permitted for use in the current block may have different correspondences, and the present invention is not specifically limited thereto.
[0147] For example, the decoder decodes the bitstream to obtain the first index.
[0148] In some embodiments, for each of the at least one combinations of reference lines permitted for use in the current block and prediction modes permitted for use in the current block, the decoder predicts the template of the current block using the prediction mode of each combination based on the reference line of each combination to obtain a prediction cost for each combination. Based on the prediction cost of each combination, the decoder sorts the at least one combination in descending order of prediction cost to obtain a combination ranking. The decoder determines the combinations that are positioned earlier in the combination ranking to be the combinations in the TMRL mode list.
[0149] For example, if the reference rows permitted for use in the current block include {0,1,3,5,7,12} and the prediction modes permitted for use in the current block include 10 different prediction modes, then 50 combinations can be formed from the reference rows and prediction modes permitted for use in the current block. The decoder uses the prediction modes included in each of these 50 combinations to make a prediction in the template area of the current block (i.e., predict the template of the current block) based on the reference rows included in each combination, and calculates the difference between the predicted result of the template of the current block and the reconstructed result of the template of the current block for each combination. For example, this difference may be the Sum of Absolute Differences (SAD). After obtaining 50 SADs, the decoder can sort these 50 SADs from smallest to largest and select several relatively small combinations as a TMRL mode list. The number of combinations selected by the decoder can be determined based on the length of the TMRL mode list.
[0150] In some embodiments, the method 300 is applied, If the TMRL mode is not used in the current block, the decoder may include determining the reference row to be used in the current block based on whether or not the TIMD mode is used in the current block.
[0151] For example, if the maximum number of rows is greater than a first preset threshold (e.g., the first preset threshold is 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag, and if sps_tmrl_enabled_flag indicates that the use of the TMRL mode is permitted in the current sequence to which the current block belongs (e.g., sps_tmrl_enabled_flag takes a value of 1), and TIMD mode is not used in the current block, the decoder decodes the bitstream to obtain cu_tmrl_flag, and if cu_tmrl_flag indicates that the TMRL mode is not used in the current block (e.g., cu_tmrl_flag takes a value of 0), the decoder determines the reference rows used in the current block based on whether or not TIMD mode is used in the current block.
[0152] For example, the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag, and if sps_tmrl_enabled_flag indicates that the use of the TMRL mode is permitted in the current sequence to which the current block belongs (e.g., sps_tmrl_enabled_flag takes a value of 1), and the maximum number of rows is greater than a first preset threshold (e.g., the first preset threshold is 1), and the TIMD mode is not used in the current block, then the decoder decodes the bitstream to obtain cu_tmrl_flag, and if cu_tmrl_flag indicates that the TMRL mode is not used in the current block (e.g., cu_tmrl_flag takes a value of 0), then determines the reference rows used in the current block based on whether or not the TIMD mode is used in the current block.
[0153] Of course, in other alternative embodiments, if the decoder determines that the TMRL mode is not used in the current sequence or that the current block does not meet the conditions for using the TMRL mode, it will determine that the TMRL mode is not used in the current block, and in this case, the decoder can directly determine the reference row used in the current block based on whether or not the TIMD mode is used in the current block. In other words, if the decoder determines that the TMRL mode is not used in the current sequence or that the current block does not meet the conditions for using the TMRL mode, it can skip decoding for cu_tmrl_flag and directly determine the reference row used in the current block based on whether or not the TIMD mode is used in the current block. For example, if sps_tmrl_enabled_flag indicates that the TMRL mode is not used in the current sequence to which the current block belongs (for example, if the value of sps_tmrl_enabled_flag is 0), the decoder can skip decoding for cu_tmrl_flag and directly determine the reference row used in the current block based on whether or not the TIMD mode is used in the current block. Furthermore, if the TIMD mode is used in the current block, for example, the decoder can skip decoding for cu_tmrl_flag and directly decode the bitstream to determine which reference row to use when the TIMD mode is used in the current block.
[0154] For example, if the TIMD mode is used in the current block, the decoder decodes the bitstream to determine the reference row to use when the TIMD mode is used in the current block; if the TIMD mode is not used in the current block, the decoder decodes the bitstream to determine the reference row to use when the TIMD mode is not used in the current block.
[0155] In some embodiments, if the TIMD mode is used in the current block, the decoder obtains a second index, and if the TIMD mode is not used in the current block, the decoder obtains a third index, of which the second index indicates the reference row to be used when the TIMD mode is used in the current block, and the third index indicates the reference row to be used when the TIMD mode is not used in the current block.
[0156] For illustrative purposes, the second index may be a multiRefIdx as shown in Table 3, and will not be described again here to avoid duplication.
[0157] For illustrative purposes, the third index may be a multiRefIdx as shown in Table 2, and will not be described again here to avoid duplication.
[0158] In some embodiments, the decoder obtains an eighth flag, which indicates that the use of MRL mode is permitted in the current sequence to which the current block belongs, and if TMRL mode is not used in the current block, determines whether TIMD mode is used in the current block to determine the reference row used in the current block.
[0159] For example, the decoder decodes the bitstream to obtain the eighth flag, which indicates that the use of MRL mode is permitted in the current sequence to which the current block belongs, and if TMRL mode is not used in the current block, then determines whether TIMD mode is used in the current block to determine the reference row used in the current block.
[0160] For example, the eighth flag may be denoted as sps_mrl_enabled_flag.
[0161] The decoder decodes the bitstream to obtain sps_mrl_enabled_flag, and determines the reference row used in the current block based on whether sps_mrl_enabled_flag indicates that the use of MRL mode is permitted in the current sequence to which the current block belongs (for example, sps_mrl_enabled_flag takes the value 1), and whether TMRL mode is not used in the current block, or whether TIMD mode is used in the current block.
[0162] In some embodiments, if the maximum number of rows is greater than or equal to the second preset threshold, the decoder acquires the eighth flag.
[0163] For example, the second preset threshold may be a threshold predefined in the protocol.
[0164] For example, the second preset threshold may be 0 or another numerical value, and the present invention is not specifically limited thereto.
[0165] If the maximum number of rows is greater than or equal to the second preset threshold, the decoder decodes the bitstream to obtain sps_mrl_enabled_flag, and if sps_mrl_enabled_flag indicates that the use of MRL mode is permitted in the current sequence to which the current block belongs (for example, the value of sps_mrl_enabled_flag is 1), and the TMRL mode is not used in the current block, the decoder determines the reference rows used in the current block based on whether or not the TIMD mode is used in the current block.
[0166] In some embodiments, if the eighth flag indicates that the use of multi-reference-row MRL mode is permitted in the current sequence, and the maximum number of rows is greater than or equal to the second preset threshold, and the TMRL mode is not used in the current block, the decoder determines the reference rows used in the current block based on whether or not the TIMD mode is used in the current block.
[0167] The decoder decodes the bitstream to obtain sps_mrl_enabled_flag, and determines the reference rows used in the current block based on whether the current block uses TIMD mode, if sps_mrl_enabled_flag indicates that the use of MRL mode is permitted in the current sequence to which the current block belongs (for example, the value of sps_mrl_enabled_flag is 1), the maximum number of rows is greater than or equal to the second preset threshold, and the current block does not use TMRL mode.
[0168] The following provides an illustrative description of the sequence-level flags according to the present invention. Of these, the syntax elements in bold in the following tables are syntax elements obtained by decoding based on the bitstream.
[0169] 1. It is sps_mrl_enabled_flag.
[0170] [Table 5]
[0171] As shown in Table 5, the sequence parameter set (seq_parameter_set_rbsp) may include sps_mrl_enabled_flag. sps_mrl_enabled_flag controls whether or not MRL is enabled for the current sequence. For example, if sps_mrl_enabled_flag is 1, it controls to enable MRL for the current sequence, and if it is 0, it controls to disable MRL for the current sequence.
[0172] 2. sps_tmrl_enabled_flag.
[0173] [Table 6]
[0174] As shown in Table 6, the sequence parameter set (seq_parameter_set_rbsp) includes sps_mrl_enabled_flag and sps_tmrl_enabled_flag.
[0175] The sps_mrl_enabled_flag controls whether or not MRL is enabled for the current sequence. For example, if sps_mrl_enabled_flag is 1, MRL is enabled for the current sequence; if it is 0, MRL is not enabled for the current sequence.
[0176] The sps_tmrl_enabled_flag indicates whether the use of TMRL mode is permitted in the current sequence. For example, if sps_tmrl_enabled_flag is 1, it indicates that the use of TMRL mode is permitted in the current sequence, and if it is 0, it indicates that the use of TMRL mode is not permitted in the current sequence.
[0177] Furthermore, sps_mrl_enabled_flag and sps_tmrl_enabled_flag have a dependency; that is, if the use of MRL mode is permitted in the current sequence (for example, sps_mrl_enabled_flag is 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag.
[0178] [Table 7]
[0179] As shown in Table 7, there is no dependency between sps_mrl_enabled_flag and sps_tmrl_enabled_flag; that is, the decoder decodes the bitstream to obtain sps_mrl_enabled_flag and sps_tmrl_enabled_flag.
[0180] When sps_mrl_enabled_flag and sps_tmrl_enabled_flag are introduced, the changes to the CU-level syntax elements are as shown in Table 8 below.
[0181] [Table 8]
[0182] As shown in Table 8, when sps_mrl_enabled_flag and sps_tmrl_enabled_flag are introduced, the decoder continues to decode the bitstream based on sps_tmrl_enabled_flag if the current block is not the first row of the current CTU, DIMD mode is not used in the current block, BDPCM mode is not used in the current block, and the current block is a luminance block.
[0183] In this example, sps_tmrl_enabled_flag is used to switch between TMRL and MRL.
[0184] If sps_tmrl_enabled_flag indicates that the use of the TMRL mode is permitted in the current sequence (for example, sps_tmrl_enabled_flag takes the value 1) and the TIMD mode is not used in the current block, the decoder decodes the bitstream to obtain cu_tmrl_flag. If cu_tmrl_flag indicates that the TMRL mode is used in the current block (for example, cu_tmrl_flag is 1), the decoder decodes the bitstream to obtain tmrl_list_idx, determines the reference row and prediction mode included in the combination indicated by tmrl_list_idx in the TMRL mode list as the reference row and prediction mode used in the current block, and then predicts the current block using the prediction mode used in the current block based on the reference row used in the current block to obtain a prediction block.
[0185] If sps_tmrl_enabled_flag indicates that the use of the TMRL mode is not permitted in the current sequence to which the current block belongs (for example, sps_tmrl_enabled_flag takes a value of 0), or if TIMD mode is used in the current block, or if cu_tmrl_flag indicates that the TMRL mode is not used in the current block (for example, cu_tmrl_flag is 0), and sps_mrl_enabled_flag indicates that the use of the MRL mode is permitted in the current sequence (for example, sps_mrl_enabled_flag takes a value of 1), and the TMRL mode is not used in the current block, then the decoder determines the reference line used in the current block based on whether or not TIMD mode is used in the current block. For example, if the TIMD mode is used in the current block, the decoder decodes the bitstream to obtain intra_luma_ref_idx, which indicates the reference row to use when the TIMD mode is used in the current block. If the TIMD mode is not used in the current block, the decoder decodes the bitstream to obtain intra_luma_ref_idx, which indicates the reference row to use when the TIMD mode is not used in the current block.
[0186] 3. gci_no_mrl_constraint_flag and gci_no_tmrl_constraint_flag.
[0187] GCI takes into account a set of flags and is used to restrict whether certain sequence-level flags exist in a bitstream. If the GCI of a particular flag is greater than 0, it means that the portion of the bitstream containing that particular flag is specially restricted. For example, if the GCI is greater than 0, a certain encoding tool is restricted in the bitstream, and if it is equal to 0, it means that no special restrictions are placed on the portion of the bitstream (e.g., a particular encoding tool). For example, standard text has gci_no_mrl_constraint_flag which indicates whether sps_mrl_enabled_flag is restricted or not. If gci_no_mrl_constraint_flag is equal to 1, then sps_mrl_enabled_flag must be equal to 0; otherwise, there is no restriction on the value of sps_mrl_enabled_flag.
[0188] The TMRL tool has been introduced and enhanced for MRL, and in view of the use of TMRL and MRL, the present invention has introduced a sequence-level flag sps_tmrl_enabled_flag that can be switched between each other. In such cases, the GCI can also be adjusted accordingly. For example, if the decoding of sps_tmrl_enabled_flag does not depend on the values of sps_mrl_enabled_flag, one GCI flag for tmrl can be added. For example, it can be adjusted in the manner shown in Table 9 below.
[0189] [Table 9]
[0190] As shown in Table 9, gci_no_mrl_constraint_flag indicates whether sps_mrl_enabled_flag is restricted or not. If gci_no_mrl_constraint_flag is equal to 1, sps_mrl_enabled_flag must be equal to 0; otherwise, no restriction is placed on the value of sps_mrl_enabled_flag.
[0191] Additionally, one gci_no_tmrl_constraint_flag may be added to restrict the value of sps_tmrl_enabled_flag. gci_no_tmrl_constraint_flag indicates whether sps_tmrl_enabled_flag is restricted or not. If gci_no_tmrl_constraint_flag is equal to 1, sps_tmrl_enabled_flag must be equal to 0; otherwise, there is no restriction on the value of sps_tmrl_enabled_flag.
[0192] Of course, in other alternative embodiments, if the decoding of sps_tmrl_enabled_flag depends on the value of sps_mrl_enabled_flag, then sps_mrl_enabled_flag and sps_tmrl_enabled_flag may be controlled simultaneously by using gci_no_mrl_constraints_flag. The present invention is not specifically limited to this.
[0193] 4. sps_tm_enabled_flag and gci_no_tm_constraints_flag.
[0194] Considering the large number of template-based techniques in ECM, for example, template-based prediction tools are used in DIMD and TIMD in prediction mode. The present invention may control all template-based techniques by introducing a single unified flag. That is, a sequence-level flag sps_tm_enabled_flag may be introduced to control whether or not to enable a template-based coding / decoding tool at the sequence level, and a flag gci_no_tm_constraints_flag may be introduced to control whether or not to impose restrictions 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, there is no restriction on the value of sps_tm_enabled_flag.
[0195] In this case, decoding of sps_tmrl_enabled_flag depends on the value of sps_tm_enabled_flag.
[0196] [Table 10]
[0197] As shown in Table 10, the decoder decodes the bitstream to obtain gci_no_tm_constraints_flag. If gci_no_tm_constraints_flag is equal to 1, then sps_tm_enabled_flag must be equal to 0; otherwise, there is no restriction on the value of sps_tm_enabled_flag.
[0198] [Table 11]
[0199] As shown in Table 11, the decoder decodes the bitstream to obtain sps_tm_enabled_flag and sps_mrl_enabled_flag. If the use of a template-based mode is permitted in the current sequence (for example, sps_tm_enabled_flag is 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag.
[0200] [Table 12]
[0201] As shown in Table 12, the decoder decodes the bitstream to obtain sps_tm_enabled_flag and sps_mrl_enabled_flag. If the current sequence allows the use of template-based modes (e.g., sps_tm_enabled_flag is 1) and the current sequence allows the use of MRL mode (e.g., sps_mrl_enabled_flag is 1), the decoder decodes the bitstream to obtain sps_tmrl_enabled_flag.
[0202] Since enabling the MRL tool means that there are non-adjacent reference lines that are permitted to be used, sps_mrl_enabled_flag can be extended to represent the number of available non-adjacent reference lines (i.e., the maximum number of lines mentioned above). After the introduction of the maximum number of lines flag, corresponding adjustments are needed to how CU-level syntax elements are implemented with different sequence parameter sets, and the following illustrates how to make those adjustments.
[0203] Method 1 The sequence parameter set (seq_parameter_set_rbsp) may be one of those shown in Table 13 below.
[0204] [Table 13]
[0205] As shown in Table 13, the sequence parameter set includes sps_mrl_enabled_flag and sps_tmrl_enabled_flag.
[0206] The sps_mrl_enabled_flag takes values in the range of 0 to x (where x is a positive integer). If sps_mrl_enabled_flag takes a value of 0, it indicates that sequence-level MRL is off. If it takes a value of 1 to x, it indicates that the MRL mode is currently used in the sequence and specifies the maximum number of rows. For example, if sps_mrl_enabled_flag takes a value of i (1 ≤ i ≤ x), it indicates that the MRL mode is currently used in the sequence and that the maximum number of rows is determined by i. If sps_mrl_enabled_flag does not exist in the bitstream, sps_mrl_enabled_flag defaults to 0.
[0207] For example, if the maximum value of sps_mrl_enabled_flag is 5, it will be as follows: If sps_mrl_enabled_flag is 0, it indicates that the MRL mode is not used in the current sequence. If sps_mrl_enabled_flag is 1, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 1, and the reference row permitted to use the current block is reference row 1. If sps_mrl_enabled_flag is 2, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 2, and the reference rows permitted to use the current block include reference rows 1 and 3. If sps_mrl_enabled_flag is 3, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 3, and the reference rows permitted to use the current block include reference rows 1, 3, and 5. If sps_mrl_enabled_flag is 4, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 4, and the reference rows permitted to use the current block include reference rows 1, 3, 5, and 7. If sps_mrl_enabled_flag is 5, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 5, and the reference rows permitted to use the current block include reference rows 1, 3, 5, 7, and 12.
[0208] The sps_tmrl_enabled_flag indicates whether the use of TMRL mode is permitted in the current sequence. For example, if sps_tmrl_enabled_flag is 1, it indicates that the use of TMRL mode is permitted in the current sequence, and if it is 0, it indicates that the use of TMRL mode is not permitted in the current sequence. If sps_tmrl_enabled_flag does not exist in the bitstream, sps_tmrl_enabled_flag defaults to 0.
[0209] sps_mrl_enabled_flag and sps_tmrl_enabled_flag have a dependency; that is, if sps_mrl_enabled_flag > n (for example, n is 1), the decoder decodes the bitstream and obtains sps_tmrl_enabled_flag.
[0210] Based on the sequence parameter set shown in Table 13, the implementation method for CU-level syntax elements may be as shown in Table 14 below.
[0211] [Table 14]
[0212] As shown in Table 14, when the maximum number of line syntax elements are introduced, if the current block is not the first line of the current CTU, and DIMD mode is not used in the current block, and BDPCM mode is not used in the current block, and the current block is a luminance block, the decoder will continue to decode the bitstream based on sps_tmrl_enabled_flag.
[0213] In this example, sps_tmrl_enabled_flag is used to switch between TMRL and MRL.
[0214] If sps_tmrl_enabled_flag indicates that the use of the TMRL mode is permitted in the current sequence (for example, sps_tmrl_enabled_flag takes the value 1) and the TIMD mode is not used in the current block, the decoder decodes the bitstream to obtain cu_tmrl_flag. If cu_tmrl_flag indicates that the TMRL mode is used in the current block (for example, cu_tmrl_flag is 1), the decoder decodes the bitstream to obtain tmrl_list_idx, determines the reference row and prediction mode included in the combination indicated by tmrl_list_idx in the TMRL mode list as the reference row and prediction mode used in the current block, and then predicts the current block using the prediction mode used in the current block based on the reference row used in the current block to obtain a prediction block.
[0215] If sps_tmrl_enabled_flag indicates that the use of the TMRL mode is not permitted in the current sequence to which the current block belongs (for example, sps_tmrl_enabled_flag takes a value of 0), or if TIMD mode is used in the current block, or if cu_tmrl_flag indicates that the TMRL mode is not used in the current block (for example, cu_tmrl_flag is 0), and sps_mrl_enabled_flag indicates that the use of the MRL mode is permitted in the current sequence (for example, sps_mrl_enabled_flag takes a value of 1), and the TMRL mode is not used in the current block, then the decoder determines the reference line used in the current block based on whether or not TIMD mode is used in the current block. For example, if the TIMD mode is used in the current block, the decoder decodes the bitstream to obtain intra_luma_ref_idx, which indicates the reference row to use when the TIMD mode is used in the current block. If the TIMD mode is not used in the current block, the decoder decodes the bitstream to obtain intra_luma_ref_idx, which indicates the reference row to use when the TIMD mode is not used in the current block.
[0216] Method 2 The sequence parameter set (seq_parameter_set_rbsp) may be one of those shown in Table 15 below.
[0217] [Table 15]
[0218] As shown in Table 15, the sequence parameter set includes sps_mrl_enabled_flag and sps_tmrl_enabled_flag.
[0219] The sps_mrl_enabled_flag takes values in the range of 0 to x (where x is a positive integer). If sps_mrl_enabled_flag takes a value of 0, it indicates that sequence-level MRL is off. If it takes a value of 1 to x, it indicates that the MRL mode is currently used in the sequence and specifies the maximum number of rows. For example, if sps_mrl_enabled_flag takes a value of i (1 ≤ i ≤ x), it indicates that the MRL mode is currently used in the sequence and that the maximum number of rows is determined by i. If sps_mrl_enabled_flag does not exist in the bitstream, sps_mrl_enabled_flag defaults to 0.
[0220] For example, if the maximum value of sps_mrl_enabled_flag is 5, it will be as follows: If sps_mrl_enabled_flag is 0, it indicates that the MRL mode is not used in the current sequence. If sps_mrl_enabled_flag is 1, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 1, and the reference row for which the current block is permitted is reference row 1. If sps_mrl_enabled_flag is 2, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 2, and the reference rows for which the current block is permitted include reference rows 1 and 3. If sps_mrl_enabled_flag is 3, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 3, and the reference rows for which the current block is permitted include reference rows 1, 3, and 5. If sps_mrl_enabled_flag is 4, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 4, and the reference rows permitted to use the current block include reference rows 1, 3, 5, and 7. If sps_mrl_enabled_flag is 5, it indicates that the MRL mode is used in the current sequence, the maximum number of rows is 5, and the reference rows permitted to use the current block include reference rows 1, 3, 5, 7, and 12.
[0221] The sps_tmrl_enabled_flag indicates whether the use of TMRL mode is permitted in the current sequence. For example, if sps_tmrl_enabled_flag is 1, it indicates that the use of TMRL mode is permitted in the current sequence, and if it is 0, it indicates that the use of TMRL mode is not permitted in the current sequence. If sps_tmrl_enabled_flag does not exist in the bitstream, sps_tmrl_enabled_flag defaults to 0.
[0222] There is no dependency between sps_mrl_enabled_flag and sps_tmrl_enabled_flag; in other words, the decoder decodes the bitstream to obtain sps_mrl_enabled_flag and sps_tmrl_enabled_flag.
[0223] Based on the sequence parameter set shown in Table 15, the implementation method for CU-level syntax elements may be as shown in Table 16 below.
[0224] [Table 16]
[0225] As shown in Table 16, when the maximum number of line syntax elements are introduced, if the current block is not the first line of the current CTU, and DIMD mode is not used in the current block, and BDPCM mode is not used in the current block, and the current block is a luminance block, the decoder will continue to decode the bitstream based on sps_tmrl_enabled_flag.
[0226] In this example, sps_tmrl_enabled_flag is used to switch between TMRL and MRL.
[0227] If sps_tmrl_enabled_flag indicates that the use of the TMRL mode is permitted in the current sequence (for example, sps_tmrl_enabled_flag takes the value 1), and the TIMD mode is not used in the current block, 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 TMRL mode is used in the current block (for example, cu_tmrl_flag is 1), the decoder decodes the bitstream to obtain tmrl_list_idx, determines the reference line and prediction mode included in the combination indicated by tmrl_list_idx in the TMRL mode list as the reference line and prediction mode used in the current block, and then predicts the current block using the prediction mode used in the current block based on the reference line used in the current block to obtain a prediction block.
[0228] Of these, the num_non_adjacent_ref_line variable is equal to the value of sps_mrl_enabled_flag, which is used to indicate its maximum number of lines.
[0229] If sps_tmrl_enabled_flag indicates that the use of the TMRL mode is not permitted in the current sequence to which the current block belongs (for example, sps_tmrl_enabled_flag takes a value of 0), or if TIMD mode is used in the current block, or if cu_tmrl_flag indicates that the TMRL mode is not used in the current block (for example, cu_tmrl_flag is 0), and sps_mrl_enabled_flag indicates that the use of the MRL mode is permitted in the current sequence (for example, sps_mrl_enabled_flag takes a value of 1), and the TMRL mode is not used in the current block, then the decoder determines the reference line used in the current block based on whether or not TIMD mode is used in the current block. For example, if the TIMD mode is used in the current block, the decoder decodes the bitstream to obtain intra_luma_ref_idx, which indicates the reference row to use when the TIMD mode is used in the current block. If the TIMD mode is not used in the current block, the decoder decodes the bitstream to obtain intra_luma_ref_idx, which indicates the reference row to use when the TIMD mode is not used in the current block.
[0230] Method 3 The sequence parameter set (seq_parameter_set_rbsp) may be one of those shown in Table 17 below.
[0231] [Table 17]
[0232] As shown in Table 17, sps_mrl_enabled_flag is still just a sequence-level flag that controls whether or not MRL is enabled for the current sequence. For example, if sps_mrl_enabled_flag is 1, it controls to enable MRL for the current sequence, and if it is 0, it controls not to enable MRL for the current sequence.
[0233] num_non_adjacent_ref_line is used to indicate the maximum number of lines. For example, in ECM, num_non_adjacent_ref_line may take values in the range of 0 to 5 and may be represented by a 3-bit fixed-length code "u(3)". Of course, if num_non_adjacent_ref_line does not exist in the bitstream, its value may default to 0.
[0234] Based on the sequence parameter set shown in Table 17, the implementation method for CU-level syntax elements may be as shown in Table 18 below.
[0235] [Table 18]
[0236] As shown in Table 18, when the maximum number of line syntax elements are introduced, if the current block is not the first line of the current CTU, and DIMD mode is not used in the current block, and BDPCM mode is not used in the current block, and the current block is a luminance block, the decoder will continue to decode the bitstream based on sps_tmrl_enabled_flag.
[0237] In this example, sps_tmrl_enabled_flag is used to switch between TMRL and MRL.
[0238] If sps_tmrl_enabled_flag indicates that the use of the TMRL mode is permitted in the current sequence (for example, sps_tmrl_enabled_flag takes the value 1), and the TIMD mode is not used in the current block, 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 TMRL mode is used in the current block (for example, cu_tmrl_flag is 1), the decoder decodes the bitstream to obtain tmrl_list_idx, determines the reference line and prediction mode included in the combination indicated by tmrl_list_idx in the TMRL mode list as the reference line and prediction mode used in the current block, and then predicts the current block using the prediction mode used in the current block based on the reference line used in the current block to obtain a prediction block.
[0239] Of these, the num_non_adjacent_ref_line variable is equal to the value of sps_mrl_enabled_flag, which is used to indicate its maximum number of lines.
[0240] If sps_tmrl_enabled_flag indicates that the use of the TMRL mode is not permitted in the current sequence to which the current block belongs (for example, sps_tmrl_enabled_flag takes a value of 0), or if TIMD mode is used in the current block, or if cu_tmrl_flag indicates that the TMRL mode is not used in the current block (for example, cu_tmrl_flag is 0), and sps_mrl_enabled_flag indicates that the use of the MRL mode is permitted in the current sequence (for example, sps_mrl_enabled_flag takes a value of 1), and num_non_adjacent_ref_line>m (for example, m is 0), and the TMRL mode is not used in the current block, then the decoder determines the reference line used in the current block based on whether or not TIMD mode is used in the current block. For example, if the TIMD mode is used in the current block, the decoder decodes the bitstream to obtain intra_luma_ref_idx, which indicates the reference row to use when the TIMD mode is used in the current block. If the TIMD mode is not used in the current block, the decoder decodes the bitstream to obtain intra_luma_ref_idx, which indicates the reference row to use when the TIMD mode is not used in the current block.
[0241] Since there is no dependency between num_non_adjacent_ref_line and sps_mrl_enabled_flag, and between num_non_adjacent_ref_line and sps_tmrl_enabled_flag, it is necessary to determine whether or not to decode the image block-level flag based on num_non_adjacent_ref_line.
[0242] Method 4 The sequence parameter set (seq_parameter_set_rbsp) may be one of those shown in Table 19 below.
[0243]
Table 19
[0244] As shown in Table 19, the sps_mrl_enabled_flag is still just a sequence-level flag for controlling whether to turn on MRL for the current sequence. For example, when the sps_mrl_enabled_flag is 1, it controls to turn on MRL for the current sequence, and when it is 0, it controls not to turn on MRL for the current sequence. The new syntax element num_non_adjacent_ref_line is introduced and used to indicate the maximum number of lines. For example, in ECM, num_non_adjacent_ref_line may have a value range of 0 to 5 and may be represented by a 3-bit fixed-length code "u(3)". Of course, if num_non_adjacent_ref_line does not exist in the bitstream, the value of num_non_adjacent_ref_line may default to 0.
[0245] Among them, sps_mrl_enabled_flag and sps_tmrl_enabled_flag may each 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 the sps_mrl_enabled_flag. If num_non_adjacent_ref_line > n (for example, n is 1), the decoder decodes the bitstream to obtain the sps_tmrl_enabled_flag.
[0246] Based on the sequence parameter set shown in Table 19, the implementation method of the CU-level syntax element may be as shown in Table 20 below.
[0247]
Table 20
[0248] As shown in Table 20, when the syntax element with the maximum number of lines is introduced, if the current block is not the first line of the current CTU, and the DIMD mode is not used in the current block, and the BDPCM mode is not used in the current block, and the current block is a luminance block, the decoder continues to decode the bitstream based on the sps_tmrl_enabled_flag.
[0249] In this embodiment, the sps_tmrl_enabled_flag is used for switching between TMRL and MRL.
[0250] If the sps_tmrl_enabled_flag indicates that the use of the TMRL mode is permitted in the current sequence (for example, the value of the sps_tmrl_enabled_flag is 1), and the TIMD mode is not used in the current block, the decoder decodes the bitstream to obtain the cu_tmrl_flag. If the cu_tmrl_flag indicates that the TMRL mode is used in the current block (for example, the cu_tmrl_flag is 1), the decoder decodes the bitstream to obtain the tmrl_list_idx, and determines the reference lines and prediction mode included in the combination indicated by the tmrl_list_idx in the TMRL mode list as the reference lines used in the current block and the prediction mode used in the current block, and then, based on the reference lines used in the current block, uses the prediction mode used in the current block to predict the current block to obtain a predicted block.
[0251] If sps_tmrl_enabled_flag indicates that the use of the TMRL mode is not permitted in the current sequence to which the current block belongs (for example, sps_tmrl_enabled_flag takes a value of 0), or if TIMD mode is used in the current block, or if cu_tmrl_flag indicates that the TMRL mode is not used in the current block (for example, cu_tmrl_flag is 0), and sps_mrl_enabled_flag indicates that the use of the MRL mode is permitted in the current sequence (for example, sps_mrl_enabled_flag takes a value of 1), and the TMRL mode is not used in the current block, then the decoder determines the reference line used in the current block based on whether or not TIMD mode is used in the current block. For example, if the TIMD mode is used in the current block, the decoder decodes the bitstream to obtain intra_luma_ref_idx, which indicates the reference row to use when the TIMD mode is used in the current block. If the TIMD mode is not used in the current block, the decoder decodes the bitstream to obtain intra_luma_ref_idx, which indicates the reference row to use when the TIMD mode is not used in the current block.
[0252] It should be understood that the implementation of CU-level syntax elements in the sequence parameter set described above is merely an example of the present invention and does not limit it. For example, in other alternative embodiments, the analysis conditions for cu_tmrl_flag, intra_luma_ref_idx, or intra_luma_ref_idx may be constructed according to the actual needs based on flags in the sequence parameter set, and the present invention does not specifically limit this. Furthermore, while the flags mentioned above control or instruct the current sequence to use a certain technique or mode when the take value is 1, and control or instruct the current sequence not to use a certain technique or mode when the take value is 0, in other alternative embodiments, the flags may control or instruct the current sequence to use a certain technique or mode when the take value is 0, and control or instruct the current sequence not to use a certain technique or mode when the take value is 1, and the present invention does not specifically limit this.
[0253] The decoding method according to an embodiment of the present invention has been described in detail above from the perspective of the decoder. Now, with reference to Figure 7, the encoding method according to an embodiment of the present invention will be described below from the perspective of the encoder.
[0254] Figure 6 is a schematic flowchart of an encoding method 400 according to an embodiment of the present invention. It should be understood that the encoding method 400 can be implemented by an encoder. This can be applied, for example, to the encoding framework 100 shown in Figure 1.
[0255] As shown in Figure 6, the encoding method 400 is S410 determines the maximum number of reference rows currently allowed in the block, It may also include S420, which encodes the maximum number of lines.
[0256] In some embodiments, this S410 is, This may include encoding a first flag, Of these, the first flag indicates that if the value is a first number, the multi-reference row MRL mode will not be used in the current sequence to which the current block belongs, and if the value is a second number other than the first number, the MRL mode will be used in the current sequence and the maximum number of rows will be indicated.
[0257] In some embodiments, this S410 is, This may also include encoding a second flag. Of these, the second flag indicates the maximum number of rows.
[0258] In some embodiments, the method 400 further, If the maximum number of lines is greater than the first preset threshold, encode the third flag. The third flag may also include encoding a fourth flag if it indicates that the current sequence is permitted to use a template-based multi-reference-row TMRL mode. Of these, the fourth flag indicates whether the TMRL mode is used in the current block.
[0259] In some embodiments, the third flag indicates that the use of the TMRL mode is permitted in the current sequence, and the fourth flag is encoded if the template-based intra-mode derived TIMD mode is not used in the current block.
[0260] In some embodiments, the method 400 further, Encoding the third flag, The third flag may include encoding a fourth flag if the current sequence is permitted to use a template-based multi-reference-row TMRL mode and the maximum number of rows is greater than a first preset threshold. Of these, the fourth flag indicates whether the TMRL mode is used in the current block.
[0261] In some embodiments, the third flag indicates that the use of the TMRL mode is permitted in the current sequence, and if the maximum number of lines is greater than the first preset threshold and the template-based intramode derivation TIMD mode is not used in the current block, the fourth flag is encoded.
[0262] In some embodiments, if the use of the multi-reference line MRL mode is permitted in the current sequence, the third flag is encoded.
[0263] In some embodiments, the fifth flag is encoded, and if the fifth flag does not limit the value of the third flag or does not limit the value of the flag for indicating whether the use of the multi-reference line MRL mode is permitted in the current sequence, the third flag is encoded.
[0264] In some embodiments, the sixth flag is encoded, and if the sixth flag indicates that the use of the template-based mode is permitted in the current sequence, the third flag is encoded.
[0265] In some embodiments, the seventh flag is encoded, and if the seventh flag does not limit the value of the sixth flag, the sixth flag is encoded.
[0266] In some embodiments, the method 400 may further include determining a reference line corresponding to the maximum number of lines as a reference line permitted for use in the current block, constructing a TMRL mode list based on the reference lines permitted for use in the current block and the prediction modes permitted for use in the current block, encoding a first index, and where the reference lines and prediction modes included in the combination indicated by the first index in the TMRL mode list are the reference lines and prediction modes used in the current block.
[0267] In some embodiments, for each of the at least one combinations of reference rows permitted for use in the current block and prediction modes permitted for use in the current block, the template of the current block is predicted using the prediction mode of each combination based on the reference row of each combination to obtain the prediction cost of each combination. Based on the prediction cost of each combination, the at least one combination is sorted in descending order of prediction cost to obtain a combination ranking. The combinations that are positioned earlier in the combination ranking are determined to be the combinations in the TMRL mode list.
[0268] In some embodiments, the method 400 further, If the template-based multi-reference-row TMRL mode is not used in the current block, the system may include determining the reference rows used in the current block based on whether or not the template-based intra-mode derivation TIMD mode is used in the current block.
[0269] In some embodiments, the method 400 further, If the TIMD mode is used in the current block, the second index is encoded, If the TIMD mode is not used in the current block, this may include encoding the third index. Of these, the second index indicates the reference row to be used when TIMD mode is used in the current block, and the third index indicates the reference row to be used when TIMD mode is not used in the current block.
[0270] In some embodiments, an eighth flag is encoded, and the use of multi-reference-row MRL mode is permitted in the current sequence to which the current block belongs, and if TMRL mode is not used in the current block, the reference rows used in the current block are determined based on whether TIMD mode is used in the current block.
[0271] In some embodiments, the eighth flag is encoded if the maximum number of lines is greater than or equal to the second preset threshold.
[0272] In some embodiments, the eighth flag indicates that the use of multi-reference-row MRL mode is permitted in the current sequence, and the maximum number of rows is greater than or equal to the second preset threshold, and if TMRL mode is not used in the current block, the reference rows used in the current block are determined based on whether TIMD mode is used in the current block.
[0273] Since the encoding method can be understood as the reverse process of the decoding method, it should be understood that specific embodiments of the encoding method 400 can refer to the relevant content of the decoding method 300, and for the sake of ease of explanation, the present invention will not repeatedly describe this.
[0274] Although preferred embodiments of the present invention have been described in detail above with reference to the drawings, the present invention is not limited to the specific details of the embodiments mentioned above. Within the scope of the technical concept of the present invention, various simple modifications can be made to the technical aspects of the present invention, and all of these simple modifications fall within the scope of protection of the present invention. For example, each specific technical feature described in the specific embodiments mentioned above can be combined in any suitable way, as long as they do not contradict each other, and in order to avoid unnecessary duplication, the present invention does not separately describe various possible combinations. Furthermore, for example, various different embodiments of the present invention can be combined in any way, and as long as they do not contradict the spirit of the present invention, they should be considered to be the same as the content disclosed in the present invention. Moreover, in the various embodiments of the present invention, the magnitude of the number of each process mentioned above does not indicate the order of execution, and the order of execution of each process should be determined by its function and inherent logic, and should be understood as not limiting the implementation process of the embodiments of the present invention.
[0275] The above describes in detail an embodiment of the method of the present invention. Hereinafter, an embodiment of the apparatus of the present invention will be described in detail with reference to Figures 7 to 9.
[0276] Figure 7 is a schematic block diagram of the decoder 500 according to an embodiment of the present invention.
[0277] As shown in Figure 7, the decoder 500 is A first determination unit 510 is configured to determine the maximum number of reference rows that are currently allowed to be used in a block, A second decision unit 520 is configured to determine whether a template-based multi-reference row TMRL mode is used in the current block based on the maximum number of rows, If the TMRL mode is used in the current block, a third decision unit 530 is configured to determine the reference row used in the current block and the prediction mode used in the current block, The system may also include a prediction unit 540 configured to predict the current block using the prediction mode used in the current block, based on the reference rows used in the current block, in order to obtain a predicted block.
[0278] In some embodiments, the first decision unit 510 is specifically: Configured to acquire the first flag, Of these, the first flag indicates that if the value is a first number, the multi-reference row MRL mode will not be used in the current sequence to which the current block belongs, and if the value is a second number other than the first number, the MRL mode will be used in the current sequence and the maximum number of rows will be indicated.
[0279] In some embodiments, the first decision unit 510 is specifically: Obtain the second flag, The number of rows indicated by the second flag is configured to be determined as the maximum number of rows.
[0280] In some embodiments, the second decision unit 520 specifically, If the maximum number of rows is greater than the first preset threshold, the third flag is obtained. The third flag is configured to obtain the fourth flag if it indicates that the use of the TMRL mode is permitted in the current sequence to which the current block belongs. Of these, the fourth flag indicates whether the TMRL mode is used in the current block.
[0281] In some embodiments, the second decision unit 520 specifically, The third flag is configured to indicate that the use of the TMRL mode is permitted in the current sequence, and the fourth flag is obtained if the template-based intra-mode derived TIMD mode is not used in the current block.
[0282] In some embodiments, the second decision unit 520 specifically, Obtain the third flag, The third flag is configured to indicate that the use of the TMRL mode is permitted in the current sequence to which the current block belongs, and if the maximum number of rows is greater than the first preset threshold, the fourth flag is obtained. Of these, the fourth flag indicates whether the TMRL mode is used in the current block.
[0283] In some embodiments, the second decision unit 520 specifically, The third flag is configured to indicate that the use of the TMRL mode is permitted in the current sequence, and to determine that the TMRL mode is used in the current block if the maximum number of rows is greater than the first preset threshold and the template-based intra-mode derived TIMD mode is not used in the current block.
[0284] In some embodiments, the second decision unit 520 specifically, The system is configured to acquire the third flag if the use of multi-reference row MRL mode is permitted in the current sequence.
[0285] In some embodiments, the second decision unit 520 specifically, Obtain the 5th flag, The fifth flag is configured to take the third flag if it does not impose any restrictions on the values that the third flag can take, or if it does not impose any restrictions on the values that the flag can take to indicate whether the use of multi-reference row MRL mode is permitted in the current sequence.
[0286] In some embodiments, the second decision unit 520 specifically, Obtain the sixth flag, The sixth flag is configured to acquire the third flag if it indicates that the use of a template-based mode is permitted in the current sequence.
[0287] In some embodiments, the second decision unit 520 specifically, Obtain the 7th flag, The system is configured to acquire the sixth flag if the seventh flag indicates that there is no restriction on the value that the sixth flag can take.
[0288] In some embodiments, the third decision unit 530 specifically, The reference row corresponding to the maximum number of rows is determined to be the reference row permitted for use in the current block. Based on the reference lines permitted for use in the current block and the prediction modes permitted for use in the current block, a TMRL mode list is constructed. Get the first index, The system is configured to determine the reference row and forecast mode included in the combination indicated by the first index in the TMRL mode list as the reference row and forecast mode used in the current block.
[0289] In some embodiments, the third decision unit 530 specifically, For each of the at least one combinations consisting of a reference row permitted for use in the current block and a prediction mode permitted for use in the current block, the template of the current block is predicted using the prediction mode of each combination based on the reference row of each combination, and the prediction cost of each combination is obtained. Based on the predicted cost of each combination, the combinations are sorted from the lowest to the highest predicted cost to obtain a combination ranking. The system is configured to determine which combinations are in the TMRL mode list based on their position in the combination ranking.
[0290] In some embodiments, the prediction unit 540 further, If the TMRL mode is not used in the current block, the system is configured to determine the reference rows used in the current block based on whether or not the template-based intra-mode derived TIMD mode is used in the current block.
[0291] In some embodiments, the prediction unit 540 is specifically, If the TIMD mode is used in the current block, the second index is obtained, If the TIMD mode is not used in the current block, it is configured to obtain the third index. Of these, the second index indicates the reference row to be used when TIMD mode is used in the current block, and the third index indicates the reference row to be used when TIMD mode is not used in the current block.
[0292] In some embodiments, the prediction unit 540 is specifically, Obtain the 8th flag, The eighth flag is configured to indicate that the use of multi-reference-row MRL mode is permitted in the current sequence to which the current block belongs, and if TMRL mode is not used in the current block, to determine the reference rows used in the current block based on whether TIMD mode is used in the current block.
[0293] In some embodiments, the prediction unit 540 is specifically, The system is configured to acquire the eighth flag if the maximum number of rows is equal to or greater than the second preset threshold.
[0294] In some embodiments, the prediction unit 540 is specifically, The eighth flag indicates that the use of multi-reference-row MRL mode is permitted in the current sequence, and the maximum number of rows is greater than or equal to the second preset threshold, and if TMRL mode is not used in the current block, the system is configured to determine the reference rows used in the current block based on whether or not TIMD mode is used in the current block.
[0295] Figure 8 is a schematic block diagram of an encoder 600 according to an embodiment of the present invention.
[0296] As shown in Figure 8, the encoder 600 is A determination unit 610 is configured to determine the maximum number of reference rows that are currently allowed to be used in a block, It may also include an encoding unit 620 configured to encode the maximum number of lines.
[0297] In some embodiments, the decision unit 610 is specifically: Configured to encode the first flag, Of these, the first flag indicates that if the value is a first number, the multi-reference row MRL mode will not be used in the current sequence to which the current block belongs, and if the value is a second number other than the first number, the MRL mode will be used in the current sequence and the maximum number of rows will be indicated.
[0298] In some embodiments, the decision unit 610 is specifically: Configured to encode the second flag, Of these, the second flag indicates the maximum number of rows.
[0299] In some embodiments, the encoding unit 620 further, If the maximum number of rows is greater than the first preset threshold, encode the third flag. The third flag is configured to encode a fourth flag if it indicates that the use of template-based multi-reference-row TMRL mode is permitted in the current sequence. Of these, the fourth flag indicates whether the TMRL mode is used in the current block.
[0300] In some embodiments, the encoding unit 620 is specifically, The third flag is configured to indicate that the use of the TMRL mode is permitted in the current sequence, and if the template-based intra-mode derived TIMD mode is not used in the current block, the fourth flag is encoded.
[0301] In some embodiments, the encoding unit 620 further, Encode the third flag, The third flag is configured to indicate that the use of template-based multi-reference-row TMRL mode is permitted in the current sequence, and if the maximum number of rows is greater than a first preset threshold, it encodes a fourth flag. Of these, the fourth flag indicates whether the TMRL mode is used in the current block.
[0302] In some embodiments, the encoding unit 620 is specifically, The third flag is configured to indicate that the use of the TMRL mode is permitted in the current sequence, and if the maximum number of rows is greater than the first preset threshold, and the template-based intra-mode derived TIMD mode is not used in the current block, then the fourth flag is encoded.
[0303] In some embodiments, the encoding unit 620 is specifically, If the use of multi-reference-row MRL mode is permitted in the current sequence, the third flag is configured to encode.
[0304] In some embodiments, the encoding unit 620 is specifically, Encode the fifth flag, The fifth flag is configured to encode the third flag if it does not impose any restrictions on the values that the third flag can take, or if it does not impose any restrictions on the values that the flag can take to indicate whether the use of multi-reference-row MRL mode is permitted in the current sequence.
[0305] In some embodiments, the encoding unit 620 is specifically, Encode the sixth flag, The third flag is configured to encode if the sixth flag indicates that the use of a template-based mode is permitted in the current sequence.
[0306] In some embodiments, the encoding unit 620 is specifically, Encode the seventh flag, The system is configured to encode the sixth flag if the seventh flag indicates that there is no restriction on the values that the sixth flag can take.
[0307] In some embodiments, the encoding unit 620 further, The reference row corresponding to the maximum number of rows is determined to be the reference row permitted for use in the current block. Based on the reference lines permitted for use in the current block and the prediction modes permitted for use in the current block, a TMRL mode list is constructed. It is configured to encode the first index, Of these, the reference row and prediction mode included in the combination indicated by the first index in the TMRL mode list are the reference row and prediction mode used in the current block.
[0308] In some embodiments, the encoding unit 620 is specifically, For each of the at least one combinations consisting of a reference row permitted for use in the current block and a prediction mode permitted for use in the current block, the template of the current block is predicted using the prediction mode of each combination based on the reference row of each combination, and the prediction cost of each combination is obtained. Based on the predicted cost of each combination, the combinations are sorted from the lowest to the highest predicted cost to obtain a combination ranking. The system is configured to determine which combinations are in the TMRL mode list based on their position in the combination ranking.
[0309] In some embodiments, the decision unit 610 further, If the template-based multi-reference row TMRL mode is not used in the current block, the system is configured to determine the reference rows used in the current block based on whether or not the template-based intra-mode derived TIMD mode is used in the current block.
[0310] In some embodiments, the encoding unit 620 further, If the TIMD mode is used in the current block, encode the second index, If the TIMD mode is not used in the current block, it is configured to encode the third index. Of these, the second index indicates the reference row to be used when TIMD mode is used in the current block, and the third index indicates the reference row to be used when TIMD mode is not used in the current block.
[0311] In some embodiments, the encoding unit 620 is specifically, It is configured to encode the 8th flag, The decision unit 610 specifically, The eighth flag is configured to indicate that the use of multi-reference-row MRL mode is permitted in the current sequence to which the current block belongs, and if TMRL mode is not used in the current block, to determine the reference rows used in the current block based on whether TIMD mode is used in the current block.
[0312] In some embodiments, the decision unit 610 further, If the maximum number of lines is equal to or greater than the second preset threshold, the eighth flag is configured to be encoded.
[0313] In some embodiments, the decision unit 610 further, The eighth flag indicates that the use of multi-reference-row MRL mode is permitted in the current sequence, and the maximum number of rows is greater than or equal to the second preset threshold, and if TMRL mode is not used in the current block, the system is configured to determine the reference rows used in the current block based on whether or not TIMD mode is used in the current block.
[0314] It should be understood that the embodiments of the apparatus are interchangeable with the embodiments of the method, and similar descriptions refer to the embodiments of the method. To avoid duplication, this will not be repeated here. Specifically, the decoder 500 shown in Figure 7 is interchangeable with a corresponding entity that performs method 300 of the embodiments of the present invention, and the above-mentioned and other operations and / or functions of each unit in the decoder 500 are for realizing the corresponding flow in each method, such as method 300. The encoder 600 shown in Figure 8 is interchangeable with a corresponding entity that performs method 400 of the embodiments of the present invention, that is, the above-mentioned and other operations and / or functions of each unit in the encoder 600 are for realizing the corresponding flow in each method, such as method 400.
[0315] Furthermore, each unit in the decoder 500 or encoder 600 according to an embodiment of the present invention may be configured by combining each or all of them with one or more other units, or some of these units may be further divided into a plurality of functionally smaller units, and it should be understood that this does not affect the realization of the technical effects of the embodiment of the present invention and the same operation can be achieved. The units mentioned above are divided based on logical functions, and in actual applications, the function of one unit may be realized by multiple units, or the function of multiple units may be realized by one unit. In other embodiments of the present invention, the decoder 500 or encoder 600 may include other units, and in actual applications, these functions may be realized with the support of other units and may be realized through the cooperation of multiple units. According to another embodiment of the present invention, a decoder 500 or encoder 600 according to an embodiment of the present invention can be constructed and an encoding or decoding method according to an embodiment of the present invention can be realized by running a computer program (including program code) capable of executing each step of the corresponding method on a general-purpose computing device of a general-purpose computer, such as a central processing unit (CPU), a random access storage medium (RAM), and a read-only storage medium (ROM). The computer program can be written on, for example, a computer-readable storage medium, loaded into an electronic device by the computer-readable storage medium, and executed therein to realize the corresponding method of an embodiment of the present invention.
[0316] In other words, the units mentioned above may be implemented in hardware form, in software form instructions, or in a combination of software and hardware. Specifically, each step of the embodiment of the method in the embodiment of the present invention may be completed by hardware integrated logic circuits and / or software form instructions in a processor, and the steps relating to the method disclosed in the embodiment of the present invention may be implemented to be performed and completed directly by a hardware decoding device, or to be implemented to be performed and completed by a combination of hardware and software in a decoding device. Optionally, the software may reside in a mature storage medium of the art, such as random memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. The storage medium resides in memory, and the processor reads information in memory and, in cooperation with its hardware, completes the steps of the embodiment of the method mentioned above.
[0317] Figure 9 is a schematic diagram of the configuration of an electronic device 700 according to an embodiment of the present invention.
[0318] As shown in Figure 9, the electronic device 700 includes at least a processor 710 and a computer-readable storage medium 720. Of these, the processor 710 and the computer-readable storage medium 720 are connected by a bus or other means. The computer-readable storage medium 720 is configured to store a computer program 721, which includes computer instructions, and the processor 710 is configured to execute the computer instructions stored in the computer-readable storage medium 720. The processor 710 is the computing core and control core of the electronic device 700 and is suitable for implementing one or more computer instructions, specifically, for implementing a corresponding method flow or corresponding function by loading and executing one or more computer instructions.
[0319] For example, the processor 710 may be called a Central Processing Unit (CPU). The processor 710 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, a discrete hardware component, and the like.
[0320] Exemplary, the computer-readable storage medium 720 may be high-speed RAM memory, or non-volatile memory, such as at least one magnetic disk memory, and optionally, at least one computer-readable storage medium located away from the processor 710. Specifically, the computer-readable storage medium 720 includes, but is not limited to, volatile memory and / or non-volatile memory. Among these, the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), or flash memory. The volatile memory may be random access memory (RAM) and may be used as an external cache. As an illustrative but non-restrictive explanation, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synch-linked dynamic random access memory (synch-link DRAM, SLDRAM), and direct Rambus random access memory (Direct Rambus RAM, DR RAM).
[0321] Exemplary, the electronic device 700 may be an encoder or encoding framework according to an embodiment of the present invention. The computer-readable storage medium 720 stores a first computer instruction. The processor 710 loads and executes the first computer instruction stored in the computer-readable storage medium 720 to realize the corresponding step in the encoding method according to an embodiment of the present invention. In other words, the first computer instruction in the computer-readable storage medium 720 is loaded by the processor 710 and the corresponding step is executed, which will not be described again here to avoid redundancy.
[0322] Exemplary, the electronic device 700 may be a decoder or decoding framework according to an embodiment of the present invention. The computer-readable storage medium 720 stores a second computer instruction. The processor 710 loads and executes the second computer instruction stored in the computer-readable storage medium 720, thereby realizing the corresponding step in the decoding method according to an embodiment of the present invention. In other words, the second computer instruction in the computer-readable storage medium 720 is loaded by the processor 710 and the corresponding step is executed, which will not be described again here to avoid redundancy.
[0323] According to another aspect of the present invention, the present invention further provides an encoding and decoding system including the encoder and decoder mentioned above.
[0324] According to another aspect of the present invention, the present invention further provides a computer-readable memory medium (Memory) which is a storage device in an electronic device 700 and is configured to store programs and data. This is, for example, a computer-readable memory medium 720. Herein, the computer-readable memory medium 720 may include an internal memory medium in the electronic device 700, and of course may include an extended memory medium supported by the electronic device 700. The computer-readable memory medium provides a memory space in which the operating system of the electronic device 700 is stored. The memory space further stores one or more computer instructions suitable for being loaded and executed by a processor 710, and these computer instructions may be one or more computer programs 721 (including program code).
[0325] According to another aspect of the present invention, the present invention further provides a computer program product or computer program, the computer program product or computer program comprising computer instructions, the computer instructions stored in a computer-readable storage medium. This is, for example, a computer program 721. In this case, the data processing device 700 may be a computer, and a processor 710 reads the computer instructions from the computer-readable storage medium 720, executes the computer instructions, thereby causing the computer to perform an encoding or decoding method relating to the various selective schemes mentioned above.
[0326] In other words, when implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the flow of the embodiment of the present invention is operated in whole or in part, or the functions of the embodiment of the present invention are realized. The computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable device. The 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, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, radio, microwave, etc.) method.
[0327] Those skilled in the art will recognize that the units and flow steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed together in hardware or software will depend on the specific application of the technical embodiment and the design constraints. While experts in the art may implement the described functions using different methods for each specific application, such implementations should not be considered beyond the scope of the invention.
[0328] Finally, the above describes only specific embodiments of the present invention; however, the scope of protection of the present invention is not limited thereto, and any modifications or substitutions that any person skilled in the art could easily conceive within the technical scope disclosed herein should be included within the scope of protection of the present invention. Accordingly, the scope of protection of the present invention should be in accordance with the scope of protection of the claims described herein.
Claims
1. Currently, the maximum number of reference rows allowed in a block is determined, Based on the aforementioned maximum number of rows, it is determined whether or not template-based multi-reference row (TMRL) mode is used in the current block, If the TMRL mode is used in the current block, determine the reference row used in the current block and the prediction mode used in the current block. This includes predicting the current block using the prediction mode used in the current block, based on the reference row used in the current block, and obtaining a predicted block. A decoding method characterized by the following:
2. Determining the maximum number of reference rows allowed in the current block, as mentioned above, This includes obtaining the first flag, The first flag indicates that if the value is a first number, the multi-reference row (MRL) mode will not be used in the current sequence to which the current block belongs; and if the value is a second number other than the first number, the MRL mode will be used in the current sequence and the maximum number of rows will be indicated. The method according to feature 1.
3. Determining the maximum number of reference rows allowed in the current block, as mentioned above, To obtain the second flag, This includes determining the number of rows indicated by the second flag as the maximum number of rows, The method according to feature 1.
4. Based on the aforementioned maximum number of rows, determining whether or not template-based multi-reference row (TMRL) mode is used in the current block is: If the aforementioned maximum number of rows is greater than the first preset threshold, the third flag is acquired. The third flag indicates that the use of the TMRL mode is permitted in the current sequence to which the current block belongs, and the fourth flag is obtained, The fourth flag indicates whether the TMRL mode is used in the current block. The method according to any one of claims 1 to 3, characterized by the following:
5. Obtaining the aforementioned fourth flag means The third flag indicates that the use of the TMRL mode is permitted in the current sequence, and the fourth flag is obtained if the template-based intra-mode derivation (TIMD) mode is not used in the current block. The method according to feature 4.
6. Based on the aforementioned maximum number of rows, determining whether or not template-based multi-reference row (TMRL) mode is used in the current block is: To obtain the third flag, The third flag indicates that the use of the TMRL mode is permitted in the current sequence to which the current block belongs, and the fourth flag is acquired if the maximum number of rows is greater than the first preset threshold, The fourth flag indicates whether the TMRL mode is used in the current block. The method according to any one of claims 1 to 3, characterized by the following:
7. Obtaining the aforementioned fourth flag means The third flag indicates that the use of the TMRL mode is permitted in the current sequence, and determines that the TMRL mode is used in the current block if the maximum number of rows is greater than the first preset threshold and the template-based intra-mode derivation (TIMD) mode is not used in the current block. The method according to feature 6.
8. Obtaining the third flag mentioned above means If the use of multi-reference row (MRL) mode is permitted in the current sequence, the third flag is obtained, The method according to any one of claims 4 to 7.
9. Obtaining the third flag mentioned above means To obtain the fifth flag, The fifth flag indicates that there is no restriction on the values that the third flag can take, or that there is no restriction on the values that the flag can take to indicate whether the use of multi-reference row (MRL) mode is permitted in the current sequence, and includes obtaining the third flag, The method according to any one of claims 4 to 7.
10. Obtaining the third flag mentioned above means Obtaining the sixth flag, If the sixth flag indicates that the use of a template-based mode is permitted in the current sequence, then obtaining the third flag, The method according to any one of claims 4 to 9, characterized by...
11. Obtaining the aforementioned sixth flag means Obtaining the 7th flag, If the seventh flag indicates that there is no restriction on the values that the sixth flag can take, then obtaining the sixth flag is included, The method according to the present invention, characterized by the present invention.
12. Determining the reference row used in the current block and the prediction mode used in the current block, as described above, The reference row corresponding to the aforementioned maximum number of rows is determined to be the reference row permitted for use in the current block, A TMRL mode list is constructed based on the reference rows permitted for use in the current block and the prediction modes permitted for use in the current block. Obtaining the first index, The process includes determining the reference row and prediction mode included in the combination indicated by the first index in the TMRL mode list as the reference row and prediction mode used in the current block, The method according to any one of claims 1 to 11, characterized by...
13. Constructing a TMRL mode list based on the reference rows permitted for use in the current block and the prediction modes permitted for use in the current block, For each of the at least one combinations consisting of a reference row permitted for use in the current block and a prediction mode permitted for use in the current block, the template of the current block is predicted using the prediction mode of each combination based on the reference row of each combination, and the prediction cost of each combination is obtained. Based on the predicted cost of each of the aforementioned combinations, the combinations are sorted in descending order of predicted cost from smallest to largest to obtain a combination ranking. This includes determining the combination that is positioned earlier in the aforementioned combination ranking as the combination in the TMRL mode list, The method according to 12, characterized by the features described above.
14. If the TMRL mode is not used in the current block, the further includes determining the reference row used in the current block based on whether or not the template-based intra-mode derivation (TIMD) mode is used in the current block. The method according to any one of claims 1 to 13, characterized by...
15. Determining the reference rows used in the current block based on whether or not the template-based intra-mode derivation (TIMD) mode is used in the current block, If the TIMD mode is used in the current block, the second index is obtained, If the TIMD mode is not used in the current block, the third index is obtained, and The second index indicates the reference row to be used when TIMD mode is used in the current block, and the third index indicates the reference row to be used when TIMD mode is not used in the current block. The method according to feature 14.
16. If the TMRL mode is not used in the current block as described above, then determining the reference rows used in the current block based on whether or not the template-based intra-mode derivation (TIMD) mode is used in the current block is: Obtaining the 8th flag, The eighth flag indicates that the use of multi-reference row (MRL) mode is permitted in the current sequence to which the current block belongs, and if the TMRL mode is not used in the current block, the reference rows used in the current block are determined based on whether or not the TIMD mode is used in the current block. The method according to 14 or 15, characterized by the features described herein.
17. Obtaining the aforementioned eighth flag means If the aforementioned maximum number of rows is equal to or greater than the second preset threshold, the eighth flag is acquired. The method according to 16, characterized by...
18. Determining the reference rows used in the current block based on whether or not the TIMD mode is used in the current block, The eighth flag indicates that the use of multi-reference row (MRL) mode is permitted in the current sequence, and the maximum number of rows is greater than or equal to a second preset threshold, and the TMRL mode is not used in the current block, and the system includes determining the reference rows used in the current block based on whether the TIMD mode is used in the current block. The method according to 16, characterized by...
19. Currently, the maximum number of reference rows allowed in a block is determined, This includes encoding the maximum number of lines, An encoding method characterized by the following.
20. Encoding the aforementioned maximum number of lines is This includes encoding the first flag, The first flag indicates that if the value is a first number, the multi-reference row (MRL) mode is not used in the current sequence to which the current block belongs; and if the value is a second number other than the first number, the first flag indicates that the MRL mode is used in the current sequence and also indicates the maximum number of rows. The method according to feature 19.
21. Encoding the aforementioned maximum number of lines is This includes encoding a second flag, The second flag indicates the maximum number of rows. The method according to feature 19.
22. If the aforementioned maximum number of lines is greater than the first preset threshold, the third flag is encoded. If the third flag indicates that the use of template-based multi-reference-row (TMRL) mode is permitted in the current sequence, then the fourth flag is encoded, The fourth flag indicates whether the TMRL mode is used in the current block. The method according to any one of claims 19 to 21, characterized by...
23. Encoding the fourth flag mentioned above is The third flag indicates that the use of the TMRL mode is permitted in the current sequence, and the fourth flag is encoded if the template-based intra-mode derivation (TIMD) mode is not used in the current block. The method according to the feature of 22.
24. Encoding the third flag, The third flag indicates that the use of template-based multi-reference-row (TMRL) mode is permitted in the current sequence, and if the maximum number of rows is greater than a first preset threshold, the fourth flag is encoded. The fourth flag indicates whether the TMRL mode is used in the current block. The method according to any one of claims 19 to 21, characterized by...
25. Encoding the fourth flag mentioned above is The third flag indicates that the use of the TMRL mode is permitted in the current sequence, and the fourth flag is encoded if the maximum number of rows is greater than the first preset threshold and the template-based intra-mode derivation (TIMD) mode is not used in the current block. The method according to feature 24.
26. Encoding the third flag mentioned above is If the use of multi-reference-line (MRL) mode is permitted in the current sequence, then the third flag is encoded, The method according to any one of claims 22 to 25, characterized by the following:
27. Encoding the third flag mentioned above is Encoding the fifth flag, The fifth flag includes encoding the third flag if it does not impose any restrictions on the values the third flag can take, or if it does not impose any restrictions on the values the flag can take to indicate whether the use of multi-reference-row (MRL) mode is permitted in the current sequence, The method according to any one of claims 22 to 25, characterized by the following:
28. Encoding the third flag mentioned above is Encoding the sixth flag, If the sixth flag indicates that the use of a template-based mode is permitted in the current sequence, then the third flag is encoded, The method according to any one of claims 22 to 27, characterized by...
29. Encoding the sixth flag mentioned above is Encoding the seventh flag, If the seventh flag indicates that there is no restriction on the values that the sixth flag can take, then the encoding of the sixth flag is included, The method according to feature 28.
30. The reference row corresponding to the aforementioned maximum number of rows is determined to be the reference row permitted for use in the current block, A TMRL mode list is constructed based on the reference rows permitted for use in the current block and the prediction modes permitted for use in the current block. This further includes encoding the first index, The reference row and prediction mode included in the combination indicated by the first index in the TMRL mode list are the reference row and prediction mode used in the current block. The method according to any one of claims 19 to 29, characterized by...
31. Constructing a TMRL mode list based on the reference rows permitted for use in the current block and the prediction modes permitted for use in the current block, For each of the at least one combinations consisting of a reference row permitted for use in the current block and a prediction mode permitted for use in the current block, the template of the current block is predicted using the prediction mode of each combination based on the reference row of each combination, and the prediction cost of each combination is obtained. Based on the predicted cost of each of the aforementioned combinations, the combinations are sorted in descending order of predicted cost from smallest to largest to obtain a combination ranking. This includes determining the combination that is positioned earlier in the aforementioned combination ranking as the combination in the TMRL mode list, The method according to the present invention, characterized by the present invention.
32. If the template-based multi-reference row (TMRL) mode is not used in the current block, the method further includes determining the reference rows used in the current block based on whether or not the template-based intra-mode derivation (TIMD) mode is used in the current block. The method according to any one of claims 19 to 31, characterized by...
33. If the TIMD mode is used in the current block, then the second index is encoded, If the TIMD mode is not used in the current block, further includes encoding the third index, The second index indicates the reference row to be used when TIMD mode is used in the current block, and the third index indicates the reference row to be used when TIMD mode is not used in the current block. The method according to feature 32.
34. If the TMRL mode is not used in the current block as described above, then determining the reference rows used in the current block based on whether or not the template-based intra-mode derivation (TIMD) mode is used in the current block is: Encoding the eighth flag, The eighth flag indicates that the use of multi-reference row MRL mode is permitted in the current sequence to which the current block belongs, and if the TMRL mode is not used in the current block, the reference rows used in the current block are determined based on whether or not the TIMD mode is used in the current block. The method according to feature 32 or 33.
35. Encoding the eighth flag as described above is If the maximum number of lines is equal to or greater than the second preset threshold, the following steps are taken, including encoding the eighth flag: The method according to feature 34.
36. Determining the reference rows used in the current block based on whether or not the TIMD mode is used in the current block, The eighth flag indicates that the use of multi-reference row (MRL) mode is permitted in the current sequence, and the maximum number of rows is greater than or equal to a second preset threshold, and the TMRL mode is not used in the current block, and the system includes determining the reference rows used in the current block based on whether the TIMD mode is used in the current block. The method according to feature 34.
37. A first decision unit configured to determine the maximum number of reference rows currently allowed to be used in a block, A second decision unit is configured to determine whether or not template-based multi-reference row (TMRL) mode is used in the current block based on the maximum number of rows, If the TMRL mode is used in the current block, a third decision unit is configured to determine the reference row used in the current block and the prediction mode used in the current block. Includes a prediction unit configured to predict the current block using the prediction mode used in the current block, based on the reference row used in the current block, and to obtain a predicted block, A decoder characterized by the following features.
38. A decision unit configured to determine the maximum number of reference rows currently allowed in a block, A coding unit configured to encode the aforementioned maximum number of lines, An encoder characterized by the following features.
39. A processor suitable for running computer programs, Including a computer-readable storage medium, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 18 or the method according to any one of claims 19 to 36 is realized. An electronic device characterized by the following features.
40. It is configured to store computer programs, When the computer program is run on the computer, the computer is made to execute the method according to any one of claims 1 to 18 or the method according to any one of claims 19 to 36. A computer-readable storage medium characterized by the following features.
41. A computer program product that includes computer programs / instructions, When the computer program / instruction is executed by the processor, the method according to any one of claims 1 to 18 or the method according to any one of claims 19 to 36 is realized. A computer program product characterized by the following features.
42. A product produced by the method described in any one of claims 1 to 18 or the method described in any one of claims 19 to 36. A bitstream characterized by the following features.