Intra-coded block partitioning method, video encoding method and electronic device

By using texture direction reference templates at different angles and decision tree models to obtain texture features of video coding blocks, the problem of ignoring predictability and serial dependency in existing technologies is solved, thereby improving the accuracy of coding block partitioning and hardware coding efficiency.

CN119629350BActive Publication Date: 2026-06-12SHANGHAI FULLHAN MICROELECTRONICS

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI FULLHAN MICROELECTRONICS
Filing Date
2024-12-02
Publication Date
2026-06-12

Smart Images

  • Figure CN119629350B_ABST
    Figure CN119629350B_ABST
Patent Text Reader

Abstract

The application provides a partitioning method of an intra-coded block, a video coding method and an electronic device. The partitioning method comprises: determining a target direction template of a current block to be coded according to at least four texture direction reference templates of different angles obtained in advance; obtaining texture features of the current block to be coded according to the target direction template; the texture features comprise a first feature value representing texture complexity and texture predictability of the current block to be coded, and / or a second feature value representing a difference in texture predictability between sub-blocks of the current block to be coded, and / or a third feature value representing a difference in texture predictability between the current block to be coded and the sub-blocks of the current block to be coded; and inputting the texture features into a decision tree model obtained in advance to obtain a flag indicating whether to partition the current block to be coded. The texture complexity and the texture predictability can be considered simultaneously, the coding process of a video encoder is accelerated, the coding time is reduced, and the power consumption of a hardware video encoder is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of video coding technology, and in particular to a method for dividing intra-frame coding blocks, a video coding method, and an electronic device. Background Technology

[0002] The high-efficiency video coding standard H.265 / HEVC employs rate-distortion optimization techniques based on Lagrange multipliers λ to select coding parameters and modes during the coding process. Compared to the previous advanced video coding standard H.264 / AVC, this method achieves a significant improvement in coding efficiency. However, due to the introduction of quadtree coding block technology, the coding complexity of H.265 / HEVC also increases substantially.

[0003] Existing solutions typically reduce coding complexity by skipping unnecessary coding block partitioning patterns. Statistical analysis of video encoding results shows that images with complex textures tend to be encoded using smaller coding blocks, while images with flat textures tend to be encoded using larger coding blocks.

[0004] Based on the above analysis, existing technologies utilize image content features (such as the brightness variance and gradient magnitude of coded blocks) to design algorithms for early partitioning or early termination of coded blocks. Specifically, for a coded block to be encoded, its feature values ​​are first calculated, and combined with statistical encoding information, it is determined whether the block needs early partitioning. If the determination indicates that the block needs early partitioning, the encoding mode for that block in the current layer will be skipped. Conversely, if the determination indicates that the block does not need early partitioning, i.e., it needs to be terminated early, only the encoding mode of the current layer is executed, while the encoding modes of sub-layers are skipped. Therefore, it is evident that by judging based on some extracted coded block features, part of the video encoding search process can be skipped, thereby effectively reducing encoding complexity.

[0005] In the process of extracting features from coded blocks, existing techniques often focus on extracting features that describe the texture complexity of the coded block to be encoded. Coding blocks with complex textures tend to be subdivided downwards. However, existing techniques neglect the predictability of coded blocks when considering their texture complexity. In some cases, coded blocks with complex textures have good predictability, thus having lower encoding costs and not tending to be subdivided downwards.

[0006] Furthermore, existing technologies rely heavily on information accumulated during the serial encoding process to determine whether to prematurely divide or terminate the encoded block. This reliance makes the technology particularly suitable for software video coding, where the encoding process can proceed sequentially, allowing the use of information generated in previous steps at each step. However, this technology encounters significant limitations when applied to hardware video coding that supports parallel processing. In parallel execution environments, with multiple encoding tasks running concurrently, it is difficult to ensure that all necessary pre-processing information is ready when encoding decisions need to be made, thus limiting the effective implementation of this technology. Summary of the Invention

[0007] The purpose of this invention is to provide a method for dividing intra-frame coded blocks, a video coding method, and an electronic device, in order to solve one or more of the problems existing in the prior art, such as ignoring the predictability of coded blocks when considering the texture complexity of coded blocks, and relying on information accumulated during the serial coding process, which leads to a hardware environment that is not conducive to parallel processing.

