Video decoding method, video encoding method, device, storage medium and program product

CN122802693APending Publication Date: 2026-09-22ZTE CORP +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510337309.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

然而,随着技术的不断发展,用户对画面质量的要求越来越高,源视频的数据量越来越大,而现有的TIMD技术中要求确定的3个预测模式必要同时包含2个角度预测模式和1个非角度预测的固定类型搭配,可能导致编解码性能不是最优,从而导致视频的压缩率降低,质量降低

Benefits of technology

[0011]本公开实施例公开了可以从多个候选预测模式中选择出M个目标预测模式,对当前块进行帧内预测。由于多个候选预测模式中包括基于邻近空域信息进行预测的第一类型预测模式,以及基于非邻近空域信息进行预测的第二类型预测模式,因此,通过多个候选预测模式得到的M个目标预测模式不再是固定类型搭配的预测模式,可以选出性能更好的M个目标预测模式,从而提高预测的准确率,从而提高视频的质量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122802693A_ABST
    Figure CN122802693A_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a video decoding method, a video encoding method, a device, a storage medium and a program product, which relate to the technical field of communication and can improve the quality of a video. The method comprises: determining a plurality of candidate prediction modes, the plurality of candidate prediction modes comprising a first type of prediction mode and a second type of prediction mode, the first type of prediction mode being based on adjacent spatial information for prediction, and the second type of prediction mode being based on non-adjacent spatial information for prediction; determining M target prediction modes from the plurality of candidate prediction modes based on a template region of a current block, M being a positive integer greater than or equal to 3; and performing intra prediction on the current block based on the M target prediction modes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of communication technology, and in particular to video decoding methods, video encoding methods, apparatus, storage media, and program products. Background Technology

[0002] In the field of video encoding and decoding, template-based intra-mode derivation (TIMD) predicts coding units based on template regions to obtain video frames. However, with the continuous development of technology, users have increasingly higher requirements for image quality, and the amount of source video data is increasing. The existing TIMD technology requires that the three prediction modes must simultaneously include a fixed combination of two angular prediction modes and one non-angular prediction mode, which may lead to suboptimal encoding and decoding performance, resulting in reduced video compression rate and quality. Summary of the Invention

[0003] This disclosure provides a video decoding method, a video encoding method, an apparatus, a storage medium, and a program product that can improve video quality.

[0004] On one hand, a video decoding and video encoding method is provided, comprising: determining multiple candidate prediction modes, the multiple candidate prediction modes including a first type prediction mode and a second type prediction mode, wherein the first type prediction mode is based on neighboring spatial information and the second type prediction mode is based on non-neighboring spatial information; determining M target prediction modes from the multiple candidate prediction modes based on the template region of the current block, wherein M is a positive integer greater than or equal to 3; and performing intra-frame prediction on the current block based on the M target prediction modes.

[0005] On another front, a video decoding and video encoding method is provided, comprising: determining multiple candidate prediction modes, the multiple candidate prediction modes including a first type prediction mode and a second type prediction mode, wherein the first type prediction mode is based on neighboring spatial information and the second type prediction mode is based on non-neighboring spatial information; determining M target prediction modes from the multiple candidate prediction modes based on the template region of the current block, where M is a positive integer greater than or equal to 3; and performing intra-frame prediction on the current block based on the M target prediction modes.

[0006] In another aspect, a video decoding and video encoding apparatus is provided, comprising: a determining unit and a processing unit; the determining unit is configured to determine a plurality of candidate prediction modes, the plurality of candidate prediction modes including a first type of prediction mode and a second type of prediction mode, the first type of prediction mode being based on neighboring spatial information, and the second type of prediction mode being based on non-neighboring spatial information; the determining unit is further configured to determine M target prediction modes from the plurality of candidate prediction modes based on the template region of the current block, where M is a positive integer greater than or equal to 3; the processing unit is configured to perform intra-frame prediction on the current block based on the M target prediction modes.

[0007] On another front, a video decoding and video encoding apparatus is provided, comprising: a determining unit and a processing unit; the determining unit is configured to determine a plurality of candidate prediction modes, the plurality of candidate prediction modes including a first type of prediction mode and a second type of prediction mode, the first type of prediction mode being based on neighboring spatial information, and the second type of prediction mode being based on non-neighboring spatial information; the determining unit is further configured to determine M target prediction modes from the plurality of candidate prediction modes based on the template region of the current block, where M is a positive integer greater than or equal to 3; the processing unit is configured to perform intra-frame prediction on the current block based on the M target prediction modes.

[0008] In another aspect, a communication device is provided, comprising: a memory and a processor; the memory and the processor are coupled; the memory is used to store a computer program; when the processor executes the computer program, it implements the video decoding and video encoding methods of any of the above embodiments.

[0009] In another aspect, a computer-readable storage medium is provided, on which computer program instructions are stored, which, when executed by a processor, implement the video decoding and video encoding methods of any of the above embodiments.

[0010] In another aspect, a computer program product is provided, which includes computer program instructions that, when executed by a processor, implement the video decoding and video encoding methods of any of the above embodiments.

[0011] This disclosure discloses a method for selecting M target prediction modes from multiple candidate prediction modes to perform intra-frame prediction on the current block. Since the multiple candidate prediction modes include a first type of prediction mode based on neighboring spatial information and a second type of prediction mode based on non-neighboring spatial information, the M target prediction modes obtained from the multiple candidate prediction modes are no longer fixed-type combinations. Therefore, M target prediction modes with better performance can be selected, thereby improving prediction accuracy and ultimately improving video quality. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in this disclosure, the accompanying drawings used in some embodiments of this disclosure will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings.

[0013] Figure 1 A schematic diagram of the dimensions of a template area provided for some embodiments of this disclosure;

[0014] Figure 2 A schematic diagram of a neighboring block provided for some embodiments of this disclosure;

[0015] Figure 3 A schematic diagram of a CU for determining candidate prediction patterns provided in some embodiments of this disclosure;

[0016] Figure 4 A communication system architecture diagram provided for some embodiments of this disclosure;

[0017] Figure 5 A flowchart illustrating a video decoding method provided in some embodiments of this disclosure;

[0018] Figure 6 A flowchart illustrating a target prediction pattern provided for some embodiments of this disclosure;

[0019] Figure 7 A schematic diagram of another neighboring block provided for some embodiments of this disclosure;

[0020] Figure 8 A schematic diagram of a non-adjacent block provided for some embodiments of this disclosure;

[0021] Figure 9 A schematic diagram showing the dimensions of another template area provided in some embodiments of this disclosure;

[0022] Figure 10 A schematic diagram of reference pixels for an angle pattern provided in some embodiments of this disclosure;

[0023] Figure 11 A schematic diagram of a block vector for a non-adjacent block provided for some embodiments of this disclosure;

[0024] Figure 12 A schematic diagram of reference pixels for another angle mode provided in some embodiments of this disclosure;

[0025] Figure 13 This is a schematic diagram illustrating a reconstructed pixel location provided for some embodiments of this disclosure;

[0026] Figure 14 A schematic diagram illustrating another target prediction pattern provided for some embodiments of this disclosure;

[0027] Figure 15 A flowchart illustrating a video encoding method provided in some embodiments of this disclosure;

[0028] Figure 16 This is a schematic diagram of the structure of a communication device provided in some embodiments of this disclosure;

[0029] Figure 17 This is a schematic diagram of the structure of another communication device provided in some embodiments of this disclosure;

[0030] Figure 18 This is a schematic diagram of the structure of another communication device provided in some embodiments of this disclosure. Detailed Implementation

[0031] The technical solutions of this disclosure will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0032] Unless the context otherwise requires, throughout the specification and claims, the term "comprise" and its other forms, such as the third-person singular "comprises" and the present participle "comprising," are interpreted as open-ended and encompassing, meaning "including, but not limited to." In the description of the specification, terms such as "one embodiment," "some embodiments," "exemplary embodiments," "example," "specific example," or "some examples," etc., are intended to indicate that a particular feature, structure, material, or characteristic associated with that embodiment or example is included in at least one embodiment or example of this disclosure. The illustrative representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics mentioned may be included in any suitable manner in any one or more embodiments or examples.

[0033] It should be noted that, in this disclosure, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in this disclosure should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0034] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.

[0035] In the description of this disclosure, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. "And / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "more than one" means two or more.

[0036] In this disclosure, suffixes such as "module," "part," or "unit" used to represent elements are used only for the purpose of illustrative purposes and have no inherent meaning. Therefore, "module," "part," or "unit" can be used interchangeably.

[0037] The following describes some of the technologies involved in the embodiments of this disclosure.

[0038] TIMD primarily uses prediction patterns (e.g., angle patterns from a predefined list of generated angle patterns) to predict template regions. Since the template region has already been reconstructed, the sum of absolute transformed differences (SATD) can be calculated between the predicted and reconstructed results. SATD characterizes the difference between the predicted and reconstructed pixel results. The calculation method for SATD is as follows:

[0039]

[0040] HT = H·W·H T ;

[0041]

[0042] Here, matrix W is the residual matrix formed by subtracting the predicted result (e.g., predicted pixel result) from the reconstructed result (e.g., reconstructed pixel result). The above formula uses a 4x4 Hadamard Transform (HT) matrix as an example. Furthermore, the size of the template area is limited, such as... Figure 1 As shown, M×N represents the current block (or the current coding unit), and the shaded area around the current block is the template area, with a maximum width of 4 for each of the template areas L1 and L2. In one implementation, there is also a TIMD-SAD approach. The difference between this approach and the TIMD approach is that the loss is represented by the sum of absolute differences (SAD) instead of STAD.

[0043] After obtaining the loss of the template region based on multiple prediction patterns, the two angle patterns corresponding to the two smallest losses among the multiple prediction patterns can be extracted as prediction patterns for the current block, namely angle pattern 0 and angle pattern 1. Then, TIMD fusion can be performed based on the extracted angle pattern 0 and angle pattern 1, that is, the prediction result for the current block is determined by the two angle patterns together.

[0044] In one possible implementation, such as Figure 2 As shown, the angle patterns in the angle pattern list can be angle patterns extracted from the neighboring blocks at the top left (AL), left side (A), top (L), top right (AR), and bottom left (BL) of the current block, i.e., angle patterns that have been used by these blocks.

[0045] In addition to the angled prediction modes mentioned above, there are also non-angled prediction modes, such as PLANA and DC component prediction (DC) mode. When selecting the optimal prediction mode based on the loss of the mode region, a non-angled mode can also be selected to predict the current block. For example, after determining angled mode 0 and angled mode 1, the loss of the template region can be determined based on multiple non-angled modes, and the non-angled mode with the smallest loss can be selected as the third prediction mode for predicting the current block, i.e., non-angled mode 2. Furthermore, based on the weights of each prediction mode, the prediction results of each prediction mode for the current block can be weighted and fused to obtain the prediction result after the fusion of multiple prediction modes.

[0046] The above describes TIMD and TIMD-SAD. In addition to these two methods, there is also a TIMD merging method (TIMD Merge, TIMD-Mrg).

[0047] In the TIMD-Mrg approach, the coding units (CUs) in the spatial domain are first traversed (e.g., ...). Figure 3 As shown in Table 1, if the CUs around the current CU are traversed, and the CUs are predicted using TIMD, TIMD-SAD, or TIMD-Mrg, then the intra-frame mode (i.e. prediction mode) used, the weights corresponding to each mode, and the position and depth are added to the list to obtain a TIMD mode list.

[0048] Table 1

[0049]

[0050]

[0051] This list can include the intra-frame modes used by the surrounding CUs, and then the loss for the template region is determined for each prediction mode (similar to the methods used for TIMD and TIMD-SAD above), i.e., the template loss corresponding to each mode X. x .

[0052] Next, by identifying multiple prediction patterns in each row of the list as a group of candidate prediction patterns (also known as a candidate TIMD pattern), the total loss for each group of prediction patterns can be determined. TIMD :

[0053] Loss TIMD =∑Weight x *Loss x ;

[0054] Subsequently, based on the total loss of each group, the group with the smallest total loss is determined as the prediction model used by the current CU, namely the TIMD-Mrg model group.

[0055] In one possible implementation, the prediction mode, in addition to the angular mode and the non-angular mode, can also include a block vector (BV) mode (also known as the block vector mode). In the process of determining the three prediction modes described above, the determined non-angular mode 2 can also be a BV mode (also known as TIMD_ITMP_IBC).

[0056] In other words, TIMD is a technique used in video coding to optimize the selection of intra-prediction modes. It aims to quickly determine a list of potential best intra-prediction mode candidates by utilizing information from encoded and reconstructed neighboring blocks (i.e., template regions), thereby reducing computational complexity in the full search process and improving coding efficiency. However, with continuous technological advancements, users' demands for image quality are increasing, and the amount of source video data is growing. Existing TIMD techniques require a fixed combination of three prediction modes, including two angular prediction modes and one non-angular prediction mode, which may lead to suboptimal encoding and decoding performance, resulting in reduced video compression rates and quality.

[0057] To address this, this disclosure provides a video decoding and encoding method that selects M target prediction modes from multiple candidate prediction modes to perform intra-frame prediction (also known as intra-frame prediction decoding) on ​​the current block. Since the multiple candidate prediction modes include a first type of prediction mode based on neighboring spatial information and a second type of prediction mode based on non-neighboring spatial information, the M target prediction modes obtained from the multiple candidate prediction modes are no longer fixed combinations of prediction modes. Therefore, M target prediction modes with better performance can be selected, thereby improving prediction accuracy and ultimately improving video quality.

[0058] The video decoding and encoding methods provided in this disclosure can be applied to systems with various communication standards. For example, the video decoding and encoding methods provided in this disclosure are applicable to systems including, but not limited to, Long Term Evolution (LTE) systems, various versions based on LTE evolution, 5G systems, future mobile communication networks (such as 6G mobile communication networks), or multiple converged communication systems. Furthermore, the video decoding and encoding methods provided in this disclosure can also be applied to future-oriented communication systems. In the process of video decoding and encoding applications, they can be applied to various scenarios, such as video conferencing, virtual reality, augmented reality, and streaming media services.

[0059] For example, the above video decoding and video encoding methods can be applied to, for example, Figure 4 In the aforementioned communication system, such as Figure 4 As shown, the communication system includes an encoder 401 and a decoder 402.

[0060] The encoder 401 and decoder 402 are communicatively connected. The encoder 401 and decoder 402 can be various devices such as terminals and servers. Figure 4 The following description uses encoder 401 as the server and decoder 402 as the terminal as an example.

[0061] In some embodiments, encoder 401 can determine multiple candidate prediction modes and, based on the template region of the current block, determine M target prediction modes from the multiple candidate prediction modes. Then, encoder 401 can perform intra-frame prediction on the current block based on the M target prediction modes to obtain the predicted pixel values ​​of the current block. It can then calculate the residual value of the current block based on the original pixel values ​​and the predicted pixel values, and encode the residual value to obtain a bitstream. Furthermore, the bitstream also includes first indication information, which indicates whether a target method is used; the target method is the method for determining the target prediction mode, i.e., indicating which method of determining the target prediction mode is allowed. Subsequently, encoder 401 sends the bitstream to decoder 402. Decoder 402 can obtain the residual value and the first indication information of the current block from the bitstream, determine the M target prediction modes based on the first indication information, perform intra-frame prediction on the current block based on the M target prediction modes to obtain the current predicted pixel values, and calculate the reconstructed pixel values ​​of the current block based on the residual value and the predicted pixel values, thereby obtaining a reconstructed video of the original video data. Since the M target prediction patterns are selected from multiple candidate prediction patterns, including both first-type and second-type prediction patterns, the resulting M target prediction patterns are no longer a fixed combination of multiple prediction patterns. This removes the limitation on the types of prediction patterns and allows for the selection of M target prediction patterns with better performance, thereby improving prediction accuracy and ultimately enhancing video quality.

[0062] It should be noted that, Figure 4 This is just an example framework diagram. Figure 4 The number of communication devices included, and the names of each communication device, are unlimited, except for... Figure 4 In addition to the communication equipment shown, the communication system may also include other communication equipment, such as relay nodes.

[0063] The application scenarios of the embodiments disclosed herein are not limited. The system architecture and business scenarios described in the embodiments of this disclosure are for the purpose of more clearly illustrating the technical solutions of the embodiments of this disclosure, and do not constitute a limitation on the technical solutions provided by the embodiments of this disclosure. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of this disclosure are also applicable to similar technical problems.

[0064] The video decoding and video encoding methods provided in the embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0065] The video decoding method provided in this disclosure can be applied to... Figure 4Decoder 402 in the communication system shown. Figure 5 A flowchart illustrating a video decoding method is shown, such as... Figure 5 As shown, the video decoding method includes the following S501-S503.

[0066] S501. Identify multiple candidate prediction patterns.

[0067] The candidate prediction modes include a first type and a second type. The first type predicts based on neighboring spatial information (spatial information can be blocks, CUs, etc.), while the second type predicts based on non-neighboring spatial information. The first type predicts can include at least one of the following: angular mode, PLANA mode, or DC mode (PLANA and DC modes can be understood as non-angular modes), which can utilize the texture similarity between neighboring spatial information and the block to be predicted for decoding. The second type predicts can include BV mode. BV mode can utilize the texture similarity between non-neighboring spatial information and the block to be predicted for decoding. By fully sampling all block vector information of the reconstructed region (i.e., the template region), a complete block vector list is constructed, thereby improving prediction performance.

[0068] In one possible implementation, the multiple candidate prediction modes can be a variety of preset modes, such as angle modes including 129 specified angle modes, and PLANA and DC modes can be non-angle modes. Alternatively, the multiple candidate prediction modes can include prediction modes already used in neighboring blocks and / or non-neighboring blocks.

