A fast partitioning method, coding device and storage medium for intra-frame prediction mode
By using a fast partitioning method based on adjacent mean square error and sub-block variance in the H.265/HEVC encoder, the problem of high computational complexity in the PU8 partitioning process is solved, thereby improving the encoding speed and efficiency. This method is applicable to Ingenic series chips and similar chips.
Patent Information
- Application Number
- CN202510624558.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2026-11-17
AI Technical Summary
In existing technologies, H.265/HEVC encoders have high computational complexity during intra-frame prediction PU partitioning, especially in the process of partitioning PU8 into PU4, resulting in excessively long encoding time and affecting encoding efficiency. Existing fast partitioning methods have limited acceleration effects on PU8.
A fast partitioning method based on the neighbor mean square error and sub-block variance is adopted. By calculating the sum of the neighbor mean square error, the variance between sub-blocks and the residual of the PU block, the partitioning judgment is terminated in advance, reducing unnecessary partitioning steps and improving coding efficiency.
It effectively reduces the computational complexity of the process of dividing PU8 into PU4, improves the encoding speed and efficiency, and is applicable to Ingenic series chips and similar chips.
Smart Images

Figure CN123123566A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of video processing technology, and specifically relates to a fast segmentation method, encoding device and storage medium in intra-frame prediction mode. Background Technology
[0002] With the rapid increase in demand for high-definition and ultra-high-definition video applications, existing video coding technologies are no longer sufficient. The new technology H.265 / HEVC reduces data transmission volume by approximately half while maintaining the same video quality and adapts to larger video sizes, significantly improving coding efficiency. Its core technologies include block partitioning, prediction techniques, transform and quantization, entropy coding, loop filtering and deblocking, multi-reference frames and motion vector prediction, and enhanced syntax structure.
[0003] H.265 / HEVC encoders can flexibly partition CUs. When faced with CU block partitioning, the encoder typically uses Restricted Decision Objects (RDOs) to determine the optimal CU partitioning. The entire image is divided into multiple CTUs, and each CTU is further divided into multiple CUs. The RDO selects the optimal partitioning method by calculating the distortion and bitrate costs of different partitioning schemes.
[0004] CU partitioning is a crucial step in intra-frame prediction and the entire video compression coding process. H.265 / HEVC uses a quadtree partitioning structure, which allows for more precise image structure division and more efficient adaptation to image encoding and decoding with different resolutions and features. However, while improving coding quality, it also introduces significant computational complexity, placing higher demands on encoding and decoding implementation. Therefore, when designing fast algorithms, it is usually necessary to strike a balance between coding quality and coding efficiency for the specific application scenario.
[0005] like Figure 1 The diagram shows the conventional division in the prior art:
[0006] 1) Start: The node where the process begins
[0007] 2) Input PU8*8 blocks
[0008] Input an 8x8 prediction unit (PU) block.
[0009] 3) Calculate the RDCost of PU8 block
[0010] Calculate the rate-distortion cost (RDCost) of the current 8x8 PU block.
[0011] RDCost = Distortion + λ × Bitrate
[0012] Where λ is a Lagrange multiplier.
[0013] 4) Pre-divided into 4 PU4 sub-blocks
[0014] The 8x8 PU block is pre-divided into four 4x4 sub-blocks.
[0015] 5) Calculate the RDCost of the PU4 sub-block.
[0016] Calculate the RDCost of each of the four 4x4 sub-blocks.
[0017] The total RDCost is obtained by summing the RDCost of all sub-blocks.
[0018] 6) Comparison of sub-block RDCost
[0019] Judgment condition: Is the total RDCost of the sub-block less than the RDCost of the PU8 block?
[0020] Yes: Enter 7)
[0021] No: Enter 8)
[0022] 7) The current optimal partitioning mode is PU4.
[0023] Select 4x4 sub-block partitioning as the optimal mode, proceed to step 9).
[0024] 8) The current optimal partitioning mode is PU8.
[0025] Maintaining the 8x8 block partition as the optimal mode, proceed to step 9).
[0026] 9) End: The process ends at this node.
[0027] Therefore, the existing technology has the following drawbacks:
[0028] During intra-frame testing of the H.265 / HEVC encoder, the number of PU4s is greater than that of PUs of other sizes. Determining whether PU8 should be partitioned into PU4 using RDO consumes a significant amount of coding time, severely impacting coding efficiency. Therefore, accelerating PU8 partitioning is essential. Many fast CU partitioning methods have been proposed to accelerate the CU partitioning coding process. These methods can reduce coding time to varying degrees and keep distortion within a reasonable range. However, these methods typically focus on larger CUs. Due to limitations such as insufficient gradient information in small-sized prediction blocks and high computational overhead and bit rate costs, their acceleration effect on the process of partitioning PU8 into PU4 is limited.
[0029] In addition, the technical terms in this field include:
[0030] H.265 / HEVC: High Efficiency Video Coding (also known as H.265) is a video compression standard protocol designed to reduce file size while maintaining high-quality video.
[0031] CTU: is an independent encoding unit in H.265 / HEVC, and its size can be 64x64, 32x32, or 16x16.
[0032] CU: A CTU contains multiple coding units (CUs), whose sizes can be 64x64, 32x32, 16x16, or 8x8.
[0033] CU quadtree partitioning: In order to adapt to the characteristics of image texture, in H.265 / HEVC, CTU or CU can be divided into 4 sub-CUs; at the same time, it is also possible not to partition, which is more flexible.
[0034] PU: A coding unit (CU) can be divided into one, two, or four prediction units based on the splitting type of the prediction pattern. A PU can only be a leaf node. The PU is the basic unit for sharing prediction information; only one level of partitioning is allowed from CU to PU, with the smallest PU being 4×4. RDCost: A value that measures the balance between distortion and bit rate, expressed as RDCost = D + λ × B.
[0035] Where D and B are the difference between the original pixel value and the pixel value after encoding and decoding, respectively, and the number of bits required to encode the current block, and λ is the Lagrange multiplier.
[0036] Flat: All pixels within the CU block remain unchanged or show little to no change.
[0037] Texture: Regular or irregular patterns or lines on the surface of objects within a CU block.
[0038] Variance: Describes the fluctuation of data in a sample around the mean. The higher the value, the greater the fluctuation. Its formula is...
[0039]
[0040] Where x i For the value of the i-th data, Let N be the mean of the current data, and N be the number of data points. Summary of the Invention
[0041] To address the aforementioned issues, the purpose of this application is to accelerate the process of dividing PU8 into PU4 using a fast partitioning method in the intra-frame prediction PU partitioning stage of the H.265 / HEVC encoder, by utilizing the neighbor mean square error, sub-block variance, and residual, thereby reducing encoding time while ensuring computational overhead and bit rate costs.
[0042] Specifically, the present invention provides a method for fast PU8 partitioning in HEVC intra-prediction mode. The method is based on fast PU8 partitioning in HEVC intra-prediction mode and includes the following steps:
[0043] S1, Obtain the dimensions of the target prediction unit PU;
[0044] S2, when the size is equal to 8, calculate the adjacent mean square error of the PU block;
[0045] S3, if the adjacent mean square error is less than the first threshold Th nmse Then, the variance between the four sub-blocks of the PU8×8 block is further calculated;
[0046] S4, if the variance between the sub-blocks is less than the second threshold Th var Then, the variance of the residuals among the four sub-blocks is further calculated;
[0047] S5, if the sum of the high values of the residuals between the sub-blocks is less than the third threshold Thre res1 Or the fourth threshold Thre res2 If the condition is met, the partitioning process terminates; otherwise, the normal partitioning process is executed.
[0048] The method further includes:
[0049] S1, Input the PU block to be divided, assuming it is an 8×8 PU block;
[0050] S2, calculate the neighbor mean square error (NMSE) of the pixel value of the current prediction unit PU. pu8 The methods for calculating adjacent mean square errors include:
[0051] The mean square error is calculated based on the pixel differences within the current PU8×8 block, where:
[0052]
[0053] N represents the current size of the PU, and p(a,b) represents the brightness value of the point with coordinates (a,b) within the PU. This represents the average brightness value combining the values of point (a,b) and the neighborhood of point (a,b).
[0054] S3, determine the target partitioning pattern based on the adjacent mean square error; including:
[0055] S3.1, if the neighbor mean square error of the target PU is less than the preset threshold Th nmse If the condition is met, the partitioning pattern determination will be terminated early; otherwise, execution will continue.
[0056] S3.2, Calculate the variance Var among the four sub-blocks of the target PU. pu4The calculation method for the variance between sub-blocks includes:
[0057] The PU8×8 block is pre-divided into 4 PU4×4 sub-blocks, and the statistical variance between each sub-block is calculated; Var pu4 The calculation is as follows:
[0058] Var pu4 =((Avg subpu0 -Avg pu8 ) 2 +(Avg suvpu1 -Avg pu8 ) 2 +
[0059] (Avg supu2 -Avg pu8 ) 2 +(Avg subpu3 -Avg pu8 ) 2 ) / 4
[0060]
[0061] Avg subpu0 Avg subpu1 Avg subpu2 Avg subpu3 These are the average brightness values of the four PU4 sub-blocks, Avg, and so on. pu8 The mean of PU8; Avg subpu The mean value of the sub-blocks is given, where subpu consists of four sub-blocks, N equals 16, and subpu(a,b) refers to the pixel value at coordinates (a,b) within subpu. The target partitioning pattern is determined based on the variance between the sub-blocks.
[0062] The target partitioning pattern is determined based on the variance between the sub-blocks;
[0063] S4, determine the target partitioning pattern based on the variance between the sub-blocks;
[0064] S4.1, if the variance between target PU sub-blocks is less than the preset threshold Th var If the partitioning pattern is determined early, the partitioning pattern determination will be terminated early; otherwise, execution will continue. var It can be set to 0-255, preferably 20;
[0065] S4.2 Calculate the sum of the high values of the residuals between PU sub-blocks. Here, the residuals refer only to the differences in pixel values between sub-blocks, not motion compensation residuals or transformation residuals, nor are they variances.
[0066] Brightness residual analysis of the four sub-blocks;
[0067] The specific calculation method is as follows:
[0068]
[0069] Thre1 and Thre2 are preset high-value thresholds for the residuals, (a,b) are the corresponding coordinates in the PU sub-block, and Res L-R Res RT-LB Res T-B Res LT-RB The textural similarity is measured at four directions: 0 degrees, 45 degrees, 90 degrees, and 135 degrees. A higher value indicates greater similarity in texture between sub-blocks. (PU) L PU R These are the two left-hand sub-blocks and two right-hand sub-blocks of PU8; PU T PU B The two sub-blocks above and below the PU8 block; PU LT PU RB These are the top-left and bottom-right child blocks of the current PU8 block; PU RT PU LB These are the top right and bottom left child blocks of PU8;
[0070] S5, determine the target partitioning mode based on the sum of the low residual values between the sub-blocks;
[0071] If the residuals between sub-blocks satisfy any of the following conditions, the partitioning mode judgment will be terminated early; otherwise, the HEVC normal partitioning mode will be executed.
[0072] The specific judgment conditions are as follows:
[0073] Res L-R <Thre res1
[0074] Res T-B <Thre res1
[0075] Pes LT-RB <Thre res2 &&Res RT-LB <Thre res2
[0076] Thre res1 and Thre res2 This is a preset threshold for the cumulative sum of high residual values.
[0077] In step S2, the adjacent mean square error reflects the flatness of the target PU, and thus reflects whether the partitioning pattern of the target PU is the optimal partitioning pattern.
[0078] In step S3.1, the smaller the adjacent mean square error of the target PU, the higher its flatness, and the partitioning mode judgment is terminated in advance. In step S3.2, the variance between sub-blocks reflects the difference between sub-blocks, and thus reflects whether the partitioning mode of the target PU is the optimal partitioning mode.
[0079] Step S5 further includes:
[0080] Based on the sum of the high values of the residuals between the sub-blocks, determine whether to continue partitioning; if the residuals between the sub-blocks satisfy any of the following conditions, the partitioning mode judgment is terminated early: The specific judgment conditions are as follows:
[0081] Res L-R <Thre res1
[0082] Res T-BH <Thre res1
[0083] Res LT-RB <Thre res2 &&Res RT-LB <Thre res2
[0084] Thre res1 and Thre res2 Preset thresholds for the cumulative sum of high residual values (80 and 120 respectively); if Res L-R <Thre res1 If the two sub-blocks on the left and right are flat, then the horizontal similarity between them is high, and the partitioning can be terminated early. Otherwise, the HEVC normal partitioning mode will be executed, and the optimal mode will be further determined by RDcost. Similarly: Res T-B <Thre res1 This indicates that the two upper and two lower sub-blocks are flat, and their similarity is high in the vertical direction; Res LT-RB <Thre res2 And Res RT-LB <Thre res2 This indicates that the top-left and bottom-right sub-blocks, as well as the bottom-left and top-right sub-blocks, are flat and have high similarity in both the 45-degree and 135-degree directions, so further subdivision is not necessary.
[0085] This application also relates to a video encoding apparatus, the apparatus including a processor and a memory, the memory storing a computer program, the processor executing the computer program to implement a fast segmentation method in an intra-frame prediction mode as described in any of the preceding claims.
[0086] This application also relates to a computer-readable storage medium storing computer instructions that, when executed by a processor, implement a fast partitioning method in an intra-frame prediction mode as described in any of the preceding claims.
[0087] Therefore, the advantage of this solution is:
[0088] 1. Using the summation of variance and residuals to determine whether to terminate the partition prematurely has low computational complexity and is conducive to parallel implementation.
[0089] 2. Using adjacent mean square error can better reflect local texture complexity. Attached Figure Description
[0090] The accompanying drawings, which are provided to further illustrate the invention and form part of this application, are not intended to limit the scope of the invention.
[0091] Figure 1 This is a schematic diagram of the standard partitioning process.
[0092] Figure 2 This is a schematic diagram of the overall process of the method in this application.
[0093] Figure 3 This is a schematic diagram of the PU sub-block in this application. Detailed Implementation
[0094] To better understand the technical content and advantages of the present invention, the present invention will now be described in further detail with reference to the accompanying drawings.
[0095] In view of the limitations and shortcomings of the prior art, this invention provides a fast partitioning method for PU8 in HEVC intra-prediction mode, namely, a fast partitioning method for PU8 in HEVC intra-prediction mode based on neighbor mean square error and sub-block residuals, which reduces partitioning complexity and improves partitioning efficiency while ensuring compression performance. Figure 2 As shown, the steps include:
[0096] S1, Input the PU block to be divided, assuming it is an 8×8 PU block;
[0097] S2, calculate the neighbor mean square error (NMSE) of the pixel value of the current prediction unit PU. pu8 The methods for calculating adjacent mean square errors include:
[0098] The mean square error is calculated based on the pixel differences within the current PU8×8 block, where:
[0099]
[0100] N represents the current size of the PU, and p(a,b) represents the brightness value of the point with coordinates (a,b) within the PU. This represents the average brightness value combining the values of point (a,b) and the neighborhood of point (a,b).
[0101] The adjacent mean square error largely reflects the flatness of the target PU, and thus whether the partitioning pattern of the target PU is the optimal partitioning pattern;
[0102] S3, if the adjacent mean square error is less than the first threshold Th nmse Then, the variance between the four sub-blocks of the PU8×8 block is further calculated;
[0103] Further, based on the adjacent mean square error, the target partitioning pattern is determined; including:
[0104] S3.1, if the neighbor mean square error of the target PU is less than the preset threshold Th nmse If the condition is met, the partitioning pattern determination will be terminated early; otherwise, execution will continue.
[0105] S3.2, Calculate the variance Var among the four sub-blocks of the target PU. pu4 The calculation method for the variance between sub-blocks includes:
[0106] The PU8×8 block is pre-divided into 4 PU4×4 sub-blocks, and the statistical variance between each sub-block is calculated; Var pu4 The calculation is as follows:
[0107] Var pu4 =((Avg subpu0 -Avg pu8 ) 2 +(Avg suvpu1 -Avg pu8 ) 2 +
[0108] (Avg suvpu2 -Avg pu8 ) 2 +(Avg subpu3 -Avg pu8 ) 2 ) / 4
[0109]
[0110] Avg subpu0 Avg subpu1 Avg subpu2 Avg subpu3 These are the average brightness values of the four PU4 sub-blocks, Avg, and so on. pu8 The mean of PU8; Avg subpuThe mean value of the sub-blocks is given, where subpu consists of four sub-blocks, N equals 16, and subpu(a,b) refers to the pixel value at coordinates (a,b) within subpu. The target partitioning pattern is determined based on the variance between the sub-blocks.
[0111] S4, if the variance between the sub-blocks is less than the second threshold Th var Then, the variance of the residuals among the four sub-blocks is further calculated;
[0112] Further, based on the variance between the sub-blocks, the target partitioning pattern is determined; including:
[0113] S4.1, if the variance between target PU sub-blocks is less than the preset threshold Th var If the partitioning pattern is determined early, the partitioning pattern determination will be terminated early; otherwise, execution will continue. var It can be set to 0-255, but the actual value is 20;
[0114] S4.2 Calculate the sum of the high values of the residuals between PU sub-blocks. Here, the residuals refer only to the differences in pixel values between sub-blocks, not motion compensation residuals or transformation residuals, nor are they variances.
[0115] Brightness residual analysis of the four sub-blocks;
[0116] The specific calculation method is as follows:
[0117]
[0118] Thre1 and Thre2 are preset high-value thresholds for the residuals, (a,b) are the corresponding coordinates in the PU sub-block, and Res L-R Res RT-LB Res T-B Res LT-RB The textural similarity is measured at four directions: 0 degrees, 45 degrees, 90 degrees, and 135 degrees. A higher value indicates greater similarity in texture between sub-blocks. (PU) L PU R These are the two left-hand sub-blocks and two right-hand sub-blocks of PU8; PU T PU B The two sub-blocks above and below the PU8 block; PU LT RU RB These are the top-left and bottom-right child blocks of the current PU8 block; PU RT RU LB The top right and bottom left child blocks of PU8; PU child blocks are as follows Figure 3 As shown;
[0119] S5, if the sum of the high values of the residuals between the sub-blocks is less than the third threshold Thre res1 Or the fourth threshold Threres2 If the condition is met, the partitioning process terminates; otherwise, the normal partitioning process is executed.
[0120] Further, in step S5, the target partitioning pattern is determined based on the sum of the low residual values between the sub-blocks;
[0121] If the residuals between sub-blocks satisfy any of the following conditions, the partitioning mode judgment will be terminated early; otherwise, the HEVC normal partitioning mode will be executed.
[0122] The specific judgment conditions are as follows:
[0123] Res L-R <Thre res1
[0124] Res T-B <Thre res1
[0125] Res LT-RB <Thre res2 &&Res RT-LB <Thre res2
[0126] Thre res1 and Thre res2 This is a preset threshold for the cumulative sum of high residual values.
[0127] Step S5 further includes:
[0128] Based on the sum of the high values of the residuals between the sub-blocks, determine whether to continue partitioning; if the residuals between the sub-blocks satisfy any of the following conditions, the partitioning mode judgment is terminated early: The specific judgment conditions are as follows:
[0129] Res L-R <Thre res1
[0130] Res T-B <Thre res1
[0131] Res LT-RB <Thre res2 &&Res RT-LB <Thre res2
[0132] Thre res1 and Thre res2 Preset thresholds for the cumulative sum of high residual values (80 and 120 respectively); if Res L-R <Thre res1If the two sub-blocks on the left and right are flat, then the horizontal similarity between them is high, and the partitioning can be terminated early. Otherwise, the HEVC normal partitioning mode will be executed, and the optimal mode will be further determined by RDcost. Similarly: Res T-B <Thre res1 This indicates that the two upper and two lower sub-blocks are flat, and their similarity is high in the vertical direction; Res LT-RB <Thre res2 And Res RT-LB <Thre res2 This indicates that the top-left and bottom-right sub-blocks, as well as the bottom-left and top-right sub-blocks, are flat and have high similarity in both the 45-degree and 135-degree directions, so further subdivision is not necessary.
[0133] This application also relates to a video encoding apparatus, the apparatus including a processor and a memory, the memory storing a computer program, the processor executing the computer program to implement a fast segmentation method in an intra-frame prediction mode as described in any of the preceding claims.
[0134] This application also relates to a computer-readable storage medium storing computer instructions that, when executed by a processor, implement a fast partitioning method in an intra-frame prediction mode as described in any of the preceding claims.
[0135] Furthermore, the specific implementation method can be described as follows:
[0136] 1. Obtain the size of the target prediction unit (PU) and determine if the PU size is 8*8;
[0137] 2. If so, calculate the adjacent mean square error (NMSE) of the PU. pu8 ;
[0138] in:
[0139]
[0140] N represents the current size of the PU, which is 8 in this example. p(a,b) represents the brightness value of the point with coordinates (a,b) within the PU. This represents the average brightness value combining the values of points (a,b) and their neighborhoods.
[0141] 3. If the adjacent mean square error of the target PU is less than the preset threshold Th nmse (Th nmse If the value is 400, then the partitioning mode judgment will be terminated early.
[0142] 4. Otherwise, calculate the variance Var among the four sub-blocks of the target PU. pu4
[0143] Var pu4 =((Avg subpu0 -Avg pu8 ) 2 +(Avg subpu1 -Avg pu8 ) 2
[0144] +(Avg subpu2 -Avg pu8 ) 2 +(Avg subpu3 -Avg pu8 ) 2 ) / 4
[0145]
[0146] Avg subpu0 Avg subpu1 Avg subpu2 Avg subpu3 These are the average brightness values of the four PU4 sub-blocks, Avg, and so on. pu8 This is the mean of PU8. (Avg) subpu The average value of the sub-blocks is given by N, where subpu consists of four sub-blocks and N equals 16. Subpu(a,b) refers to the pixel value at coordinates (a,b) within subpu.
[0147] 5. If the variance Var between target PU sub-blocks pu4 Less than the preset threshold Th sd (Th sd If the value is 20, then the partitioning mode judgment will be terminated early.
[0148] 6. Otherwise, calculate the residuals between target PU sub-blocks and the sum of the highest residual values:
[0149]
[0150] Thre1 and Thre2 are preset high-value thresholds for residuals (20 and 30 respectively), (a, b) are the corresponding coordinates in the PU sub-block, and Res L-R Res RT-LB Res T-B Res LT-RB These are the sums of the highest residual values of sub-blocks in the four directions: 0 degrees, 45 degrees, 90 degrees, and 135 degrees.
[0151] 7. If the sum of the high values of the residuals between sub-blocks satisfies any of the following conditions, the partitioning mode judgment shall be terminated early.
[0152] Res L-R <Thre res1
[0153] Res T-B <Thre res1
[0154] Res LT-RB <Thre res2 &&Res RT-LB <Thre res2
[0155] Thre res1 and Thre res2 The preset thresholds for the cumulative sum of high residual values are 80 and 120, respectively.
[0156] 8. Otherwise, use the regular partitioning method and determine whether the current PU should continue partitioning through RDO.
[0157] In summary, the present invention can achieve the following:
[0158] The PU8 sub-blocks are preemptively divided using the mean square error between adjacent sub-blocks and the variance between sub-blocks. Furthermore, the texture smoothness within the PU8 sub-blocks is determined using the residual between sub-blocks. This skips some PU8 sub-blocks with similar textures between sub-blocks and divides them further, thereby improving compression efficiency.
[0159] This technical solution can be applied to all series of chips from Ingenic Semiconductor and similar chips.
[0160] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A fast segmentation method in intra-frame prediction mode, characterized in that, The method is based on fast PU8 partitioning in HEVC intra-frame prediction mode, and includes the following steps: S1, Obtain the dimensions of the target prediction unit PU; S2, when the size is equal to 8, calculate the adjacent mean square error of the PU block; S3, if the adjacent mean square error is less than the first threshold Th nmse Then, the variance between the four sub-blocks of the PU8×8 block is further calculated; S4, if the variance between the sub-blocks is less than the second threshold Th var Then, the variance of the residuals among the four sub-blocks is further calculated; S5, if the sum of the high values of the residuals between the sub-blocks is less than the third threshold Thre res1 Or the fourth threshold Thre res2 If the condition is met, the partitioning process terminates; otherwise, the normal partitioning process is executed.
2. The fast segmentation method in intra-frame prediction mode according to claim 1, characterized in that, The method further includes: S1, Input the PU block to be divided, assuming it is an 8×8 PU block; S2, calculate the neighbor mean square error (MMSE) of the pixel value of the current prediction unit PU. pu8 The methods for calculating adjacent mean square errors include: The mean square error is calculated based on the pixel differences within the current PU8×8 block, where: N represents the current size of the PU, and p(a,b) represents the brightness value of the point with coordinates (a,b) within the PU. This represents the average brightness value combining the values of point (a,b) and the neighborhood of point (a,b). S3, determine the target partitioning pattern based on the adjacent mean square error; S3.1, if the neighbor mean square error of the target PU is less than the preset threshold Th nmse If the condition is met, the partitioning pattern determination will be terminated early; otherwise, execution will continue. S3.2, Calculate the variance Var among the four sub-blocks of the target PU. pu4 The calculation method for the variance between sub-blocks includes: The PU8×8 block is pre-divided into 4 PU4×4 sub-blocks, and the statistical variance between each sub-block is calculated; Var pu4 The calculation is as follows: Our pu4 =((Avg subpu0 -Avg pu8 ) 2 +(Avg subpu1 -Avg pu8 ) 2 + (Avg. subpu2 -Avg pu8 ) 2 +(Avg subpu3 -Avg pu8 ) 2 ) / 4 Avg subpu0 Avg subpu1 Avg subpu2 Avg subpu3 These are the average brightness values of the four PU4 sub-blocks, Avg, and so on. pu8 The mean of PU8; Avg subpu The average value of the sub-blocks is given by N, where subpu consists of four sub-blocks and N equals 16. Subpu(a,b) refers to the pixel value at coordinates (a,b) within subpu. S4, determine the target partitioning pattern based on the variance between the sub-blocks; S4.1, if the variance between target PU sub-blocks is less than the preset threshold Th var If the partitioning pattern is determined early, the partitioning pattern determination will be terminated early; otherwise, execution will continue. var It can be set to 0-255, preferably 20; S4.2, calculate the sum of the high residual values between PU sub-blocks; Analysis of the brightness residuals of the four sub-blocks The specific calculation method is as follows: Thre1 and Thre2 are preset high-value thresholds for the residuals, (a,b) are the corresponding coordinates in the PU sub-block, and Res L-R Res RT-LB Res T-B Res LT-RB The textural similarity is measured at four directions: 0 degrees, 45 degrees, 90 degrees, and 135 degrees. A higher value indicates greater similarity in texture between sub-blocks. (PU) L PU R These are the two left-hand sub-blocks and two right-hand sub-blocks of PU8; PU T PU B The two upper and two lower sub-blocks of the PU8 block; PU LT PU RB These are the top-left and bottom-right child blocks of the current PU8 block; PU RT PU LB These are the top right and bottom left child blocks of PU8; S5, determine the target partitioning pattern based on the sum of the low residual values between the sub-blocks; If the residuals between sub-blocks satisfy any of the following conditions, the partitioning mode judgment will be terminated early; otherwise, the HEVC normal partitioning mode will be executed. The specific judgment conditions are as follows: Res L-R <Thre res1 Res T-B <Thre res1 Res LT-RB <Thre res2 &&Res RT-LB <Thre res2 Thre res1 and Thre res2 This is a preset threshold for the cumulative sum of high residual values.
3. The fast segmentation method in intra-frame prediction mode according to claim 1, characterized in that, In step S2, the adjacent mean square error reflects the flatness of the target PU, and thus reflects whether the partitioning pattern of the target PU is the optimal partitioning pattern.
4. The fast segmentation method in intra-frame prediction mode according to claim 1, characterized in that, In step S3.1, the smaller the adjacent mean square error of the target PU, the higher its flatness, and the partitioning mode judgment is terminated in advance. In step S3.2, the variance between sub-blocks reflects the difference between sub-blocks, and thus reflects whether the partitioning mode of the target PU is the optimal partitioning mode.
5. The fast segmentation method in intra-frame prediction mode according to claim 1, characterized in that, Step S5 further includes: Based on the sum of the high values of the residuals between the sub-blocks, determine whether to continue partitioning; if the residuals between the sub-blocks satisfy any of the following conditions, the partitioning mode judgment is terminated early: The specific judgment conditions are as follows: Res L-R <Thre res1 Res T-B <Thre res1 Res LT-RB <Thre res2 &&Res RT-LB <Thre res2 Thre res1 and Thre res2 This is a preset threshold for the cumulative sum of high residual values; if Res L-R <Thre res1 If the two sub-blocks on the left and right are flat, and their horizontal similarity is high, then the partitioning can be terminated early. Otherwise, the HEVC normal partitioning mode will be executed, and the optimal mode will be further determined by RDcost. Similarly: Res T-B <Thre res1 This indicates that the two upper and two lower sub-blocks are flat, and their vertical similarity is high; Res LT-RB <Thre res2 And Res RT-LB <Thre res2 This indicates that the top-left and bottom-right sub-blocks, as well as the bottom-left and top-right sub-blocks, are flat and have high similarity in both the 45-degree and 135-degree directions, so further subdivision is not necessary.
6. A video encoding device, characterized in that, The device includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement a fast segmentation method in an intra-frame prediction mode according to any one of claims 1-5.
7. A computer-readable storage medium, characterized in that, The storage medium stores computer instructions, which, when executed by a processor, implement a fast segmentation method in an intra-frame prediction mode according to any one of claims 1-5.