[0008] To achieve the above objectives, the present invention provides the following technical solution: a method for dividing intra-frame coded blocks, the method comprising:

[0009] Based on at least four pre-acquired texture direction reference templates at different angles, determine the target direction template of the current block to be encoded;

[0010] Based on the target direction template, the texture features of the current block to be encoded are obtained; the texture features include a first feature value characterizing the texture complexity and texture predictability of the current block to be encoded, and / or a second feature value characterizing the difference in texture predictability between the sub-blocks of the current block to be encoded, and / or a third feature value characterizing the difference in texture predictability between the current block to be encoded and the sub-blocks of the current block to be encoded.

[0011] The texture features of the current block to be encoded are input into a pre-acquired decision tree model to obtain a flag indicating whether or not to divide the current block to be encoded.

[0012] Optionally, determining the target orientation template of the current block to be encoded based on at least four pre-acquired texture orientation reference templates at different angles includes: determining whether the size of the current block to be encoded is 8×8 or 4×4; if not, downsampling the current block to be encoded to a size of 8×8 and using the sampling result as the current block to be encoded; calculating the pixel value deviation of the current block to be encoded under each texture orientation reference template, and using the texture orientation reference template corresponding to the smallest pixel value deviation as the target orientation template of the current block to be encoded.

[0013] Optionally, for each texture direction reference template, the pixel value deviation of the current block to be encoded under the texture direction reference template is calculated based on the number of pixels on each line under the texture angle of the texture direction reference template, the average pixel value on each line, and the original pixel value of the current block to be encoded.

[0014] Optionally, the first feature value of the current block to be encoded is obtained by: taking the average pixel value on each line of the target direction template of the current block to be encoded as the predicted value of each pixel value on that line; forming a prediction block of the current block to be encoded by combining the predicted values ​​of each pixel value on all lines; subtracting the prediction block of the current block to be encoded from the original block of the current block to be encoded to obtain a residual block; performing a Hadamard transform on the residual block to obtain a matrix after the Hadamard transform; and taking the sum of the absolute values ​​of all coefficients in the matrix after the Hadamard transform as the first feature value of the current block to be encoded under its corresponding target direction template.

[0015] Optionally, a Hadamard transform can be performed on the residual block using a butterfly operation.

[0016] Optionally, the second feature value is obtained by: obtaining the first feature value of each sub-block of the current block to be encoded; obtaining the variance of the first feature values ​​of all sub-blocks of the current block to be encoded based on the first feature value of each sub-block, and using the variance as the second feature value of the current block to be encoded.

[0017] Optionally, the third feature value is obtained by: obtaining the first feature value of the current block to be encoded and the first feature values ​​of all sub-blocks of the current block to be encoded; subtracting the sum of the first feature values ​​of all sub-blocks of the current block to be encoded from the first feature value of the current block to be encoded to obtain a difference; dividing the difference by the first feature value of the current block to be encoded to obtain the third feature value of the current block to be encoded.

[0018] Optionally, before inputting the texture features of the current block to be encoded into the pre-acquired decision tree model, the partitioning method further includes acquiring the decision tree model by: acquiring training samples, each training sample including training texture features and partitioning labels of the current encoded block, the training texture features including a first training feature value characterizing the texture predictability of the current encoded block, and / or a second training feature value characterizing the difference in texture predictability between sub-blocks of the current encoded block, and / or a third training feature value characterizing the difference in texture predictability between the current encoded block and the sub-blocks of the encoded block; and training the decision tree model using the training samples.

[0019] To achieve the above objectives, the present invention also provides a video encoding method, comprising:

[0020] Perform the intra-frame coding block partitioning method described above on at least one block to be encoded in the video to be encoded, and obtain a flag indicating whether to partition the block to be encoded.

[0021] The flags of all the blocks to be encoded are sent to the video encoder to encode the video.

[0022] To achieve the above objectives, the present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the intra-frame coding block partitioning method or the video coding method described in any of the above claims.

[0023] Compared with the prior art, the intra-frame coding block partitioning method, video coding method, and electronic device provided by the present invention have the following beneficial effects:

[0024] The intra-coded block partitioning method provided by this invention includes: determining a target orientation template for the current block to be encoded based on at least four pre-acquired texture orientation reference templates at different angles; obtaining texture features of the current block to be encoded based on the target orientation template; the texture features include a first feature value characterizing the texture complexity and texture predictability of the current block to be encoded, and / or a second feature value characterizing the difference in texture predictability between sub-blocks of the current block to be encoded, and / or a third feature value characterizing the difference in texture predictability between the current block to be encoded and its sub-blocks; inputting the texture features of the current block to be encoded into a pre-acquired decision tree model to obtain a flag indicating whether or not to partition the current block to be encoded. Therefore, the intra-coded block partitioning method provided by this invention first determines the target orientation template of the current block to be encoded using at least four pre-acquired texture orientation reference templates at different angles, laying the foundation for obtaining the texture features of the current block to be encoded. Next, based on the target direction template of the current block to be encoded, the texture features of the current block to be encoded can be obtained. The first feature value in the texture features characterizes the texture complexity and predictability of the current block to be encoded; the second feature value characterizes the difference in texture predictability between sub-blocks of the current block to be encoded; and the third feature value characterizes the difference in texture predictability between the current block to be encoded and its sub-blocks. By obtaining the texture features of the current block to be encoded, not only its texture complexity but also its texture predictability can be characterized, laying a good foundation for improving the accuracy of the decision tree model's partitioning decision for the current block to be encoded. Finally, by inputting the texture features of the current block to be encoded into a pre-acquired decision tree model, a flag indicating whether or not to partition the current block to be encoded is obtained, which improves the accuracy of the decision tree model's partitioning decision for the current block to be encoded. Furthermore, the intra-frame coding block partitioning method provided by this invention is applicable to both software and hardware video encoders, and can effectively accelerate the encoding process of video encoders, reduce encoding time, and reduce the power consumption of hardware video encoders.

[0025] Since the video encoding method and electronic device provided by this invention belong to the same inventive concept as the intra-frame coding block partitioning method provided by this invention, the video encoding method and electronic device provided by this invention have at least all the advantages of the intra-frame coding block partitioning method provided by this invention. For the advantages of the video encoding method and electronic device provided by this invention, please refer to the relevant description of the beneficial effects of the intra-frame coding block partitioning method provided by this invention, which will not be repeated here. Attached Figure Description

[0026] Figure 1 This is a flowchart illustrating a method for dividing an intra-frame coded block according to Embodiment 1 of the present invention.

[0027] Figure 2 This is a schematic diagram of eight texture direction reference templates of size 8×8 at different angles provided in Embodiment 1 of the present invention;

[0028] Figure 3 This is a flowchart illustrating a video encoding method provided in Embodiment 2 of the present invention. Detailed Implementation

[0029] The following detailed description, in conjunction with the accompanying drawings and specific embodiments, further illustrates the intra-frame coding block division method, video coding method, and electronic device proposed in this invention. The advantages and features of this invention will become clearer from the following description. It should be noted that the accompanying drawings are all in a very simplified form and use non-precise proportions, used only to facilitate and clearly illustrate the purpose of the embodiments of this invention. Please refer to the accompanying drawings to make the objectives, features, and advantages of this invention more apparent and understandable. It should be understood that the structures, proportions, sizes, etc., depicted in the accompanying drawings are only used to complement the content disclosed in the specification, for those skilled in the art to understand and read, and are not intended to limit the implementation conditions of this invention. Any modifications to the structure, changes in proportional relationships, or adjustments to the size, if they are the same as or similar to the effects and objectives achieved by this invention, should still fall within the scope of the technical content disclosed in this invention. Specific design features of the invention disclosed herein, including, for example, specific dimensions, orientations, positions, and shapes, will be determined in part by the specific application and usage environment. Furthermore, in the embodiments described below, sometimes the same reference numerals are used across different drawings to denote the same parts or parts having the same function, and repeated descriptions are omitted.

[0030] Example 1

[0031] This embodiment provides a method for dividing intra-frame coded blocks. For details, please refer to... Figure 1 and Figure 2 , Figure 1 This is a flowchart illustrating the intra-frame coding block partitioning method provided in this embodiment; Figure 2 This is a schematic diagram of eight 8×8 texture direction reference templates at different angles provided in this embodiment. From Figure 1 and Figure 2 It can be seen that the division method includes:

[0032] S100: Determine the target orientation template of the current block to be encoded based on at least four texture orientation reference templates with different angles obtained in advance;

[0033] S200: Based on the target direction template, obtain the texture features of the current block to be encoded; the texture features include a first feature value characterizing the texture complexity and texture predictability of the current block to be encoded, and / or a second feature value characterizing the difference in texture predictability between the sub-blocks of the current block to be encoded, and / or a third feature value characterizing the difference in texture predictability between the current block to be encoded and the sub-blocks of the current block to be encoded;

[0034] S300: Input the texture features of the current block to be encoded into a pre-acquired decision tree model to obtain a flag indicating whether or not to divide the current block to be encoded.

[0035] Therefore, the intra-coded block partitioning method provided in this embodiment first determines the target direction template of the current block to be encoded by using at least four texture direction reference templates with different pre-acquired angles, laying the foundation for obtaining the texture features of the current block to be encoded. Next, based on the target direction template of the current block to be encoded, the texture features of the current block to be encoded can be obtained. The first feature value in the texture features can characterize the texture complexity and texture predictability of the current block to be encoded; the second feature value in the texture features can characterize the difference in texture predictability between the sub-blocks of the current block to be encoded; and the third feature value in the texture features characterizes the difference in texture predictability between the current block to be encoded and its sub-blocks. By obtaining the texture features of the current block to be encoded, not only the texture complexity of the current block to be encoded can be characterized, but also its texture predictability, laying a good foundation for improving the accuracy of the decision tree model's partitioning decision for the current block to be encoded. Finally, by inputting the texture features of the current block to be encoded into a pre-acquired decision tree model, a flag indicating whether or not to partition the current block is obtained, which improves the accuracy of the decision tree model's partitioning decision for the current block. Furthermore, the intra-frame coding block partitioning method provided in this embodiment is applicable to both software and hardware video encoders, and can effectively accelerate the encoding process of the video encoder, reduce encoding time, and lower the power consumption of the hardware video encoder.

[0036] It should be noted that the obtained texture features of the current block to be encoded may include any one of the three feature values ​​of the current block to be encoded: the first feature value, the second feature value, and the third feature value; it may also include any two of these three feature values; or it may include all three feature values. When the texture features of the current block to be encoded include the first feature value, the second feature value, and the third feature value, a texture feature that better reflects whether the current block to be encoded needs to be partitioned can be formed, thereby laying a good foundation for improving the accuracy of the decision tree model's partitioning decision for the current block to be encoded.

[0037] Preferably, in step S100, determining the target orientation template of the current block to be encoded based on at least four pre-acquired texture orientation reference templates at different angles includes:

[0038] S110: Determine whether the size of the current block to be encoded is 8×8 or 4×4. If not, downsample the current block to be encoded to a size of 8×8 and use the sampling result as the current block to be encoded.

[0039] S120: Calculate the pixel value deviation of the current block to be encoded under each of the texture direction reference templates, and take the texture direction reference template corresponding to the smallest pixel value deviation as the target direction template of the current block to be encoded.

[0040] For example, please continue to see Figure 2 In some implementations, if the size of the current block to be encoded is 8×8, then the size of the current block to be encoded is directly calculated. Figure 2 The image shows pixel value deviations under eight different 8×8 texture direction reference templates at various angles, and the texture direction reference template corresponding to the smallest pixel value deviation is used as the target direction template for the current block to be encoded. In some other embodiments, if the size of the current block to be encoded is 4×4, then the pixel values ​​are truncated respectively. Figure 2 The top-left 4×4 texture direction reference template of the eight 8×8 texture direction reference templates at different angles shown is used as the texture direction reference template of the current block to be encoded. The pixel value deviation of the current block to be encoded under the texture direction reference template of the current block to be encoded is calculated, and the texture direction reference template corresponding to the smallest pixel value deviation is used as the target direction template of the current block to be encoded. In some embodiments, if the size of the current block to be encoded is 16×16, the current block to be encoded is first downsampled to 8×8, and then the target direction template of the downsampled 8×8 block to be encoded is calculated. Figure 2 The pixel value deviations under eight different angles and 8×8 texture direction reference templates are shown, and the texture direction reference template corresponding to the smallest pixel value deviation is used as the target direction template of the current block to be encoded.