[0069] S502. Based on the template region of the current block, determine M target prediction modes from multiple candidate prediction modes.

[0070] Where M is a positive integer greater than or equal to 3. The current block can be a CU.

[0071] In TIMD, multiple prediction modes (three for example) can be determined based on the template region of the current block, such as two angular modes plus one non-angular mode (or one BV mode). The types of prediction modes are fixed, therefore, the determined combination of prediction modes may not be optimal. In this embodiment, the decoder can jointly select M target prediction modes from multiple candidate prediction modes, including first-type and second-type prediction modes, instead of M target prediction modes with a fixed configuration. This way, the combination of the determined M target prediction modes can be the optimal combination, offering better performance than the combination of multiple prediction modes with a fixed configuration, thereby improving video compression rate and video quality.

[0072] Furthermore, when the M target prediction modes include the second type of prediction mode, the decoder can also make predictions using non-nearby spatial information. It can use the texture similarity between the non-nearby spatial information and the block to be predicted to predict the current block, thereby improving the accuracy of the prediction, making the determined error value smaller, improving the video compression rate, and reducing the amount of data transmitted.

[0073] S503. Perform intra-frame prediction on the current block based on M target prediction patterns.

[0074] After determining the M target prediction modes, the decoder can perform intra-frame prediction on the current block based on these modes to obtain the prediction result for the current block. Since the M target prediction modes represent the optimal combination of prediction modes, the resulting prediction is more accurate, thus improving video quality.

[0075] The following will describe the method for determining the prediction patterns of the M targets.

[0076] In some embodiments, combined with Figure 5 ,like Figure 6 As shown, in S502 above, determining M target prediction modes from multiple candidate prediction modes based on the template region of the current block specifically includes:

[0077] S601. Based on the template region of the current block, determine the template loss value of each of the multiple candidate prediction modes.

[0078] The template loss value is used to characterize the loss between the reconstructed value and the predicted value of the template region.

[0079] To select the optimal prediction mode from multiple candidate prediction modes, the decoder can determine the template loss value for each prediction mode based on the template region of the current block. Since the template region is a reconstructed reference region, the decoder can determine the template loss value based on the reconstructed value of the template region and the prediction value of the prediction mode for the template region. Thus, the template loss value characterizes the performance of the prediction mode; the smaller the template loss value, the more accurate the prediction of the template region.

[0080] In one possible implementation, the template loss can be calculated using any of the following methods: sum of absolute transformed difference (SATD), sum of absolute difference (SAD), or mean removed sum of absolute difference (MRSAD). For example, when calculating the template loss value, the predicted and reconstructed results of the template region can be subjected to SATD to characterize the loss between the predicted and reconstructed pixel results.

[0081] S602. Based on the template loss values ​​of each of the multiple candidate prediction modes, determine M target prediction modes from the multiple candidate prediction modes.

[0082] Since the template loss value of the prediction model to the template region can characterize the performance of the prediction model, M target prediction models, that is, the M target prediction models with better performance, can be determined by the template loss values ​​of multiple candidate prediction models.

[0083] In one possible implementation, S602 includes: selecting the M prediction modes with the smallest template loss values ​​from among multiple candidate prediction modes as the M target prediction modes. That is, selecting the M prediction modes with the best performance as the M target prediction modes. Thus, the combination of the resulting M prediction modes is the optimal combination in terms of performance, thereby improving decoding performance.

[0084] In another possible implementation, S602 includes: for each candidate prediction mode, correcting the template loss value of the candidate prediction mode based on the correction coefficient corresponding to the candidate prediction mode to obtain the corrected template loss value of the candidate prediction mode; and determining M target prediction modes from the multiple candidate prediction modes based on their respective corrected template loss values. Each prediction mode corresponds to a correction coefficient. For example, prediction modes with better performance (or more suitable for the block to be predicted) have smaller correction coefficients and smaller corrected loss values, while prediction modes with poorer performance have larger correction coefficients and larger corrected loss values. In this way, determining M target prediction modes based on the corrected template loss values ​​can more likely select prediction modes with better performance (or more important ones).

[0085] In some embodiments, S501 specifically includes: traversing the target prediction patterns used by neighboring blocks in multiple directions of the current block, adding a first type of prediction pattern from the target prediction patterns used by neighboring blocks to a plurality of candidate prediction patterns; traversing the target prediction patterns used by non-neighboring blocks, adding a second type of prediction pattern from the target prediction patterns used by non-neighboring blocks to a plurality of candidate prediction patterns.

[0086] The first type of prediction mode in the candidate prediction modes is the prediction mode used by the neighboring blocks of the current block. The second type of prediction mode in the candidate prediction modes is the prediction mode used by non-adjacent blocks, that is, non-adjacent blocks are spatially non-neighboring blocks of the current coding block. It should be noted that the traversed non-adjacent blocks can also be called non-adjacent CUs, non-adjacent reconstructed blocks, or non-adjacent coding blocks. Adjacent blocks are the same as non-adjacent blocks, and will not be repeated here. Among them, for the decoder, non-adjacent blocks are reconstructed, so they can also be called non-adjacent reconstructed blocks, while for the encoder, non-adjacent blocks can also be called non-adjacent coding blocks.

[0087] For example, 1. Traverse the adjacent CUs (i.e., the aforementioned neighboring blocks or adjacent coding blocks, such as...) of the current block (or the current coding block). Figure 7 As shown, AL, A, AR, L, and BL represent the adjacent CUs and non-adjacent CUs of the current CU (i.e., the aforementioned non-adjacent blocks, non-adjacent reconstructed blocks, or non-adjacent coded blocks, such as...). Figure 8 As shown, the marked CUs are non-adjacent CUs of the current CU. If a CU uses the BV mode as its prediction mode, then the BV it uses is added to the BV candidate list of the current CU (i.e., the second type of prediction mode in the candidate prediction modes). There can be a maximum of 50 valid BVs. One BV corresponds to one BV mode (or it can be understood that multiple BV modes are prediction modes using different BVs). Among them, when the CU uses intra template matching prediction (IntraTMP / ITMP), intra block copy (IBC), decoder side intra mode derivation (DIMD), spatial geometric partitioning mode (SGPM), TIMD, or occurrence based intra coding (OBIC), it can use the BV prediction mode.

[0088] 2. After obtaining the BV candidate list, the template region of the current CU (i.e., the current block) can be determined, such as... Figure 9As shown, the current CU template area includes a left template and a top template. The size x1 of the template area is set as follows:

[0089]

[0090] Among them, CU Width CU is the width of the template area. Height This represents the height of the template area.

[0091] 3. After obtaining the template area, select the angled patterns and non-angled patterns (i.e., the first type of prediction patterns mentioned above) from the original TIMD / TIMD-SAD pattern list. Figure 10 As shown, predictions are made based on reference pixels of the angle patterns in the upper and left template regions of the current CU and the BV values ​​in the BV list above, resulting in multiple prediction results. Then, the error loss between the multiple prediction results and the reconstructed pixel values ​​of the template region (i.e., the template loss values ​​mentioned above) is determined, and these error losses are sorted in ascending order. The patterns with the smallest error losses are selected as the M target prediction patterns.

[0092] In addition, the error loss and location depth must be preserved. The location depth is determined according to the following formula:

[0093]

[0094] Among them, SATD A SATD L These refer to the SATD of the upper and left templates, respectively.

[0095] Log2A = floor(log2CU) Height +x1),Log2L=floor(log2CU Width +x1).

[0096] CU Height CU Width This refers to the height and width of the template area. Errors (or error losses) include SATD, SAD, and MRSAD.

[0097] In one possible approach, when the prediction mode is BV mode, such as Figure 11 As shown, the template region of the current block can be predicted using the block vectors of the non-neighboring blocks (i.e., reference blocks) of the current block, thus obtaining the prediction result of the template region.

[0098] When the prediction mode is angle mode, such as Figure 12As shown, the template region can be predicted by the reference pixels of the angle pattern in the template region of the prediction unit (PU) (i.e., the current CU), and the prediction result of the template region can be obtained.

[0099] 4. After obtaining the template loss for all prediction patterns, a table showing the correspondence between prediction patterns and template losses can be constructed.

[0100] The template loss can be the loss after correction based on the correction coefficient.

[0101] 5. Based on the template loss of each prediction pattern, extract the three prediction patterns with the smallest loss as the pattern group of TIMD (i.e. the above M target prediction patterns).

[0102] 6. Calculate the prediction result for the current block for each prediction mode. After obtaining the prediction results for the three prediction modes, calculate the corresponding weights of the three modes, and then perform a weighted fusion calculation. The weights of the three modes are as follows:

[0103] TotalCost=SATD0+SATD1+SATD2;

[0104]

[0105] SATD0, SATD1, and SATD2 are the losses obtained by processing the template regions for the three prediction modes, respectively, and TotalCost is the total loss of the three modes.

