Intra-frame coding block division method, video coding method and electronic equipment

By using texture direction reference templates at different angles in video encoding to obtain the red-reaching characteristics of the coded block and input it into the decision tree model, the encoding complexity problem caused by ignoring the predictability of the coded block in the prior art is solved, and a more efficient video encoding process is achieved.

CN119629350AActive Publication Date: 2025-03-14SHANGHAI FULLHAN MICROELECTRONICS
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411751211.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-03-14
Estimated Expiration
2044-12-02

AI Technical Summary

Technical Problem

The prior art ignores the predictability of the encoding blocks in the video encoding process, making it difficult to effectively reduce the encoding complexity in a parallel processing environment.

Method used

By determining the target orientation template of the block to be encoded using at least four different angles, obtaining its texture features, including eigenvalues ​​of texture complexity and predictability, and entering these features into the decision tree model to decide whether to divide.

Benefits of technology

Improves the accuracy of the decision tree model for coding block division decisions, and is suitable for software and hardware video encoders, reducing encoding time and reducing the power consumption of hardware video encoders.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629350A_ABST
    Figure CN119629350A_ABST
Patent Text Reader

Abstract

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

Description

Technical Field

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

[0002] The high-efficiency video coding standard H.265 / HEVC uses rate-distortion optimization technology based on Lagrange multipliers λ to select coding parameters and coding modes during the coding process. Compared with the previous advanced video coding standard H.264 / AVC, this method has achieved significant improvements in coding efficiency. However, due to the introduction of coding block quadtree technology, the coding complexity of H.265 / HEVC has also increased significantly.

[0003] Existing solutions generally reduce encoding complexity by skipping unnecessary coding block divisions. When analyzing the encoding results of a video, statistical results show that image content with complex textures often ends up being encoded using smaller coding blocks, while image content with flat textures often ends up being encoded using larger coding blocks.

[0004] Based on the above analysis results, the prior art uses the characteristics of the image content (such as the brightness variance and gradient amplitude of the coding block) to design an early division or early termination algorithm for the coding block. Specifically, for a coding block to be encoded, the characteristic value of the coding block is first calculated, and the statistical coding information is combined to determine whether the coding block needs to be divided in advance. If the judgment result shows that the coding block needs to be divided in advance, the coding mode of the coding block in the current layer will be skipped. On the contrary, if the judgment result shows that the coding block does not need to be divided in advance, that is, the coding needs to be terminated in advance, only the coding mode of the current layer will be executed, and the coding mode of the sub-layer will be skipped. It can be seen that it is possible to skip part of the video coding search process based on the characteristics of some extracted coding blocks, thereby effectively reducing the coding complexity.

[0005] In the process of extracting features of coding blocks, the prior art often focuses on extracting features that can describe the texture complexity of the coding blocks to be encoded, and coding blocks with complex textures tend to be divided downward. However, when considering the texture complexity of coding blocks, the prior art ignores the predictability of coding blocks. In some cases, coding blocks with complex textures have better predictability, so they have lower encoding costs and tend not to be divided downward.

[0006] In addition, the prior art relies heavily on information accumulated during the serial encoding process to determine whether to divide or terminate the encoding block in advance. This dependence makes the technology particularly suitable for software video encoding, because in software encoding, the encoding process can be carried out in sequence, allowing each step to utilize the information generated by the previous step. However, when applied to hardware video encoding that supports parallel processing, this technology encounters significant limitations. In a parallel execution environment, since multiple encoding tasks are carried out simultaneously, it is difficult to ensure that all necessary pre-information is ready when encoding decisions need to be made, which limits the effective implementation of the technology. Summary of the invention

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

[0008] To achieve the above object, the present invention is implemented by the following technical solution: a method for dividing intra-frame coding blocks, the method comprising:

[0009] Determine a target direction template of the current block to be encoded according to at least four texture direction reference templates of different angles acquired in advance;