[0041] It should be noted that the present invention does not impose excessive limitations on the downsampling method for the current block to be encoded, which has a size exceeding 8×8. For example, in some embodiments, average pooling is used for downsampling; in other embodiments, bilinear interpolation or bicubic interpolation is used for downsampling.

[0042] It should be noted that, as those skilled in the art will understand, the present invention does not impose excessive limitations on the texture angle of the texture direction reference template. For example, in some exemplary embodiments, the texture angle of the texture direction reference template can be, but is not limited to, a horizontal angle, a vertical angle, a 45° left tilt, and a 45° right tilt.

[0043] Furthermore, for each texture direction reference template, the pixel value deviation of the current block to be encoded under the texture direction reference template is calculated based on the number of pixels on each line under the texture angle of the texture direction reference template, the average pixel value on each line, and the original pixel value of the current block to be encoded.

[0044] To better understand the present invention, by way of example, the pixel value deviation E of the current block to be encoded under the texture direction reference template d is... d The process of obtaining it will be explained.

[0045] First, the average pixel value on each line of the texture direction reference template d is calculated using the following formula (1):

[0046]

[0047] The pixel value deviation E of the current block to be encoded under the texture direction reference template d is then calculated using the following formula (2). d :

[0048]

[0049] In equations (1) and (2), μ d,k x is the average pixel value on the k-th line of the texture direction reference template d. p P represents the original pixel value of the current block to be encoded. d,k Let N be the set of pixels on the k-th line of the texture direction reference template d. d,k For P d,k The number of pixels in the image.

[0050] Preferably, in step S200, the first feature value of the current block to be encoded is obtained in the following way:

[0051] S211: The average pixel value on each line of the target direction template of the current block to be encoded is used as the predicted value of each pixel on that line;

[0052] S212: The predicted values ​​of each pixel on all the obtained lines are used to form the prediction block of the current block to be encoded;

[0053] S213: Subtract the predicted block of the current block to be encoded from the original block of the current block to be encoded to obtain the residual block;

[0054] S214: Perform a Hadamard transformation on the residual block to obtain the matrix after the Hadamard transformation;

[0055] S215: The sum of the absolute values ​​of all coefficients in the matrix after the Hadamard transform is taken as the first feature value of the current block to be encoded under its corresponding target direction template.

[0056] It should be noted that, as those skilled in the art will understand, performing a Hadamard transformation on the residual block means multiplying the residual block on the left by a Hadamard matrix of the same size as the residual block and then multiplying it on the right by a Hadamard matrix of the same size as the residual block.

[0057] To better understand the present invention, the process of obtaining the first feature value of the current block to be encoded, which is 16×16 in size, will be described exemplarily. Since the size of the current block to be encoded exceeds 8×8, the current block to be encoded is downsampled to a size of 8×8, and the sampling result is used as the current block to be encoded.

[0058] First, the average pixel value on each line of the target direction template of the current block to be encoded is used as the predicted value of each pixel value on that line; and the predicted values ​​of each pixel value on all lines are used to form the prediction block of the current block to be encoded. Next, the prediction block of the current block to be encoded is subtracted from the original block of the current block to be encoded (the original block of the current block to be encoded is the downsampled current block to be encoded) to obtain the residual block. Then, the residual block is multiplied left by an 8×8 Hadamard matrix and then right by an 8×8 Hadamard matrix to obtain the Hadamard transformed matrix. Finally, the sum of the absolute values ​​of all coefficients in the Hadamard transformed matrix is ​​used as the first eigenvalue of the current block to be encoded under the target direction template of the current block to be encoded, which is 16×16 in size.

[0059] Preferably, a butterfly operation is used to perform Hadamard transform on the residual block. This reduces computational complexity, thereby further reducing encoding time and lowering the power consumption of the hardware video encoder.

[0060] Preferably, in step S200, the second feature value of the current block to be encoded is obtained in the following way:

[0061] S221: Obtain the first feature value of each sub-block of the current block to be encoded;

[0062] S222: Based on the first feature value of each sub-block, obtain the variance of the first feature values ​​of all sub-blocks of the current block to be encoded, and use the variance as the second feature value of the current block to be encoded.

