CN112584154A - Video coding block dividing method and device, electronic equipment and storage medium - Google Patents
Video coding block dividing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN112584154A CN112584154A CN202011559398.4A CN202011559398A CN112584154A CN 112584154 A CN112584154 A CN 112584154A CN 202011559398 A CN202011559398 A CN 202011559398A CN 112584154 A CN112584154 A CN 112584154A
- Authority
- CN
- China
- Prior art keywords
- coding block
- current coding
- determining
- dividing
- homogeneity
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 84
- 238000006243 chemical reaction Methods 0.000 claims description 69
- 238000013139 quantization Methods 0.000 claims description 52
- 239000011159 matrix material Substances 0.000 claims description 36
- 238000005192 partition Methods 0.000 claims description 18
- 238000000638 solvent extraction Methods 0.000 claims description 15
- 238000012549 training Methods 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 8
- 238000010801 machine learning Methods 0.000 claims description 4
- 230000004044 response Effects 0.000 claims description 4
- 230000008569 process Effects 0.000 abstract description 21
- 238000004364 calculation method Methods 0.000 abstract description 19
- 238000007906 compression Methods 0.000 abstract description 11
- 230000006835 compression Effects 0.000 abstract description 10
- 238000010586 diagram Methods 0.000 description 7
- 238000012545 processing Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 238000010606 normalization Methods 0.000 description 6
- 238000012935 Averaging Methods 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 2
- 238000003709 image segmentation Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/176—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/124—Quantisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/182—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/186—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Bioinformatics & Cheminformatics (AREA)
- General Health & Medical Sciences (AREA)
- Computational Linguistics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Biophysics (AREA)
- Molecular Biology (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Biomedical Technology (AREA)
- Health & Medical Sciences (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The invention provides a video coding block dividing method, a video coding block dividing device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a current coding block, judging whether the current coding block has homogeneity or not, and acquiring a judgment result; and determining a division mode according to the judgment result, and dividing the current coding block according to the determined division mode. According to the video coding block dividing method, the video coding block dividing device, the electronic equipment and the storage medium, the dividing mode of the coding block is determined after the homogeneity of the coding block is judged, the operation process that each coding block traverses all possible dividing modes recursively is avoided, the calculation time is shortened, and the compression speed is improved.
Description
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a method and an apparatus for dividing video coding blocks, an electronic device, and a storage medium.
Background
On the premise of the same video quality, the intraframe coding of the multifunctional video coding standard (VVC) can realize the improvement of about 50% of compression efficiency, and provides important guarantee for industrial application.
In the encoding block compression process, the VVC usually adopts a block partitioning mode combining a quadtree, a ternary tree and a binary tree. In the whole process of block division, all possible division modes need to be recursively traversed, and the mode with the minimum rate-distortion cost is selected as the final division mode.
In the division process, although the video compression rate is improved, the calculation complexity is greatly increased, the calculation processing time is prolonged, and the compression rate is low, so that the coding instantaneity is greatly challenged.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a video coding block dividing method, a video coding block dividing device, electronic equipment and a storage medium.
The invention provides a video coding block dividing method, which comprises the following steps:
acquiring a current coding block, judging whether the current coding block has homogeneity or not, and acquiring a judgment result;
and determining a division mode according to the judgment result, and dividing the current coding block according to the determined division mode.
According to the method for dividing the video coding block provided by the invention, the judging whether the current coding block has the homogeneity or not and obtaining the judging result comprises the following steps:
acquiring the edge strength, the quantization parameter, the quantization step length and the reaction coefficient of the current coding block;
when the edge strength, the quantization parameter, the quantization step length and the reaction coefficient meet preset conditions, determining that the current coding block has homogeneity; and when the edge strength, the quantization parameter, the quantization step size and the reaction coefficient do not meet the preset conditions, determining that the current coding block does not have homogeneity.
According to the method for dividing the video coding block provided by the invention, the preset conditions comprise that:
ES < alpha.Q, wherein ES is the edge strength, alpha is a first preset coefficient, and Q is the maximum value of the quantization parameter and the quantization step;
and R < beta.Q, wherein R is a reaction coefficient and beta is a second preset coefficient.
According to the method for dividing the video coding block provided by the invention, the determining the division mode according to the judgment result comprises the following steps:
determining that the current coding block has homogeneity according to the judgment result, and not dividing the current coding block;
determining that the current coding block does not have homogeneity according to a judgment result, inputting a pixel matrix of the current coding block and a corresponding quantization parameter into a mode judgment model, and outputting a division mode corresponding to the current coding block;
the mode judgment model is obtained by machine learning training by taking a pixel matrix of a sample coding block and a quantization parameter of the sample coding block as input and is used for determining a division mode of the coding block.
According to the method for dividing the video coding block provided by the invention, the obtaining of the edge strength of the current coding block comprises the following steps:
acquiring the pixel value of each pixel point in the current coding block, and determining the gradient information of each pixel point according to the pixel value of each pixel point;
and determining the edge strength of the current coding block according to the gradient information of each pixel point and the size information of the current coding block.
According to the method for dividing the video coding block provided by the invention, the step of obtaining the reaction coefficient of the current coding block comprises the following steps:
acquiring each pixel point in a current coding block, and determining gradient information of each pixel point according to the pixel value of each pixel point;
and constructing a curvature matrix corresponding to each pixel point according to the gradient information of each pixel point, and determining the reaction coefficient of the current coding block according to each curvature matrix.
According to the method for dividing the video coding block provided by the invention, the determining the reaction coefficient of the current coding block according to each curvature matrix comprises the following steps:
obtaining corresponding reaction coefficients according to the curvature matrixes;
and obtaining a preset number of reaction coefficients from each reaction coefficient, and determining the reaction coefficient of the current coding block according to the preset number of reaction coefficients.
The present invention also provides a video coding block dividing apparatus, including:
the judging module is used for acquiring a current coding block, judging whether the current coding block has homogeneity or not and acquiring a judging result;
and the dividing module is used for determining a dividing mode according to the judgment result and dividing the current coding block according to the determined dividing mode.
The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the video coding block dividing method as described in any one of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the video coding block partitioning method as described in any one of the above.
According to the video coding block dividing method, the video coding block dividing device, the electronic equipment and the storage medium, the dividing mode of the coding block is determined after the homogeneity of the coding block is judged, the operation process that each coding block traverses all possible dividing modes recursively is avoided, the calculation time is shortened, and the compression speed is improved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a video coding block dividing method provided by the present invention;
FIG. 2 is a schematic diagram of a specific structure of a mode decision model provided by the present invention;
fig. 3 is a schematic structural diagram of a video coding block dividing apparatus provided by the present invention;
fig. 4 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following describes a video coding block dividing method, apparatus, electronic device and storage medium provided by the present invention with reference to fig. 1-4.
Fig. 1 shows a flow diagram of a video coding block dividing method provided by the present invention, and referring to fig. 1, the method includes the following steps:
s11, acquiring a current coding block, judging whether the current coding block has homogeneity, and acquiring a judgment result;
and S12, determining a division mode according to the judgment result, and dividing the current coding block according to the determined division mode.
It should be noted that, in step S11 and step S12, in the present invention, in order to improve the compression efficiency of the video coding tree block (i.e., CTU), each coding block (i.e., CU) needs to be divided differently. The size of the coding blocks may be set to 64 × 64 or 32 × 32 or 16 × 16, etc., depending on the coding settings. The division modes for the coding block comprise four-way tree, three-way tree, two-way tree and other division modes, and meanwhile, under special conditions, the coding block can not be divided.
In the invention, which division mode is adopted when the current coding block is divided is mainly determined. Firstly, acquiring a current coding block, and then judging whether the current coding block has homogeneity or not according to pixel information of the current coding block. Homogeneity, also called homogeneity, is largely linked to local information in the image, reflecting regional consistency. The larger the homogeneity is, the less the variation among different regions of the image texture is, and the local part is very uniform; on the contrary, the image texture is considered to be more complex. Homogeneity has an important role in image segmentation, since the result of image segmentation is some homogeneous regions.
In the invention, the current coding block has homogeneity and does not have homogeneity, and belongs to two different conditions.
For example, the current coding block may be configured to have homogeneity without coding block division, which is called a non-division mode. And any one of the four-way tree, the three-way tree, the binary tree and other division modes is configured for the condition that the current coding block has no homogeneity.
For another example, when the current coding block has homogeneity, the coding block division is not performed, that is, the mode is called a non-division mode. And configuring the next operation step of judging the division mode for the condition that the current coding block does not have the homogeneity, wherein the next operation step can be carried out when the current coding block is known not to have the homogeneity, and the division mode can be further determined according to the next operation step.
According to the video coding block dividing method provided by the invention, the dividing mode of the coding block is determined after the homogeneity of the coding block is judged, the operation process that each coding block recursively traverses all possible dividing modes is avoided, the calculation time is shortened, and the compression speed is increased.
In the further explanation of the above method, the process of determining whether the current coding block has homogeneity is mainly explained as follows:
acquiring the edge strength, the quantization parameter, the quantization step length and the reaction coefficient of the current coding block;
when the edge strength, the quantization parameter, the quantization step length and the reaction coefficient meet preset conditions, determining that the current coding block has homogeneity; and when the edge strength, the quantization parameter, the quantization step size and the reaction coefficient do not meet the preset conditions, determining that the current coding block does not have homogeneity.
In this regard, it should be noted that, in the present invention, the edge strength, the quantization parameter, the quantization step size, and the reaction coefficient of the current coding block are determined based on the pixel value of the pixel point in the current coding block. The predetermined condition mentioned in the present invention establishes a determination condition according to the above information, such as comparison between values, or comparison between the calculation result of the values and the threshold.
For this purpose, the edge strength, the quantization parameter, the quantization step size, and the response coefficient may be placed in preset conditions, and when the preset conditions are met, it is determined that the current coding block has homogeneity. And when the preset condition is not satisfied, determining that the current coding block has no homogeneity.
In the further description of the above method, the specific content of the preset condition is mainly explained, specifically, the following two conditions are simultaneously satisfied:
ES < alpha.Q, wherein ES is the edge strength, alpha is a first preset coefficient, and Q is the maximum value of the quantization parameter and the quantization step;
r < beta.Q, wherein R is a reaction coefficient, and beta is a second preset coefficient.
The quantization parameter and the quantization step are both preset values for the coding block.
For coding blocks of 64 x 64 and 32 x 32, the value of α is 0.15; for a 16 x 16 coded block, the value of α is 0.40.
For coding blocks 64 x 64 and 32 x 32, β is set to 0.5, and for coding blocks 16 x 16, β is set to 0.9.
The invention further provides a video coding block dividing method, which adopts the characteristic parameters conforming to the coding blocks to establish preset conditions to realize the condition judgment of the homogeneity of each coding block.
In the further explanation of the above method, the processing procedure of determining the partition mode according to the determination result of whether the current coding block has homogeneity is mainly explained as follows:
determining that the current coding block has homogeneity according to the judgment result, and not dividing the current coding block;
determining that the current coding block does not have homogeneity according to a judgment result, inputting a pixel matrix of the current coding block and a corresponding quantization parameter into a mode judgment model, and outputting a division mode corresponding to the current coding block;
the mode judgment model is obtained by machine learning training by taking a pixel matrix of a sample coding block and a quantization parameter of the sample coding block as input and is used for determining a division mode of the coding block.
In this regard, it should be noted that, in the present invention, the current coding block is a coding block with a luminance component of 2N × 2N, and when the current coding block has homogeneity, a division mode of 2N × 2N is continuously adopted, that is, the current coding block is not divided.
And the current coding block is a coding block with a brightness component of 2N by 2N, and the current coding block does not have homogeneity, and the next step of determining is continued. And inputting the pixel matrix of the current coding block and the corresponding quantization parameter into a mode judgment model, and outputting a division mode corresponding to the current coding block.
In the invention, the pixel matrix is determined by the pixel value of each pixel point of the coding block. The quantization parameter is a value previously allocated to each coding block.
Fig. 2 is a schematic diagram showing a specific structure of a mode judgment model, and referring to fig. 2, the model includes an input layer, a convolutional layer, and a full link layer. The input layer L1 is a matrix of 8x8, and the first convolutional layer C2 includes six output feature maps, each obtained by convolving an input image with a convolution kernel of 3x 3. The next layer P3 performs in a specific way to grab the maximum value in the area, there are also six signatures, each with dimensions 3x 3. The fourth layer C4 performs a second convolution operation with a 2x2 convolution kernel, resulting in 16 2x2 output signatures. The fifth layer C5 was convolved with a 2x2 convolution kernel, outputting a signature size of 1x 1. The full connection layer constitutes the sixth layer MLP6 and the seventh layer MLP 7. The output layer output comprises four output cells o1, o2, o3, o 4. Wherein the output values of o1, o2, o3 and o4 respectively correspond to the normalization results of the rate-distortion costs corresponding to the four partitioning modes.
In order to prevent the model from falling into ill condition during training, the number of training samples corresponding to the four mode categories is equal in proportion. Meanwhile, in order to avoid that coding blocks with less obvious characteristics enter a training sample set, the coding blocks which are specified not to satisfy the condition that log { abs (δ Cost) } > 3.0 are removed from the training sample set, wherein δ Cost represents the difference between the minimum rate distortion Cost and the second minimum rate distortion Cost generated by the four partition modes, and abs () is an absolute value function. And in the training, a back propagation algorithm is adopted, and the difference between the actual output obtained by forward propagation and the corresponding ideal output is calculated to adjust the network weight.
The partitioning pattern of 2N × 2N is selected if the value output by o1 is maximum, the partitioning pattern of quad tree is selected if the value output by o2 is maximum, the partitioning pattern of tri tree is selected if the value output by o3 is maximum, and the partitioning pattern of binary tree is selected if the value output by o4 is maximum.
The video coding block division method further provided by the invention outputs one of the candidate division modes through the model trained by the neural network, and compared with the operation process of recursively traversing all possible division modes for each coding block, the method reduces the processing time and improves the compression speed.
In the further description of the above method, the processing procedure for obtaining the edge strength of the current coding block is mainly explained, which specifically includes the following steps:
acquiring the pixel value of each pixel point in the current coding block, and determining the gradient information of each pixel point according to the pixel value of each pixel point;
and determining the edge strength of the current coding block according to the gradient information of each pixel point and the size information of the current coding block.
In this regard, it should be noted that the gradient information is gradient information of the pixel points in the x-axis and y-axis directions. The required gradient information can be obtained according to a specific calculation mode based on the pixel values of the pixel points.
The edge strength of the current coding block needs to be determined finally, and the number of pixel points is related to the length and width of the coding block. Therefore, the edge strength of the current coding block needs to be determined by the gradient information of each pixel point and the size information of the current coding block based on a set calculation mode. Such as summing, integrating, etc., and are not described herein.
In the further description of the above method, it is mainly an explanation of a more specific process for obtaining the edge strength of the current coding block, which is specifically as follows:
in the invention, the following calculation formula is adopted to obtain the edge strength of the current coding block;
wherein, Pi,jIs the pixel value of the (i, j) pixel point, δ xi,jAnd δ yi,jGradient information in the x-axis and y-axis directions, respectively; s1And S2Is the length and width dimension of the code block. If S1And S2Same, then S1S2Is S2。
The video coding block dividing method provided by the invention can acquire the edge strength by adopting a set calculation mode based on the position relation of each pixel point in the coding block, realize the acquisition mode of the joint coding scene and improve the accuracy of the edge strength.
In the further explanation of the above method, the process of obtaining the reaction coefficient of the current coding block is mainly explained, which specifically includes the following steps:
acquiring each pixel point in a current coding block, and determining gradient information of each pixel point according to the pixel value of each pixel point;
and constructing a curvature matrix corresponding to each pixel point according to the gradient information of each pixel point, and determining the reaction coefficient of the current coding block according to each curvature matrix.
In this regard, it should be noted that, in the present invention, the gradient information is gradient information of the pixel points in the x-axis and y-axis directions. The required gradient information can be obtained according to a specific calculation mode based on the pixel values of the pixel points.
Because of the position relation of each pixel point in the coding block, a region containing several adjacent pixel points can be constructed, and a matrix can be determined according to the gradient information of each pixel point in the region, namely the curvature matrix. Since the area is established based on a certain pixel point, the curvature matrix can correspond to the pixel point.
Through the process of solving the curvature matrix, a plurality of curvature matrices can be obtained, and the reaction coefficient of the current coding block is obtained by adopting a set calculation mode according to the plurality of curvature matrices.
In the further description of the above method, it is mainly an explanation of a specific process for determining the reaction coefficient of the current coding block according to each curvature matrix, which is as follows:
obtaining corresponding reaction coefficients according to the curvature matrixes;
and obtaining a preset number of reaction coefficients from each reaction coefficient, and determining the reaction coefficient of the current coding block according to the preset number of reaction coefficients.
In this regard, it should be noted that each curvature matrix can obtain a response coefficient, which corresponds to a corresponding pixel point. At this time, a certain number of reaction coefficients can be screened from the plurality of reaction coefficients according to a set screening rule, and then the reaction coefficients belonging to the current coding block are determined according to the screened reaction coefficients.
The video coding block dividing method further provided by the invention can acquire the reaction coefficient by adopting a set calculation mode based on the position relation of each pixel point in the coding block, realize the acquisition mode of the joint coding scene and improve the accuracy of the reaction coefficient.
In the further description of the above method, it is mainly an explanation of a more specific process for obtaining the reaction coefficient of the current coding block, which is specifically as follows:
in the present invention, the following calculation formula is used to obtain the reaction coefficient of the current coding block, which is described in detail below as follows:
1) calculating gradient information I of pixel points (x, y) in the x direction and the y directionxAnd IyThe calculation method is as follows:
wherein, I represents a pixel value matrix of a 3 × 3 region with (x, y) pixels as angular vertices. GxAnd GySobel operators in the x-direction and y-direction, respectively, are as follows:
3) and generating a curvature matrix of each region by taking the region of 2x2 as a unit.
Mx,yAnd the curvature matrix represents a 2x2 region formed by four pixel points of (x, y), (x +1, y), (x, y +1) and (x +1, y + 1).
4) Calculating the reaction coefficient R of each 2x2 regionx,yThe following are:
5) and selecting the reaction coefficients from 1 to m in the descending order of the reaction coefficients, wherein m is the number of the preselected reaction coefficients, and averaging the reaction coefficients to obtain the reaction coefficient of the current coding block.
R=AVR(Rmax1+Rmax2+…+Rmaxm)
{Rmax1+Rmax2+…+Rmaxm=MAXm{Rx,y}}
Wherein, MAXm { Rx,yThe coefficients are arranged in a sequence from large to small in the order of 1-m, and AVR () is used for averaging.
The video coding block dividing method further provided by the invention can acquire the reaction coefficient by adopting a set calculation mode based on the position relation of each pixel point in the coding block, realize the acquisition mode of the joint coding scene and improve the accuracy of the reaction coefficient.
In the further explanation of the above method, the processing procedure of inputting the pixel matrix of the current coding block and the corresponding quantization parameter into the mode judgment model and outputting the partition mode corresponding to the current coding block is mainly explained, which specifically includes the following steps:
inputting a pixel matrix of a current coding block and a corresponding quantization parameter into a mode judgment model to obtain a normalization result of each candidate division mode;
and determining the candidate partition mode corresponding to the maximum value as the partition mode corresponding to the current coding block according to the normalization result of each candidate partition mode.
In this regard, it should be noted that, based on the above explanation of the model, the model is capable of outputting the normalization result of the current coding block in each candidate partition mode, and then determining the candidate partition mode corresponding to the largest value as the partition mode corresponding to the current coding block.
For example, if the value output from o1 is the largest, the partition pattern of 2N × 2N is selected, if the value output from o2 is the largest, the partition pattern of quad tree is selected, if the value output from o3 is the largest, the partition pattern of tri tree is selected, and if the value output from o4 is the largest, the partition pattern of binary tree is selected.
The video coding block division method further provided by the invention outputs one of the candidate division modes through the model trained by the neural network, and compared with the operation process of recursively traversing all possible division modes for each coding block, the method reduces the processing time and improves the compression speed.
The following describes the video coding block dividing apparatus provided by the present invention, and the video coding block dividing apparatus described below and the video coding block dividing method described above can be referred to correspondingly.
Fig. 3 shows a schematic structural diagram of a video coding block dividing apparatus provided by the present invention, and referring to fig. 3, the apparatus includes a judging module 31 and a dividing module 32, where:
the judging module 31 is configured to obtain a current coding block, judge whether the current coding block has homogeneity, and obtain a judgment result;
and a dividing module 32, configured to determine a dividing mode according to the determination result, and divide the current coding block according to the determined dividing mode.
In a further description of the foregoing apparatus, the determining module, in the processing procedure of determining whether the current coding block has homogeneity and obtaining the determination result, is specifically configured to:
acquiring the edge strength, the quantization parameter, the quantization step length and the reaction coefficient of the current coding block;
when the edge strength, the quantization parameter, the quantization step length and the reaction coefficient meet preset conditions, determining that the current coding block has homogeneity; and when the edge strength, the quantization parameter, the quantization step size and the reaction coefficient do not meet the preset conditions, determining that the current coding block does not have homogeneity.
In a further description of the above apparatus, the preset conditions include:
ES < alpha.Q, wherein ES is the edge strength, alpha is a first preset coefficient, and Q is the maximum value of the quantization parameter and the quantization step;
and R < beta.Q, wherein R is a reaction coefficient and beta is a second preset coefficient.
In a further description of the foregoing apparatus, the dividing module, in the process of determining the dividing mode according to the determination result, is specifically configured to:
determining that the current coding block has homogeneity according to the judgment result, and not dividing the current coding block;
determining that the current coding block does not have homogeneity according to a judgment result, inputting a pixel matrix of the current coding block and a corresponding quantization parameter into a mode judgment model, and outputting a division mode corresponding to the current coding block;
the mode judgment model is obtained by machine learning training by taking a pixel matrix of a sample coding block and a quantization parameter of the sample coding block as input and is used for determining a division mode of the coding block.
In a further description of the foregoing apparatus, the determining module, in the process of obtaining the edge strength of the current coding block, is specifically configured to:
acquiring the pixel value of each pixel point in the current coding block, and determining the gradient information of each pixel point according to the pixel value of each pixel point;
and determining the edge strength of the current coding block according to the gradient information of each pixel point and the size information of the current coding block.
In a further description of the foregoing apparatus, the determining module, in the process of obtaining the edge strength of the current coding block, is specifically configured to:
acquiring the edge strength of the current coding block by adopting the following calculation formula;
wherein, Pi,jIs the pixel value of the (i, j) pixel point, δ xi,jAnd δ yi,jGradient information in the x-axis and y-axis directions, respectively; s1And S2Is the length and width dimension of the code block.
In a further description of the foregoing apparatus, the determining module, in the process of obtaining the reaction coefficient of the current coding block, is specifically configured to:
acquiring each pixel point in a current coding block, and determining gradient information of each pixel point according to the pixel value of each pixel point;
and constructing a curvature matrix corresponding to each pixel point according to the gradient information of each pixel point, and determining the reaction coefficient of the current coding block according to each curvature matrix.
In a further description of the above apparatus, the determining module, in the process of determining the reaction coefficient of the current coding block according to each curvature matrix, is specifically configured to:
obtaining corresponding reaction coefficients according to the curvature matrixes;
and obtaining a preset number of reaction coefficients from each reaction coefficient, and determining the reaction coefficient of the current coding block according to the preset number of reaction coefficients.
In a further description of the foregoing apparatus, the determining module, in the process of obtaining the reaction coefficient of the current coding block, is specifically configured to:
acquiring a reaction coefficient of a current coding block by adopting the following calculation formula;
R=AVR(Rmax1+Rmax2+…+Rmaxm)
{Rmax1+Rmax2+…+Rmaxm=MAXm{Rx,y}}
wherein, IxAnd IyFor gradient information, I represents a matrix of pixel values of a 3x3 region with (x, y) pixels as vertices, GxAnd GySobel operators, M, in x-and y-directions, respectivelyx,yA curvature matrix representing a 2x2 region composed of four pixel points of (x, y), (x +1, y), (x, y +1), and (x +1, y +1), Rx,yThe reaction coefficient of the 2x2 region composed of four pixel points (x, y), (x +1, y), (x, y +1), (x +1, y +1), MAXm { R }x,yAnd the reaction coefficients are arranged in the order from large to small in the reaction coefficients by 1-m.
In a further description of the above apparatus, the partitioning module, in a process of inputting the pixel matrix of the current coding block and the corresponding quantization parameter into the mode decision model and outputting the partition mode corresponding to the current coding block, is specifically configured to:
inputting a pixel matrix of a current coding block and a corresponding quantization parameter into a mode judgment model to obtain a normalization result of each candidate division mode;
and determining the candidate partition mode corresponding to the maximum value as the partition mode corresponding to the current coding block according to the normalization result of each candidate partition mode.
Since the principle of the apparatus according to the embodiment of the present invention is the same as that of the method according to the above embodiment, further details are not described herein for further explanation.
It should be noted that, in the embodiment of the present invention, the relevant functional module may be implemented by a hardware processor (hardware processor).
According to the video coding block dividing method provided by the invention, the dividing mode of the coding block is determined after the homogeneity of the coding block is judged, the operation process that each coding block recursively traverses all possible dividing modes is avoided, the calculation time is shortened, and the compression speed is increased.
Fig. 4 is a schematic physical structure diagram of an electronic device, which may include, as shown in fig. 4: a processor (processor)41, a communication Interface (communication Interface)42, a memory (memory)43 and a communication bus 44, wherein the processor 41, the communication Interface 42 and the memory 43 complete communication with each other through the communication bus 44. Processor 41 may invoke logic instructions in memory 43 to perform a video coding block partitioning method comprising: acquiring a current coding block, judging whether the current coding block has homogeneity or not, and acquiring a judgment result; and determining a division mode according to the judgment result, and dividing the current coding block according to the determined division mode.
Furthermore, the logic instructions in the memory 43 may be implemented in the form of software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the video coding block partitioning method provided by the above methods, the method comprising: acquiring a current coding block, judging whether the current coding block has homogeneity or not, and acquiring a judgment result; and determining a division mode according to the judgment result, and dividing the current coding block according to the determined division mode.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor is implemented to perform the video coding block partitioning method provided above, the method comprising: acquiring a current coding block, judging whether the current coding block has homogeneity or not, and acquiring a judgment result; and determining a division mode according to the judgment result, and dividing the current coding block according to the determined division mode.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A method for video coding block partitioning, comprising:
acquiring a current coding block, judging whether the current coding block has homogeneity or not, and acquiring a judgment result;
and determining a division mode according to the judgment result, and dividing the current coding block according to the determined division mode.
2. The method of claim 1, wherein said determining whether the current coding block has homogeneity and obtaining the determination result comprises:
acquiring the edge strength, the quantization parameter, the quantization step length and the reaction coefficient of the current coding block;
when the edge strength, the quantization parameter, the quantization step length and the reaction coefficient meet preset conditions, determining that the current coding block has homogeneity; and when the edge strength, the quantization parameter, the quantization step size and the reaction coefficient do not meet the preset conditions, determining that the current coding block does not have homogeneity.
3. The video coding block division method of claim 2, wherein the preset conditions comprise:
ES < alpha.Q, wherein ES is the edge strength, alpha is a first preset coefficient, and Q is the maximum value of the quantization parameter and the quantization step;
and R < beta.Q, wherein R is a reaction coefficient and beta is a second preset coefficient.
4. The method of claim 1, wherein said determining a partition mode according to said determination comprises:
determining that the current coding block has homogeneity according to the judgment result, and not dividing the current coding block;
determining that the current coding block does not have homogeneity according to a judgment result, inputting a pixel matrix of the current coding block and a corresponding quantization parameter into a mode judgment model, and outputting a division mode corresponding to the current coding block;
the mode judgment model is obtained by machine learning training by taking a pixel matrix of a sample coding block and a quantization parameter of the sample coding block as input and is used for determining a division mode of the coding block.
5. The method of claim 2, wherein said obtaining the edge strength of the current coding block comprises:
acquiring the pixel value of each pixel point in the current coding block, and determining the gradient information of each pixel point according to the pixel value of each pixel point;
and determining the edge strength of the current coding block according to the gradient information of each pixel point and the size information of the current coding block.
6. The method of claim 2, wherein said obtaining the response coefficient of the current coding block comprises:
acquiring each pixel point in a current coding block, and determining gradient information of each pixel point according to the pixel value of each pixel point;
and constructing a curvature matrix corresponding to each pixel point according to the gradient information of each pixel point, and determining the reaction coefficient of the current coding block according to each curvature matrix.
7. The method of claim 6, wherein said determining the response coefficients of the current coding block according to the curvature matrices comprises:
obtaining corresponding reaction coefficients according to the curvature matrixes;
and obtaining a preset number of reaction coefficients from each reaction coefficient, and determining the reaction coefficient of the current coding block according to the preset number of reaction coefficients.
8. A video coding block partitioning apparatus, comprising:
the judging module is used for acquiring a current coding block, judging whether the current coding block has homogeneity or not and acquiring a judging result;
and the dividing module is used for determining a dividing mode according to the judgment result and dividing the current coding block according to the determined dividing mode.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program implements the steps of the video coding block partitioning method according to any one of claims 1 to 7.
10. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the steps of the video coding block partitioning method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011559398.4A CN112584154A (en) | 2020-12-25 | 2020-12-25 | Video coding block dividing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011559398.4A CN112584154A (en) | 2020-12-25 | 2020-12-25 | Video coding block dividing method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112584154A true CN112584154A (en) | 2021-03-30 |
Family
ID=75140503
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011559398.4A Pending CN112584154A (en) | 2020-12-25 | 2020-12-25 | Video coding block dividing method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112584154A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113691808A (en) * | 2021-07-01 | 2021-11-23 | 杭州未名信科科技有限公司 | Neural network-based interframe coding unit size dividing method |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109963151A (en) * | 2017-12-14 | 2019-07-02 | 腾讯科技(深圳)有限公司 | Coding unit, which divides, determines method and device, terminal device and readable storage medium storing program for executing |
-
2020
- 2020-12-25 CN CN202011559398.4A patent/CN112584154A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109963151A (en) * | 2017-12-14 | 2019-07-02 | 腾讯科技(深圳)有限公司 | Coding unit, which divides, determines method and device, terminal device and readable storage medium storing program for executing |
Non-Patent Citations (1)
Title |
---|
李云鹏: "HEVC帧间编码器算法优化", 《中国优秀硕士学位论文全文数据库》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113691808A (en) * | 2021-07-01 | 2021-11-23 | 杭州未名信科科技有限公司 | Neural network-based interframe coding unit size dividing method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CA2537000C (en) | Method and apparatus for modeling film grain patterns in the frequency domain | |
CN111652818B (en) | Pyramid-based image filtering method, pyramid-based image filtering device and storage medium | |
CN107464217B (en) | Image processing method and device | |
CN112862689B (en) | Image super-resolution reconstruction method and system | |
CN109816612A (en) | Image enchancing method and device, computer readable storage medium | |
CN109886891B (en) | Image restoration method and device, electronic equipment and storage medium | |
WO2014070273A1 (en) | Recursive conditional means image denoising | |
CN109949200B (en) | Filter subset selection and CNN-based steganalysis framework construction method | |
CN109587491A (en) | A kind of intra-frame prediction method, device and storage medium | |
CN111757110A (en) | Video coding method, coding tree unit dividing method, system, device and readable storage medium | |
CN110956594B (en) | Image filtering method, device, electronic equipment and storage medium | |
CN115131229A (en) | Image noise reduction and filtering data processing method and device and computer equipment | |
CN110213581B (en) | Encoding method, device and storage medium based on block division mode skipping | |
CN112584154A (en) | Video coding block dividing method and device, electronic equipment and storage medium | |
CN113132740A (en) | Method, system and storage medium for reconstructing frames based on adaptive loop filtering | |
CN106157251A (en) | A kind of face super-resolution method based on Cauchy's regularization | |
Bouaafia et al. | VVC in-loop filtering based on deep convolutional neural network | |
CN110120009B (en) | Background blurring implementation method based on salient object detection and depth estimation algorithm | |
CN111353982A (en) | Depth camera image sequence screening method and device | |
CN110383837B (en) | Method and apparatus for video processing | |
CN111083482A (en) | Video compression network training method and device and terminal equipment | |
CN103258318B (en) | A kind of image noise reduction disposal route and system | |
CN114666590A (en) | Full-view video coding method and system based on load balancing | |
CN103559692B (en) | Method and device for processing image | |
CN114119377A (en) | Image processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210330 |
|
RJ01 | Rejection of invention patent application after publication |