[0010] According to the target direction template, a texture feature of the current block to be encoded is obtained; the texture feature includes 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 the sub-block of the current block to be encoded;

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

[0012] Optionally, determining the target direction template of the current block to be encoded based on at least four texture direction reference templates of different angles acquired in advance includes: judging whether the size of the current block to be encoded is 8×8 or 4×4, and 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 of the texture direction reference templates, and using the texture direction reference template corresponding to the smallest pixel value deviation as the target direction template of the current block to be encoded.

[0013] Optionally, for each of the texture direction reference templates, 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 at the texture angle of the texture direction reference template and the average pixel value on each line, and the original pixel value of the current block to be encoded.

[0014] Optionally, the first eigenvalue of the current block to be encoded is obtained in the following manner: taking the average value of pixels on each line on the target direction template of the current block to be encoded as the predicted value of each pixel value on the line; forming the predicted values ​​of each pixel value on all the obtained lines into a prediction block of the current block to be encoded; 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 eigenvalue of the current block to be encoded under its corresponding target direction template.

[0015] Optionally, a butterfly operation is used to perform Hadamard transform on the residual block.

[0016] Optionally, the second eigenvalue is obtained in the following manner: obtaining the first eigenvalue of each sub-block of the current block to be encoded; obtaining the variance of the first eigenvalues ​​of all sub-blocks of the current block to be encoded based on the first eigenvalue of each sub-block, and using the variance as the second eigenvalue of the current block to be encoded.

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

[0018] Optionally, before inputting the texture features of the current block to be encoded into a pre-acquired decision tree model, the partitioning method also includes obtaining the decision tree model in the following manner: obtaining training samples, each of the training samples including training texture features and partition 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 using the training samples to train to obtain the decision tree model.

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

[0020] Performing any of the above-mentioned methods for dividing intra-frame coding blocks on at least one block to be coded in the video to be coded, and obtaining a flag of whether to divide the block to be coded;

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

[0022] To achieve the above objectives, the present invention also provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for dividing the intra-frame coding blocks described in any one of the above items is implemented or the video coding method described in any one of the above items is implemented.

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

[0024] The method for dividing intra-frame coding blocks provided by the present invention comprises: determining the target direction template of the current block to be coded according to the texture direction reference templates of at least four different angles acquired in advance; acquiring the texture features of the current block to be coded according to the target direction template; the texture features comprise a first feature value characterizing the texture complexity and texture predictability of the current block to be coded, and / or a second feature value characterizing the difference in texture predictability between sub-blocks of the current block to be coded, and / or a third feature value characterizing the difference in texture predictability between the current block to be coded and the sub-blocks of the current block to be coded; the texture features of the current block to be coded are input into a pre-acquired decision tree model to obtain a flag for whether to divide the current block to be coded. Thus, the method for dividing intra-frame coding blocks provided by the present invention can first determine the target direction template of the current block to be coded by pre-acquired texture direction reference templates of at least four different angles, laying a foundation for acquiring the texture features of the current block to be coded. Then, according to the target direction template of the current block to be encoded, the texture feature of the current block to be encoded can be obtained, the first eigenvalue in the texture feature can characterize the texture complexity and texture predictability of the current block to be encoded, the second eigenvalue in the texture feature can characterize the difference in texture predictability between the sub-blocks of the current block to be encoded, and the third eigenvalue in the texture feature characterizes the difference in texture predictability between the current block to be encoded and the sub-blocks of the current block to be encoded; by obtaining the texture feature of the current block to be encoded, not only the texture complexity of the current block to be encoded can be characterized, but also the texture predictability of the current block to be encoded can be characterized, which lays a good foundation for improving the accuracy of the decision tree model for the division decision result of the current block to be encoded. Finally, by inputting the texture feature of the current block to be encoded into the pre-acquired decision tree model, a sign of whether to divide the current block to be encoded is obtained, which can improve the accuracy of the decision tree model for the division decision result of the current block to be encoded. In addition, the intra-frame coding block division method provided by the present invention can be applied to software video encoders and hardware video encoders, and can effectively accelerate the encoding process of the video encoder, reduce the encoding time, and reduce the power consumption of the hardware video encoder.