[0063] Therefore, by obtaining the variance of the first feature value of all sub-blocks of the current block to be encoded, the difference in texture predictability among all sub-blocks of the current block to be encoded can be characterized, laying a good foundation for improving the accuracy of the decision tree model's partitioning decision for the current block to be encoded.

[0064] Furthermore, in step S200, the third feature value of the current block to be encoded is obtained in the following way:

[0065] S231: Obtain the first feature value of the current block to be encoded and the first feature values ​​of all sub-blocks of the current block to be encoded;

[0066] S232: Subtract the sum of the first feature values ​​of all sub-blocks of the current block to be encoded from the first feature value of the current block to be encoded to obtain the difference;

[0067] S233: Divide the difference by the first feature value of the current block to be encoded to obtain the third feature value of the current block to be encoded.

[0068] Therefore, the third feature value obtained in the above manner can characterize the difference in texture predictability between the current block to be encoded and its sub-blocks, laying a good foundation for further improving the accuracy of the decision tree model's partitioning decision for the current block to be encoded.

[0069] To better understand this invention, the process of obtaining the second and third feature values ​​of the current block to be encoded in the H.265 / HEVC video coding standard is explained by way of example. In the H.265 / HEVC video coding standard, the internal structure of the current block to be encoded is divided into four sub-blocks using a quadtree partitioning method.

[0070] When obtaining the second feature value of the current block to be encoded, the first feature values ​​of the four sub-blocks of the current block to be encoded are first obtained by referring to the method for obtaining the first feature value provided in this embodiment. Then, the average value of the first feature values ​​of the four sub-blocks is calculated. Then, the variance of the first feature values ​​of the four sub-blocks is calculated, and this variance is used as the second feature value of the current block to be encoded.

[0071] When obtaining the third feature value of the current block to be encoded, the first feature value of the current block to be encoded and the first feature values ​​of its four sub-blocks are first obtained by referring to the method for obtaining the first feature value provided in this embodiment. Next, the sum of the first feature values ​​of the four sub-blocks of the current block to be encoded is subtracted from the first feature value of the current block to be encoded to obtain the difference. Then, the difference is divided by the first feature value of the current block to be encoded to obtain the third feature value of the current block to be encoded.

[0072] It should be noted that the above is merely an illustrative example, and the present invention does not impose excessive limitations on the number of sub-blocks obtained by dividing the current block to be encoded internally. For example, in the H.266 / VVC video coding standard, the current block to be encoded can be divided into two sub-blocks using a binary tree partitioning method or into three sub-blocks using a ternary tree partitioning method.

[0073] Preferably, before inputting the texture features of the current block to be encoded into the pre-acquired decision tree model, the partitioning method further includes acquiring the decision tree model by: acquiring training samples, each training sample including training texture features and partitioning labels of the current encoded block, the training texture features including a first training feature value characterizing the texture predictability of the current encoded block, and / or a second training feature value characterizing the difference in texture predictability between sub-blocks of the current encoded block, and / or a third training feature value characterizing the difference in texture predictability between the current encoded block and the sub-blocks of the encoded block; and training the decision tree model using the training samples.

[0074] For example, in some exemplary embodiments, a decision tree model is trained by using the first, second, and third feature values ​​of encoded blocks in a large number of video sequences, along with their corresponding partitioning labels, as training samples.

[0075] Example 2

[0076] This embodiment provides a video encoding method. For details, please refer to [link to relevant documentation]. Figure 3 , Figure 3 This is a flowchart illustrating the video encoding method provided in this embodiment. Figure 3 As can be seen, the video encoding method includes:

[0077] S400: Perform the intra-frame coding block partitioning method described in any of the above embodiments on at least one block to be encoded in the video to be encoded, and obtain a flag indicating whether to partition the block to be encoded.

[0078] S500: The flags of all the blocks to be encoded are sent to the video encoder to encode the video.

[0079] Since the video encoding method provided in this embodiment belongs to the same inventive concept as the intra-frame coding block partitioning method described in any of the above embodiments, the video encoding method provided in this embodiment has at least all the advantages of the intra-frame coding block partitioning methods provided in the above embodiments. For the advantages of the video encoding method provided in this embodiment, please refer to the relevant description of the beneficial effects of the intra-frame coding block partitioning methods provided in the above embodiments, which will not be repeated here.