[0106] In one possible implementation, such as Figure 13 As shown, when the BV mode is included among the three prediction modes, the BV corresponding to the BV mode and the current block coordinates (i.e., the top left corner of the current block) are used to find the reconstructed pixel position in the corresponding reconstructed pixel block. Then, the current block is copied pixel by pixel for prediction to obtain the prediction result of the current block.

[0107] 7. Determine the location depth of each mode based on its weight and the prediction result for the current CU. Since the weighted fusion of location depths is independent of the type of predicted mode, mode 0, mode 1, and mode 2 will be identified as mode X, mode Y, and mode Z respectively below. Their weights will also change from Weight0, Weight1, Weight2 to WeightX, WeightY, WeightZ. The prediction results for each mode will also become pX, pY, and pZ.

[0108] If the position depths of X, Y, and X patterns are all Vertical, then the weight of Vertical is:

[0109] Weight Ver=WeightX + WeightY + WeightZ;

[0110] pVer=WeightX*pX+WeightY*pY+WeightZ*pZ;

[0111] If the position depth of the X and Y patterns is Vertical, then the weight of Vertical is:

[0112] Weight Ver =WeightX + WeightY;

[0113]

[0114] If the position depth of the X pattern is Vertical, then the weight of Vertical is:

[0115] Weight Ver =WeightX;

[0116] pVer = pX;

[0117] Among them, Weight Ver Here, pVer represents the weight corresponding to Vertical, and pVer represents the prediction result corresponding to Vertical. Based on the above formula, the prediction results pVer, pHor, and pDia for each location depth can be determined. Then, weighted fusion can be performed based on location depth to obtain the prediction result after fusing multiple prediction modes.

[0118] pDst = Weight Ver *pVer+Weight Hor *pHor+Weight Dia *pDia;

[0119] Where pDst is the final prediction result, pVer, pHor, and pDia are the pixel intensities after weighted fusion based on the depth (Vertical, Horizontal, Diagonal) at the corresponding locations, respectively. Ver Weight Hor Weight Dia These are the weights for the depth at the corresponding positions.

[0120] The above describes how to select M target prediction modes from multiple candidate prediction modes. Below, we will describe another way to select M target prediction modes.

[0121] In some embodiments, combined with Figure 5 ,like Figure 14As shown, in S502 above, determining M target prediction modes from multiple candidate prediction modes based on the template region of the current block specifically includes:

[0122] S1401. Based on the template region of the current block, determine the target prediction mode group from multiple prediction mode groups.

[0123] Among them, multiple candidate prediction modes include multiple prediction mode groups, and each prediction mode group includes M prediction modes.

[0124] Instead of individual prediction modes, multiple candidate prediction modes are now presented as groups of prediction modes, each containing M prediction modes. This allows the decoder to select a target prediction mode group from these groups based on the template region of the current block.

[0125] In one possible implementation, the method for determining the target prediction mode group includes: determining the total loss value of each of the multiple prediction mode groups based on the template region of the current block, wherein each prediction mode group includes M prediction modes, and the total loss value of each prediction mode group is determined according to the template loss value of each of the M prediction modes in the prediction mode group; and determining the target prediction mode group from the multiple prediction mode groups based on the total loss value of each of the multiple prediction mode groups.

[0126] In this way, the total loss value of the template region of the current block can be determined based on each prediction mode group, and the prediction mode group with the smallest total loss value can be selected from multiple total loss values ​​to be determined as the target prediction mode group. In this way, the performance of the prediction mode group is the best and the prediction results are the most accurate.

[0127] In another possible implementation, a prediction mode group is a set of multiple target prediction modes used by a neighboring or non-neighboring block. That is, multiple prediction mode groups can be a collection of prediction modes used by blocks (neighboring or non-neighboring blocks) in the spatial domain. A prediction mode group is a set of multiple target prediction modes used by a block, i.e., multiple prediction modes that have been used.

[0128] S1402. Based on the target prediction model group, determine M target prediction models.

[0129] In one implementation, since each prediction mode group includes M target prediction modes, the M prediction modes in the target prediction mode group can be determined as M target prediction modes.

[0130] In another implementation, S1402 above includes:

[0131] Based on the order of weights of each prediction mode in the target prediction mode group from largest to smallest, a replacement check operation is performed on each prediction mode in the target prediction mode group in turn until the number of replaced prediction modes in the target prediction mode group reaches the maximum value, or all candidate prediction modes in the target prediction mode group have undergone a replacement check operation; the replacement check operation is used to check whether the checked prediction mode in the target prediction mode group is replaced by a candidate second type prediction mode; the M prediction modes in the target prediction mode group after the replacement check operation are taken as the M target prediction modes.

[0132] After (or before) selecting the target prediction mode group, the decoder can obtain the BV (Browser Value) applied by neighboring and non-neighboring CUs. That is, if a CU uses a BV mode, the BV mode used by that CU is identified as a candidate second-type prediction mode, and the template loss of each candidate second-type prediction mode is determined based on the template region of the current block. Then, a replacement check operation is performed in descending order of the weights of each prediction mode in the target prediction mode group (i.e., the weights for the weighted fusion of M prediction modes to determine the total loss value). This replaces the poorly performing prediction modes in the target prediction mode group with better performing prediction modes, and the replaced prediction modes in the target prediction mode group are identified as the M target prediction modes. This increases the prediction performance of the target prediction mode group and improves video quality.

[0133] The replacement check operation includes: comparing the template loss value of the checked prediction mode in the target prediction mode group with the template loss value of the candidate second type prediction mode in the candidate set of second type prediction modes one by one; if the template loss value of the prediction mode in the target prediction mode group is greater than the template loss value of the candidate second type prediction mode, the checked prediction mode is replaced by the candidate second type prediction mode.

[0134] In other words, the template loss values ​​of the examined prediction modes in the target prediction mode group are compared with those of the candidate second-type prediction modes. If the template loss value of the examined prediction mode is greater than that of the candidate second-type prediction mode, the prediction mode in the target prediction mode group is replaced with the candidate second-type prediction mode.

[0135] In one possible implementation, if the target prediction mode group includes at least one second-type prediction mode, all or part of the second-type prediction modes in the at least one second-type prediction mode are replaced with first-type prediction modes, for example, replacing all or part of the BV modes in the target prediction mode group with PLANA modes. That is, before performing the replacement check operation, all or at least one second-type prediction mode in the target prediction mode group is replaced with a first-type prediction mode (which can be a PLANA mode). After the replacement is completed, a replacement check operation is performed on the replaced target prediction mode group.

[0136] In one possible implementation, the second type prediction mode candidate set includes the second type prediction modes used by the neighboring and non-neighboring blocks of the current block. The decoder can traverse the neighboring and non-neighboring blocks of the current block, and if a neighboring or non-neighboring block uses a second type prediction mode as the target prediction mode, then the second type prediction mode used by it is added to the second type prediction mode candidate set. For example, if the second type prediction mode is the BV mode, the BV of the BV mode used by the neighboring and non-neighboring blocks of the current block is added to a BV candidate list (a BV can be considered a BV mode), and this BV candidate list is the second type prediction mode candidate set.

[0137] In one possible implementation, the template loss value of the examined prediction mode in the target prediction mode group is compared one by one with the template loss values ​​of candidate second-type prediction modes in the candidate set of second-type prediction modes, including:

[0138] The template loss values ​​of the candidate second prediction modes in the second type of prediction mode candidate set are compared one by one with the template loss values ​​of the candidate second type prediction modes in the second type of prediction mode candidate set, according to the order of the template loss values ​​of each candidate second type prediction mode in the target prediction mode group.

[0139] When comparing template loss values, the template loss values ​​in the second type of pattern candidate set are compared in ascending order. This ensures that the predicted pattern with the smaller template loss value has a greater probability of being replaced, thereby further improving decoding performance.

[0140] It should be noted that if the target prediction mode group includes at least one first-type prediction mode, the maximum number of first-type prediction modes that can be replaced is 1. That is, after replacing the first first-type prediction mode, the other first-type prediction modes in the target prediction mode group will not be replaced. For example, after the first angle mode is replaced, the remaining angle modes in the target prediction mode group will not be replaced.

[0141] For example, 1. Traverse the adjacent CUs of the current block (i.e., the aforementioned neighboring blocks, such as...) Figure 7 As shown, AL, A, AR, L, and BL represent the adjacent CUs (and non-adjacent CUs, i.e., the other current blocks mentioned above, such as...) of the current CU. Figure 8 As shown, the marked CUs are the non-adjacent CUs of the current CU. If a CU uses a BV pattern as its prediction pattern, then the BV it uses is added to the current CU's BV candidate list (i.e., the second type of pattern candidate set). There can be a maximum of 50 valid BVs. One BV corresponds to one BV pattern (or multiple BV patterns can be understood as prediction patterns using different BVs). Specifically, when a CU uses IntraTMP, IBC, DIMD, SGPM, TIMD, or OBIC, all of these can be BV prediction patterns.