[0025] Since the video encoding method and the electronic device provided by the present invention belong to the same inventive concept as the method for dividing the intra-frame coding blocks provided by the present invention, the video encoding method and the electronic device provided by the present invention at least have all the advantages of the method for dividing the intra-frame coding blocks provided by the present invention. For the advantages of the video encoding method and the electronic device provided by the present invention, please refer to the relevant description of the beneficial effects of the method for dividing the intra-frame coding blocks provided by the present invention, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A schematic diagram of a flow chart of a method for dividing intra-frame coding blocks provided in Embodiment 1 of the present invention;

[0027] Figure 2 A schematic diagram of eight texture direction reference templates of a size of 8×8 at different angles provided in the first embodiment of the present invention;

[0028] Figure 3 A schematic diagram of a flow chart of a video encoding method provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION

[0029] The following is a further detailed description of the intra-frame coding block division method, video coding method and electronic device proposed in the present invention in combination with the accompanying drawings and specific embodiments. According to the following description, the advantages and features of the present invention will be clearer. It should be noted that the drawings are all in a very simplified form and use non-precise proportions, which are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention. In order to make the purposes, features and advantages of the present invention more obvious and easy to understand, please refer to the accompanying drawings. It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the limiting conditions for the implementation of the present invention. Any modification of the structure, change in the proportional relationship or adjustment of the size, in the case of the same or similar effects and purposes that can be achieved by the present invention, should still fall within the scope of the technical content disclosed by the present invention. The specific design features of the present invention disclosed herein include, for example, specific dimensions, directions, positions and shapes, which will be determined in part by the specific environment to be applied and used. And, in the implementation described below, sometimes the same figure mark is used in common between different drawings to represent the same part or part with the same function, and its repeated description is omitted.

[0030] Embodiment 1

[0031] This embodiment provides a method for dividing intra-frame coding blocks. Figure 1 and Figure 2 , Figure 1 A schematic diagram of a flow chart of a method for dividing intra-frame coding blocks provided in this embodiment; Figure 2 Schematic diagram of eight texture direction reference templates of 8×8 in size at different angles provided in this embodiment. Figure 1 and Figure 2 It can be seen that the division method includes:

[0032] S100: determining a target direction template of a current block to be encoded according to at least four texture direction reference templates of different angles acquired in advance;

[0033] S200: Acquire texture features of the current block to be encoded according to the target direction 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 a sub-block of the current block to be encoded;

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

[0035] Therefore, the intra-frame coding block division method provided by the present embodiment can first determine the target direction template of the current block to be coded by pre-acquired texture direction reference templates of at least four different angles, laying a foundation for obtaining the texture features of the current block to be coded. Then, according to the target direction template of the current block to be coded, the texture features of the current block to be coded can be obtained, the first eigenvalue in the texture features can characterize the texture complexity and texture predictability of the current block to be coded, the second eigenvalue in the texture features can characterize the difference in texture predictability between the sub-blocks of the current block to be coded, and the third eigenvalue in the texture features characterizes the difference in texture predictability between the current block to be coded and the sub-blocks of the current block to be coded; by acquiring the texture features of the current block to be coded, not only the texture complexity of the current block to be coded can be characterized, but also the texture predictability of the current block to be coded can be characterized, laying a good foundation for improving the accuracy of the decision tree model's division decision results for the current block to be coded. Finally, by inputting the texture features of the current block to be encoded into the pre-acquired decision tree model, a flag of whether to divide the current block to be encoded is obtained, which can improve the accuracy of the decision tree model's decision result on the division of the current block to be encoded. In addition, the intra-frame coding block division method provided in this embodiment can be applied to software video encoders and hardware video encoders, and can effectively accelerate the encoding process of the video encoder, reduce the encoding time, and reduce the power consumption of the hardware video encoder.