[0080] It should be noted that the present invention does not impose excessive limitations on the number of blocks to be encoded in the video to be encoded, for which the intra-coded block partitioning method described in any of the above embodiments is applied. For example, in some embodiments, the intra-coded block partitioning method described in any of the above embodiments can be applied to all blocks to be encoded in all coding tree units of the video to be encoded; in other embodiments, the intra-coded block partitioning method described in any of the above embodiments can be applied to all blocks to be encoded in a single coding tree unit of the video to be encoded.

[0081] To better understand the present invention, the process of using the video encoding method provided in this embodiment on a certain encoding tree unit in the video to be encoded will be described by way of example.

[0082] First, the target orientation template for each block to be encoded in the coding tree unit is determined, and the first, second, and third feature values ​​corresponding to each block to be encoded are obtained. Next, the first, second, and third feature values ​​corresponding to all blocks to be encoded in the coding tree unit are input into a pre-acquired decision tree model. The decision tree model then obtains a flag indicating whether each block to be encoded in the coding tree unit needs to be segmented. Finally, the obtained flags for all blocks to be encoded in the coding tree unit are sent to the video encoder for encoding the coding tree unit.

[0083] Example 3

[0084] This embodiment provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the intra-frame coding block partitioning method or the video coding method described in any of the above embodiments.

[0085] Since the electronic device provided in this embodiment belongs to the same inventive concept as the intra-frame coding block partitioning method or the video coding method described in any of the above embodiments, the electronic device provided in this embodiment has at least all the advantages of the intra-frame coding block partitioning method or the video coding method provided in the above embodiments. For the advantages of the electronic device provided in this embodiment, please refer to the relevant descriptions of the beneficial effects of the intra-frame coding block partitioning method or the video coding method provided in the above embodiments, which will not be repeated here.

[0086] In summary, the intra-frame coding block partitioning method, video coding method, and electronic device provided by this invention have the following advantages: The intra-frame coding block partitioning method provided by this invention includes: determining a target orientation template for the current block to be encoded based on at least four pre-acquired texture orientation reference templates at different angles; obtaining texture features of the current block to be encoded based on the target orientation template; the texture features include a first feature value characterizing the texture complexity and texture predictability of the current block to be encoded, and / or a second feature value characterizing the difference in texture predictability between sub-blocks of the current block to be encoded, and / or a third feature value characterizing the difference in texture predictability between the current block to be encoded and its sub-blocks; inputting the texture features of the current block to be encoded into a pre-acquired decision tree model to obtain a flag indicating whether or not to partition the current block to be encoded. Therefore, the intra-frame coding block partitioning method provided by this invention first determines the target orientation template of the current block to be encoded using at least four pre-acquired texture orientation reference templates at different angles, laying the foundation for obtaining the texture features of the current block to be encoded. Next, based on the target direction template of the current block to be encoded, the texture features of the current block to be encoded can be obtained. The first feature value in the texture features characterizes the texture complexity and predictability of the current block to be encoded; the second feature value characterizes the difference in texture predictability between sub-blocks of the current block to be encoded; and the third feature value characterizes the difference in texture predictability between the current block to be encoded and its sub-blocks. By obtaining the texture features of the current block to be encoded, not only its texture complexity but also its texture predictability can be characterized, laying a good foundation for improving the accuracy of the decision tree model's partitioning decision for the current block to be encoded. Finally, by inputting the texture features of the current block to be encoded into a pre-acquired decision tree model, a flag indicating whether or not to partition the current block to be encoded is obtained, which improves the accuracy of the decision tree model's partitioning decision for the current block to be encoded. Furthermore, the intra-frame coding block partitioning method provided by this invention is applicable to both software and hardware video encoders, and can effectively accelerate the encoding process of video encoders, reduce encoding time, and reduce the power consumption of hardware video encoders.

[0087] Since the video encoding method and electronic device provided by this invention belong to the same inventive concept as the intra-frame coding block partitioning method provided by this invention, the video encoding method and electronic device provided by this invention have at least all the advantages of the intra-frame coding block partitioning method provided by this invention. For the advantages of the video encoding method and electronic device provided by this invention, please refer to the relevant description of the beneficial effects of the intra-frame coding block partitioning method provided by this invention, which will not be repeated here.