[0142] 2. After obtaining the BV candidate list, the template area of ​​the current CU (i.e., the current block) can be determined. The template area of ​​the current CU includes the left template and the top template. The value of the template area size x1 is set as follows:

[0143]

[0144] Among them, CU Width CU is the width of the template area. Height This represents the height of the template area.

[0145] 3. After obtaining the template region, the template region is predicted using the multiple TIMD mode groups (i.e., the prediction mode groups mentioned above) determined by TIMD-MRG and the candidate BVs in the BV list, resulting in multiple prediction results. Then, the error loss between the multiple prediction results and the reconstructed pixel values ​​of the template region (i.e., the total loss value mentioned above) is determined, and these error losses are sorted in ascending order. The prediction mode in the mode group with the smallest error loss is selected as the M target prediction modes.

[0146] In addition, as shown in Table 2, the error loss and location depth must also be saved. The location depth is determined according to the following formula:

[0147]

[0148] Among them, SATD A SATD L These refer to the SATD of the upper and left templates, respectively.

[0149] Log2A = floor(log2CU) Height +x1),Log2L=floor(log2CU Width +x1).

[0150] CU Height CU Width This refers to the height and width of the template area. Error (or error loss) can be calculated using methods such as SATD, SAD, or MRSAD.

[0151] Table 2

[0152]

[0153]

[0154] 4. After determining the target prediction model group, arrange the prediction models in the target prediction model group in descending order of their weights, and then sort them in ascending order of error loss in the BV list.

[0155] 5. Compare the prediction modes in the target prediction mode group with the BV modes in the BV list according to their order. If the error loss in the BV list is smaller, replace the BV mode being compared with the prediction mode in the target prediction mode group.

[0156] 6. Make predictions for the current block using the replaced target prediction mode group.

[0157] The above describes the process of determining M target prediction modes. Subsequently, prediction can be performed on the blocks to be predicted in the bitstream based on these M target prediction modes. In addition to the blocks to be predicted, the bitstream may also include first indication information, which indicates whether a target method is used; the target method is the method used to determine the target prediction mode. The first indication information may indicate whether only one target method is allowed, or it may indicate whether multiple target methods are allowed. Optionally, different target methods may have different fields, and the value of these fields determines whether the target method is allowed.

[0158] For example, the first indication information could indicate whether the target prediction pattern can be determined using the TIMD method (i.e., the traditional determination method), or whether the target prediction pattern can be determined using the TIMD-SAD method (i.e., replacing SATD in TIMD loss calculation with SAD). Alternatively, the first indication information could indicate whether the target prediction pattern can be determined using the TIMD-BV replacement method, i.e., determining the target prediction pattern through methods S1401 and S1402. The following are some examples of target methods.

[0159] The target method may include at least one of the following: TIMD-BV, TIMD-SAD-BV, TIMD-MRG-BV, TIMD-BV replacement, TIMD-SAD-BV replacement, TIMD-MRG-BV replacement, TIMD, TIMD-SAD, TIMD-MRG.