[0036] It should be noted that the texture features of the current block to be encoded that are obtained may include any one of the three eigenvalues ​​of the first eigenvalue, the second eigenvalue, and the third eigenvalue of the current block to be encoded, may include any two of the three eigenvalues, and may also include all of the three eigenvalues. When the texture features of the current block to be encoded include the first eigenvalue, the second eigenvalue, and the third eigenvalue of the current block to be encoded, texture features that can better reflect whether the current block to be encoded needs to be divided can be formed, thereby laying a good foundation for improving the accuracy of the decision tree model's decision results on the division of the current block to be encoded.

[0037] Preferably, in step S100, determining the target direction template of the current block to be encoded according to the pre-acquired texture direction reference templates of at least four 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 use the texture direction reference template corresponding to the minimum pixel value deviation as the target direction template of the current block to be encoded.

[0040] For example, please see Figure 2 In some implementations, if the size of the current block to be encoded is 8×8, the current block to be encoded is directly calculated in Figure 2 The pixel value deviations of the texture direction reference templates of size 8×8 at eight different angles 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. In some other implementations, if the size of the current block to be encoded is 4×4, the pixel value deviations of the texture direction reference templates of size 8×8 at eight different angles 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. Figure 2 The 4×4 texture direction reference template in the upper left corner of the eight 8×8 texture direction reference templates at different angles is used as the texture direction reference template of the current block to be encoded, and 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 other 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 downsampled 8×8 block to be encoded is calculated. Figure 2 The pixel value deviations of the texture direction reference templates of size 8×8 at eight different angles 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 too many restrictions on the downsampling method of the current block to be encoded whose size exceeds 8×8. For example, in some embodiments, an average pooling method is used for downsampling; in other embodiments, a bilinear interpolation method or a bicubic interpolation method is used for downsampling.

[0042] It should be noted that, as those skilled in the art can understand, the present invention does not impose too many restrictions 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 left tilt of 45°, and a right tilt of 45°.

[0043] Further, for each of the texture direction reference templates, 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 and the average pixel value on each line, and the original pixel value of the current block to be encoded.

[0044] In order to facilitate the understanding of the present invention, illustratively, the pixel value deviation E of the current block to be encoded under the texture direction reference template d is d The acquisition process is described below.

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

[0046]

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

[0048]

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

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

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

[0052] S212: Combining the obtained prediction values ​​of each pixel value on all lines into a prediction block of the current block to be encoded;

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

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

[0055] S215: Taking the sum of the absolute values ​​of all coefficients in the matrix after the Hadamard transformation as the first eigenvalue of the current block to be encoded under the corresponding target direction template.

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

[0057] In order to facilitate understanding of the present invention, the process of obtaining the first characteristic value of the current block to be encoded of a size of 16×16 is described as an example. 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 value of pixels on each line on the target direction template of the current block to be encoded is used as the predicted value of each pixel value on the line; and the obtained predicted values ​​of each pixel value on all lines are combined into the predicted block of the current block to be encoded. Next, the predicted 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 current block to be encoded obtained by downsampling) to obtain a residual block. Then, the residual block is multiplied on the left by a Hadamard matrix of size 8×8 and then on the right by a Hadamard matrix of size 8×8 to obtain a matrix after Hadamard transformation. Finally, the sum of the absolute values ​​of all coefficients in the matrix after Hadamard transformation is used as the first eigenvalue of the current block to be encoded of size 16×16 under the target direction template of the current block to be encoded.

[0059] Preferably, the Hadamard transform is performed on the residual block in a butterfly operation manner, thereby reducing the computational complexity, thereby further reducing the encoding time and the power consumption of the hardware video encoder.

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

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

[0062] S222: Obtain, according to the first eigenvalue of each sub-block, the variance of the first eigenvalues ​​of all sub-blocks of the current block to be encoded, and use the variance as the second eigenvalue of the current block to be encoded.