[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for dividing intra-frame coded blocks, characterized in that, The partitioning method includes: Based on at least four pre-acquired texture direction reference templates at different angles, determine the target direction template of the current block to be encoded; Based on the target direction template, the texture features of the current block to be encoded are obtained; the texture features include a first feature value characterizing the texture complexity and texture predictability of the current block to be encoded, and / or a second feature value characterizing the difference in texture predictability between the sub-blocks of the current block to be encoded, and / or a third feature value characterizing the difference in texture predictability between the current block to be encoded and the sub-blocks of the current block to be encoded. The texture features of the current block to be encoded are input into a pre-acquired decision tree model to obtain a flag indicating whether or not to divide the current block to be encoded. The first feature value of the current block to be encoded is obtained by: taking the average pixel value of each line on the target direction template of the current block to be encoded as the predicted value of each pixel value on that line; forming a prediction block of the current block to be encoded by taking the predicted values ​​of each pixel value on all lines; subtracting the original block of the current block to be encoded from the prediction block of the current block to obtain a residual block; performing a Hadamard transform on the residual block to obtain a matrix after the Hadamard transform; and taking the sum of the absolute values ​​of all coefficients in the matrix after the Hadamard transform as the first feature value of the current block to be encoded under its corresponding target direction template.

2. The method for dividing intra-frame coded blocks as described in claim 1, characterized in that, The step of determining the target orientation template of the current block to be encoded based on at least four pre-acquired texture orientation reference templates at different angles includes: Determine whether the size of the current block to be encoded is 8×8 or 4×4. If not, downsample the current block to be encoded to a size of 8×8 and use the sampling result as the current block to be encoded. Calculate the pixel value deviation of the current block to be encoded under each of the texture direction reference templates, and take the texture direction reference template corresponding to the smallest pixel value deviation as the target direction template of the current block to be encoded.

3. The method for dividing intra-frame coded blocks as described in claim 2, characterized in that, For each texture direction reference template, the pixel value deviation of the current block to be encoded under the texture direction reference template is calculated based on the number of pixels on each line under the texture angle of the texture direction reference template, the average pixel value on each line, and the original pixel value of the current block to be encoded.

4. The method for dividing intra-frame coded blocks as described in claim 1, characterized in that, The residual block is subjected to Hadamard transformation using a butterfly operation.

5. The method for dividing intra-frame coded blocks as described in claim 1, characterized in that, The second feature value is obtained in the following way: Obtain the first feature value of each sub-block of the current block to be encoded; Based on the first feature value of each sub-block, obtain the variance of the first feature values ​​of all sub-blocks of the current block to be encoded, and use this variance as the second feature value of the current block to be encoded.

6. The method for dividing intra-frame coded blocks as described in claim 1, characterized in that, The third feature value is obtained in the following way: Obtain the first feature value of the current block to be encoded and the first feature values ​​of all sub-blocks of the current block to be encoded; The difference is obtained by subtracting the sum of the first feature values ​​of all sub-blocks of the current block to be encoded from the first feature value of the current block to be encoded. Divide the difference by the first feature value of the current block to be encoded to obtain the third feature value of the current block to be encoded.

7. The method for dividing intra-frame coded blocks as described in claim 1, characterized in that, Before inputting the texture features of the current block to be encoded into the pre-acquired decision tree model, the partitioning method further includes obtaining the decision tree model in the following manner: Obtain training samples, each of which includes training texture features and partitioning labels for the current encoded block. The training texture features include a first training feature value characterizing the texture predictability of the current encoded block, and / or a second training feature value characterizing the difference in texture predictability between sub-blocks of the current encoded block, and / or a third training feature value characterizing the difference in texture predictability between the current encoded block and the sub-blocks of the encoded block. The decision tree model is obtained by training the training samples.

8. A video encoding method, characterized in that, include: Perform the intra-frame coding block partitioning method as described in any one of claims 1 to 7 on at least one block to be encoded in the video to be encoded, and obtain a flag indicating whether to partition the block to be encoded; The flags of all the blocks to be encoded are sent to the video encoder to encode the video.

9. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the intra-frame coding block partitioning method as described in any one of claims 1 to 7 or the video coding method as described in claim 8.