[0160] The difference between TIMD-BV and TIMD lies in that TIMD-BV can determine whether to replace the PLANA patterns in the M target prediction patterns with BV patterns based on the template loss cost. TIMD-SAD-BV differs from TIMD-BV in that it uses the SAD method to calculate the template loss. TIMD-MRG-BV is similar to TIMD-BV, that is, it can determine whether to replace the PLANA patterns in the target prediction pattern group with BV patterns based on the template loss cost. TIMD-BV replacement can determine whether to replace the first-type prediction patterns in the M target prediction patterns with BV prediction patterns based on the template loss cost, meaning there is no fixed restriction on the type configuration of the M target prediction patterns (i.e.,...). Figure 5 The corresponding approach), the difference between TIMD-SAD-BV and TIMD-BV replacement is that TIMD-SAD-BV uses the SAD method to calculate the template loss. TIMD-MRG-BV replacement is similar to TIMD-BV replacement, that is, it can determine whether to replace the first type of prediction mode in the target prediction mode group with the BV mode based on the template loss cost (i.e., Figure 14 (Corresponding method).

[0161] For example, the bitstream includes multi-level syntax element control, so the first instruction information can be carried in different syntax structures.

[0162] Sequence parameter set: The value of the first indicator information in the sequence parameter set (SPS) determines whether the current sequence uses the target method. The syntax and semantics are shown in Table 3.

[0163] Table 3

[0164]

[0165] The first indication information may include at least one of the following:

[0166] sps_timd_bv_replace_enabled_flag: A value of 1 indicates that TIMD-BV replacement technology is enabled in the current sequence (i.e., the sequence containing the current block), while a value of 0 indicates that TIMD-BV replacement technology is not enabled in the current sequence.

[0167] sps_timd_sad_bv_replace_enabled_flag: A value of 1 indicates that TIMD-SAD-BV replacement technology is enabled in the current sequence, while a value of 0 indicates that TIMD-SAD-BV technology is not enabled in the current sequence.

[0168] sps_timd_mrg_bv_replace_enabled_flag: A value of 1 indicates that TIMD-MRG-BV replacement technology is enabled in the current sequence, while a value of 0 indicates that TIMD-MRG-BV technology is not enabled in the current sequence.

[0169] In other words, the above syntax elements are used to indicate whether the current sequence is enabled (or using) the target mode.

[0170] Similarly, when the above syntax elements are included in the image parameter set, the values ​​of the syntax elements are used to indicate whether the current image is enabled (or using) the target mode. When the above syntax elements can also be included in the image parameter set, the values ​​of the syntax elements are used to indicate whether the entire video is enabled (or using) the target mode.

[0171] General restriction information syntax:

[0172] The value of the first indicator information syntax element in GCI determines whether to restrict the value of the first indicator information in the sequence parameter set, i.e. whether to allow the use of the target mode. The syntactic semantics are shown in Table 4.

[0173] Table 4

[0174]

[0175] The first indication information may include the following:

[0176] `gci_no_timd_bv_replace_constraint_flag`: A value of 1 indicates that `sps_timd_bv_replace_enabled_flag` in the sequence parameter set must be 0, meaning that the TIMD-BV replacement technique in the target method is not allowed. A value of 0 indicates that there is no restriction, meaning that the use of the TIMD-BV replacement technique in the target method can be determined by the value of the syntax element `sps_timd_bv_replace_enabled_flag` in the parameter set.

[0177] `gci_no_timd_sad_bv_replace_constraint_flag`: A value of 1 indicates that the value of `sps_timd_sad_bv_replace_enabled_flag` in the sequence parameter set is 0, meaning that the TIMD-SAD-BV replacement technique in the target method is not allowed. A value of 0 indicates that there is no restriction, meaning that the use of the TIMD-SAD-BV replacement technique in the target method can be determined by the value of the syntax element `sps_timd_sad_bv_replace_enabled_flag` in the sequence parameter set.

[0178] `gci_no_timd_mrg_bv_replace_constraint_flag`: A value of 1 indicates that the value of `sps_timd_mrg_bv_replace_enabled_flag` in the sequence parameter set is 0, meaning that the TIMD-MRG-BV replacement technique in the target method is not allowed. A value of 0 indicates that such a restriction does not exist. In other words, the value of the syntax element `sps_timd_mrg_bv_replace_enabled_flag` in the sequence parameter set can be used to determine whether the TIMD-MRG-BV replacement technique in the target method is used.

[0179] In other words, the above syntax elements are used to indicate whether to restrict the value of the first indicator information in the parameter set, that is, whether to allow the target mode to be enabled (or used).

[0180] Encoding unit definition:

[0181] The value of the first indicator information syntax element in the encoding unit definition determines whether the target mode indicated by the first indicator information in the sequence parameter set is enabled in the current block (i.e., the target mode allowed when the value of the first indicator information in the sequence parameter set is 1), as shown in Table 5:

[0182] Table 5

[0183]

[0184]

[0185] The first indication information may include the following:

[0186] intra_timd_bv_replace_flag: A value of 1 indicates that the TIMD-BV replacement technology is enabled in the current coding unit (i.e., the current coding block), while a value of 0 indicates that the TIMD-BV replacement technology is not enabled in the current coding unit.

[0187] intra_timd_sad_bv_replace_flag: A value of 1 indicates that the TIMD-SAD-BV replacement technology is enabled in the current coding unit (i.e., the current coding block), while a value of 0 indicates that the TIMD-SAD-BV replacement technology is not enabled in the current coding unit.

[0188] intra_timd_mrg_bv_replace_flag: A value of 1 indicates that the TIMD-MRG-BV replacement technology is enabled in the current coding unit (i.e., the current coding block), while a value of 0 indicates that the TIMD-MRG-BV replacement technology is not enabled in the current coding unit.

[0189] In other words, the above syntax elements are used to indicate whether the current coding unit in the current sequence is enabled (or using) the target mode.

[0190] The video decoding method provided in this disclosure can be applied to... Figure 4 Encoder 401 in the communication system shown. Figure 15 A flowchart illustrating a video encoding method is shown, such as... Figure 15 As shown, the video encoding method includes the following S1501-S1503.

[0191] S1501, Identify multiple candidate prediction patterns.

[0192] Among them, the multiple candidate prediction modes include a first type of prediction mode and a second type of prediction mode. The first type of prediction mode makes predictions based on neighboring airspace information, while the second type of prediction mode makes predictions based on non-neighboring airspace information.

[0193] S1502. Based on the template region of the current block, determine M target prediction modes from multiple candidate prediction modes.

[0194] Where M is a positive integer greater than or equal to 3.

[0195] S1503. Perform intra-frame prediction on the current block based on M target prediction patterns.

[0196] The encoder can select M target prediction modes from multiple candidate prediction modes to perform intra-frame prediction (also known as intra-frame predictive coding) on ​​the current block. Since the multiple candidate prediction modes include the first type of prediction mode based on neighboring spatial information and the second type of prediction mode based on non-neighboring spatial information, the M target prediction modes obtained from the multiple candidate prediction modes are no longer fixed-type combinations. The M target prediction modes with better performance can be selected, thereby improving the prediction accuracy and thus improving the video quality.

[0197] It should be noted that the descriptions of target prediction modes, candidate prediction modes, etc., can be found in the descriptions on the decoder side, and will not be repeated here in the embodiments disclosed herein.

[0198] It is understood that video decoding and video encoding devices, in order to achieve the above-mentioned functions, include corresponding hardware structures and / or software modules for performing each function. Those skilled in the art should readily recognize that, based on the algorithmic steps of the examples described in conjunction with the embodiments of this disclosure, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.

[0199] This disclosure embodiment can divide the video decoding and video encoding apparatus into functional modules according to the above method embodiment. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one functional module. The integrated module can be implemented in hardware or software. It should be noted that the module division in this disclosure embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. The following description uses the example of dividing each function into a separate functional module.

[0200] Figure 16 This is a schematic diagram of a communication device provided in an embodiment of this disclosure. The communication device can execute the video decoding method provided in the above-described method embodiment. Figure 16 As shown, the communication device includes: a determining unit 1601 and a processing unit 1602.

[0201] The determining unit 1601 is used to determine multiple candidate prediction modes, including a first type of prediction mode and a second type of prediction mode. The first type of prediction mode makes predictions based on neighboring airspace information, and the second type of prediction mode makes predictions based on non-neighboring airspace information.

[0202] The determining unit 1601 is used to determine M target prediction modes from the plurality of candidate prediction modes based on the template region of the current block, where M is a positive integer greater than or equal to 3;

[0203] Processing unit 1602 is used to perform intra-frame prediction on the current block based on the M target prediction modes.

[0204] In one possible implementation, the first type of prediction mode includes at least one of the following: angle mode, PLANA mode, and DC mode.

[0205] In one possible implementation, the second type of prediction mode includes a block vector mode.

[0206] In one possible implementation, the determining unit 1601 is specifically used for:

[0207] Based on the template region of the current block, the template loss value of each of the multiple candidate prediction modes is determined. The template loss value is used to characterize the loss between the reconstructed value and the predicted value of the template region.

[0208] Based on the template loss values ​​of each of the multiple candidate prediction modes, M target prediction modes are determined from the multiple candidate prediction modes.

[0209] In one possible implementation, the determining unit 1601 is specifically used for:

[0210] The M prediction modes with the smallest template loss values ​​among the multiple candidate prediction modes are selected as the M target prediction modes.

[0211] In one possible implementation, the processing unit 1602 is specifically used for:

[0212] For each candidate prediction mode, the template loss value of the candidate prediction mode is corrected based on the correction coefficient corresponding to the candidate prediction mode to obtain the corrected template loss value of the candidate prediction mode.

[0213] Based on the modified template loss value of each of the multiple candidate prediction modes, the M target prediction modes are determined from the multiple candidate prediction modes.

[0214] In one possible implementation, the determining unit 1601 is specifically used for:

[0215] Iterate through the target prediction patterns used by neighboring blocks in multiple directions of the current block, and add the first type of prediction pattern from the target prediction patterns used by the neighboring blocks to the multiple candidate prediction patterns;

[0216] Iterate through the target prediction patterns used by other current blocks and add the second type of prediction pattern from the target prediction patterns used by the other current blocks to the plurality of candidate prediction patterns.

[0217] In one possible implementation, the determining unit 1601 is specifically used for:

[0218] Based on the template region of the current block, a target prediction mode group is determined from multiple prediction mode groups;

[0219] Based on the target prediction pattern group, the M target prediction patterns are determined.

[0220] In one possible implementation, the determining unit 1601 is specifically used for:

[0221] Based on the template region of the current block, the total loss value of each of the multiple prediction mode groups is determined. Each prediction mode group includes M prediction modes, and the total loss value of each prediction mode group is determined according to the template loss value of each of the M prediction modes in the prediction mode group.

[0222] Based on the total loss value of each of the multiple prediction mode groups, a target prediction mode group is determined from the multiple prediction mode groups.

[0223] In one possible implementation, the determining unit 1601 is specifically used for:

[0224] The prediction mode group with the smallest total loss value among the multiple prediction mode groups is determined as the target prediction mode group.

[0225] In one possible implementation, a prediction pattern group consists of multiple target prediction patterns used for a neighboring block or a non-neighboring block.

[0226] In one possible implementation, if the target prediction mode group includes at least one second type prediction mode, all or part of the second type prediction modes in the at least one second type prediction mode are replaced with the first type prediction mode.

[0227] In one possible implementation, the determining unit 1601 is specifically used for:

[0228] Based on the order of weights of each prediction mode in the target prediction mode group from largest to smallest, a replacement check operation is performed on each prediction mode in the target prediction mode group in turn until the number of replaced prediction modes in the target prediction mode group reaches the maximum value, or all candidate prediction modes in the target prediction mode group have undergone a replacement check operation; the replacement check operation is used to check whether the checked prediction mode in the target prediction mode group is replaced by a candidate second type prediction mode.

[0229] The M prediction patterns in the target prediction pattern group after the replacement check operation are taken as the M target prediction patterns.

[0230] In one possible implementation, the replacement check operation includes: comparing the template loss value of the checked prediction mode in the target prediction mode group with the template loss value of the candidate second type prediction mode in the candidate set of second type prediction modes one by one; if the template loss value of the prediction mode in the target prediction mode group is greater than the template loss value of the candidate second type prediction mode, replacing the checked prediction mode with the candidate second type prediction mode.

[0231] In one possible implementation, the processing unit 1602 is further configured to compare the template loss value of the examined prediction mode in the target prediction mode group with the template loss value of the candidate second prediction modes in the second type prediction mode candidate set in ascending order of their template loss values.

[0232] In one possible implementation, when the target prediction pattern group includes at least one first type prediction pattern, the maximum number of the first type prediction patterns that are replaced is 1.

[0233] In one possible implementation, the candidate set of the second type of prediction pattern includes: the second type of prediction pattern used by the neighboring blocks and non-neighboring blocks of the current block.

[0234] In one possible implementation, the device further includes: a receiving unit 1603; the receiving unit 1603 is configured to receive a code stream including first indication information, the first indication information being used to indicate whether a target mode is used; the target mode being a mode for determining the target prediction mode.

[0235] Figure 17 This is a schematic diagram of another communication device provided in an embodiment of this disclosure. The communication device can execute the video encoding method provided in the above-described method embodiments. Figure 17 As shown, the communication device includes: a determination unit 1701 and a processing unit 1702.

[0236] The determining unit 1701 is used to determine multiple candidate prediction modes, including a first type of prediction mode and a second type of prediction mode. The first type of prediction mode makes predictions based on neighboring airspace information, and the second type of prediction mode makes predictions based on non-neighboring airspace information.

[0237] The determining unit 1701 is further configured to determine M target prediction modes from the plurality of candidate prediction modes based on the template region of the current block, where M is a positive integer greater than or equal to 3;

[0238] Processing unit 1702 is used to perform intra-frame prediction on the current block based on the M target prediction modes.

[0239] In one possible implementation, the first type of prediction mode includes at least one of the following: angle mode, PLANA mode, and DC mode.

[0240] In one possible implementation, the second type of prediction mode includes a block vector mode.

[0241] In one possible implementation, the determining unit 1701 is specifically used for:

[0242] Based on the template region of the current block, the template loss value of each of the multiple candidate prediction modes is determined. The template loss value is used to characterize the loss between the reconstructed value and the predicted value of the template region.

[0243] Based on the template loss values ​​of each of the multiple candidate prediction modes, M target prediction modes are determined from the multiple candidate prediction modes.

[0244] In one possible implementation, the determining unit 1701 is specifically used for:

[0245] The M prediction modes with the smallest template loss values ​​among the multiple candidate prediction modes are selected as the M target prediction modes.

[0246] In one possible implementation, the processing unit 1702 is specifically used for:

[0247] For each candidate prediction mode, the template loss value of the candidate prediction mode is corrected based on the correction coefficient corresponding to the candidate prediction mode to obtain the corrected template loss value of the candidate prediction mode.

[0248] Based on the modified template loss value of each of the multiple candidate prediction modes, the M target prediction modes are determined from the multiple candidate prediction modes.

[0249] In one possible implementation, the determining unit 1701 is specifically used for:

[0250] Iterate through the target prediction patterns used by neighboring blocks in multiple directions of the current block, and add the first type of prediction pattern from the target prediction patterns used by the neighboring blocks to the multiple candidate prediction patterns;

[0251] Iterate through the target prediction patterns used by other current blocks and add the second type of prediction pattern from the target prediction patterns used by the other current blocks to the plurality of candidate prediction patterns.

[0252] In one possible implementation, the determining unit 1701 is specifically used for:

[0253] Based on the template region of the current block, a target prediction mode group is determined from multiple prediction mode groups;

[0254] Based on the target prediction pattern group, the M target prediction patterns are determined.

[0255] In one possible implementation, the determining unit 1701 is specifically used for:

[0256] Based on the template region of the current block, the total loss value of each of the multiple prediction mode groups is determined. Each prediction mode group includes M prediction modes, and the total loss value of each prediction mode group is determined according to the template loss value of each of the M prediction modes in the prediction mode group.

[0257] Based on the total loss value of each of the multiple prediction mode groups, a target prediction mode group is determined from the multiple prediction mode groups.

[0258] In one possible implementation, the determining unit 1701 is specifically used for:

[0259] The prediction mode group with the smallest total loss value among the multiple prediction mode groups is determined as the target prediction mode group.

[0260] In one possible implementation, if the target prediction mode group includes at least one second type prediction mode, all or part of the second type prediction modes in the at least one second type prediction mode are replaced with the first type prediction mode.

[0261] In one possible implementation, a prediction pattern group comprises multiple target prediction patterns used by a neighboring block or a non-neighboring block. In one possible implementation, the determining unit 1701 is specifically used for:

[0262] Based on the order of weights of each prediction mode in the target prediction mode group from largest to smallest, a replacement check operation is performed on each prediction mode in the target prediction mode group in turn until the number of replaced prediction modes in the target prediction mode group reaches the maximum value, or all candidate prediction modes in the target prediction mode group have undergone a replacement check operation; the replacement check operation is used to check whether the checked prediction mode in the target prediction mode group is replaced by a candidate second type prediction mode.

[0263] The M prediction patterns in the target prediction pattern group after the replacement check operation are taken as the M target prediction patterns.

[0264] In one possible implementation, the replacement check operation includes: comparing the template loss value of the checked prediction mode in the target prediction mode group with the template loss value of the candidate second type prediction mode in the candidate set of second type prediction modes one by one; if the template loss value of the prediction mode in the target prediction mode group is greater than the template loss value of the candidate second type prediction mode, replacing the checked prediction mode with the candidate second type prediction mode.

[0265] In one possible implementation, the processing unit 1702 is further configured to compare the template loss value of the examined prediction mode in the target prediction mode group with the template loss value of the candidate second prediction modes in the second type prediction mode candidate set in ascending order of their template loss values.

[0266] In one possible implementation, when the target prediction pattern group includes at least one first type prediction pattern, the maximum number of the first type prediction patterns that are replaced is 1.

[0267] In one possible implementation, the candidate set of the second type of prediction pattern includes: the second type of prediction pattern used by the neighboring blocks and non-neighboring blocks of the current block.

[0268] In one possible implementation, the device further includes: a sending unit 1703; the sending unit 1703 is configured to send first indication information in the code stream, the first indication information being used to indicate whether a target mode is used; the target mode is a method for determining the target prediction mode.

[0269] In implementing the functionality of the integrated modules described above using hardware, this disclosure provides another possible structure for the communication device involved in the above embodiments. For example... Figure 18 As shown, the communication device 180 includes a processor 1802 and a bus 1804. Optionally, the communication device may also include a memory 1801; alternatively, the communication device may also include a communication interface 1803.

[0270] Processor 1802 may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with embodiments of this disclosure. Processor 1802 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with embodiments of this disclosure. Processor 1802 may also be a combination of computing functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0271] The communication interface 1803 is used to connect to other devices via a communication network. This communication network can be Ethernet, wireless access network, wireless local area network (WLAN), etc.