[0063] Therefore, by obtaining the variance of the first eigenvalue of all sub-blocks of the current block to be encoded, the difference in texture predictability between 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 decision results on the division of the current block to be encoded.

[0064] Further, in step S200, the third characteristic value of the current block to be encoded is obtained by:

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

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

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

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

[0069] In order to facilitate understanding of the present invention, exemplarily, the process of obtaining the second eigenvalue and the third eigenvalue of the current block to be encoded in the H.265 / HEVC video coding standard is described. In the H.265 / HEVC video coding standard, the interior of the current block to be encoded is divided into four sub-blocks by a quadtree partitioning method.

[0070] When obtaining the second eigenvalue of the current block to be encoded, first refer to the method for obtaining the first eigenvalue provided in this embodiment to obtain the first eigenvalues ​​of the four sub-blocks of the current block to be encoded. Then, calculate and obtain the average value of the first eigenvalues ​​of the four sub-blocks. Then calculate and obtain the variance of the first eigenvalues ​​of the four sub-blocks, and use the variance as the second eigenvalue of the current block to be encoded.

[0071] When obtaining the third eigenvalue of the current block to be encoded, first refer to the method for obtaining the first eigenvalue provided in this embodiment to obtain the first eigenvalue of the current block to be encoded and the first eigenvalues ​​of the four sub-blocks of the current block to be encoded. Then, the sum of the first eigenvalues ​​of the four sub-blocks of the current block to be encoded is subtracted from the first eigenvalue of the current block to be encoded to obtain a difference. Then, the difference is divided by the first eigenvalue of the current block to be encoded to obtain the third eigenvalue of the current block to be encoded.

[0072] It should be noted that the above is only an exemplary description, and the present invention does not impose too many restrictions on the number of sub-blocks obtained by dividing the internal part of the current block to be encoded. For example, in the H.266 / VVC video coding standard, the internal part of the current block to be encoded can be divided into two sub-blocks by a binary tree partitioning method or divided into three sub-blocks by a ternary tree partitioning method.

[0073] Preferably, before inputting the texture features of the current block to be encoded into a pre-acquired decision tree model, the division method also includes obtaining the decision tree model in the following manner: obtaining training samples, each of the training samples including training texture features and division 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 using the training samples to train to obtain the decision tree model.

[0074] Exemplarily, in some exemplary implementations, the first eigenvalues, the second eigenvalues, and the third eigenvalues ​​of encoded blocks in a large number of video sequences and the corresponding partition labels are used as training samples to train a decision tree model.

[0075] Embodiment 2

[0076] This embodiment provides a video encoding method. Figure 3 , Figure 3 The following is a flow chart of the video encoding method provided in this embodiment. Figure 3 It can be seen that the video encoding method includes:

[0077] S400: performing the intra-frame coding block division method described in any of the above embodiments on at least one block to be encoded in the video to be encoded, and obtaining a flag of whether to divide the block to be encoded;

[0078] S500: Transmit the obtained flags of all the blocks to be encoded to a video encoder to encode the video to be encoded.

[0079] Since the video encoding method provided in this embodiment and the method for dividing the intra-frame coding blocks described in any of the above-mentioned embodiments belong to the same inventive concept, the video encoding method provided in this embodiment has at least all the advantages of the method for dividing the intra-frame coding blocks provided in the above-mentioned 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 method for dividing the intra-frame coding blocks provided in the above-mentioned embodiments, which will not be repeated here.

[0080] It should be noted that the present invention does not impose too many restrictions on the number of blocks to be encoded in the video to be encoded that are subjected to the method for dividing intra-frame coding blocks described in any of the above embodiments. For example, in some of the embodiments, the method for dividing intra-frame coding blocks described in any of the above embodiments may be performed on all blocks to be encoded in all coding tree units in the video to be encoded; in other embodiments, the method for dividing intra-frame coding blocks described in any of the above embodiments may also be performed on all blocks to be encoded in a certain coding tree unit in the video to be encoded.

