Video block prediction method, video bit stream processing method, and related device
By using the prediction results of block vector candidates instead of the prediction results of target angle patterns in video block prediction, the prediction error problem caused by the low spatial correlation of the current blocks is solved, thus improving the prediction accuracy and efficiency of video blocks.
Patent Information
- Application Number
- PCT/CN2025/096035
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-14
- Filing Date
- 2025-05-20
- Publication Date
- 2026-02-19
AI Technical Summary
Existing video block prediction methods suffer from decreased prediction accuracy when the spatial correlation between the spatial information of some neighboring spatial domains of the current block and the current block is small, especially when the use of multiple angle modes and planar modes produces large errors.
By obtaining the prediction loss values of the target angle pattern and the block vector candidate of the current block, and determining that the preset relationship is met, the prediction result of the block vector candidate is replaced with the prediction result of the target angle pattern, so as to reduce the use of adjacent airspace information and enhance the use of non-adjacent airspace information.
It improves the prediction accuracy of video blocks, reduces errors, enhances the effective use of non-adjacent spatial information, and improves prediction efficiency.
Smart Images

Figure CN2025096035_19022026_PF_FP_ABST
Abstract
Description
Method for predicting video block, video stream processing method and related device
[0001] Cross-reference to related applications
[0002] The present application is based on and claims priority to Chinese Patent Application No. 2024111181428, filed on August 14, 2024, the content of which is hereby incorporated by reference in its entirety into the present application. TECHNICAL FIELD
[0003] Embodiments of the present application relate to the technical field of video coding, and in particular to a method for predicting a video block, a video stream processing method and related devices. BACKGROUND
[0004] Prediction of a video block is an important link in video coding and analysis, which mainly predicts a to-be-coded block by using a coded block in a video frame. Current methods for predicting a video block include multiple angle modes and a planar (PLANAR) mode, etc., and the multiple angle modes and the planar mode mainly predict a current video block by using adjacent spatial information. If part of the adjacent spatial information of the current block has a small spatial correlation with the current block, then predicting the video block by using the multiple angle modes and the planar mode will produce a large error, which affects the prediction accuracy of the video block. SUMMARY
[0005] Embodiments of the present application provide a method for predicting a video block, a video stream processing method and related devices.
[0006] In a first aspect, embodiments of the present application provide a method for predicting a video block, the method comprising: obtaining a target angle mode of a current block and a first prediction loss value corresponding to the target angle mode; obtaining a block vector candidate of the current block and a second prediction loss value corresponding to the block vector candidate; determining that the first prediction loss value and the second prediction loss value satisfy a preset relationship, and replacing a prediction result of the target angle mode with a prediction result based on the block vector candidate to obtain a prediction result of the current block.
[0007] In a second aspect, an embodiment of the present application provides a video stream processing method, which comprises: setting a preset switch flag in coding parameter information, the preset switch flag being used to indicate whether a target strategy is used to predict a current block; and writing the coding parameter information into a video stream; wherein the target strategy comprises: obtaining a target angle mode of the current block and a first prediction loss value corresponding to the target angle mode, obtaining a block vector candidate of the current block and a second prediction loss value corresponding to the block vector candidate, determining that the first prediction loss value and the second prediction loss value satisfy a preset relationship, and replacing a prediction result of the target angle mode with a prediction result based on the block vector candidate to obtain a prediction result of the current block.
[0008] In a third aspect, an embodiment of the present application provides a video stream processing method, which comprises: receiving a video stream and obtaining coding parameter information from the video stream; and predicting a current block using a target strategy according to a preset switch flag in the coding parameter information; wherein the target strategy comprises: obtaining a target angle mode of the current block and a first prediction loss value corresponding to the target angle mode, obtaining a block vector candidate of the current block and a second prediction loss value corresponding to the block vector candidate, determining that the first prediction loss value and the second prediction loss value satisfy a preset relationship, and replacing a prediction result of the target angle mode with a prediction result based on the block vector candidate to obtain a prediction result of the current block.
[0009] In a fourth aspect, an embodiment of the present application provides an electronic device, which comprises: one or more processors; and a memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of the first aspect, the second aspect or the third aspect.
[0010] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the method according to any one of the first aspect, the second aspect or the third aspect.
[0011] In a sixth aspect, an embodiment of the present application provides a computer program product, which comprises a computer program, wherein the computer program is executed by a processor to implement the method according to any one of the first aspect, the second aspect or the third aspect. BRIEF DESCRIPTION OF DRAWINGS
[0012] The accompanying drawings are included to provide a further understanding of the technical scheme of the present application, constitute a part of the specification and are used to explain the technical scheme of the present application together with the embodiments of the present application, and do not constitute a limitation on the technical scheme of the present application.
[0013] FIG. 1 is a general flowchart of the intra prediction method according to an embodiment of the present application;
[0014] FIG. 2 is a schematic diagram of the neighboring spatial domain of the current block according to an embodiment of the present application;
[0015] FIG. 3 is a schematic diagram of the block vector candidate according to an embodiment of the present application;
[0016] FIG. 4 is a schematic diagram of the sampling points in the neighboring spatial domain and the non-neighboring spatial domain of the current block according to an embodiment of the present application;
[0017] FIG. 5 is a flowchart of replacing the prediction result of the target angular mode with the prediction result based on the block vector candidate according to step S300 in FIG. 1;
[0018] FIG. 6 is a flowchart of replacing the prediction result of the target angular mode with the prediction result based on the block vector candidate according to step S310 in FIG. 5;
[0019] FIG. 7 is a flowchart of obtaining the prediction result of the current block according to the weight corresponding to the target angular mode according to an embodiment of the present application;
[0020] FIG. 8 is a flowchart of the weighted fusion according to the prediction result based on the block vector candidate and the weight, the prediction result of the other mode and the weight according to step S322 in FIG. 7;
[0021] FIG. 9 is a schematic diagram of the template region of the block vector candidate according to an embodiment of the present application;
[0022] FIG. 10 is a flowchart of determining the target angular mode according to the gradient histogram according to an embodiment of the present application;
[0023] FIG. 11 is a schematic diagram of the template region according to an embodiment of the present application;
[0024] FIG. 12 is a schematic diagram of the pixel matrix corresponding to the template region according to an embodiment of the present application;
[0025] FIG. 13 is a flowchart of determining the target angular mode according to the frequency histogram according to an embodiment of the present application;
[0026] FIG. 14 is a schematic diagram of the frequency histogram according to an embodiment of the present application;
[0027] FIG. 15 is a flowchart of determining the target angular mode according to the angular mode list according to an embodiment of the present application;
[0028] FIG. 16 is another schematic diagram of the template region according to an embodiment of the present application;
[0029] FIG. 17 is a schematic diagram of the upper template region and the lower template region according to an embodiment of the present application;
[0030] FIG. 18 is a flow chart of determining a target angle mode according to an IMM list according to an embodiment of the present application;
[0031] FIG. 19 is another schematic diagram of an upper template region and a lower template region according to an embodiment of the present application;
[0032] FIG. 20 is a schematic diagram of a current block and a template region according to an embodiment of the present application;
[0033] FIG. 21 is a flow chart of a video stream processing method according to an embodiment of the present application;
[0034] FIG. 22 is a schematic diagram of a video stream processing method in an encoding process according to an embodiment of the present application;
[0035] FIG. 23 is a flow chart of setting a preset switch flag in encoding parameter information in step S910 of FIG. 21 according to an embodiment of the present application;
[0036] FIG. 24 is another flow chart of a video stream processing method according to an embodiment of the present application;
[0037] FIG. 25 is a schematic diagram of a video stream processing method in a decoding process according to an embodiment of the present application;
[0038] FIG. 26 is a flow chart of step S940 of FIG. 24 according to a preset switch flag in encoding parameter information according to an embodiment of the present application;
[0039] FIG. 27 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0040] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.
[0041] It should be understood that, in the description of the embodiments of the present application, if there is a description to "first", "second" and the like, it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or the sequence of the indicated technical features. "At least one" means one or more, and "multiple" means two or more. The "and / or" describes the association relationship of the associated objects, which means that there can be three kinds of relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. Wherein A, B can be singular or plural. The character " / " generally represents that the front and rear associated objects are in an "or" relationship. "At least one of the following" and the like means any group of these items, including any group of single items or multiple items. For example, at least one of a, b and c can mean: a, b, c, a and b, a and c, b and c, or a and b and c, wherein a, b, c can be single or multiple.
[0042] In addition, the technical features involved in the various embodiments of the present application described below can be combined with each other as long as there is no conflict.
[0043] Prediction of a video block is an important link in video coding and analysis, mainly predicting unknown blocks through known blocks in a video frame. The current method of predicting a video block includes multiple angle modes and a planar (PLANAR) mode, and the multiple angle modes and the planar mode mainly predict the current video block by using the adjacent spatial information. If part of the adjacent spatial information of the current block has less spatial correlation with the current block, predicting the video block by the multiple angle modes and the planar mode will produce a large error, affecting the prediction accuracy of the video block.
[0044] Based on this, the embodiments of the present application provide a method for predicting a video block, a video bitstream processing method and related equipment. In the case that the first prediction loss value and the second prediction loss value satisfy a preset relationship, the embodiments of the present application predict based on the prediction result of the block vector candidate instead of the prediction result of the target angle mode, reduce the use of adjacent spatial information with less spatial correlation with the current block, and strengthen the use of effective information of non-adjacent spatial domain, thereby improving the prediction accuracy of the video block.
[0045] The present application will be further described below with reference to the accompanying drawings.
[0046] Referring to FIG. 1, FIG. 1 is a general flowchart of a method for predicting a video block provided by the embodiments of the present application. The method for predicting a video block provided by the embodiments of the present application includes but is not limited to the following steps S100, S200 and S300.
[0047] Step S100, obtaining a target angle mode of the current block and a first prediction loss value corresponding to the target angle mode.
[0048] Step S200, obtaining a block vector candidate of the current block and a second prediction loss value corresponding to the block vector candidate.
[0049] Step S300, determining that the first prediction loss value and the second prediction loss value satisfy a preset relationship, replacing a prediction result of the target angle mode with a prediction result based on the block vector candidate to obtain a prediction result of the current block.
[0050] It should be noted that the current block is a video block currently requiring prediction.
[0051] It should be noted that the target angle mode is an angle mode for predicting the current block. The target angle mode can be any one or more of a plurality of angle prediction modes. For example, in Versatile Video Coding (VCC), i.e., H.266, the target angle mode can be any one or more of 65 angle prediction modes.
[0052] It should be noted that the number of target angle modes is not limited, and it can be one or more. The number of target angle modes is determined according to the number of angle prediction modes participating in the prediction of the current block.
[0053] It should be noted that the first prediction loss value corresponds to the target angle mode, and represents the difference between the prediction result obtained by predicting the current block using the target angle mode and the true pixels of the current block.
[0054] The target angle mode is to predict the current block using the adjacent spatial information of the current block. For the current block shown in FIG. 2, the angle prediction mode information is extracted from the blocks corresponding to the adjacent spaces AL, A, L, AR and BL of the current block to predict the current block.
[0055] The stronger the spatial correlation between adjacent blocks, the stronger the spatial correlation between the current block and the adjacent spatial information, and the smaller the prediction error of the current block, and the smaller the first prediction loss value. Conversely, the weaker the spatial correlation between the current block and the adjacent spatial information, the larger the first prediction loss value, and the lower the prediction accuracy of the current block.
[0056] It should be noted that the block vector (BV) prediction mode searches for a matching block in the already encoded area of the video frame in which the current block is located, and uses a block vector to describe the displacement between the current block and the searched matching block, thereby realizing efficient prediction. The block vector candidate is a candidate block vector for BV prediction of the current block.
[0057] It should be noted that the second prediction loss value corresponds to a block vector candidate, which refers to a difference between a prediction result obtained by predicting the current block using the block vector candidate and the real pixels of the current block.
[0058] It should be noted that the prediction loss value described in the embodiments of the present application can be obtained by the following process: taking the reconstructed region above and / or left of the current block as a template, matching the reconstructed pixels in the template region with the prediction result of a certain prediction mode corresponding to the template region, and obtaining the prediction loss value of the current block corresponding to the prediction mode.
[0059] The block vector candidate is to predict the current block using the non-adjacent spatial information of the current block. Referring to FIG. 3, the block vector candidate is to predict the current block using the reference block in the non-adjacent spatial information of the current block, which has been reconstructed.
[0060] The stronger the spatial correlation between the current block and the non-adjacent spatial information, the smaller the prediction error of the current block, and the smaller the second prediction loss value. Conversely, the weaker the spatial correlation between the current block and the non-adjacent spatial information, the larger the second prediction loss value, and the lower the prediction accuracy of the current block.
[0061] It should be noted that FIG. 4 is a schematic diagram of sampling points in the adjacent spatial information and the non-adjacent spatial information of the current block provided by the embodiments of the present application. The embodiments of the present application can traverse the block corresponding to the sampling points in the adjacent spatial information and the non-adjacent spatial information shown in FIG. 4, i.e., the coding unit CU. If the CU uses Intra Template Matching Prediction (IntraTMP) or Intra Block Copy (IBC) as the prediction mode, the block vector used by the CU can be used as a block vector candidate. Wherein, IntraTMP and IBC are both intra prediction modes using block copy method for prediction.
[0062] It should be noted that if the first prediction loss value and the second prediction loss value satisfy a preset relationship, the spatial correlation between the adjacent spatial information and the current block is smaller than the spatial correlation between the non-adjacent spatial information and the current block, and the prediction accuracy of the current block using the block vector candidate is higher. Therefore, in this case, the prediction result based on the block vector candidate is used to replace the prediction result of the target angle mode for prediction to obtain the prediction result of the current block.
[0063] It should be noted that the preset relationship between the first prediction loss value and the second prediction loss value can be set as needed, as long as the spatial correlation between the adjacent spatial information and the current block is smaller than the spatial correlation between the non-adjacent spatial information and the current block under the preset relationship.
[0064] It should be noted that the embodiments of steps S100 to S300 first obtain a target angle mode of the current block and a first prediction loss value corresponding to the target angle mode, and obtain a block vector candidate of the current block and a second prediction loss value corresponding to the block vector candidate, wherein the target angle mode is predicted by using the neighboring spatial information of the current block, i.e., the neighboring spatial domain, and the block vector candidate is predicted by using the non-neighboring spatial information of the current block. If the first prediction loss value and the second prediction loss value satisfy a preset relationship, the prediction result based on the block vector candidate is used to replace the prediction result of the target angle mode to obtain the fusion prediction result of the current block. In the case where the first prediction loss value and the second prediction loss value satisfy the preset relationship, the spatial correlation between the neighboring spatial information and the video block is less than the spatial correlation between the non-neighboring spatial information and the video block, and then the prediction result of the current block based on the prediction result of the block vector candidate reduces the use of the neighboring spatial information with less spatial correlation with the current block, and strengthens the use of the effective information of the non-neighboring spatial domain, thereby improving the prediction accuracy of the video block.
[0065] It can be understood that referring to FIG. 5, step S300 includes but is not limited to the following step S310.
[0066] Step S310, determining that the second prediction loss value is less than the first prediction loss value, and using the prediction result based on the block vector candidate to replace the prediction result of the target angle mode to obtain the prediction result of the current block.
[0067] It should be noted that in the case where it is determined that the second prediction loss value is less than the first prediction loss value, the spatial correlation between the neighboring spatial information and the current block is less than the spatial correlation between the non-neighboring spatial information and the current block. Therefore, the prediction result based on the block vector candidate is used to replace the prediction result of the target angle mode to obtain the prediction result of the current block, which reduces the use of the neighboring spatial information with less spatial correlation with the current block, and strengthens the use of the effective information of the non-neighboring spatial domain, thereby improving the prediction accuracy of the video block.
[0068] It should be noted that the number of target angle modes can be one or more, and the number of block vector candidates can be one or more. It should also be noted that each prediction result based on the block vector candidate is only allowed to replace the prediction result of one target angle mode.
[0069] In a possible implementation, for step S310, specifically comprising: for each block vector candidate, if there are multiple target angle modes whose first prediction loss values are greater than the second prediction loss value of the block vector candidate, replacing the prediction result of one of the target angle modes with the prediction result based on the block vector candidate according to a preset rule. The preset rule is determined according to the first prediction loss value of the target angle mode, for example, selecting the target angle mode with the minimum first prediction loss value as the replaced target angle mode.
[0070] In another possible implementation, for step S310, specifically comprising: for each target angle mode, if there are multiple block vector candidates whose second prediction loss values are less than the first prediction loss value of the target angle mode, replacing the prediction result of the target angle mode with the prediction result based on one of the block vector candidates according to a preset rule, wherein the preset rule is determined according to the second prediction loss value of the block vector candidate, for example, selecting the block vector candidate with the minimum second prediction loss value to replace the target angle mode.
[0071] In some examples, the number of target angle modes is I (I≥1), and the number of block vector candidates is J (J≥1). Referring to FIG. 6, step S310 includes but is not limited to the following steps:
[0072] - step S311, sorting the I target angle modes in ascending order according to the first prediction loss value to obtain a target angle mode sequence;
[0073] - step S312, sorting the J block vector candidates in ascending order according to the second prediction loss value to obtain a block vector candidate sequence;
[0074] - step S313, initializing i=1 and j=1;
[0075] - step S314, comparing the jth block vector candidate in the block vector candidate sequence and the ith target angle mode in the target angle mode sequence, if the second prediction loss value of the jth block vector candidate is less than the first prediction loss value of the ith target angle mode, continuing to execute step S315, otherwise jumping to step S319;
[0076] - step S315, replacing the ith target angle mode with the jth block vector candidate to participate in the fusion prediction;
[0077] - step S316, determining whether j is equal to J, if yes, ending the flow, otherwise continuing to execute step S317;
[0078] - step S317, updating j=j+1;
[0079] - step S318, determining whether i is equal to I, if yes, ending the flow, otherwise continuing to execute step S319;
[0080] - step S319, updating i = i + 1, and returning to perform step S314.
[0081] The target angle mode with the same order is compared with the block vector candidate, and it is determined that the second prediction loss value corresponding to the block vector candidate is smaller than the first prediction loss value corresponding to the target angle mode, and the block vector candidate is replaced by the target angle mode to participate in the fusion prediction.
[0082] It should be noted that in the case where the number of target angle modes and block vector candidates is multiple, the multiple target angle modes are sorted in ascending order of the first prediction loss value. The multiple target angle modes after sorting are arranged in ascending order of the first prediction loss value. The multiple target angle modes are sorted in ascending order of the second prediction loss value. The multiple target angle modes after sorting are arranged in ascending order of the second prediction loss value.
[0083] It should be noted that the target mode with the same order is compared with the block vector candidate, and if the second prediction loss value corresponding to the block vector candidate is smaller than the first prediction loss value corresponding to the target angle mode, the block vector candidate is replaced by the target angle mode to participate in the fusion prediction.
[0084] It should be noted that if there are multiple target angle modes, there are also multiple modes participating in the prediction process of the current block, so as to realize the fusion prediction of the current block.
[0085] In addition, in the fusion prediction process of the current block, in addition to the target angle mode, other prediction modes such as the planar (PLANAR) mode and the direct current (DC) mode are also included.
[0086] It should be noted that each block vector candidate can only replace one target angle mode. For example, there are 3 target angle modes participating in the fusion prediction, and there is only 1 block vector candidate, so the second prediction loss value corresponding to the block vector candidate is compared with the first prediction loss value ranked first, and in the case where the second prediction loss value is smaller than the first prediction loss value, the block vector candidate is replaced by the target angle mode to participate in the fusion prediction. In the case where the second prediction loss value is greater than the first prediction loss value, the second prediction loss value corresponding to the block vector candidate is compared with the first prediction loss value ranked second, and so on until the comparison with the 3 target angle modes is completed or the prediction result of the block vector candidate replaces the prediction result of the target angle mode.
[0087] After the comparison between the target angle mode with the same order and the block vector candidate is completed, the block vector candidate which has not participated in the prediction can be compared with the target angle mode which has not been replaced.
[0088] It should be noted that the embodiments of steps S310 to S330 are in the case that the number of target angle modes and the number of block vector candidates are both plural, the plural target angle modes and the plural block vector candidates are sorted in ascending order according to the corresponding loss values, and the target angle modes and the block vector candidates with the same order are compared to determine whether the block vector candidate can replace the target angle mode for fusion prediction, which can further improve the prediction accuracy of the video block.
[0089] It can be understood that, referring to FIG. 7, after step S100, the method provided in the embodiments of the present application further includes step S410.
[0090] Step S410, determining the weight corresponding to the target angle mode.
[0091] Correspondingly, step S300 includes step S321 and step S322.
[0092] Step S321, replacing the prediction result of the target angle mode with the prediction result based on the block vector candidate, and taking the weight corresponding to the target angle mode as the weight corresponding to the prediction result based on the block vector candidate.
[0093] Step S322, performing weighted fusion according to the prediction result and the weight based on the block vector candidate and the prediction result and the weight of the other mode to obtain the prediction result of the current block.
[0094] It should be noted that the weight corresponding to the target angle mode refers to the weight of the prediction result of the target angle mode in the fusion prediction.
[0095] The number of prediction modes corresponding to the fusion prediction is different, the way of determining the target angle mode is different, and the way of calculating the weight is also different. If two-mode fusion prediction is used, and the two modes are denoted as mode 1 and mode 0, the weight of mode 0 can be represented as:
[0096] Wherein, costMode0 is the prediction loss corresponding to mode 0, and costMode1 is the prediction loss corresponding to mode 1. If mode 0 is the target angle mode, then costMode0 is the first prediction loss value. The weight of mode 1 can be the difference between 1 and weight0.
[0097] If three-mode fusion prediction is used, and the three modes are denoted as mode 0, mode 1 and mode 2, the weight of mode 0 can be represented as:
[0098] The weight of mode 1 can be represented as:
[0099] The weight of mode 2 can be represented as:
[0100] Wherein, the costMode0 is the prediction loss corresponding to the mode 0, the costMode1 is the prediction loss corresponding to the mode 1, and the costMode2 is the prediction loss corresponding to the mode 2.
[0101] It should be noted that if the second prediction loss value and the first prediction loss value satisfy the preset relationship, the weight corresponding to the target angle mode is taken as the weight corresponding to the prediction result based on the block vector candidate when predicting the current block, so that the prediction result of the block vector candidate replaces the prediction result of the target angle mode for fusion prediction. For example, the prediction modes corresponding to the fusion prediction are respectively mode 0, mode 1 and mode 2, wherein the mode 1 is the target angle mode, and the weight corresponding thereto is 0.4. When the second prediction loss value and the first prediction loss value satisfy the preset relationship, the weight of the prediction result based on the block vector candidate is set to 0.4 to replace the prediction result of the target angle mode for weighted fusion, so as to obtain the prediction result of the current block.
[0102] It should be noted that in the case that the first prediction loss value and the second prediction loss value satisfy the preset relationship, the prediction result of the block vector candidate replaces the prediction result of the target angle mode to predict the current block. In the process of predicting the current block, the corresponding multiple prediction modes not only include the target angle mode, but also can include the planar mode and the like, and in the case that there are multiple target angle modes, other target angle modes which are not replaced can also participate in the prediction. In the embodiments of the present application, these modes are collectively referred to as other modes.
[0103] After determining the block vector candidate and the other modes required for predicting the current block, the prediction result of the current block is obtained by weighted fusion according to the prediction result based on the block vector candidate and the weight, the prediction result of the other modes and the weight.
[0104] It should be noted that the embodiments of the above steps S410 and steps S321, S322 replace the prediction result of the target angle mode with the prediction result based on the block vector candidate and take the weight corresponding to the target angle mode as the weight corresponding to the prediction result based on the block vector candidate for weighted fusion of the prediction result in the case that the first prediction loss value and the second prediction loss value satisfy the preset relationship. This method ensures that the prediction result based on the block vector candidate can be used for prediction when there are multiple prediction modes in the fusion prediction, and improves the prediction accuracy of the video block. In addition, this method does not need to calculate the weight of each prediction mode again, and improves the prediction efficiency of the video block.
[0105] It can be understood that referring to FIG. 8, the step S322 includes but is not limited to the following steps S331-S334.
[0106] Step S331, determine the location depth corresponding to each block vector candidate and other mode, wherein the location depth includes vertical, horizontal and diagonal depth.
[0107] Step S332, for each location depth, determine the weight corresponding to the location depth according to the weight of the block vector candidate and / or other mode corresponding to the location depth.
[0108] Step S333, for each location depth, determine the pixel intensity corresponding to the location depth according to the weight and prediction result of the block vector candidate and / or other mode corresponding to the location depth.
[0109] Step S334, weighted fusion according to the weight and pixel intensity corresponding to each location depth.
[0110] It should be noted that after determining the block vector candidate and other mode required for predicting the current block, the location depth corresponding to each mode is determined. The location depth can be represented as:
[0111] wherein the location depth is LocDepth, the vertical depth is Vertical, the horizontal depth is Horizontal, and the diagonal depth is Diagonal. A is the upper template region, L is the left template region, and the corresponding Cost A is the prediction loss of the upper template region, and Cost L is the prediction loss of the left template region. Wherein the upper template region and the left template region refer to Fig. 9.
[0112] In addition, Log2A=floor(log2(CU Height +x1), Log2L=floor(log2(CU Width +x1), wherein CU is the reference block. For the block vector candidate, the reference block is the block in the non-adjacent spatial domain, and for the other mode, the reference block is the block in the adjacent spatial domain. floor is the floor function, x1 is the length of the left template region or the height of the upper template region, and the x1 of the reference block shown in Fig. 9 is 4. CU Height is the length of the reference block, and CU Width is the width of the reference block.
[0113] It should be noted that the prediction loss includes sum of absolute transformed difference (SATD), sum of absolute difference (SAD), mean removed sum of absolute difference (MRSAD).
[0114] It should be noted that after determining the position depth, the weight corresponding to the position depth can be determined according to the weight of the block vector candidate and / or other modes corresponding to the position depth.
[0115] Suppose that the modes participating in the fusion prediction are angle mode 0, angle mode 1 and block vector candidate 2, and the weights of the position depths, i.e., the vertical depth, the horizontal depth and the diagonal depth, are irrelevant to the specific prediction mode participating in the prediction of the current block. Therefore, for the convenience of description, the embodiments of the present application use modes X, Y and Z to replace the angle mode 0, the angle mode 1 and the block vector candidate 2, and X, Y and Z can refer to any mode. The weight of the mode X can be represented as WeightX, the weight of the mode Y can be represented as WeightY, and the weight of the mode Z can be represented as WeightZ.
[0116] For the calculation of the weight corresponding to the vertical depth, if the position depths of the modes X, Y and Z are all Vertical, the weight WeightVertical corresponding to the vertical depth can be represented as: Ver WeightVertical = WeightX + WeightY + WeightZ. Ver X Y Z .
[0117] If the position depths of the modes X and Y are both Vertical, the weight WeightVertical corresponding to the vertical depth can be represented as: Ver WeightVertical = WeightX + WeightY. Ver X Y .
[0118] If the position depth of the mode X is Vertical, the weight WeightVertical corresponding to the vertical depth can be represented as: Ver WeightVertical = WeightX. Ver X .
[0119] The weight corresponding to the vertical depth can be calculated according to the above formula. Similarly, the weights corresponding to the horizontal depth and the diagonal depth can be calculated.
[0120] In addition, the weight of the position depth is 0 if there is no corresponding prediction mode for the position depth. For example, the modes participating in the fusion prediction are angle mode 0, angle mode 1 and block vector candidate 2, the position depths corresponding to angle mode 0 and angle mode 1 are vertical depth, and the position depth corresponding to block vector candidate 2 is diagonal depth, then the weight of the horizontal depth is 0.
[0121] It should be noted that the pixel intensity corresponding to the position depth can be determined according to the weight and prediction result of the block vector candidate and / or other modes corresponding to the position depth.
[0122] It is assumed that the modes participating in the fusion prediction are angle mode 0, angle mode 1 and block vector candidate 2, and the prediction results of the position depths, i.e. vertical depth, horizontal depth and diagonal depth, are independent of the specific prediction mode participating in the prediction of the current block. Therefore, for ease of description, the present embodiment uses modes X, Y and Z to replace angle mode 0, angle mode 1 and block vector candidate 2, and X, Y and Z can refer to any mode. The weight of mode X can be represented as WeightX, the weight of mode Y can be represented as WeightY, and the weight of mode Z can be represented as WeightZ. The prediction result of mode X can be represented as pX, the prediction result of mode Y can be represented as pY, and the prediction result of mode Z can be represented as pZ.
[0123] For the prediction result corresponding to the vertical depth, if the position depths of modes X, Y and Z are all Vertical, then the pixel intensity pVer corresponding to the vertical depth can be represented as: pVer = Weight X *pX + Weight Y *pY + Weight Z *pZ.
[0124] If the position depths of modes X and Y are both Vertical, then the pixel intensity pVer corresponding to the vertical depth can be represented as: pVer = Weight X *pX + Weight Y *pY.
[0125] If the position depth of mode X is Vertical, then the pixel intensity pVer corresponding to the vertical depth can be represented as: pVer = Weight X *pX.
[0126] The pixel intensity corresponding to the vertical depth can be calculated according to the above formula. Similarly, the pixel intensities of the horizontal depth and the diagonal depth can be calculated.
[0127] It should be noted that after the weight corresponding to each position depth and the pixel intensity are determined, the weighted fusion can be performed based thereon. The weighted fusion manner based on the position depth can be represented as: pDst = Weight Ver * pVer + Weight Hor * pHor + Weight Dia * pDia,
[0128] Wherein, pDst is the pixel intensity of the final prediction of the current block, which can also be understood as the prediction result of the current block. Weight Ver is the weight of the vertical depth, and pVer is the prediction result of the vertical depth. Weight Hor is the weight of the horizontal depth, and pHor is the prediction result of the horizontal depth. Weight Dia is the weight of the diagonal depth, and pDia is the prediction result of the diagonal depth.
[0129] In an embodiment, the prediction result of the current block can also be represented as:
[0130] Wherein, pDst is the prediction result of the current block. x is the number of modes participating in the fusion prediction, and the value range of x is x∈[2, 6], which includes the planar mode, and the planar mode is always x-1. In order to improve the prediction efficiency of the video block, the maximum value of the number of prediction modes participating in the prediction of the current block is set to 6 in the embodiment of the application. pPred i is the prediction result of mode i, and weight i is the weight corresponding to mode i.
[0131] If mode i is not replaced by the block vector candidate, pPred i The prediction result of the current block is obtained using the normal intra angular mode, i.e. the target angular mode.
[0132] If mode i is replaced by the block vector candidate, pPred i The prediction result of the current block is obtained using the block vector candidate.
[0133] It should be noted that the embodiments of the above steps S331 to S334 determine the weight and the prediction result based on the block vector candidate and the position depth corresponding to other modes, and then perform weighted fusion, thereby improving the prediction accuracy of the video block,
[0134] It can be understood that, with reference to FIG. 10, the target angular mode in the embodiment of the application is obtained through the following steps S510 and S520.
[0135] Step S510: Construct a gradient histogram based on the template region, wherein the gradient histogram is used to indicate the gradient magnitude of multiple angle patterns.
[0136] Step S520: Select the k angle patterns with the largest gradient magnitudes from the gradient histogram as the target angle patterns, where k is greater than or equal to 1.
[0137] It should be noted that the template region is adjacent to the current block, and the specific template region of the current block can be seen in Figure 11. If the template region is located within a reconstructed area, then the pixels in the template region have already been reconstructed. However, if the current block is located within an unusable area, the pixels in the current block need to be predicted and reconstructed.
[0138] Referring to Figure 12, the template region specifically comprises the L-shaped template region corresponding to the three columns to the left and the three rows to the top of the current block. In this embodiment, a 3x3 Sobel operator is used to calculate the template region to obtain gradient direction information. The formula for calculating the gradient direction information is as follows:
[0139] Among them, G x It is the Sobel operator in the x-direction, i.e., the horizontal direction, _G y This refers to the Sobel operator in the y-direction, i.e., the vertical direction. A is the pixel matrix corresponding to the 3x3 template region, such as the pixel matrix of the window region in Figure 12. Amp is the gradient magnitude of the angle mode, and _Orientation is the gradient direction information.
[0140] After obtaining the gradient direction information, each gradient direction value corresponds to an angle prediction pattern, i.e., an angle pattern. Combined with the Amp determined by the above formula, a gradient histogram (HoG) can be constructed. Specifically, the gradient histogram records the gradient magnitudes of 67 angle patterns, which can be expressed as: HoG[idx] = HoG[idx] + Amp.
[0141] Here, idx is the angle pattern index, and the value of the angle pattern index ranges from 0 to 66. Therefore, this gradient histogram can be used to indicate the gradient magnitude of multiple angle patterns.
[0142] It should be noted that after determining the gradient histogram, multiple angle patterns can be sorted in descending order of gradient magnitude, and the k angle patterns with the largest gradient magnitude can be selected as the target angle patterns, where k is a positive integer greater than or equal to 1.
[0143] If the maximum value of k is set to 5, the 5 angle modes with the largest gradient amplitudes are obtained as the target angle modes. If there are less than 5 angle modes with non-zero gradient amplitudes, only the angle modes with non-zero gradient amplitudes are taken as the target angle modes.
[0144] It should be noted that, in addition to the obtained k target angle modes, the planar mode also participates in the prediction of the current block.
[0145] In the case of determining the target angle modes according to the gradient histogram, the weight of each target angle mode can be determined based on the gradient histogram, and the gradient amplitude of the target angle mode in the gradient histogram is denoted as amp x .
[0146] Suppose that 1 target angle mode is obtained according to the gradient histogram, denoted as mode 0, in this case, the weight of mode 0 is 43, and the weight of the planar mode is 21.
[0147] If 2 target angle modes are obtained according to the gradient histogram, denoted as mode 0 and mode 1 respectively, then the weight of mode 0 is the weight of mode 1 is and the weight of the planar mode is 16.
[0148] If 3 target angle modes are obtained according to the gradient histogram, denoted as mode 0, mode 1 and mode 2 respectively, then the weight of mode 0 is the weight of mode 1 is the weight of mode 2 is and the weight of the planar mode is 16.
[0149] If 4 target angle modes are obtained according to the gradient histogram, denoted as mode 0, mode 1, mode 2 and mode 3 respectively, then the weight of mode 0 is the weight of mode 1 is the weight of mode 2 is the weight of mode 3 is and the weight of the planar mode is 16.
[0150] If 5 target angle modes are obtained according to the gradient histogram, denoted as mode 0, mode 1, mode 2, mode 3 and mode 4 respectively, then the weight of mode 0 is the weight of mode 1 can be expressed as the weight of mode 2 can be expressed as the weight of mode 3 is the weight of mode 4 is and the weight of the planar mode is 16.
[0151] It should be noted that the step S510 and the step S520 construct the gradient histogram according to the template region, and then determine the target angle mode according to the gradient amplitude of each angle mode in the gradient histogram. The gradient direction and the intensity of the pixel points in the video frame image can be calculated to determine the texture direction and the edge information of the image. Then, the target angle mode determined according to the gradient amplitude can effectively improve the efficiency and the accuracy of the predicted video block.
[0152] It can be understood that, referring to FIG. 13, in another embodiment, the target angle mode is obtained through the following steps S610 and S620.
[0153] The step 610 constructs a frequency histogram according to the spatial domain statistical information, where the frequency histogram is used to indicate the frequency amplitude of the plurality of angle modes.
[0154] The step 620 selects k angle modes with the largest frequency amplitude from the frequency histogram as the target angle mode, where k is greater than or equal to 1.
[0155] It should be noted that the embodiment of the present application can obtain the available coding unit in which the sampling points are located from the sampling points in the adjacent spatial domain and the non-adjacent spatial domain of the current block. The available coding unit refers to the block that has been reconstructed. Specifically, the present application can sample according to the adjacent spatial domain and the non-adjacent spatial domain in FIG. 4.
[0156] After determining the available coding units, the corresponding number of angle mode information is obtained according to the intra mode used by the available coding unit. As shown in Table 1, if the intra mode used by the available coding unit is decoder-side intra mode derivation (DIMD), then at most 5 angle mode information is obtained. If the intra mode used by the available coding unit is occurrence-based intra coding (OBIC), then at most 5 angle mode information is obtained. If the intra mode used by the available coding unit is template-based intra mode derivation (TIMD), then at most 3 angle mode information is obtained. If the intra mode used by the available coding unit is spatial geometric partitioning mode (SGPM), then at most 2 angle mode information is obtained. If the intra mode used by the available coding unit is extrapolation-based intra prediction (EIP), then 1 angle mode information is obtained, and the intra angle mode is obtained after EIP prediction in a manner similar to DIMD. If the intra mode used by the available coding unit is matrix-based intra prediction (MIP), then 1 angle mode information is obtained, and the intra angle mode is obtained after MIP prediction in a manner similar to DIMD. If the intra mode used by the available coding unit is intra template matching prediction (IntraTMP), then 1 angle mode information is obtained, and the intra angle mode is obtained after IntraTMP prediction in a manner similar to DIMD. If the intra mode used by the available coding unit is angular mode, then 1 angle mode information is obtained.
[0157] Table 1
[0158] After obtaining the angle mode information, the area of the available coding unit is obtained, and is accumulated at the corresponding angle mode index of the frequency histogram. The frequency histogram (Histogram of Occurrence, HoC) can be represented as: HoC[idx] = HoC[idx] + CU area,
[0159] wherein idx is the angle mode index, and the value range of the angle mode index is 1 to 66. The CU area is the area of the available coding unit CU.
[0160] After traversing all the available coding units in the neighboring, non-neighboring airspaces, a complete frequency histogram can be obtained. The frequency histogram is used to indicate the frequency amplitudes of the multiple angle modes, which can be referred to FIG. 14. The horizontal axis of the frequency histogram is the angle mode information, and the vertical axis is the frequency amplitude.
[0161] After obtaining the complete frequency histogram, the multiple angle modes can be sorted according to the order of the frequency amplitudes from large to small, and the k angle modes with the largest frequency amplitudes are obtained as the target angle modes, where k is a positive integer greater than or equal to 1.
[0162] If the maximum value of k is set to 5, the 5 angle modes with the largest frequency amplitudes are obtained as the target angle modes. If there are less than 5 angle modes with non-zero frequency amplitudes, only the angle modes with non-zero frequency amplitudes are used as the target angle modes.
[0163] It should be noted that in addition to the obtained k target angle modes, the planar mode is also used for prediction of the current block.
[0164] In the case of determining the target angle modes according to the frequency histogram, the weight of each target angle mode can be determined based on the frequency histogram. The frequency amplitude of the target angle mode in the frequency histogram is denoted as amp x .
[0165] Suppose that 1 target angle mode is obtained according to the frequency histogram, denoted as mode 0. In this case, the weight of mode 0 is 43, and the weight of the planar mode is 21.
[0166] If 2 target angle modes are obtained according to the frequency histogram, the 2 target angle modes are mode 0 and mode 1 respectively. Then the weight of mode 0 is the weight of mode 1 is and the weight of the planar mode is 16.
[0167] If 3 target angle modes are obtained according to the frequency histogram, the 3 target angle modes are mode 0, mode 1 and mode 2 respectively. Then the weight of mode 0 is the weight of mode 1 is the weight of mode 2 is and the weight of the planar mode is 16.
[0168] If 4 target angle modes are obtained according to the frequency histogram, the 4 target angle modes are mode 0, mode 1, mode 2 and mode 3 respectively. Then the weight of mode 0 is the weight of mode 1 is the weight of mode 2 is the weight of mode 3 is and the weight of the planar mode is 16.
[0169] If 5 target angle modes are obtained according to the frequency histogram, the 5 target angle modes are mode 0, mode 1, mode 2, mode 3 and mode 4 respectively, the weight of mode 0 is The weight of mode 1 can be expressed as The weight of mode 2 can be expressed as The weight of mode 3 is The weight of mode 4 is The weight of the plane mode is 16.
[0170] It should be noted that the step S610 and the step S620 construct the frequency histogram according to the template region, and then determine the target angle mode according to the frequency amplitude of each angle mode in the frequency histogram, so that the target angle mode can correspond to the current block, and the accuracy of the video block prediction is improved.
[0171] It can be understood that, referring to FIG. 15, in another embodiment, the target angle mode is obtained through the following steps S710-S740.
[0172] Step S710, determining the third prediction loss value corresponding to each angle mode in the angle mode list according to the template region.
[0173] Step S720, selecting a first angle mode with the minimum third prediction loss value and a second angle mode with the second minimum third prediction loss value.
[0174] Step S730, in the case that the third prediction loss value corresponding to the second angle mode is less than a times the third prediction loss value corresponding to the first angle mode, taking both the first angle mode and the second angle mode as the target angle mode, a is a value greater than 1.
[0175] Step S740, in the case that the third prediction loss value corresponding to the second angle mode is greater than or equal to a times the third prediction loss value corresponding to the first angle mode, only taking the first angle mode as the target angle mode.
[0176] It should be noted that the angle mode list is the angle mode used by the blocks in the adjacent spatial domain of the current block in the reconstruction process. Referring to FIG. 16 and FIG. 17, the template of the current block is divided into an upper template region and a left template region, the upper template region is located directly above the current block, and the left template region is located on the left side of the current block.
[0177] After the template region and the list of angle modes are determined, the template region is predicted using the angle modes in the list of angle modes. Since the template region has already been reconstructed, the sum of absolute transformed difference (SATD) can be calculated based on the predicted result and the reconstructed result to represent the loss of the predicted pixel result and the reconstructed pixel. The formula of the SATD is as follows: SATD =∑ i,j |HT (i,j) |, HT=H·W·H T ,
[0178] where (i,j) represents each element in the matrix HT, i represents the row of the matrix element in the matrix, and j represents the column of the matrix element in the matrix. The matrix W is a residual matrix formed by subtracting the reconstructed pixel from the predicted pixel result, and HT is a 4x4 Hadamard transform matrix. Since the size of the template region, i.e., the maximum value of L1 and L2 shown in FIG. 16, is 4, the 4x4 Hadamard transform matrix is used for calculation in the embodiment of the present application. The SATD calculated according to the above formula is the third prediction loss value corresponding to the angle mode.
[0179] It should be noted that after the third prediction loss values corresponding to the angle modes in the list of angle modes are determined, the first two angle modes with the minimum third prediction loss values are taken out, and the angle mode with the minimum third prediction loss value is taken as the first angle mode, and the angle mode with the second minimum third prediction loss value is taken as the second angle mode.
[0180] If the third prediction loss value corresponding to the second angle mode is less than a times the third prediction loss value corresponding to the first angle mode, the first angle mode and the second angle mode are taken as the target angle mode to predict the current block.
[0181] If the third prediction loss value corresponding to the second angle mode is greater than a times the third prediction loss value corresponding to the first angle mode, only the first angle mode is taken as the target angle mode.
[0182] It should be noted that a is a value greater than 1. If a is set to 2, then the first angle mode and the second angle mode are taken as the target angle mode if the third prediction loss value corresponding to the second angle mode is less than 2 times the third prediction loss value corresponding to the first angle mode. Otherwise, only the first angle mode is taken as the target angle mode.
[0183] It can be understood that, with reference to FIG. 18, the target angle mode is obtained through the following steps S810-S830.
[0184] Step S810, constructing an Intra Merge Mode (IMM) list according to the spatial domain statistical information, the IMM list including a plurality of IMM candidate mode groups, each IMM candidate mode group containing at least one angle mode.
[0185] Step S820, for each IMM candidate mode group, determining a total loss value corresponding to the IMM candidate mode group according to fourth prediction loss values corresponding to respective angle modes in the IMM candidate mode group.
[0186] Step S830, determining a target angle mode according to an IMM candidate mode group with a minimum total loss value.
[0187] It should be noted that the spatial domain statistical information refers to information contained in CUs corresponding to neighboring spatial domains and non-neighboring spatial domains of a current block. If the CUs are predicted using TIMD or DIMD or OBIC or Intra Merge Mode (IMM), the corresponding intra prediction mode information is saved according to Table 2 and stored in the IMM list.
[0188] Table 2
[0189] It should be noted that the IMM list includes a plurality of IMM candidate mode groups, each IMM candidate mode group containing at least one angle mode.
[0190] For each IMM candidate mode group, a prediction calculation is performed on the template region shown in FIG. 19 according to respective angle modes in the IMM candidate mode group. As shown in FIG. 20, the template region in FIG. 19 is a reconstructed region. Therefore, the loss value of each angle mode in the IMM candidate mode group can be calculated by the SATD, thereby obtaining fourth prediction loss values corresponding to the respective angle modes. IAMidx After obtaining the fourth prediction loss values of the respective angle modes corresponding to the IMM candidate mode group, the total loss value of the IMM candidate mode group can be calculated by the following formula: CandCost = [∑IAM∈CandIAMSetCost IAM *Weight IAM ]>>6,
[0191] Wherein, CandCost is the total loss value of the IMM candidate mode group, CandIAMSet is all angle modes contained in the IMM candidate mode group, Weight IAM is the weight of the angle mode in the IMM candidate mode group.
[0192] It should be noted that after determining the total loss values of all IMM candidate mode groups in the IMM list, all angle modes in the IMM candidate mode group with the minimum total loss value are determined as the target angle mode.
[0193] The embodiments of the steps S810 to S830 construct the intra merge mode IMM list according to the spatial domain statistical information, and determine the multiple angle modes in the IMM candidate mode group as the target angle modes according to the total loss values corresponding to each IMM candidate mode group in the IMM list, which ensures that the selection of the target angle modes matches the current block and improves the prediction accuracy of the video block.
[0194] It should be noted that the embodiments of the present application can determine the target angle modes corresponding to the current block through the frequency histogram and the gradient histogram, or determine the target angle modes according to the third prediction loss values corresponding to each angle mode in the angle mode list, or determine the target angle modes according to the fourth prediction loss values corresponding to each angle mode in the multiple IMM candidate mode groups in the IMM list. After determining the target angle modes of the current block, the first prediction loss values corresponding to the target angle modes are determined, and the block vector candidates of the current block and the second prediction loss values corresponding to the block vector candidates are obtained. In the case that the number of the target angle modes and the number of the block vector candidates are both multiple, the multiple target angle modes are sorted in ascending order according to the first prediction loss values. The multiple block vector candidates are sorted in ascending order according to the second prediction loss values. The target angle modes and the block vector candidates with the same order are compared, it is determined that the second prediction loss value corresponding to the block vector candidate is smaller than the first prediction loss value corresponding to the target angle mode, the block vector candidate replaces the target angle mode to participate in the fusion prediction. In the case that the first prediction loss value and the second prediction loss value satisfy the preset relationship, the spatial correlation between the adjacent spatial domain information and the video block is smaller than the spatial correlation between the non-adjacent spatial domain information and the video block, then the prediction result of the current block based on the block vector candidate reduces the use of the adjacent spatial domain information with smaller spatial correlation with the current block, and strengthens the use of the effective information of the non-adjacent spatial domain, thereby improving the prediction accuracy of the video block.
[0195] In addition, the embodiments of the present application also provide a video stream processing method, referring to FIG. 21, the video stream processing method provided by the embodiments of the present application includes but is not limited to the following steps S910-S920.
[0196] Step S910, set a preset switch flag in the encoding parameter information, the preset switch flag is used to indicate whether to use the target strategy to predict the current block.
[0197] Step S920, write the encoding parameter information into the video stream.
[0198] The target strategy includes: obtaining a target angle mode of the current block and a first prediction loss value corresponding to the target angle mode, obtaining a block vector candidate of the current block and a second prediction loss value corresponding to the block vector candidate, determining that the first prediction loss value and the second prediction loss value satisfy a preset relationship, and replacing a prediction result of the target angle mode with a prediction result based on the block vector candidate to obtain a prediction result of the current block.
[0199] It should be noted that the video stream processing includes video encoding processing, and the video encoding is a technology for compressing video data, aiming to reduce data transmission and storage costs. The encoding parameter information is the related parameter information of the video encoding processing, and the encoding parameter is usually written in the video encoding stream to provide the necessary information for the decoder to quickly start the decoding process without additional analysis or guessing, which can reduce the decoding delay and improve the playing efficiency.
[0200] It should be noted that the preset switch flag is used to indicate whether the target strategy is executed, and the current block is predicted through the target strategy. For example, in the frame diagram of the video stream processing in the encoding process shown in FIG. 22, the preset switch flag is provided, and the preset switch flag is used to select whether the processing mode of the video stream is intra prediction or inter prediction, that is, whether the intra prediction is performed.
[0201] It should be noted that the encoding parameter information needs to be written into the video stream in the embodiments of the present application, so as to facilitate subsequent decoding of the video stream.
[0202] It should be noted that the target strategy in the video stream processing method provided by the embodiments of the present application is implemented based on the above-mentioned method for predicting the video block, and the prediction method of the video block is based on the prediction result of the block vector candidate to replace the prediction result of the target angle mode for prediction in the case that the first prediction loss value and the second prediction loss value satisfy the preset relationship, thereby reducing the use of the adjacent spatial information with less spatial correlation of the current block, and strengthening the use of the effective information of the non-adjacent spatial domain, and improving the prediction accuracy of the video block. Therefore, the video stream processing method strengthens the use of the effective information of the non-adjacent spatial domain, improves the encoding accuracy of the video block, and improves the processing efficiency of the video stream.
[0203] It can be understood that the encoding parameter information includes general constraint information GCI, sequence parameter set SPS and picture parameter set PPS. Referring to FIG. 23, the step S910 includes steps S911-S913.
[0204] In step S911, a first preset switch flag in the general constraint information GCI is set to a limit / non-limit flag value to indicate that all video sequences are limited / non-limited to use the target strategy to predict the video block.
[0205] Step S912, setting a second preset switch flag in the sequence parameter set SPS to an on / off flag value to indicate using / not using the target strategy to predict the video block for the current video sequence.
[0206] Step S913, setting a third preset switch flag in the picture parameter set PPS to an on / off flag value to indicate using / not using the target strategy to predict the video block for the current picture.
[0207] It should be noted that the general constraint information GCI contains common coding parameters of all video sequences. Therefore, the first preset switch flag in the general constraint information GCI is used to indicate whether to limit using the target strategy to predict the video block for all video sequences. When the first preset switch flag is set to a limit flag value, using the target strategy to predict the video block is limited for all video sequences. When the first preset switch flag is set to a non-limit flag value, using the target strategy to predict the video block is not limited for all video sequences.
[0208] It should be noted that the sequence parameter set SPS contains common coding parameters of the current video sequence. Once the sequence parameter set SPS is referenced, all pictures in the current video sequence use the coding parameters of the sequence parameter set SPS. Therefore, when the second preset switch flag in the sequence parameter set SPS is set to an on flag value, the target strategy to predict the video block is not used for the current video sequence. When the second preset switch flag in the sequence parameter set SPS is set to an off flag value, the target strategy to predict the video block is not used for the current video sequence.
[0209] It should be noted that the picture parameter set PPS contains common coding parameters of the current picture, and therefore, the third preset switch flag in the picture parameter set PPS is used to indicate whether to use the target strategy to predict the video block for the current picture. In the case that the third preset switch flag is set to an on flag value, the target strategy to predict the video block is used for the current picture. In the case that the third preset switch flag is set to an off flag value, the target strategy to predict the video block is not used for the current picture.
[0210] It should be noted that the embodiments of the above steps S911 to S913 perform the target strategy on the related numbers in the video code stream through the preset switch flags of the general constraint information GCI, the sequence parameter set SPS, and the picture parameter set PPS, thereby improving the processing accuracy of the video code stream.
[0211] In addition, the embodiments of the present application also provide a video code stream processing method, as shown in FIG. 24, which comprises:
[0212] Step S930, receiving a video code stream and obtaining coding parameter information from the video code stream.
[0213] Step S940, using the target strategy to predict the current block according to the preset switch flag in the coding parameter information.
[0214] The target strategy includes: obtaining a target angular mode of the current block and a first prediction loss value corresponding to the target angular mode, obtaining a block vector candidate of the current block and a second prediction loss value corresponding to the block vector candidate, determining that the first prediction loss value and the second prediction loss value satisfy a preset relationship, and replacing a prediction result of the target angular mode with a prediction result based on the block vector candidate to obtain a prediction result of the current block.
[0215] It should be noted that the video stream is the coding result obtained by the video stream processing method in steps S910 and S920. The video stream is received and decoded to obtain the coding parameter information. Video stream processing includes video decoding, that is, converting the compressed digital video signal into playable video content.
[0216] It should be noted that the preset switch flag is set in the coding parameter information. For example, in the frame diagram of the video stream processing in the decoding process shown in FIG. 25, the preset switch flag is set, and the preset switch flag is used to select whether the processing mode of the video stream is intra prediction or inter prediction, that is, whether to perform intra prediction.
[0217] It should be noted that the target strategy in the video stream processing method provided by the embodiment of the application is implemented based on the above-mentioned method of predicting the video block. In the case that the first prediction loss value and the second prediction loss value satisfy the preset relationship, the prediction result based on the block vector candidate replaces the prediction result of the target angular mode to perform prediction, which reduces the use of adjacent spatial information with less spatial correlation of the current block, and strengthens the use of effective information of non-adjacent spatial domain, thereby improving the prediction accuracy of the video block. Therefore, the video stream processing method strengthens the use of effective information of non-adjacent spatial domain, improves the decoding accuracy of the video block, and improves the processing efficiency of the video stream.
[0218] It can be understood that the coding parameter information includes general constraint information GCI, sequence parameter set SPS, and picture parameter set PPS. Referring to FIG. 26, step S940 includes one of the following:
[0219] Step S941, when the first preset switch flag in the general constraint information GCI is a limit / non-limit flag value, all video sequences are limited / not limited to use the target strategy for video block prediction.
[0220] Step S942, when the second preset switch flag in the sequence parameter set SPS is an on / off flag value, the target strategy is used / not used to predict the current block for the current video sequence.
[0221] Step S943, when the third preset switch flag in the picture parameter set PPS is the open / close flag value, using / not using the target strategy to predict the current block.
[0222] It should be noted that the preset switch flags corresponding to the general constraint information GCI, the sequence parameter set SPS and the picture parameter set PPS in the encoding parameter information are consistent with the preset switch flags in steps S911 to S913.
[0223] It should be noted that the general constraint information GCI contains common encoding parameters of all video sequences. Therefore, the first preset switch flag in the general constraint information GCI is used to indicate whether to limit the use of the target strategy to predict the video block for all video sequences. When the first preset switch flag is set to the limit flag value, the use of the target strategy to predict the video block is limited for all video sequences. When the first preset switch flag is set to the no-limit flag value, the use of the target strategy to predict the video block is not limited for all video sequences.
[0224] It should be noted that the sequence parameter set SPS contains common encoding parameters of the current video sequence. Once the sequence parameter set SPS is referenced, all pictures in the current video sequence use the encoding parameters of the sequence parameter set SPS. Therefore, when the second preset switch flag in the sequence parameter set SPS is set to the open flag value, the target strategy is not used to predict the video block for the current video sequence. When the second preset switch flag in the sequence parameter set SPS is set to the close flag value, the target strategy is not used to predict the video block for the current video sequence.
[0225] It should be noted that the picture parameter set PPS contains common encoding parameters of the current picture, and therefore, the third preset switch flag in the picture parameter set PPS is used to indicate whether to use the target strategy to predict the video block for the current picture. In the case that the third preset switch flag is set to the open flag value, the target strategy is used to predict the video block for the current picture. In the case that the third preset switch flag is set to the close flag value, the target strategy is not used to predict the video block for the current picture.
[0226] It should be noted that the embodiments of steps S941 to S943 above perform the target strategy on the related data in the video code stream based on the preset switch flags of the general constraint information GCI, the sequence parameter set SPS and the picture parameter set PPS in the encoding parameter information, thereby improving the processing accuracy of the video code stream.
[0227] The embodiments of the present application also provide an electronic device, as shown in FIG. 27, the electronic device 1400 includes:
[0228] one or more processors 1410;
[0229] The memory 1420 stores one or more programs, and when the one or more programs are executed by the one or more processors 1410, the one or more processors 1410 implement the method for predicting a video block according to any one of the embodiments of the present application, or implement the method for processing a video bitstream according to any one of the embodiments of the present application.
[0230] The memory 1420 is a non-transitory network system, which can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory 1420 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory 1420 can optionally include a memory 1420 remotely arranged with respect to the processor 1410, and these remote memories 1420 can be connected to the processor 1410 through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0231] The memory 1420 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1420 can store an operating system and other application programs, and when the related program codes are saved in the memory 1420 and executed by the processor 1410 to implement the method of the embodiments of the present application, the related program codes are saved in the memory 1420 and executed by the processor 1410 to implement the method of the embodiments of the present application.
[0232] The processor 1410 can be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute related programs to implement the technical solutions provided by the embodiments of the present application.
[0233] In some embodiments, the electronic device further includes:
[0234] The input / output interface is used to realize information input and output;
[0235] The communication interface is used to realize the communication interaction between the device and other devices, which can realize communication through wired means (such as USB, network cable, etc.), or can realize communication through wireless means (such as mobile network, WIFI, Bluetooth, etc.);
[0236] a bus for transmitting information between the various components (e.g., the processor 1410, the memory 1420, the input / output interface, and the communication interface) of the device;
[0237] The processor 1410, the memory 1420, the input / output interface, and the communication interface can be communicatively connected to each other within the device through the bus.
[0238] An embodiment of the present application also provides a computer readable storage medium storing computer executable instructions for implementing the method for predicting a video block provided by any one of the embodiments of the present application, or implementing the method for processing a video bitstream provided by any one of the embodiments of the present application.
[0239] An embodiment of the present application also provides a computer program product including a computer program or computer instructions stored in a computer readable storage medium, and a processor of a computer device reading the computer program or computer instructions from the computer readable storage medium and executing the computer program or computer instructions to enable the computer device to implement the method for predicting a video block provided by any one of the embodiments of the present application, or implement the method for processing a video bitstream provided by any one of the embodiments of the present application.
[0240] The system architecture and application scenarios described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. It can be known by those skilled in the art that, as the system architecture evolves and new application scenarios appear, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0241] The embodiments of the present application first acquire a target angle mode of a current block, a first prediction loss value corresponding to the target angle mode, a block vector candidate of the current block, and a second prediction loss value corresponding to the block vector candidate. The target angle mode is predicted by using the neighboring spatial information of the current block, i.e., the neighboring spatial domain. The block vector candidate is predicted by using the non-neighboring spatial information of the current block. If the first prediction loss value and the second prediction loss value satisfy a preset relationship, the prediction result based on the block vector candidate is used to replace the prediction result of the target angle mode, so as to obtain a fusion prediction result of the current block. In the case where the first prediction loss value and the second prediction loss value satisfy the preset relationship, the spatial correlation between the neighboring spatial information and the video block is smaller than the spatial correlation between the non-neighboring spatial information and the video block. Therefore, the prediction result of the current block based on the block vector candidate reduces the use of the neighboring spatial information with smaller spatial correlation with the current block, and strengthens the use of the effective information of the non-neighboring spatial domain, thereby improving the prediction accuracy of the video block.
[0242] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing relevant hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, databases, or other media in the embodiments provided herein can include non-volatile and / or volatile storage. Non-volatile storage can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile storage can include random access memory (RAM), or external cache memory. As an illustration but not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0243] Those skilled in the art can understand that all or some steps of the above-mentioned methods and systems can be implemented as software, firmware, hardware and appropriate combinations thereof. Some or all physical components can be implemented as software executed by a processor such as a central processing unit, a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit such as an application specific integrated circuit. Such software can be distributed on a computer readable medium, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, as known to those skilled in the art, communication media generally includes computer readable instructions, data structures, program modules or other data in modulated data signals such as carrier waves or other transport mechanisms, and can include any information delivery medium.
[0244] The above describes some embodiments of the present application with reference to the accompanying drawings, and is not limited to the scope of the present application. Any modification, equivalent replacement and improvement made by those skilled in the art without departing from the scope and essence of the present application shall be within the scope of the present application.
Claims
1. A method for predicting a video block, the method comprising: obtaining a target angular mode of a current block and a first prediction loss value corresponding to the target angular mode; obtaining a block vector candidate of the current block and a second prediction loss value corresponding to the block vector candidate; determining that the first prediction loss value and the second prediction loss value satisfy a preset relationship, replacing a prediction result of the target angular mode with a prediction result based on the block vector candidate to obtain a prediction result of the current block.
2. The method of claim 1, wherein, The determining that the first prediction loss value and the second prediction loss value satisfy a preset relationship, replacing a prediction result of the target angular mode with a prediction result based on the block vector candidate to obtain a prediction result of the current block comprises: determining that the second prediction loss value is less than the first prediction loss value, replacing a prediction result of the target angular mode with a prediction result based on the block vector candidate to obtain a prediction result of the current block.
3. The method of claim 2, wherein, The number of the target angular modes is one or more, the number of the block vector candidates is one or more, and each prediction result based on the block vector candidate is only allowed to replace a prediction result of one target angular mode.
4. The method of claim 3, wherein, The determining that the second prediction loss value is less than the first prediction loss value, replacing a prediction result of the target angular mode with a prediction result based on the block vector candidate comprises: for each block vector candidate, if there are multiple target angular modes whose first prediction loss values are greater than the second prediction loss value of the block vector candidate, replacing a prediction result of one of the target angular modes with a prediction result based on the block vector candidate according to a preset rule, wherein the preset rule is determined according to the first prediction loss values of the target angular modes; or, for each target angular mode, if there are multiple block vector candidates whose second prediction loss values are less than the first prediction loss value of the target angular mode, replacing a prediction result of the target angular mode with a prediction result based on one of the block vector candidates according to a preset rule, wherein the preset rule is determined according to the second prediction loss values of the block vector candidates.
5. The method of claim 1, wherein, After obtaining the target angular mode of the current block, the method further comprises: determining a weight corresponding to the target angular mode; The replacing a prediction result of the target angular mode with a prediction result based on the block vector candidate to obtain a prediction result of the current block comprises: replacing a prediction result of the target angular mode with a prediction result based on the block vector candidate, and taking the weight corresponding to the target angular mode as a weight corresponding to the prediction result based on the block vector candidate; performing weighted fusion according to the prediction result and the weight based on the block vector candidate and the prediction results and the weights of other modes to obtain the prediction result of the current block.
6. The method of claim 5, wherein, The performing weighted fusion according to the prediction result and the weight based on the block vector candidate and the prediction results and the weights of other modes comprises: determining position depths corresponding to the block vector candidate and the other modes respectively, wherein the position depths include vertical, horizontal and diagonal depths; For each of the position depths, a weight corresponding to the position depth is determined according to a weight of the block vector candidate and / or other modes corresponding to the position depth; For each of the position depths, a pixel intensity corresponding to the position depth is determined according to the weight of the block vector candidate and / or other modes corresponding to the position depth and a prediction result; The weights and the pixel intensities corresponding to the respective position depths are fused by weighting.
7. The method of claim 1, wherein, The target angle mode is obtained by the following steps: A gradient histogram is constructed according to the template region, wherein the gradient histogram is used to indicate gradient amplitudes of a plurality of angle modes; The k angle modes with the largest gradient amplitudes are selected from the gradient histogram as the target angle mode, k is greater than or equal to 1.
8. The method of claim 1, wherein, The target angle mode is obtained by the following steps: A frequency histogram is constructed according to the spatial domain statistical information, wherein the frequency histogram is used to indicate frequency amplitudes of a plurality of angle modes; The k angle modes with the largest frequency amplitudes are selected from the frequency histogram as the target angle mode, k is greater than or equal to 1.
9. The method of claim 1, wherein, The target angle mode is obtained by the following steps: A third prediction loss value corresponding to each angle mode in the angle mode list is determined according to the template region; A first angle mode with the smallest third prediction loss value and a second angle mode with the second smallest third prediction loss value are selected; In a case that the third prediction loss value corresponding to the second angle mode is smaller than a times of the third prediction loss value corresponding to the first angle mode, the first angle mode and the second angle mode are both taken as the target angle mode, a is a value greater than 1; In a case that the third prediction loss value corresponding to the second angle mode is greater than or equal to a times of the third prediction loss value corresponding to the first angle mode, only the first angle mode is taken as the target angle mode.
10. The method of claim 1, wherein, The target angle mode is obtained by the following steps: An intra merge mode (IMM) list is constructed according to the spatial domain statistical information, the IMM list includes a plurality of IMM candidate mode groups, each of the IMM candidate mode groups contains at least one angle mode; For each of the IMM candidate mode groups, a total loss value corresponding to the IMM candidate mode group is determined according to fourth prediction loss values corresponding to the respective angle modes in the IMM candidate mode group; The target angle mode is determined according to the IMM candidate mode group with the smallest total loss value.
11. A video bitstream processing method, the method comprising: setting a preset switch flag in coding parameter information, the preset switch flag being used to indicate whether a target strategy is used to predict a current block; writing the coding parameter information into a video bitstream; The target strategy comprises: obtaining a target angle mode of the current block and a first prediction loss value corresponding to the target angle mode, obtaining a block vector candidate of the current block and a second prediction loss value corresponding to the block vector candidate, determining that the first prediction loss value and the second prediction loss value satisfy a preset relationship, and replacing a prediction result of the target angle mode with a prediction result based on the block vector candidate to obtain a prediction result of the current block.
12. The method of claim 11, wherein, The coding parameter information comprises general constraint information (GCI), sequence parameter set (SPS) and picture parameter set (PPS); and the preset switch flag in the coding parameter information is set as at least one of the following: a first preset switch flag in the GCI is set as a limit / non-limit flag value to indicate that all video sequences are limited / not limited to use the target strategy to predict video blocks; a second preset switch flag in the SPS is set as an open / close flag value to indicate that the current video sequence uses / does not use the target strategy to predict video blocks; a third preset switch flag in the PPS is set as an open / close flag value to indicate that the current image uses / does not use the target strategy to predict video blocks.
13. A video bitstream processing method, the method comprising: receiving a video bitstream and obtaining coding parameter information from the video bitstream; predicting a current block using a target strategy according to a preset switch flag in the coding parameter information; wherein the target strategy comprises: obtaining a target angle mode of the current block and a first prediction loss value corresponding to the target angle mode, obtaining a block vector candidate of the current block and a second prediction loss value corresponding to the block vector candidate, determining that the first prediction loss value and the second prediction loss value satisfy a preset relationship, and replacing a prediction result of the target angle mode with a prediction result based on the block vector candidate to obtain a prediction result of the current block.
14. The method of claim 13, wherein, The coding parameter information comprises general constraint information (GCI), sequence parameter set (SPS) and picture parameter set (PPS); and the preset switch flag in the coding parameter information is set as at least one of the following: when a first preset switch flag in the GCI is a limit / non-limit flag value, all video sequences are limited / not limited to use the target strategy to predict video blocks; when a second preset switch flag in the SPS is an open / close flag value, the current video sequence uses / does not use the target strategy to predict the current block; when a third preset switch flag in the PPS is an open / close flag value, the current image uses / does not use the target strategy to predict the current block.
15. An electronic device, comprising: one or more processors; a memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1-14.
16. A computer readable storage medium having stored thereon a computer program, wherein, The program, when executed by the processor, implements the method of any of claims 1-14.
17. A computer program product comprising a computer program, wherein, The computer program, when executed by the processor, implements the method of any of claims 1-14.
Citation Information
Patent Citations
Video coding using hybrid intra prediction
CN108781283A
Encoding method and device, and decoding method and device
CN109743576A
Intra-frame prediction mode selection method and device, equipment and storage medium
CN111741299A
Encoding method and apparatus, decoding method and apparatus, encoder, decoder, code stream, and storage medium
WO2024152384A1