CN105120291A - Self-adaption rapid video coding method based on variance - Google Patents

Self-adaption rapid video coding method based on variance Download PDF

Info

Publication number
CN105120291A
CN105120291A CN201510483491.4A CN201510483491A CN105120291A CN 105120291 A CN105120291 A CN 105120291A CN 201510483491 A CN201510483491 A CN 201510483491A CN 105120291 A CN105120291 A CN 105120291A
Authority
CN
China
Prior art keywords
mrow
current frame
variance
coding
cus
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.)
Granted
Application number
CN201510483491.4A
Other languages
Chinese (zh)
Other versions
CN105120291B (en
Inventor
梁凡
谢立威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sun Yat Sen University
Original Assignee
Sun Yat Sen University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Sun Yat Sen University filed Critical Sun Yat Sen University
Priority to CN201510483491.4A priority Critical patent/CN105120291B/en
Publication of CN105120291A publication Critical patent/CN105120291A/en
Application granted granted Critical
Publication of CN105120291B publication Critical patent/CN105120291B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a self-adaption rapid video coding method based on a variance. The method comprises the following steps of calculating a variance of a current frame CU; according to the variance of the current frame CU, using a PU dividing-mode rapid decision algorithm based on the variance to carry out PU dividing mode detection so as to obtain a PU dividing mode with minimum rate distortion cost and optimum rate distortion cost of CU non-division; according to the variance of the current frame CU, using a CU dividing-mode rapid decision algorithm based on the variance to carry out CU dividing decision and determining a CU dividing mode with the minimum rate distortion cost; coding according to the PU dividing mode with the minimum rate distortion cost and the CU dividing mode. In the invention, the PU dividing-mode rapid decision algorithm based on the variance and the CU dividing-mode rapid decision algorithm based on the variance are combined to carry out CU and PU dividing mode selection; a coding complexity is greatly reduced, a coding speed is increased and the method can be widely used in a video coding field.

Description

Self-adaptive fast video coding method based on variance
Technical Field
The invention relates to the field of video coding, in particular to a variance-based adaptive fast video coding method.
Background
HEVC (high performance video coding) is a new generation video coding standard established by ITU-T vceg (video coding expertsgroup) and ISO/IEC mpeg (moving picture expertsgroup) in the joint group of video coding JCT-vc (joint video coding) established in 1 month 2010. In 1 month 2013, HEVC is formally the latest international standard for video coding.
In general, compared with the h.264/AVC video coding standard, the HEVC standard has more excellent coding performance, and can save about 50% of code rate on average while maintaining the same subjective video quality; however, the coding and decoding complexity of HEVC is much higher than that of H.264/AVC. Therefore, applying the HEVC standard to various multimedia application fields can reduce the cost, but also presents great challenges, especially in real-time applications as well as in mobile video.
HEVC, as a next generation standard of h.264/AVC, still continues to use a hybrid coding framework based on h.264/AVC blocks, except that HEVC makes detailed and effective improvements on prediction coding, transform coding, quantization coding, and entropy coding, and introduces a new video coding technique, as shown in fig. 1. HEVC in the encoding process, an input image is divided into a series of coding units, and for each coding unit, an encoder traverses all possible coding mode combinations, during which prediction, transform quantization and entropy coding, and corresponding reconstruction processes are performed, until a coding mode combination with the smallest rate distortion cost is selected, which is performed by performing a complicated recursive division on the coding units, that is, a Quad-tree (Quad-tree) encoding process. In addition, after each frame of image is encoded, the reconstructed image is subjected to deblocking filtering and adaptive sample offset sao (sampleadaptiveoffset), so as to further remove distortion of the reconstructed image.
However, the coding complexity of HEVC is greatly increased using new coding techniques, in particular the quadtree coding structure. Matching the coding structure of the quadtree, HEVC introduces many new concepts, including coding tree unit ctu (coding treeunit), coding unit cu (coding unit), prediction unit pu (predictionunit), and transform unit tu (transformunit). The CTU quadtree coding process is a main coding process of the HEVC encoder, and substantially all HEVC coding modes are established in the process.
In quadtree coding, the HEVC encoder needs to traverse all possible nodes of the coding unit quadtree, and for each node, all possible PU partition modes need to be traversed, as shown in fig. 2. For each possible PU partition mode, it is further required to traverse all nodes of an RQT (quad tree structure with square residual), and the whole traversal process is performed in a depth-first manner, and often needs to be implemented by recursive calling of functions. According to the common coding setting, the number of nodes of the coding unit quadtree is up to 85, each node needs to detect up to 8 PU partition modes, and the number of nodes of the RQT can be up to 21, so that the coding unit quadtree, the PU partition modes and the RQT form a plurality of coding mode combinations. Therefore, selecting the optimal coding mode combination according to RDO (rate distortion optimization) in the quadtree coding process consumes a lot of time, which makes HEVC very challenging for real-time applications and mobile terminals.
In view of the foregoing, there is a need for a video encoding method that reduces encoding complexity and increases encoding speed while substantially maintaining video compression efficiency and encoding quality.
Disclosure of Invention
In order to solve the technical problems, the invention aims to: the self-adaptive fast video coding method based on the variance is low in coding complexity and high in coding speed.
The technical scheme adopted by the invention for solving the technical problems is as follows:
a method of variance-based adaptive fast video coding, comprising:
A. calculating the variance of the current frame CU;
B. detecting a PU partition mode by adopting a variance-based PU partition mode fast decision algorithm according to the variance of the current frame CU to obtain a PU partition mode with the minimum rate distortion cost and the optimal rate distortion cost without partition of the CU;
C. according to the variance of the current frame CU, a variance-based CU partition mode fast decision algorithm is adopted to carry out CU partition decision, and the CU partition mode with the minimum rate-distortion cost is determined;
D. and coding according to the PU partition mode and the CU partition mode with the minimum rate-distortion cost.
Further, the step a specifically includes:
calculating the variance of the current frame CU, wherein the calculation formula of the variance of the CU is as follows:
<math> <mrow> <mfenced open = '{' close = ''> <mtable> <mtr> <mtd> <mrow> <mover> <mi>p</mi> <mo>&OverBar;</mo> </mover> <mo>=</mo> <mfrac> <mn>1</mn> <mrow> <mi>N</mi> <mi>M</mi> </mrow> </mfrac> <munderover> <mo>&Sigma;</mo> <mrow> <mi>i</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>N</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <munderover> <mo>&Sigma;</mo> <mrow> <mi>j</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>M</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <msub> <mi>p</mi> <mrow> <mi>i</mi> <mi>j</mi> </mrow> </msub> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mi>v</mi> <mo>=</mo> <mfrac> <mn>1</mn> <mrow> <mi>N</mi> <mi>M</mi> </mrow> </mfrac> <munderover> <mo>&Sigma;</mo> <mrow> <mi>i</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>N</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <munderover> <mo>&Sigma;</mo> <mrow> <mi>j</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>M</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <msup> <mrow> <mo>(</mo> <msub> <mi>p</mi> <mrow> <mi>i</mi> <mi>j</mi> </mrow> </msub> <mo>-</mo> <mover> <mi>p</mi> <mo>&OverBar;</mo> </mover> <mo>)</mo> </mrow> <mn>2</mn> </msup> </mrow> </mtd> </mtr> </mtable> </mfenced> <mo>,</mo> </mrow> </math>
wherein the size of the CU corresponding region is NxM, { pijI is more than or equal to 0 and less than or equal to N-1, j is more than or equal to 0 and less than or equal to M-1, i belongs to Z, j belongs to Z and represents all original pixel values in the corresponding area of the CU,is the mean of all the original pixels in the corresponding region of the CU, and v is the variance of the original pixels in the corresponding region of the CU.
Further, the step B, which comprises:
b1, judging whether the coding configuration of the current frame is AI or AI10 coding configuration, if so, executing the step B2, otherwise, executing the step B3;
b2, judging whether the current frame meets the direct judgment condition that the CU needs to be divided, if so, jumping to the step B4, otherwise, executing the step B3, wherein the direct judgment condition that the CU needs to be divided is as follows:
<math> <mrow> <mfenced open = '{' close = ''> <mtable> <mtr> <mtd> <msub> <mi>v</mi> <mrow> <mi>c</mi> <mi>u</mi> <mi>r</mi> </mrow> </msub> <mo>&gt;</mo> <msub> <mi>v</mi> <mrow> <mi>m</mi> <mi>a</mi> <mi>x</mi> </mrow> </msub> <mo>&CenterDot;</mo> <mi>&beta;</mi> </mtd> </mtr> <mtr> <mtd> <msub> <mi>v</mi> <mrow> <mi>m</mi> <mi>a</mi> <mi>x</mi> </mrow> </msub> <mo>=</mo> <mfrac> <msup> <mrow> <mo>(</mo> <msup> <mn>2</mn> <mrow> <mi>b</mi> <mi>i</mi> <mi>t</mi> <mi>d</mi> <mi>e</mi> <mi>p</mi> <mi>t</mi> <mi>h</mi> </mrow> </msup> <mo>-</mo> <mn>1</mn> <mo>)</mo> </mrow> <mn>2</mn> </msup> <mn>4</mn> </mfrac> </mtd> </mtr> </mtable> </mfenced> <mo>,</mo> </mrow> </math>
wherein v iscurIs the variance of the current frame CU, beta is a first adaptive adjustment factor, vmaxIs the maximum variance of the current frame CU, bitdepth is the internal bit depth used by the encoder;
b3, adopting a variance-based PU partition mode fast decision algorithm to detect the PU partition mode, and selecting the PU partition mode with the minimum rate distortion cost and the optimal rate distortion cost without partition of the CU;
and B4, directly judging that the current frame CU needs to be divided, and recursively traversing sub-CUs of the current frame CU.
Further, the step B2, which includes:
b21, updating the value of p to be + + p, wherein p is the total number of CUs detected in the four-section tree coding of the previous frame;
b22, judging whether the current frame meets the direct judgment condition that the CU needs to be divided, if so, executing the step B4 after updating the value of q to be + + q, otherwise, executing the step B3, wherein q is the total number of CUs which meet the direct judgment condition that the CU needs to be divided in the four-section tree coding of the previous frame.
Further, the adaptive adjustment method of the first adaptive adjustment factor β is as follows:
if q is less than 10% of p, taking a value obtained by subtracting 0.1 from the beta value after the previous self-adaptive adjustment of the current frame quadtree coding as the beta value of the current CU;
if q is more than or equal to 10% of p and less than or equal to 15% of p, the beta value of the current CU is the beta value after the previous self-adaptive adjustment of the current frame quadtree coding;
if q is larger than 15% of p, taking the value obtained by adding 0.1 to the beta value after the previous self-adaptive adjustment of the current frame quadtree coding as the beta value of the current CU;
if the beta is less than 0.1, setting the beta value of the current CU to be 0.1;
wherein the initial value of the first adaptively adjusted factor β is 1.
Further, the step B3, which includes:
b31, testing the SKIP mode to obtain the rate distortion cost under the SKIP mode;
b32, calculating the variances of the two PUs corresponding to the Part _ Nx2N division mode, and judging whether the variances of the two PUs are not less than a given PU variance threshold, if so, executing a step B34, otherwise, executing a step B33;
b33, testing the Part _ Nx2N division mode to obtain the rate distortion cost under the Part _ Nx2N division mode, and then executing the step B34;
b34, calculating the variances of the two PUs corresponding to the Part _2NxN division mode, and judging whether the variances of the two PUs are not less than a given PU variance threshold, if so, executing a step B36, otherwise, executing a step B35;
b35, testing the Part _2NxN division mode to obtain the rate-distortion cost under the Part _2NxN division mode, and then executing the step B36;
and B36, testing AMP modes, and selecting the PU partition mode with the minimum rate distortion cost and the optimal rate distortion cost without partitioning the CU, wherein the AMP modes comprise a PART _ nRx2N partition mode, a PART _ nLx2N partition mode, a PART _2NxnU partition mode and a PART _2NxnD partition mode.
Further, the given PU variance threshold is half of the variance of the current frame CU.
Further, the step C, which comprises:
c1, judging whether the variance of the current frame CU is smaller than the average variance of the current frame CU which is not divided, if so, executing the step C2, otherwise, executing the step C4;
c2, updating the value of m to be + + m, then judging whether the current CU meets the partition judgment condition of the CU, if so, executing step C3 after updating the value of n to be + + n, otherwise, executing step C4, where the partition judgment condition of the CU is:
<math> <mrow> <msub> <mi>v</mi> <mrow> <mi>c</mi> <mi>u</mi> <mi>r</mi> </mrow> </msub> <mo>&CenterDot;</mo> <mi>&alpha;</mi> <mo>&lt;</mo> <msub> <mover> <mi>v</mi> <mo>&OverBar;</mo> </mover> <mrow> <mi>l</mi> <mi>e</mi> <mi>a</mi> <mi>f</mi> </mrow> </msub> <mo>,</mo> </mrow> </math>
wherein,the current frame is not divided into the average variance of the CU, alpha is a second adaptive adjustment factor, and m is that the variance of the CU is smaller than that of the CU in the coding process of the previous frameN is the number of CUs that satisfy the CU partition decision condition in the encoding process of the previous frame;
c3, simplifying the sub-CU traversal process of the current frame CU according to a set simplification rule;
and C4, obtaining the optimal rate-distortion cost sum of all sub-CUs of the current frame CU, and judging whether the optimal rate-distortion cost of the current frame CU which is not divided is less than or equal to the optimal rate-distortion cost sum of all sub-CUs of the current frame CU, wherein if yes, the current frame CU does not need to be divided, otherwise, the current frame CU needs to adopt a division structure corresponding to the sub-CU.
Further, the adaptive adjustment method of the second adaptive adjustment factor α is as follows:
if n is less than 70% of m, taking the value obtained by subtracting 0.5 from the alpha value after the previous self-adaptive adjustment of the current frame quadtree coding as the alpha value of the current CU;
if n is more than or equal to 70% of m and less than or equal to 75% of m, the alpha value of the current CU is the alpha value after adaptive adjustment before the current frame quadtree coding;
if n is larger than 75% of m, taking the value obtained by adding 0.5 to the alpha value after the previous self-adaptive adjustment of the current frame quadtree coding as the alpha value of the current CU;
if the alpha is smaller than 1, setting the alpha value of the current CU to be 1;
wherein the initial value of the factor α of the second adaptive adjustment is 6.
Further, the step C3 specifically includes:
setting a simplified traversal flag bit bFast of the current frame CU according to the dividing conditions of the two CUs A and L which are respectively positioned right above and left of the current frame CU, and then simplifying the sub-CU traversal process of the current frame CU: if neither A nor L carries out CU division, setting bFast as true, then directly judging that the current frame CU does not need to be divided, and at the moment, not traversing sub-CUs of the current frame CU; if one of the A and the L is not divided and the other is divided, setting bFast as false, then judging whether the optimal rate-distortion cost of the current frame CU which is not divided is less than or equal to the sum of the optimal rate-distortion costs of all sub-CUs which are not divided, if so, judging that the current frame CU does not need to be divided, at the moment, not traversing the sub-CUs of the previous frame CU, and if not, stopping traversing the sub-CUs of the current frame after only dividing the current frame CU into 4 sub-CUs; if both A and L are divided, setting bFast as false, then recursively traversing sub-CUs of the current frame, and judging whether the optimal rate-distortion cost sum of all sub-CUs of the current frame CU is less than or equal to the optimal rate-distortion cost sum of all sub-CUs of the current frame CU which are not divided, if so, judging that the current frame CU does not need to be divided, at the moment, not traversing the sub-CUs of the previous frame CU, and if not, adopting a dividing structure corresponding to the sub-CUs by the current frame CU.
The invention has the beneficial effects that: based on the correlation between the coding performance of predictive coding and the local characteristics of images, a variance-based PU partition mode fast decision algorithm and a variance-based CU partition mode fast decision algorithm are combined to select the partition modes of the CU and the PU, the partition decision results of the CU and the PU are predicted in advance according to the variance of the CU and the variance of the PU, the traversal time and the traversal times of a coding unit four-branch tree node, a PU partition mode and a RQT node are greatly reduced, on the premise of basically keeping the HEVC video compression efficiency and the coding quality, the coding complexity is greatly reduced, the coding speed is improved, and the high requirements of real-time application and a mobile terminal can be met. Furthermore, a prediction method for dividing the CU in the quadtree coding is specially provided for AI and AI10 coding configuration, and the coding complexity is further reduced through a direct judgment condition that the CU needs to be divided. Furthermore, the step of simplifying the sub-CU traversal process of the current CU according to the set simplification rule is added, the judgment time of the CU partition mode is further shortened, and the coding speed is higher.
Drawings
The invention is further illustrated by the following figures and examples.
Fig. 1 is a coding framework of the HEVC video coding standard;
fig. 2 is a schematic diagram of a PU partition mode of the HEVC video coding standard;
FIG. 3 is a general flow chart of an adaptive fast video coding method based on variance according to the present invention;
FIG. 4 is a flow chart of step B of the present invention;
FIG. 5 is a flowchart of step B2 according to the present invention;
FIG. 6 is a flowchart of step B3 according to the present invention;
FIG. 7 is a flow chart of step C of the present invention;
FIG. 8 is a schematic diagram of the structures of CUs of one or two objects according to an embodiment of the present invention;
FIG. 9 is a flowchart of a fast decision algorithm for a variance-based PU partition mode according to an embodiment of the present invention;
fig. 10 is a flowchart of an adaptive fast HEVC coding method based on variance according to an embodiment of the present invention.
Detailed Description
Referring to fig. 3, a variance-based adaptive fast video coding method includes:
A. calculating the variance of the current frame CU;
B. detecting a PU partition mode by adopting a variance-based PU partition mode fast decision algorithm according to the variance of the current frame CU to obtain a PU partition mode with the minimum rate distortion cost and the optimal rate distortion cost without partition of the CU;
C. according to the variance of the current frame CU, a variance-based CU partition mode fast decision algorithm is adopted to carry out CU partition decision, and the CU partition mode with the minimum rate-distortion cost is determined;
D. and coding according to the PU partition mode and the CU partition mode with the minimum rate-distortion cost.
Further, as a preferred embodiment, the step a is specifically:
calculating the variance of the current frame CU, wherein the calculation formula of the variance of the CU is as follows:
<math> <mrow> <mo>{</mo> <mrow> <mtable> <mtr> <mtd> <mrow> <mover> <mi>p</mi> <mo>&OverBar;</mo> </mover> <mo>=</mo> <mfrac> <mn>1</mn> <mrow> <mi>N</mi> <mi>M</mi> </mrow> </mfrac> <munderover> <mo>&Sigma;</mo> <mrow> <mi>i</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>N</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <munderover> <mo>&Sigma;</mo> <mrow> <mi>j</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>M</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <msub> <mi>p</mi> <mrow> <mi>i</mi> <mi>j</mi> </mrow> </msub> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mi>v</mi> <mo>=</mo> <mfrac> <mn>1</mn> <mrow> <mi>N</mi> <mi>M</mi> </mrow> </mfrac> <munderover> <mo>&Sigma;</mo> <mrow> <mi>i</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>N</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <munderover> <mo>&Sigma;</mo> <mrow> <mi>j</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>M</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <msup> <mrow> <mo>(</mo> <msub> <mi>p</mi> <mrow> <mi>i</mi> <mi>j</mi> </mrow> </msub> <mo>-</mo> <mover> <mi>p</mi> <mo>&OverBar;</mo> </mover> <mo>)</mo> </mrow> <mn>2</mn> </msup> </mrow> </mtd> </mtr> </mtable> <mo>,</mo> </mrow> </mrow> </math>
wherein the size of the region corresponding to the CUIs NxM, { pijI is more than or equal to 0 and less than or equal to N-1, j is more than or equal to 0 and less than or equal to M-1, i belongs to Z, j belongs to Z and represents all original pixel values in the corresponding area of the CU,is the mean of all the original pixels in the corresponding region of the CU, and v is the variance of the original pixels in the corresponding region of the CU.
Referring to fig. 4, as a further preferred embodiment, the step B includes:
b1, judging whether the coding configuration of the current frame is AI or AI10 coding configuration, if so, executing the step B2, otherwise, executing the step B3;
b2, judging whether the current frame meets the direct judgment condition that the CU needs to be divided, if so, jumping to the step B4, otherwise, executing the step B3, wherein the direct judgment condition that the CU needs to be divided is as follows:
<math> <mrow> <mfenced open = '{' close = ''> <mtable> <mtr> <mtd> <msub> <mi>v</mi> <mrow> <mi>c</mi> <mi>u</mi> <mi>r</mi> </mrow> </msub> <mo>&gt;</mo> <msub> <mi>v</mi> <mrow> <mi>m</mi> <mi>a</mi> <mi>x</mi> </mrow> </msub> <mo>&CenterDot;</mo> <mi>&beta;</mi> </mtd> </mtr> <mtr> <mtd> <msub> <mi>v</mi> <mrow> <mi>m</mi> <mi>a</mi> <mi>x</mi> </mrow> </msub> <mo>=</mo> <mfrac> <msup> <mrow> <mo>(</mo> <msup> <mn>2</mn> <mrow> <mi>b</mi> <mi>i</mi> <mi>t</mi> <mi>d</mi> <mi>e</mi> <mi>p</mi> <mi>t</mi> <mi>h</mi> </mrow> </msup> <mo>-</mo> <mn>1</mn> <mo>)</mo> </mrow> <mn>2</mn> </msup> <mn>4</mn> </mfrac> </mtd> </mtr> </mtable> </mfenced> <mo>,</mo> </mrow> </math>
wherein v iscurIs the variance of the current frame CU, beta is a first adaptive adjustment factor, vmaxIs the maximum variance of the current frame CU, bitdepth is the internal bit depth used by the encoder;
b3, adopting a variance-based PU partition mode fast decision algorithm to detect the PU partition mode, and selecting the PU partition mode with the minimum rate distortion cost and the optimal rate distortion cost without partition of the CU;
and B4, directly judging that the current frame CU needs to be divided, and recursively traversing sub-CUs of the current frame CU.
The process of selecting the optimal rate-distortion cost for non-partition of the CU is similar to the process of selecting the PU partition mode with the minimum rate-distortion cost, and the process of selecting the optimal rate-distortion generation for non-partition of the CU is as follows: the encoder assumes that the CU is not divided, rate distortion cost of the CU under different prediction modes is solved, and the minimum rate distortion cost is selected as the optimal rate distortion cost of the CU which is not divided; the process of selecting the PU partition mode with the minimum rate distortion cost comprises the following steps: the encoder assumes that the PU needs to be divided, rate distortion costs of the PU in different prediction modes are solved, and the PU division mode corresponding to the minimum rate distortion cost is selected as the PU division mode with the minimum rate distortion cost.
Referring to fig. 5, further as a preferred embodiment, the step B2 includes:
b21, updating the value of p to be + + p, wherein p is the total number of CUs detected in the four-section tree coding of the previous frame;
b22, judging whether the current frame meets the direct judgment condition that the CU needs to be divided, if so, executing the step B4 after updating the value of q to be + + q, otherwise, executing the step B3, wherein q is the total number of CUs which meet the direct judgment condition that the CU needs to be divided in the four-section tree coding of the previous frame.
Wherein, + + p means p is added by 1, and, + + q means q is added by 1.
Further, as a preferred embodiment, the adaptive adjustment method of the first adaptive adjustment factor β is as follows:
if q is less than 10% of p, taking a value obtained by subtracting 0.1 from the beta value after the previous self-adaptive adjustment of the current frame quadtree coding as the beta value of the current CU;
if q is more than or equal to 10% of p and less than or equal to 15% of p, the beta value of the current CU is the beta value after the previous self-adaptive adjustment of the current frame quadtree coding;
if q is larger than 15% of p, taking the value obtained by adding 0.1 to the beta value after the previous self-adaptive adjustment of the current frame quadtree coding as the beta value of the current CU;
if the beta is less than 0.1, setting the beta value of the current CU to be 0.1;
wherein the initial value of the first adaptively adjusted factor β is 1.
Since the quadtree coding unit at least comprises one CU, the process of coding the quadtree of the current frame can carry out adaptive adjustment on the beta value at least once.
Referring to fig. 6, further as a preferred embodiment, the step B3 includes:
b31, testing the SKIP mode to obtain the rate distortion cost under the SKIP mode;
b32, calculating the variances of the two PUs corresponding to the Part _ Nx2N division mode, and judging whether the variances of the two PUs are not less than a given PU variance threshold, if so, executing a step B34, otherwise, executing a step B33;
b33, testing the Part _ Nx2N division mode to obtain the rate distortion cost under the Part _ Nx2N division mode, and then executing the step B34;
b34, calculating the variances of the two PUs corresponding to the Part _2NxN division mode, and judging whether the variances of the two PUs are not less than a given PU variance threshold, if so, executing a step B36, otherwise, executing a step B35;
b35, testing the Part _2NxN division mode to obtain the rate-distortion cost under the Part _2NxN division mode, and then executing the step B36;
and B36, testing AMP modes, and selecting the PU partition mode with the minimum rate distortion cost and the optimal rate distortion cost without partitioning the CU, wherein the AMP modes comprise a PART _ nRx2N partition mode, a PART _ nLx2N partition mode, a PART _2NxnU partition mode and a PART _2NxnD partition mode.
Further as a preferred embodiment, the given PU variance threshold is half of the variance of the current frame CU.
Referring to fig. 7, as a further preferred embodiment, the step C includes:
c1, judging whether the variance of the current frame CU is smaller than the average variance of the current frame CU which is not divided, if so, executing the step C2, otherwise, executing the step C4;
c2, updating the value of m to be + + m, then judging whether the current CU meets the partition judgment condition of the CU, if so, executing step C3 after updating the value of n to be + + n, otherwise, executing step C4, where the partition judgment condition of the CU is:
<math> <mrow> <msub> <mi>v</mi> <mrow> <mi>c</mi> <mi>u</mi> <mi>r</mi> </mrow> </msub> <mo>&CenterDot;</mo> <mi>&alpha;</mi> <mo>&lt;</mo> <msub> <mover> <mi>v</mi> <mo>&OverBar;</mo> </mover> <mrow> <mi>l</mi> <mi>e</mi> <mi>a</mi> <mi>f</mi> </mrow> </msub> <mo>,</mo> </mrow> </math>
wherein,the current frame is not divided into the average variance of the CU, alpha is a second adaptive adjustment factor, and m is that the variance of the CU is smaller than that of the CU in the coding process of the previous frameN is the number of CUs that satisfy the CU partition decision condition in the encoding process of the previous frame;
c3, simplifying the sub-CU traversal process of the current frame CU according to a set simplification rule;
and C4, obtaining the optimal rate-distortion cost sum of all sub-CUs of the current frame CU, and judging whether the optimal rate-distortion cost of the current frame CU which is not divided is less than or equal to the optimal rate-distortion cost sum of all sub-CUs of the current frame CU, wherein if yes, the current frame CU does not need to be divided, otherwise, the current frame CU needs to adopt a division structure corresponding to the sub-CU.
Wherein, + + m means that m is added by 1, and, + + n means that n is added by 1.
Further, as a preferred embodiment, the adaptive adjustment method of the second adaptive adjustment factor α is as follows:
if n is less than 70% of m, taking the value obtained by subtracting 0.5 from the alpha value after the previous self-adaptive adjustment of the current frame quadtree coding as the alpha value of the current CU;
if n is more than or equal to 70% of m and less than or equal to 75% of m, the alpha value of the current CU is the alpha value after adaptive adjustment before the current frame quadtree coding;
if n is larger than 75% of m, taking the value obtained by adding 0.5 to the alpha value after the previous self-adaptive adjustment of the current frame quadtree coding as the alpha value of the current CU;
if the alpha is smaller than 1, setting the alpha value of the current CU to be 1;
wherein the initial value of the factor α of the second adaptive adjustment is 6.
Since the quadtree coding unit at least comprises one CU, the process of coding the quadtree of the current frame can carry out adaptive adjustment on the alpha value at least once.
Further, as a preferred embodiment, the step C3 is specifically:
setting a simplified traversal flag bit bFast of the current frame CU according to the dividing conditions of the two CUs A and L which are respectively positioned right above and left of the current frame CU, and then simplifying the sub-CU traversal process of the current frame CU: if neither A nor L carries out CU division, setting bFast as true, then directly judging that the current frame CU does not need to be divided, and at the moment, not traversing sub-CUs of the current frame CU; if one of the A and the L is not divided and the other is divided, setting bFast as false, then judging whether the optimal rate-distortion cost of the current frame CU which is not divided is less than or equal to the sum of the optimal rate-distortion costs of all sub-CUs which are not divided, if so, judging that the current frame CU does not need to be divided, at the moment, not traversing the sub-CUs of the previous frame CU, and if not, stopping traversing the sub-CUs of the current frame after only dividing the current frame CU into 4 sub-CUs; if both A and L are divided, setting bFast as false, then recursively traversing sub-CUs of the current frame, and judging whether the optimal rate-distortion cost sum of all sub-CUs of the current frame CU is less than or equal to the optimal rate-distortion cost sum of all sub-CUs of the current frame CU which are not divided, if so, judging that the current frame CU does not need to be divided, at the moment, not traversing the sub-CUs of the previous frame CU, and if not, adopting a dividing structure corresponding to the sub-CUs by the current frame CU.
The invention is described in further detail below with reference to the figures and specific examples of the specification.
Example one
Referring to fig. 8, 9 and 10, a first embodiment of the present invention:
in the process of coding the tetrad tree of the CTU, the HEVC encoder selects a coding mode with the smallest rate distortion cost according to the RDO criterion, so that redundant data in a video sequence can be better removed, which means that the partition mode of a CU and the partition mode of a PU depend on their corresponding coding effects. Redundant data in a video sequence is mainly temporal redundancy and spatial redundancy, and an HEVC encoder applies intra prediction or inter prediction to a PU by using a specific PU partition mode for the CU, thereby removing the temporal redundancy and the spatial redundancy, that is, the coding effect of the CU and the PU depends on the performance of prediction coding to a large extent.
According to the principle of predictive coding, it can be known that the coding performance of the prediction coding is greatly related to the local features of the image, so that for a CU at a certain depth, the coding effect of applying a specific PU partition mode is closely related to the image features of the CU and each PU. The variance of the local area may reflect the image characteristics of the CU and the PU to some extent, that is, the variance has a correlation with the partition mode selection of the CU and the PU. Based on the correlation analysis, the invention provides a variance-based adaptive fast video coding algorithm, which comprises two parts, namely a variance-based CU partition mode fast decision algorithm and a variance-based PU partition mode fast decision algorithm. The two algorithms and the overall coding algorithm composed of the two algorithms are described one by one.
(I) fast decision algorithm for variance-based CU partition mode
As mentioned before, the main purpose of the quadtree coding of a CTU is to remove as much redundant data, in particular temporal and spatial redundancy, of the image areas corresponding to the CTU as possible while ensuring that the image distortion does not exceed a given value.
The intra-frame prediction is the main tool for removing the spatial redundancy, and the inter-frame prediction is the main tool for removing the temporal redundancy, so the intra-frame prediction and the inter-frame prediction also become the main coding tools used by the quadtree coding, and the coding performance of the intra-frame prediction and the inter-frame prediction can greatly influence the decision of the quadtree coding on the CU partition mode.
The basic principle of intra-frame prediction is to predict a pixel to be encoded by using an encoded reconstructed pixel of a current frame, and to transmit or store a difference value between an original pixel and the predicted value. The basic principle of interframe prediction is to predict the pixels to be coded of the current frame by using the coded reconstructed frame, and transmit or store the difference value between the original pixels and the predicted value. Therefore, by applying intra-prediction and inter-prediction, spatial redundancy and temporal redundancy in a video sequence can be removed.
However, in a block-based hybrid coding framework, there is one default assumption for each of intra-prediction and inter-prediction. Intra prediction assumes that all pixels within the predicted region have the same texture direction; inter-frame prediction assumes that all pixels in the predicted region belong to the same object and share the same motion vector. In the actual quadtree coding, the regions included by all possible nodes do not necessarily satisfy the assumptions, but for the nodes satisfying the assumptions, the predictive coding can obtain a good coding effect, and it can be considered that the sub-nodes of the nodes do not need to be detected continuously (that is, the CU does not need to be subdivided); for nodes which do not meet the assumptions, the coding effect of predictive coding is very poor, and the nodes can be directly judged to be divided without detecting the nodes. In addition, it can also be known that nodes satisfying these assumptions tend to have small variances, and nodes not satisfying these assumptions tend to have large variances, so that the variances of CUs have correlation with the partition decisions of CUs, and the partition decision results of CUs can be predicted according to the variances of CUs.
The variance may be calculated by using original pixels or reconstructed pixels of the CU corresponding region, and in order to avoid distortion introduced by the reconstructed pixels, the variance is calculated by using the original pixels of the CU corresponding region in the present embodiment, as shown in the following equations (1) and (2):
<math> <mrow> <mover> <mi>p</mi> <mo>&OverBar;</mo> </mover> <mo>=</mo> <mfrac> <mn>1</mn> <mrow> <mi>N</mi> <mi>M</mi> </mrow> </mfrac> <munderover> <mo>&Sigma;</mo> <mrow> <mi>i</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>N</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <munderover> <mo>&Sigma;</mo> <mrow> <mi>j</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>M</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <msub> <mi>p</mi> <mrow> <mi>i</mi> <mi>j</mi> </mrow> </msub> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>1</mn> <mo>)</mo> </mrow> </mrow> </math>
<math> <mrow> <mi>v</mi> <mo>=</mo> <mfrac> <mn>1</mn> <mrow> <mi>N</mi> <mi>M</mi> </mrow> </mfrac> <munderover> <mo>&Sigma;</mo> <mrow> <mi>i</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>N</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <munderover> <mo>&Sigma;</mo> <mrow> <mi>j</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>M</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <msup> <mrow> <mo>(</mo> <msub> <mi>p</mi> <mrow> <mi>i</mi> <mi>j</mi> </mrow> </msub> <mo>-</mo> <mover> <mi>p</mi> <mo>&OverBar;</mo> </mover> <mo>)</mo> </mrow> <mn>2</mn> </msup> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>2</mn> <mo>)</mo> </mrow> </mrow> </math>
based on the above analysis, the present algorithm will predict the partition decision of a CU in advance according to the variance of the CU, i.e. if equation (3) holds, the encoder will consider that the CU does not need to be partitioned, and will not detect its sub-CUs.
<math> <mrow> <msub> <mi>v</mi> <mrow> <mi>c</mi> <mi>u</mi> <mi>r</mi> </mrow> </msub> <mo>&CenterDot;</mo> <mi>&alpha;</mi> <mo>&lt;</mo> <msub> <mover> <mi>v</mi> <mo>&OverBar;</mo> </mover> <mrow> <mi>l</mi> <mi>e</mi> <mi>a</mi> <mi>f</mi> </mrow> </msub> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>3</mn> <mo>)</mo> </mrow> </mrow> </math>
In equation (3), the adjustment of α is performed before encoding each frame, assuming that m is a variance less than that in the encoding of the previous frameN is the number of CUs for which equation (3) holds in the encoding process of the previous frame, and the initial value of α is set to 6. The adaptive adjustment algorithm for α is as follows:
1) if n is less than 70% of m, α will be subtracted by 0.5 based on the previous adaptation;
2) if n is greater than 75% of m, alpha is added with 0.5 on the basis of the previous self-adaptive adjustment;
3) if α is less than 1, α is set to 1.
After the adaptive adjustment of α is completed, m and n need to be reset to 0, and both values are updated during the encoding process of the current frame. In addition, to obtainThe algorithm collects the variances of the non-divided CUs in the first 10 CTU quadtree codes of the current frame, and takes the average value of the variances as the average value
In addition, the algorithm also provides a corresponding prediction method for dividing the CU in the quadtree coding for AI and AI10 coding configuration, and if the formula (4) is established, the current CU is directly judged to need to be divided and is not detected any more.
vcur>vmax·β(4)
Wherein v ismaxThe value of (a) is shown in formula (5):
v m a x = ( 2 b i t d e p t h - 1 ) 2 4 - - - ( 5 )
the algorithm adapts beta before each frame is encoded. Assuming that p is the total number of CUs detected in the quadtree coding of the previous frame, q is the total number of CUs satisfying the formula (4) in the quadtree coding of the previous frame, and the initial value of β is 1, the adaptive adjustment algorithm of β is as follows:
1) if q is less than 10% of p, beta will be subtracted by 0.1 based on the previous adaptive adjustment;
2) if q is more than 15% of p, adding 0.1 to beta on the basis of previous self-adaptive adjustment;
3) if β is less than 0.1, β is set to 0.1.
After the adaptive adjustment of β is completed before each frame is encoded, p and q are reset to 0 and both values are updated in the quadtree encoding of the current frame. The above is a fast algorithm for variance-based CU partition decision.
(II) fast algorithm for PU partition judgment based on variance
According to the foregoing analysis, when the PU partition mode can make all PUs in the CU satisfy the default assumption of inter prediction, the inter prediction can obtain a very good coding effect in the PU partition mode, i.e., the PU partition mode can be considered as the optimal partition mode, otherwise, the coding effect of the inter prediction in the PU partition mode is very poor, i.e., the PU partition mode can be considered as not the optimal partition mode.
And the variance of the PU corresponding to the PU partition mode may well reflect whether the PU partition mode satisfies the assumption of inter prediction. Fig. 8 shows a CU containing two objects a and B, the dashed line indicating the boundary between them, assuming that the pixel values in a are both a and B are both B, it can be known that the partition mode of Part _ Nx2N can make a and B both satisfy the assumption of inter-frame prediction, when the variance of both is 0, and the partition mode of Part _2NxN makes the corresponding PU neither satisfy the assumption of inter-frame prediction, when the variance of both PUs is 0.25(a-B)2. Therefore, if the variance of a PU is greater than a certain threshold (which is set to half of the CU variance in the present embodiment), the corresponding PU partition mode may be considered not to be the optimal partition mode.
The present algorithm predicts the decision result of the PU partition mode by the PU variance corresponding to the PU partition mode, as shown in fig. 9. In the process of detecting the PU partition mode, an encoder firstly calculates the variance of the current CU, and then tests the SKIP mode (wherein the SKIP mode adopts the PU of a Part _2Nx 2N partition mode), so as to obtain the rate distortion cost corresponding to the SKIP mode. Then the encoder calculates the variance of two PUs corresponding to the Part _ Nx2N partition mode, if neither of the two is smaller than the given PU variance threshold, the detection of the Part _ Nx2N partition mode is directly skipped, otherwise, the rate-distortion cost in the partition mode is obtained. Then, the encoder also calculates the variances of two PUs corresponding to the Part _2NxN partition mode, if neither is smaller than the given PU variance threshold, the encoder directly skips the detection of the Part _2NxN partition mode, otherwise, the encoder obtains the rate-distortion cost in the partition mode. And finally, testing the AMP mode, and selecting a mode with the minimum distortion cost from the SKIP mode, the Part _ Nx2N division mode, the Part _2NxN division mode and the AMP mode.
(III) adaptive fast video coding algorithm based on variance
As shown in fig. 10, the above two algorithms are combined to form an adaptive fast video coding algorithm based on variance, which is provided by the present invention, and the specific implementation process is as follows:
the first 10 CTUs of the current frame are used for data collection first, while the following CTUs are applied to the present algorithm. In the quad-tree coding process of the CTU, the encoder calculates the variance of the CU first. If AI or AI10 encoding configuration is used, updating the value of p, detecting whether the p meets the formula (4), if so, updating the value of q, directly judging that the current CU needs to be divided, and recursively traversing the sub-CUs; otherwise, the flow of fig. 9 is applied to obtain the optimal rate-distortion cost for the CU without partitioning.
Next, if the encoder uses the inter-frame coding configuration, or the AI or AI10 coding configuration has the condition that the above formula (4) is not satisfied, after applying the PU partition mode fast decision algorithm to obtain the optimal rate-distortion cost Rd of the un-partitioned CU, testing whether the variance of the CU is smaller than or equal toNot dividing the average variance of the CU, if not, recursively traversing the sub-CUs to obtain the optimal rate-distortion cost sum J corresponding to the sub-CUssubIf R isdLess than or equal to JsubAnd judging that the CU does not need to be divided, otherwise, adopting a division structure corresponding to the sub-CU.
And if the variance of the CU is smaller than the average variance of the non-divided CU, updating the value of m, judging whether the formula (3) is established, if so, updating the value of n, assuming that A and L are the CUs with the same size and positioned right above and left of the CU, if neither A nor L is divided, setting the bFast to true, and otherwise, setting the bFast to false. And if the bFast is true, directly judging that the CU is not divided and not traversing the sub-CUs. If the bFast is false and one of the A and the L is not divided, judging whether the optimal rate-distortion cost of the non-divided CU is less than or equal to the sum of the optimal rate-distortion costs of the non-divided sub-CUs, if not, only dividing the CU into 4 sub-CUs without traversing the sub-CUs, otherwise, judging that the CU does not need to be divided and does not traverse the sub-CUs. If the bFast is false and both A and L are divided, recursively traversing the sub-CU, and judging whether the CU needs to be divided according to the optimal rate-distortion cost sum of the sub-CU.
And if the formula (3) does not hold after the value of m is updated, recursively traversing the sub-CUs in the same way, and judging whether the CU needs to be divided according to the sum of the optimal rate-distortion costs of the sub-CUs.
Example two
To verify the performance of the proposed algorithm, the present invention implemented the proposed algorithm based on HM16.0 and performed a lot of experiments. All subsequent experiments of the invention are carried out under the same experimental environment, and the experimental environment of the invention is as follows:
a processor: intel (R) core (TM) i7-2600 CPU3.40GHz3.41GHz;
operating the system: 64-bit Windows 7;
and (3) encoding configuration: test conditions specified by CTC (CommonTestCondition)
This example comprehensively evaluates the performance of the algorithm by comparing the test results of the algorithm proposed by the present invention with the test results corresponding to HM16.0, and the experimental data are shown in tables 1, 2 and 3 below (where the video types and video sequences in tables 1, 2 and 3 are all from the test conditions specified by the HEVC standard).
The invention uses three evaluation indexes specified by CTC to measure the performance of the algorithm, as shown in the following formula (6), formula (7) and formula (8),
<math> <mrow> <mi>&Delta;</mi> <mi>T</mi> <mo>=</mo> <mfrac> <mrow> <msub> <mi>Time</mi> <mrow> <mi>o</mi> <mi>p</mi> <mi>t</mi> </mrow> </msub> <mo>-</mo> <msub> <mi>Time</mi> <mrow> <mi>o</mi> <mi>r</mi> <mi>g</mi> </mrow> </msub> </mrow> <mrow> <msub> <mi>Time</mi> <mrow> <mi>o</mi> <mi>r</mi> <mi>g</mi> </mrow> </msub> </mrow> </mfrac> <mo>&times;</mo> <mn>100</mn> <mi>%</mi> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>6</mn> <mo>)</mo> </mrow> </mrow> </math>
<math> <mrow> <mi>&Delta;</mi> <mi>B</mi> <mo>=</mo> <mfrac> <mrow> <msub> <mi>Bitrate</mi> <mrow> <mi>o</mi> <mi>p</mi> <mi>t</mi> </mrow> </msub> <mo>-</mo> <msub> <mi>Bitrate</mi> <mrow> <mi>o</mi> <mi>r</mi> <mi>g</mi> </mrow> </msub> </mrow> <mrow> <msub> <mi>Bitrate</mi> <mrow> <mi>o</mi> <mi>r</mi> <mi>g</mi> </mrow> </msub> </mrow> </mfrac> <mo>&times;</mo> <mn>100</mn> <mi>%</mi> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>7</mn> <mo>)</mo> </mrow> </mrow> </math>
<math> <mrow> <mi>&Delta;</mi> <mi>P</mi> <mo>=</mo> <mfrac> <mrow> <msub> <mi>PSNR</mi> <mrow> <mi>o</mi> <mi>p</mi> <mi>t</mi> </mrow> </msub> <mo>-</mo> <msub> <mi>PSNR</mi> <mrow> <mi>o</mi> <mi>r</mi> <mi>g</mi> </mrow> </msub> </mrow> <mrow> <msub> <mi>PSNR</mi> <mrow> <mi>o</mi> <mi>r</mi> <mi>g</mi> </mrow> </msub> </mrow> </mfrac> <mo>&times;</mo> <mn>100</mn> <mi>%</mi> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>8</mn> <mo>)</mo> </mrow> </mrow> </math>
wherein, Timeopt、BitrateoptAnd PSNRoptThe coding speed, code rate and signal-to-noise ratio PSNR, respectively, and the Time corresponding to the algorithm provided by the present inventionorg、BitrateorgAnd PSNRorgRespectively, the encoding speed, the code rate and the signal-to-noise ratio PSNR corresponding to HM 16.0.
Table 1 lists the experimental results of the algorithm of the present invention in the AI and AI10 encoding configuration. As can be seen from the table, the algorithm of the present invention can reduce the encoding complexity by 25.02% in the AI encoding configuration on average, while maintaining the same encoding performance as the original encoder. Under the AI coding configuration, the algorithm can reduce coding complexity by 55.96% at most, and effectively optimizes the coding speed. The algorithm of the invention can reduce the encoding complexity by 25.14% on average under the AI10 encoding configuration, and the encoding performance is basically the same as that of the original encoder, wherein the encoding complexity can be reduced by 56.13% at most. In particular, the algorithm of the present invention can effectively optimize the encoding speed of high definition and ultra-high definition video sequences in the AI and AI10 encoding configurations.
TABLE 1 Experimental results of the Algorithm under AI and AI10 coding configuration
Table 2 shows the experimental results of the algorithm of the present invention in the RA and RA10 encoding configurations. As can be known from experimental data of RA coding configuration, the algorithm of the invention can reduce the coding complexity by 34.37% on average, the code rate is increased by far less than 1%, the change of PSNR is basically negligible, and the algorithm of the invention can reduce the coding complexity by 53.93% at most. As can be seen from the data of the RA coding configuration, the algorithm of the present invention can reduce the coding complexity by nearly 50% for the ultra high definition video sequence in this configuration. The algorithm of the invention can reduce the encoding complexity of 34.42% on average under the RA10 encoding configuration, and simultaneously keeps the encoding performance equivalent to the original performance, and can reduce the encoding complexity of 54.07% at most. Therefore, similar to the encoding configuration of RA, under the encoding configuration of RA10, the algorithm of the present invention can optimize the encoding speed of the ultra high definition video sequence very effectively.
Table 2 experimental results of algorithm in RA and RA10 encoding configuration
Table 3 lists the experimental results of the algorithm of the present invention in the LB and LB10 encoding configurations. As can be seen from the data in the table, the algorithm of the present invention can reduce the encoding complexity by 37.10% on average under the LB encoding configuration, and meanwhile, the encoding performance equivalent to the original performance is maintained, and the encoding complexity can be reduced by 57.11% at most. Similarly, the algorithm of the present invention can be very effective in reducing the encoding complexity for high definition as well as ultra high definition video sequences. While for the LB10 encoding configuration, the algorithm of the present invention has similar experimental results. Therefore, in the LB and LB10 coding configuration, the algorithm of the present invention can reduce the coding complexity effectively while maintaining the coding performance equivalent to the original one.
Table 3 experimental results of algorithm under LB and LB10 coding configuration
In summary, the algorithm provided by the present invention can effectively reduce the coding complexity while maintaining the coding performance substantially consistent with that of the original HEVC coding, and is particularly suitable for video sequences with high definition resolution.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A variance-based adaptive fast video coding method is characterized in that: the method comprises the following steps:
A. calculating the variance of the current frame CU;
B. detecting a PU partition mode by adopting a variance-based PU partition mode fast decision algorithm according to the variance of the current frame CU to obtain a PU partition mode with the minimum rate distortion cost and the optimal rate distortion cost without partition of the CU;
C. according to the variance of the current frame CU, a variance-based CU partition mode fast decision algorithm is adopted to carry out CU partition decision, and the CU partition mode with the minimum rate-distortion cost is determined;
D. and coding according to the PU partition mode and the CU partition mode with the minimum rate-distortion cost.
2. The method of claim 1, wherein the adaptive fast video coding based on variance comprises: the step A specifically comprises the following steps:
calculating the variance of the current frame CU, wherein the calculation formula of the variance of the CU is as follows:
<math> <mrow> <mfenced open = '{' close = ''> <mtable> <mtr> <mtd> <mrow> <mover> <mi>p</mi> <mo>&OverBar;</mo> </mover> <mo>=</mo> <mfrac> <mn>1</mn> <mrow> <mi>N</mi> <mi>M</mi> </mrow> </mfrac> <munderover> <mo>&Sigma;</mo> <mrow> <mi>i</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>N</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <munderover> <mo>&Sigma;</mo> <mrow> <mi>j</mi> <mo>=</mo> <mn>1</mn> </mrow> <mrow> <mi>M</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <msub> <mi>p</mi> <mrow> <mi>i</mi> <mi>j</mi> </mrow> </msub> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mi>v</mi> <mo>=</mo> <mfrac> <mn>1</mn> <mrow> <mi>N</mi> <mi>M</mi> </mrow> </mfrac> <munderover> <mo>&Sigma;</mo> <mrow> <mi>i</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>N</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <munderover> <mo>&Sigma;</mo> <mrow> <mi>j</mi> <mo>=</mo> <mn>0</mn> </mrow> <mrow> <mi>M</mi> <mo>-</mo> <mn>1</mn> </mrow> </munderover> <msup> <mrow> <mo>(</mo> <msub> <mi>p</mi> <mrow> <mi>i</mi> <mi>j</mi> </mrow> </msub> <mo>-</mo> <mover> <mi>p</mi> <mo>&OverBar;</mo> </mover> <mo>)</mo> </mrow> <mn>2</mn> </msup> </mrow> </mtd> </mtr> </mtable> </mfenced> <mo>,</mo> </mrow> </math>
wherein the size of the CU corresponding region is NxM, { pijI is more than or equal to 0 and less than or equal to N-1, j is more than or equal to 0 and less than or equal to M-1, i belongs to Z, j belongs to Z and represents all original pixel values in the corresponding area of the CU,is the mean of all the original pixels in the corresponding region of the CU, and v is the variance of the original pixels in the corresponding region of the CU.
3. The method of claim 1, wherein the adaptive fast video coding based on variance comprises: the step B, which comprises:
b1, judging whether the coding configuration of the current frame is AI or AI10 coding configuration, if so, executing the step B2, otherwise, executing the step B3;
b2, judging whether the current frame meets the direct judgment condition that the CU needs to be divided, if so, jumping to the step B4, otherwise, executing the step B3, wherein the direct judgment condition that the CU needs to be divided is as follows:
<math> <mrow> <mfenced open = '{' close = ''> <mtable> <mtr> <mtd> <msub> <mi>v</mi> <mrow> <mi>c</mi> <mi>u</mi> <mi>r</mi> </mrow> </msub> <mo>&gt;</mo> <msub> <mi>v</mi> <mrow> <mi>m</mi> <mi>a</mi> <mi>x</mi> </mrow> </msub> <mo>&CenterDot;</mo> <mi>&beta;</mi> </mtd> </mtr> <mtr> <mtd> <msub> <mi>v</mi> <mrow> <mi>m</mi> <mi>a</mi> <mi>x</mi> </mrow> </msub> <mo>=</mo> <mfrac> <msup> <mrow> <mo>(</mo> <msup> <mn>2</mn> <mrow> <mi>b</mi> <mi>i</mi> <mi>t</mi> <mi>d</mi> <mi>e</mi> <mi>p</mi> <mi>t</mi> <mi>h</mi> </mrow> </msup> <mo>-</mo> <mn>1</mn> <mo>)</mo> </mrow> <mn>2</mn> </msup> <mn>4</mn> </mfrac> </mtd> </mtr> </mtable> </mfenced> <mo>,</mo> </mrow> </math>
wherein v iscurIs the variance of the current frame CU, beta is a first adaptive adjustment factor, vmaxIs the maximum variance of the current frame CU, bitdepth is the internal bit depth used by the encoder;
b3, adopting a variance-based PU partition mode fast decision algorithm to detect the PU partition mode, and selecting the PU partition mode with the minimum rate distortion cost and the optimal rate distortion cost without partition of the CU;
and B4, directly judging that the current frame CU needs to be divided, and recursively traversing sub-CUs of the current frame CU.
4. The method of claim 3, wherein the variance-based adaptive fast video coding comprises: the step B2, which includes:
b21, updating the value of p to be + + p, wherein p is the total number of CUs detected in the four-section tree coding of the previous frame;
b22, judging whether the current frame meets the direct judgment condition that the CU needs to be divided, if so, executing the step B4 after updating the value of q to be + + q, otherwise, executing the step B3, wherein q is the total number of CUs which meet the direct judgment condition that the CU needs to be divided in the four-section tree coding of the previous frame.
5. The method of claim 4, wherein the variance-based adaptive fast video coding comprises: the adaptive adjustment method of the first adaptive adjustment factor beta comprises the following steps:
if q is less than 10% of p, taking a value obtained by subtracting 0.1 from the beta value after the previous self-adaptive adjustment of the current frame quadtree coding as the beta value of the current CU;
if q is more than or equal to 10% of p and less than or equal to 15% of p, the beta value of the current CU is the beta value after the previous self-adaptive adjustment of the current frame quadtree coding;
if q is larger than 15% of p, taking the value obtained by adding 0.1 to the beta value after the previous self-adaptive adjustment of the current frame quadtree coding as the beta value of the current CU;
if the beta is less than 0.1, setting the beta value of the current CU to be 0.1;
wherein the initial value of the first adaptively adjusted factor β is 1.
6. The method of claim 3, wherein the variance-based adaptive fast video coding comprises: the step B3, which includes:
b31, testing the SKIP mode to obtain the rate distortion cost under the SKIP mode;
b32, calculating the variances of the two PUs corresponding to the Part _ Nx2N division mode, and judging whether the variances of the two PUs are not less than a given PU variance threshold, if so, executing a step B34, otherwise, executing a step B33;
b33, testing the Part _ Nx2N division mode to obtain the rate distortion cost under the Part _ Nx2N division mode, and then executing the step B34;
b34, calculating the variances of the two PUs corresponding to the Part _2NxN division mode, and judging whether the variances of the two PUs are not less than a given PU variance threshold, if so, executing a step B36, otherwise, executing a step B35;
b35, testing the Part _2NxN division mode to obtain the rate-distortion cost under the Part _2NxN division mode, and then executing the step B36;
and B36, testing AMP modes, and selecting the PU partition mode with the minimum rate distortion cost and the optimal rate distortion cost without partitioning the CU, wherein the AMP modes comprise a PART _ nRx2N partition mode, a PART _ nLx2N partition mode, a PART _2NxnU partition mode and a PART _2NxnD partition mode.
7. The method of claim 6, wherein the variance-based adaptive fast video coding comprises: the given PU variance threshold is half of the variance of the current frame CU.
8. The method of claim 6, wherein the variance-based adaptive fast video coding comprises: the step C, which comprises:
c1, judging whether the variance of the current frame CU is smaller than the average variance of the current frame CU which is not divided, if so, executing the step C2, otherwise, executing the step C4;
c2, updating the value of m to be + + m, then judging whether the current CU meets the partition judgment condition of the CU, if so, executing step C3 after updating the value of n to be + + n, otherwise, executing step C4, where the partition judgment condition of the CU is:
<math> <mrow> <msub> <mi>v</mi> <mrow> <mi>c</mi> <mi>u</mi> <mi>r</mi> </mrow> </msub> <mo>&CenterDot;</mo> <mi>&alpha;</mi> <mo>&lt;</mo> <msub> <mover> <mi>v</mi> <mo>&OverBar;</mo> </mover> <mrow> <mi>l</mi> <mi>e</mi> <mi>a</mi> <mi>f</mi> </mrow> </msub> <mo>,</mo> </mrow> </math>
wherein,the current frame is not divided into the average variance of the CU, alpha is a second adaptive adjustment factor, and m is that the variance of the CU is smaller than that of the CU in the coding process of the previous frameN is the number of CUs that satisfy the CU partition decision condition in the encoding process of the previous frame;
c3, simplifying the sub-CU traversal process of the current frame CU according to a set simplification rule;
and C4, obtaining the optimal rate-distortion cost sum of all sub-CUs of the current frame CU, and judging whether the optimal rate-distortion cost of the current frame CU which is not divided is less than or equal to the optimal rate-distortion cost sum of all sub-CUs of the current frame CU, wherein if yes, the current frame CU does not need to be divided, otherwise, the current frame CU needs to adopt a division structure corresponding to the sub-CU.
9. The method of claim 8, wherein the variance-based adaptive fast video coding comprises: the adaptive adjustment method of the second adaptive adjustment factor α comprises the following steps:
if n is less than 70% of m, taking the value obtained by subtracting 0.5 from the alpha value after the previous self-adaptive adjustment of the current frame quadtree coding as the alpha value of the current CU;
if n is more than or equal to 70% of m and less than or equal to 75% of m, the alpha value of the current CU is the alpha value after adaptive adjustment before the current frame quadtree coding;
if n is larger than 75% of m, taking the value obtained by adding 0.5 to the alpha value after the previous self-adaptive adjustment of the current frame quadtree coding as the alpha value of the current CU;
if the alpha is smaller than 1, setting the alpha value of the current CU to be 1;
wherein the initial value of the factor α of the second adaptive adjustment is 6.
10. The method of claim 8, wherein the variance-based adaptive fast video coding comprises: the step C3 specifically includes:
setting a simplified traversal flag bit bFast of the current frame CU according to the dividing conditions of the two CUs A and L which are respectively positioned right above and left of the current frame CU, and then simplifying the sub-CU traversal process of the current frame CU: if neither A nor L carries out CU division, setting bFast as true, then directly judging that the current frame CU does not need to be divided, and at the moment, not traversing sub-CUs of the current frame CU; if one of the A and the L is not divided and the other is divided, setting bFast as false, then judging whether the optimal rate-distortion cost of the current frame CU which is not divided is less than or equal to the sum of the optimal rate-distortion costs of all sub-CUs which are not divided, if so, judging that the current frame CU does not need to be divided, at the moment, not traversing the sub-CUs of the previous frame CU, and if not, stopping traversing the sub-CUs of the current frame after only dividing the current frame CU into 4 sub-CUs; if both A and L are divided, setting bFast as false, then recursively traversing sub-CUs of the current frame, and judging whether the optimal rate-distortion cost sum of all sub-CUs of the current frame CU is less than or equal to the optimal rate-distortion cost sum of all sub-CUs of the current frame CU which are not divided, if so, judging that the current frame CU does not need to be divided, at the moment, not traversing the sub-CUs of the previous frame CU, and if not, adopting a dividing structure corresponding to the sub-CUs by the current frame CU.
CN201510483491.4A 2015-08-07 2015-08-07 A kind of adaptive Fast video coding method based on variance Expired - Fee Related CN105120291B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510483491.4A CN105120291B (en) 2015-08-07 2015-08-07 A kind of adaptive Fast video coding method based on variance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510483491.4A CN105120291B (en) 2015-08-07 2015-08-07 A kind of adaptive Fast video coding method based on variance

Publications (2)

Publication Number Publication Date
CN105120291A true CN105120291A (en) 2015-12-02
CN105120291B CN105120291B (en) 2018-04-10

Family

ID=54668137

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510483491.4A Expired - Fee Related CN105120291B (en) 2015-08-07 2015-08-07 A kind of adaptive Fast video coding method based on variance

Country Status (1)

Country Link
CN (1) CN105120291B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108712648A (en) * 2018-04-10 2018-10-26 天津大学 A kind of quick inner frame coding method of deep video
CN111818332A (en) * 2020-06-09 2020-10-23 复旦大学 Fast algorithm for intra-frame prediction partition judgment suitable for VVC standard
CN111918058A (en) * 2020-07-02 2020-11-10 北京大学深圳研究生院 Hardware-friendly intra prediction mode fast determination method, device and storage medium
CN112702598A (en) * 2020-12-03 2021-04-23 浙江智慧视频安防创新中心有限公司 Method, device, electronic equipment and medium for encoding and decoding based on displacement operation

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008125058A (en) * 2006-11-13 2008-05-29 Jiaotong Univ Video coding method using image data skipping
CN101938657A (en) * 2010-10-07 2011-01-05 西安电子科技大学 Self-adaptively dividing method for code units in high-efficiency video coding
CN102404570A (en) * 2011-11-16 2012-04-04 浙江工业大学 Method for rapidly selecting multi-view video coding modes based on rate distortion sensitivity
CN102984521A (en) * 2012-12-12 2013-03-20 四川大学 High-efficiency video coding inter-frame mode judging method based on temporal relativity
CN103888762A (en) * 2014-02-24 2014-06-25 西南交通大学 Video coding framework based on HEVC standard
EP2899974A1 (en) * 2012-09-18 2015-07-29 Nec Corporation Video coding device, video coding method, and video coding program

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008125058A (en) * 2006-11-13 2008-05-29 Jiaotong Univ Video coding method using image data skipping
TWI339073B (en) * 2006-11-13 2011-03-11 Univ Nat Chiao Tung Video coding method using image data skipping
CN101938657A (en) * 2010-10-07 2011-01-05 西安电子科技大学 Self-adaptively dividing method for code units in high-efficiency video coding
CN102404570A (en) * 2011-11-16 2012-04-04 浙江工业大学 Method for rapidly selecting multi-view video coding modes based on rate distortion sensitivity
EP2899974A1 (en) * 2012-09-18 2015-07-29 Nec Corporation Video coding device, video coding method, and video coding program
CN102984521A (en) * 2012-12-12 2013-03-20 四川大学 High-efficiency video coding inter-frame mode judging method based on temporal relativity
CN103888762A (en) * 2014-02-24 2014-06-25 西南交通大学 Video coding framework based on HEVC standard

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
PINSON M H,,WOLF S: ""A new standardized method for objectively measuring video quality"", 《IEEE TRANSACTIONS ON BROADCASTING》 *
斯晓华等: ""基于边缘建模的纹理深度联合快速三维编码"", 《计算机工程与应用》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108712648A (en) * 2018-04-10 2018-10-26 天津大学 A kind of quick inner frame coding method of deep video
CN108712648B (en) * 2018-04-10 2021-04-30 天津大学 Rapid intra-frame coding method for depth video
CN111818332A (en) * 2020-06-09 2020-10-23 复旦大学 Fast algorithm for intra-frame prediction partition judgment suitable for VVC standard
CN111918058A (en) * 2020-07-02 2020-11-10 北京大学深圳研究生院 Hardware-friendly intra prediction mode fast determination method, device and storage medium
CN111918058B (en) * 2020-07-02 2022-10-28 北京大学深圳研究生院 Hardware-friendly intra prediction mode fast determination method, device and storage medium
CN112702598A (en) * 2020-12-03 2021-04-23 浙江智慧视频安防创新中心有限公司 Method, device, electronic equipment and medium for encoding and decoding based on displacement operation
CN112702598B (en) * 2020-12-03 2024-06-04 浙江智慧视频安防创新中心有限公司 Method, device, electronic equipment and medium for encoding and decoding based on displacement operation

Also Published As

Publication number Publication date
CN105120291B (en) 2018-04-10

Similar Documents

Publication Publication Date Title
CN110024394B (en) Method and apparatus for encoding/decoding image and recording medium storing bit stream
CN103797795B (en) Method and apparatus for motion-vector prediction
CN103561263B (en) Based on motion vector constraint and the motion prediction compensation method of weighted motion vector
CA2855777C (en) Method and apparatus for setting reference picture index of temporal merging candidate
CN103997646B (en) Fast intra-mode prediction mode selecting method in a kind of HD video coding
CN111373755A (en) Image encoding/decoding method and apparatus, and recording medium storing bit stream
CN117156155A (en) Image encoding/decoding method, storage medium, and transmission method
CN110024402B (en) Image encoding/decoding method and apparatus, and recording medium storing bit stream
CN105120291B (en) A kind of adaptive Fast video coding method based on variance
CN112740697A (en) Image encoding/decoding method and apparatus, and recording medium storing bit stream
CN112637591B (en) Video predictive coding method and device
CN104168480A (en) Fast selecting method for intra-frame prediction encoding modes based on HEVC standard
CN104954787B (en) HEVC inter-frame forecast mode selection methods and device
Zhang et al. Adaptive loop filter with temporal prediction
CN103533355A (en) Quick coding method for HEVC (high efficiency video coding)
CN112637592A (en) Method and device for video predictive coding
KR20200039591A (en) Method and apparatus for encoding/decoding image and recording medium for storing bitstream
CN113875235A (en) Image encoding/decoding method and apparatus, and recording medium storing bit stream
CN113841398A (en) Image coding/decoding method and device based on sub-block division
CN111052741A (en) Image encoding/decoding method and apparatus based on efficiently transmitted differential quantization parameter
CN113906754A (en) Image encoding/decoding method and apparatus
CN113841404A (en) Video encoding/decoding method and apparatus, and recording medium storing bitstream
CN110913232A (en) Selection method and device of TU division mode and readable storage medium
KR20140127385A (en) Method for decision of coding unit splittng
KR101603887B1 (en) Method for coding data by fast coding unit decision in high efficiency video coding

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180410

Termination date: 20210807

CF01 Termination of patent right due to non-payment of annual fee