[0081] In order to make the present invention more understandable, by way of example, a process of using the video encoding method provided by this embodiment on a coding tree unit in a video to be encoded is described.

[0082] First, determine the target direction template of each block to be encoded in the coding tree unit, and obtain the first eigenvalue, second eigenvalue and third eigenvalue corresponding to each block to be encoded. Then, input the first eigenvalue, second eigenvalue and third eigenvalue corresponding to all blocks to be encoded in the coding tree unit into the pre-acquired decision tree model, and obtain the flag of whether each block to be encoded in the coding tree unit needs to be divided through the decision tree model. Finally, the obtained flags of all blocks to be encoded in the coding tree unit are transmitted to the video encoder to encode the coding tree unit.

[0083] Embodiment 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, wherein when the processor executes the computer program, the method for dividing intra-frame coding blocks described in any one of the above-mentioned embodiments is implemented, or the video coding method described in any one of the above-mentioned embodiments is implemented.

[0085] Since the electronic device provided by this embodiment and the method for dividing the intra-frame coding blocks described in any of the above-mentioned embodiments or the video coding method described in any of the above-mentioned embodiments belong to the same inventive concept, the electronic device provided by this embodiment at least has all the advantages of the method for dividing the intra-frame coding blocks provided by the above-mentioned embodiments or the video coding method provided by the above-mentioned embodiments. For the advantages of the electronic device provided by this embodiment, please refer to the relevant description of the beneficial effects of the method for dividing the intra-frame coding blocks provided by the above-mentioned embodiments or the video coding method provided by the above-mentioned embodiments, which will not be repeated here.

[0086] In summary, the intra-frame coding block division method, video coding method and electronic device provided by the present invention have the following advantages: the intra-frame coding block division method provided by the present invention comprises: determining the target direction template of the current block to be coded according to the texture direction reference templates of at least four different angles acquired in advance; acquiring the texture feature of the current block to be coded according to the target direction template; the texture feature comprises a first feature value characterizing the texture complexity and texture predictability of the current block to be coded, and / or a second feature value characterizing the difference in texture predictability between the sub-blocks of the current block to be coded, and / or a third feature value characterizing the difference in texture predictability between the current block to be coded and the sub-blocks of the current block to be coded; the texture feature of the current block to be coded is input into the pre-acquired decision tree model to obtain a sign of whether to divide the current block to be coded. Therefore, the intra-frame coding block division method provided by the present invention can first determine the target direction template of the current block to be coded by pre-acquired texture direction reference templates of at least four different angles, laying a foundation for acquiring the texture feature of the current block to be coded. Then, according to the target direction template of the current block to be encoded, the texture feature of the current block to be encoded can be obtained, the first eigenvalue in the texture feature can characterize the texture complexity and texture predictability of the current block to be encoded, the second eigenvalue in the texture feature can characterize the difference in texture predictability between the sub-blocks of the current block to be encoded, and the third eigenvalue in the texture feature characterizes the difference in texture predictability between the current block to be encoded and the sub-blocks of the current block to be encoded; by obtaining the texture feature of the current block to be encoded, not only the texture complexity of the current block to be encoded can be characterized, but also the texture predictability of the current block to be encoded can be characterized, which lays a good foundation for improving the accuracy of the decision tree model for the division decision result of the current block to be encoded. Finally, by inputting the texture feature of the current block to be encoded into the pre-acquired decision tree model, a sign of whether to divide the current block to be encoded is obtained, which can improve the accuracy of the decision tree model for the division decision result of the current block to be encoded. In addition, the intra-frame coding block division method provided by the present invention can be applied to software video encoders and hardware video encoders, and can effectively accelerate the encoding process of the video encoder, reduce the encoding time, and reduce the power consumption of the hardware video encoder.

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