[0272] The memory 1801 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.

[0273] As one possible implementation, the memory 1801 can exist independently of the processor 1802. The memory 1801 can be connected to the processor 1802 via a bus 1804 and is used to store instructions or program code. When the processor 1802 calls and executes the instructions or program code stored in the memory 1801, it can implement the video decoding and video encoding methods provided in this embodiment of the disclosure.

[0274] In another possible implementation, the memory 1801 can also be integrated with the processor 1802.

[0275] The 1804 bus can be an extended industry standard architecture (EISA) bus, etc. The 1804 bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 18 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0276] Some embodiments of this disclosure provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium) storing computer program instructions that, when executed on a computer, cause the computer to perform the video decoding and video encoding methods as described in any of the above embodiments.

[0277] For example, the computer-readable storage media described above may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks, or magnetic tapes), optical disks (e.g., compact disks (CDs), digital versatile disks (DVDs), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROMs), cards, sticks, or key drives, etc.). The various computer-readable storage media described in this disclosure may represent one or more devices for storing information and / or other machine-readable storage media. The term "machine-readable storage media" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and / or carrying instructions and / or data.

[0278] This disclosure provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the video decoding and video encoding methods described in any of the above embodiments. The above descriptions are merely specific implementations of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions within the technical scope disclosed in this disclosure should be covered within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.

Claims

1. A video decoding method, characterized in that, The method includes: Multiple candidate prediction modes are determined, including a first type of prediction mode and a second type of prediction mode. The first type of prediction mode makes predictions based on neighboring airspace information, and the second type of prediction mode makes predictions based on non-neighboring airspace information. Based on the template region of the current block, M target prediction modes are determined from the plurality of candidate prediction modes, where M is a positive integer greater than or equal to 3; Intra-frame prediction is performed on the current block based on the M target prediction patterns.

2. The method according to claim 1, characterized in that, The first type of prediction mode includes at least one of the following: angle mode, PLANA mode, and DC mode.

3. The method according to claim 1, characterized in that, The second type of prediction mode includes block vector mode.

4. The method according to claim 1, characterized in that, The process of determining M target prediction modes from the plurality of candidate prediction modes based on the template region of the current block includes: Based on the template region of the current block, the template loss value of each of the multiple candidate prediction modes is determined. The template loss value is used to characterize the loss between the reconstructed value and the predicted value of the template region. Based on the template loss values ​​of each of the multiple candidate prediction modes, M target prediction modes are determined from the multiple candidate prediction modes.

5. The method according to claim 4, characterized in that, The step of determining M target prediction modes from the multiple candidate prediction modes based on their respective template loss values ​​includes: The M prediction modes with the smallest template loss values ​​among the multiple candidate prediction modes are selected as the M target prediction modes.

6. The method according to claim 4, characterized in that, The step of determining M target prediction modes from the multiple candidate prediction modes based on their respective template loss values ​​includes: For each candidate prediction mode, the template loss value of the candidate prediction mode is corrected based on the correction coefficient corresponding to the candidate prediction mode to obtain the corrected template loss value of the candidate prediction mode. Based on the modified template loss value of each of the multiple candidate prediction modes, the M target prediction modes are determined from the multiple candidate prediction modes.

7. The method according to claim 4, characterized in that, The determination of multiple candidate prediction patterns includes: Iterate through the target prediction patterns used by neighboring blocks in multiple directions of the current block, and add the first type of prediction pattern from the target prediction patterns used by the neighboring blocks to the multiple candidate prediction patterns; Traverse the target prediction patterns used by non-adjacent blocks and add the second type of prediction pattern from the target prediction patterns used by the non-adjacent blocks to the plurality of candidate prediction patterns.

8. The method according to claim 1, characterized in that, The multiple candidate prediction modes include multiple prediction mode groups, and each prediction mode group includes M prediction modes. The process of determining M target prediction modes from the plurality of candidate prediction modes based on the template region of the current block includes: Based on the template region of the current block, a target prediction mode group is determined from multiple prediction mode groups; Based on the target prediction pattern group, the M target prediction patterns are determined.

9. The method according to claim 8, characterized in that, The step of determining the target prediction mode group from multiple prediction mode groups based on the template region of the current block includes: Based on the template region of the current block, the total loss value of each of the multiple prediction mode groups is determined. Each prediction mode group includes M prediction modes, and the total loss value of each prediction mode group is determined according to the template loss value of each of the M prediction modes in the prediction mode group. Based on the total loss value of each of the multiple prediction mode groups, a target prediction mode group is determined from the multiple prediction mode groups.