[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A method for dividing intra-frame coding blocks, characterized in that: The division method comprises: Determine a target direction template of the current block to be encoded according to at least four texture direction reference templates of different angles acquired in advance; According to the target direction template, a texture feature of the current block to be encoded is obtained; the texture feature includes 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 the sub-block of the current block to be encoded; The texture feature of the current block to be encoded is input into a pre-acquired decision tree model to obtain a flag indicating whether to divide the current block to be encoded.

2. The method for dividing intra-frame coding blocks according to claim 1, characterized in that: The step of determining the target direction template of the current block to be encoded according to the pre-acquired texture direction reference templates of at least four 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; The pixel value deviation of the current block to be encoded under each of the texture direction reference templates is calculated, and the texture direction reference template corresponding to the minimum pixel value deviation is used as the target direction template of the current block to be encoded.

3. The method for dividing intra-frame coding blocks according to claim 2, characterized in that: For each of the texture direction reference templates, 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 at the texture angle of the texture direction reference template and 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 coding blocks according to claim 1, characterized in that: The first characteristic value of the current block to be encoded is obtained in the following manner: Taking the average value of pixels on each line on the target direction template of the current block to be encoded as the predicted value of each pixel value on the line; Combining the obtained prediction values ​​of each pixel value on all lines into a prediction block of the current block to be encoded; 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 Hadamard transformation on the residual block to obtain a matrix after Hadamard transformation; The sum of the absolute values ​​of all coefficients in the matrix after the Hadamard transformation is used as the first eigenvalue of the current block to be encoded under the corresponding target direction template.

5. The method for dividing intra-frame coding blocks according to claim 4, characterized in that: A butterfly operation is used to perform Hadamard transform on the residual block.

6. The method for dividing intra-frame coding blocks according to claim 1, characterized in that: The second characteristic value is obtained by: Obtaining the first characteristic value of each sub-block of the current block to be encoded; According to the first eigenvalue of each sub-block, the variance of the first eigenvalues ​​of all sub-blocks of the current block to be encoded is obtained, and the variance is used as the second eigenvalue of the current block to be encoded.

7. The method for dividing intra-frame coding blocks according to claim 1, characterized in that: The third eigenvalue is obtained by: Acquire the first characteristic value of the current block to be encoded and the first characteristic values ​​of all sub-blocks of the current block to be encoded; Subtract the sum of the first eigenvalues ​​of all sub-blocks of the current to-be-encoded block from the first eigenvalue of the current to-be-encoded block to obtain a difference; The difference is divided by the first eigenvalue of the current block to be encoded to obtain the third eigenvalue of the current block to be encoded.

8. The method for dividing intra-frame coding blocks according to claim 1, characterized in that: Before inputting the texture feature of the current block to be encoded into a pre-acquired decision tree model, the division method further includes acquiring the decision tree model in the following manner: Acquire training samples, each of which includes training texture features and partition labels of a currently encoded block, wherein the training texture features include a first training feature value characterizing texture predictability of the currently encoded block, and / or a second training feature value characterizing a difference in texture predictability between sub-blocks of the currently encoded block, and / or a third training feature value characterizing a difference in texture predictability between the currently encoded block and a sub-block of the encoded block; The decision tree model is obtained by training using the training samples.

9. A video encoding method, characterized in that: include: Performing the intra-frame coding block division method according to any one of claims 1 to 8 on at least one to-be-encoded block in the to-be-encoded video to obtain a flag of whether to divide the to-be-encoded block; The obtained flags of all the blocks to be encoded are transmitted to a video encoder to encode the video to be encoded.

10. An electronic device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for dividing the intra-frame coding block as claimed in any one of claims 1 to 8 or the video coding method as claimed in claim 9 is implemented.

Citation Information

Patent Citations

  • Face image feature extraction method under illumination

    CN110287780A

  • Intra-frame division method and system based on textural features and storage medium

    CN111432212A

  • Hardware-friendly intra-frame coding block division method and device and storage medium

    CN111918057A

  • Coding block division mode determination method and device, equipment and storage medium

    CN115802044A

  • Intra-frame predictive coding method and system for 360-degree video and medium

    US20240080439A1