10. The method according to claim 9, characterized in that, The step of determining the target prediction mode group from the plurality of prediction mode groups based on their respective total loss values ​​includes: The prediction mode group with the smallest total loss value among the multiple prediction mode groups is determined as the target prediction mode group.

11. The method according to claim 8, characterized in that, A prediction pattern group is a set of multiple target prediction patterns used for a neighboring or non-neighboring block.

12. The method according to claim 8, characterized in that, In the case where the target prediction mode group includes at least one second type prediction mode, all or part of the second type prediction modes in the at least one second type prediction mode are replaced with the first type prediction mode.

13. The method according to claim 8 or 12, characterized in that, The step of determining the M target prediction patterns based on the target prediction pattern group includes: Based on the order of weights of each prediction mode in the target prediction mode group from largest to smallest, a replacement check operation is performed on each prediction mode in the target prediction mode group in turn until the number of replaced prediction modes in the target prediction mode group reaches the maximum value, or all candidate prediction modes in the target prediction mode group have undergone a replacement check operation; the replacement check operation is used to check whether the checked prediction mode in the target prediction mode group is replaced by a candidate second type prediction mode. The M prediction patterns in the target prediction pattern group after the replacement check operation are taken as the M target prediction patterns.

14. The method according to claim 13, characterized in that, The replacement check operation includes: comparing the template loss value of the checked prediction mode in the target prediction mode group with the template loss value of the candidate second type prediction mode in the candidate set of second type prediction modes one by one; if the template loss value of the prediction mode in the target prediction mode group is greater than the template loss value of the candidate second type prediction mode, replacing the checked prediction mode with the candidate second type prediction mode.

15. The method according to claim 14, characterized in that, The step of comparing the template loss value of the examined prediction mode in the target prediction mode group with the template loss value of the candidate second-type prediction mode in the candidate set of second-type prediction modes one by one includes: The template loss values ​​of the predicted modes examined in the target predicted mode group are compared one by one with the template loss values ​​of the candidate second predicted modes in the second type predicted mode candidate set, according to the order of the template loss values ​​sorted from smallest to largest in the candidate set of the second type predicted modes.

16. The method according to claim 13, characterized in that, When the target prediction pattern group includes at least one first type prediction pattern, the maximum number of the first type prediction patterns that are replaced is 1.

17. The method according to claim 15, characterized in that, The second type of prediction pattern candidate set includes: the second type of prediction pattern used by the neighboring blocks and non-neighboring blocks of the current block.

18. The method according to claim 1 or 8, characterized in that, The method further includes: Receive a bitstream including first indication information, the first indication information being used to indicate whether a target method is used; the target method is the method for determining the target prediction mode.

19. A video coding method, characterized in that, The method includes: Multiple candidate prediction modes are determined, including a first type of prediction mode and a second type of prediction mode. The first type of prediction mode makes predictions based on neighboring airspace information, and the second type of prediction mode makes predictions based on non-neighboring airspace information. Based on the template region of the current block, M target prediction modes are determined from the plurality of candidate prediction modes, where M is a positive integer greater than or equal to 3; Intra-frame prediction is performed on the current block based on the M target prediction patterns.

20. The method according to claim 19, characterized in that, The first type of prediction mode includes at least one of the following: angle mode, PLANA mode, and DC mode.

21. The method according to claim 19, characterized in that, The second type of prediction mode includes block vector mode.

22. The method according to claim 19, characterized in that, The process of determining M target prediction modes from the plurality of candidate prediction modes based on the template region of the current block includes: Based on the template region of the current block, the template loss value of each of the multiple candidate prediction modes is determined. The template loss value is used to characterize the loss between the reconstructed value and the predicted value of the template region. Based on the template loss values ​​of each of the multiple candidate prediction modes, M target prediction modes are determined from the multiple candidate prediction modes.

23. The method according to claim 22, characterized in that, The step of determining M target prediction modes from the multiple candidate prediction modes based on their respective template loss values ​​includes: The M prediction modes with the smallest template loss values ​​among the multiple candidate prediction modes are selected as the M target prediction modes.

24. The method according to claim 22, characterized in that The process of determining M target prediction modes from the plurality of candidate prediction modes based on their respective template loss values ​​includes: For each candidate prediction mode, the template loss value of the candidate prediction mode is corrected based on the correction coefficient corresponding to the candidate prediction mode to obtain the corrected template loss value of the candidate prediction mode. Based on the modified template loss value of each of the multiple candidate prediction modes, the M target prediction modes are determined from the multiple candidate prediction modes.

25. The method according to claim 22, characterized in that, The determination of multiple candidate prediction patterns includes: Iterate through the target prediction patterns used by neighboring blocks in multiple directions of the current block, and add the first type of prediction pattern from the target prediction patterns used by the neighboring blocks to the multiple candidate prediction patterns; Traverse the target prediction patterns used by non-adjacent blocks and add the second type of prediction pattern from the target prediction patterns used by the non-adjacent blocks to the plurality of candidate prediction patterns.

26. The method according to claim 19, characterized in that, The multiple candidate prediction modes include multiple prediction mode groups, and each prediction mode group includes M prediction modes. The process of determining M target prediction modes from the plurality of candidate prediction modes based on the template region of the current block includes: Based on the template region of the current block, a target prediction mode group is determined from multiple prediction mode groups; Based on the target prediction pattern group, the M target prediction patterns are determined.

27. The method according to claim 26, characterized in that, The step of determining the target prediction mode group from multiple prediction mode groups based on the template region of the current block includes: Based on the template region of the current block, the total loss value of each of the multiple prediction mode groups is determined. Each prediction mode group includes M prediction modes, and the total loss value of each prediction mode group is determined according to the template loss value of each of the M prediction modes in the prediction mode group. Based on the total loss value of each of the multiple prediction mode groups, a target prediction mode group is determined from the multiple prediction mode groups.

28. The method according to claim 27, characterized in that, The step of determining the target prediction mode group from the plurality of prediction mode groups based on their respective total loss values ​​includes: The prediction mode group with the smallest total loss value among the multiple prediction mode groups is determined as the target prediction mode group.

29. The method according to claim 26, characterized in that, A prediction pattern group is a set of multiple target prediction patterns used for a neighboring or non-neighboring block.

30. The method according to claim 26, characterized in that, In the case where the target prediction mode group includes at least one second type prediction mode, all or part of the second type prediction modes in the at least one second type prediction mode are replaced with the first type prediction mode.

31. The method according to claim 26 or 30, characterized in that, The step of determining the M target prediction patterns based on the target prediction pattern group includes: Based on the order of weights of each prediction mode in the target prediction mode group from largest to smallest, a replacement check operation is performed on each prediction mode in the target prediction mode group in turn until the number of replaced prediction modes in the target prediction mode group reaches the maximum value, or all candidate prediction modes in the target prediction mode group have undergone a replacement check operation; the replacement check operation is used to check whether the checked prediction mode in the target prediction mode group is replaced by a candidate second type prediction mode. The M prediction patterns in the target prediction pattern group after the replacement check operation are taken as the M target prediction patterns.

32. The method according to claim 31, characterized in that, The replacement check operation includes: comparing the template loss value of the checked prediction mode in the target prediction mode group with the template loss value of the candidate second type prediction mode in the candidate set of second type prediction modes one by one; if the template loss value of the prediction mode in the target prediction mode group is greater than the template loss value of the candidate second type prediction mode, replacing the checked prediction mode with the candidate second type prediction mode.

33. The method according to claim 32, characterized in that, The step of comparing the template loss value of the examined prediction mode in the target prediction mode group with the template loss value of the candidate second-type prediction mode in the candidate set of second-type prediction modes one by one includes: The template loss values ​​of the predicted modes examined in the target predicted mode group are compared one by one with the template loss values ​​of the candidate second predicted modes in the second type predicted mode candidate set, according to the order of the template loss values ​​sorted from smallest to largest in the candidate set of the second type predicted modes.

34. The method according to claim 31, characterized in that, When the target prediction pattern group includes at least one first type prediction pattern, the maximum number of the first type prediction patterns that are replaced is 1.

35. The method according to claim 33, characterized in that, The second type of prediction pattern candidate set includes: the second type of prediction pattern used by the neighboring blocks and non-neighboring blocks of the current block.

36. The method according to claim 31, characterized in that, The method further includes: Send first indication information in the bitstream, the first indication information being used to indicate whether to use the target method; the target method is the method for determining the target prediction mode.

37. A communication device, characterized in that, include: Memory and processor; Memory and processor are coupled; The memory is used to store instructions that can be executed by the processor; When the processor executes the instructions, it performs the method as described in any one of claims 1-36.

38. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-36.

39. A computer program product, characterized in that, The computer program product includes computing technology program instructions that, when executed by a processor, implement the method as described in any one of claims 1-36.