A kind of QP selection algorithm based on CU conspicuousness
Technical field
The present invention relates to technical field of video compression, more particularly to a kind of QP selection based on CU conspicuousness
Algorithm.
Background technique
Currently, as the continuous development of video compression technology, high-quality, high real-time video have become development trend, this
Also promote the rapid development of high definition, ultra high-definition Video Applications.Currently, a new generation video encoding standard HEVC (High
EfficiencyVideo Coding) in the frame foundation for remaining conventional video coding, adopt video compress skill in recent years
The new results of art research make its coding efficiency substantially and can achieve 2 times of H.264/AVC standard.However, this compression performance
Raising also bring huge encoder complexity, it is still necessary to conduct further research and improve.Meanwhile with video point
The raising of resolution and quality, requirement of the modern society to video high definition is also higher and higher, is developed to 4K by initial QCIF
(resolution ratio is 3840 × 2160), or even development shortly after are the ultra high-definition video of 8K (resolution ratio is 7680 × 4320), in this way
To the compression of video, stores and transmits and made higher requirement.In the case where HD video applies more more and more universal,
Because Bandwidth-Constrained and the problem bring huge challenge to video compression technology, how to guarantee the high definition of high quality
Transmission of video, the subjective vision for promoting human eye, which experience the own warp of quality, becomes very urgent problem to be solved specifically how
It can be improved compression efficiency, be more clear the image quality of human eye part of interest, be true etc. and is most important.
The code efficiency of video compress is realized by reducing statistical redundancy and perception redundancy.In the video of standard
In compression method, removal statistical redundancy is as core technology, including intra prediction, inter-prediction, entropy coding etc., removal sense
The technology for knowing redundancy mainly includes the high fdrequency component that decays in quantization matrix, coloration sub-sampling, deblocking filtering etc..However, for people
Class vision system (HVS) the study found that the mankind are typically only capable to can be clearly seen the zonule in 2-5 ° of visual angle, and work as me
When observing image, since the understanding of each region to piece image is different, people can concentrate on sight some comparisons
Special place (ROI, the i.e. area-of-interest of human eye vision), thus the attention of eyes be not be evenly distributed, and
It is more sharp to the image fault of ROI region, if by method for video coding and human visual system (HumanVisual
System, HVS) it organically combines, more subjective vision perception redundancies can be removed, while promoting the subjective vision of human eye
Perceived quality, and further promote video compress effect.
Therefore, reducing the perception redundancy of video to obtain preferable compression effectiveness is the new direction that current video develops,
Needing the saliency algorithm based on attention mechanism with the preferential video compression algorithm of perception, the two aspects are right
HEVC is improved and is strengthened.
Therefore, encoder complexity can effectively be avoided by how providing one kind.And can the QP value effectively to CU select
The QP selection algorithm based on CU conspicuousness, the technical issues of being those skilled in the art's urgent need to resolve.
Summary of the invention
In view of this, the algorithm is according to the significant of CU the present invention provides a kind of QP selection algorithm based on CU conspicuousness
Property value select its corresponding QP, can be encoded with ensuring to have compared with the CU of highly significant with lesser QP, so that it is guaranteed that high
Marking area has higher compression quality.
To achieve the goals above, the present invention adopts the following technical scheme:
A kind of QP selection algorithm based on CU conspicuousness, comprising the following steps:
S10: the video frame picture is divided into multiple CU blocks, and calculate the significant of each CU block by selected video frame picture
Property value;
S20: the average significance value of all CU blocks in S10 is calculated;
S30: respectively according to the average conspicuousness of all CU blocks in the significance value of each CU block and selected video frame picture
Value dynamic adjusts the QP value of the CU block, obtains the perception QP value of each CU block.
Further, the conspicuousness calculation formula of CU block is as follows in S10:
S (k) indicates the significance value of k-th of CU block, S in formula (1)k(i, j) indicate current video frame picture in for
K-th of CU block of n*n size, from left to right the significance value of each pixel, the formula indicate institute in k-th of CU block from top to bottom
There is the significance value of pixel to be averaging.
Further, the average significance value calculation formula of all CU blocks is as follows in S20:
Savg indicates the average significance value of all CU blocks in current video frame picture in formula (2), and width expression is worked as
The width value of preceding video frame picture, height indicate that the height value of current video frame picture, S (i, j) indicate current video frame figure
The significance value of each pixel in piece.
Further, the calculation formula of the perception QP value of CU block is as follows in S30:
Wherein WkCalculation formula it is as follows:
Wherein, QPk indicates that the quantization parameter of k-th of CU block, QPc indicate the QP value of present frame, and a, b, c are normal parameter.
It can be seen via above technical scheme that compared with prior art, it is significant based on CU that the present disclosure provides one kind
Property QP selection algorithm, which selects its corresponding QP according to the significance value of CU, to ensure to have compared with highly significant
CU can be encoded with lesser QP, so that it is guaranteed that high marking area has higher compression quality.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, below will to embodiment or
Attached drawing needed to be used in the description of the prior art is briefly described, it should be apparent that, the accompanying drawings in the following description is only
The embodiment of the present invention for those of ordinary skill in the art without creative efforts, can be with
Other attached drawings are obtained according to the attached drawing of offer.
Fig. 1 attached drawing is the flow chart of the QP selection algorithm provided by the invention based on CU conspicuousness;
Fig. 2 attached drawing video time and space significance provided by the invention detection and perception compression process for HD video
It is whole to realize block diagram;
Fig. 3 attached drawing is BasketballDrive under the conditions of 1920 × 1080 resolution ratio provided by the invention, frequency frame 50HZ
The QP selection algorithm and the adaptive QP of HM standard (AQP) provided by the present invention based on CU conspicuousness is used in video frame picture
The QP of algorithm and more QP (MQP) algorithm figure.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts it is all its
His embodiment, shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a kind of QP selection algorithms based on CU conspicuousness, as shown in Figure 1, including following step
It is rapid:
S10: the video frame picture is divided into multiple CU blocks, and calculate the significant of each CU block by selected video frame picture
Property value;
S20: the average significance value of all CU blocks in S10 is calculated;
S30: respectively according to the average conspicuousness of all CU blocks in the significance value of each CU block and selected video frame picture
Value dynamic adjusts the QP value of the CU block, obtains the perception QP value of each CU block.
Wherein, in step S10, the saliency value of each CU block in video is obtained, it is whole to realize block diagram as shown in Fig. 2, being to utilize
Convolutional neural networks carry out the detection of airspace conspicuousness to input video frame, while according to inter-prediction mistake in HEVC compression process
The motion vector that journey obtains generates the movement significant result of domain portion, aobvious to time-space domain using the method for Entropy uncertainty
Work property is merged, to obtain the time-space domain significant result for video.In video coding section, the present invention uses one
More flexible QP selection method of the kind based on HEVC, which selects its corresponding QP according to the significance value of CU, with true
Protecting to have can be encoded compared with the CU of highly significant with lesser QP, so that it is guaranteed that high marking area has higher compression matter
Amount.
In the present embodiment, the present invention is in conjunction with proposed time and space significance optimization pressure to the Further aim of compression section
The perceived quality of contracting rear video gives these marking areas (people in statistical significance that is, after obtaining video visual conspicuousness
Be more likely to the region of concern) better compression quality, and can suitably be reduced under the premise of not occurring and being excessively distorted
The compression quality in non-significant region is to reduce video code rate.From the core concept of rate-distortion optimization, the invention proposes
QP selection algorithm based on CU conspicuousness, can effectively improve the perceived quality of video compress.
Specifically, calculating its significance value using following formula for the CU of a n × n:
S (k) indicates the significance value of k-th of CU block, S in formula (1)k(i, j) indicates kth in current video frame picture
The from left to right significance value of each pixel (i.e. in current video frame picture i-th in k-th of CU block from top to bottom in a CU block
The significance value of the pixel of row jth column).Meanwhile also needing to calculate the average significance value of all CU blocks.Publicity (1) indicates the
The significance value of all pixels point is averaging in k CU block.
The average significance value calculation formula for calculating all CU blocks in S20 is as follows:
S in formula (2)avgIndicate the average significance value of all CU blocks in current video frame picture, width indicates current
The width value of video frame picture, height indicate that the height value of current video frame picture, S (i, j) indicate current video frame picture
In each pixel significance value
When encoding a CU block, its QP value is dynamically adjusted according to the significance value for calculating the resulting CU block, can be obtained
The perception QP value of the CU block are as follows:
Wherein WkCalculation formula it is as follows:
Wherein, QPk indicates that the quantization parameter of k-th of CU block, QPc indicate the QP value of present frame, and a, b, c are normal parameter,
A=0.7, b=0.6, c=4 are set in an experiment.
For the compression process of HD video, compression efficiency is also a very important factor of evaluation, to measure
The compression efficiency of the mentioned algorithm of the present invention records the compression time under various methods in experimentation, in an Intel
It is tested under the experiment condition of Xeon E5-1620v3CPU with 8GB RAM and aNVIDIA Titan X GPU,
On the basis of using the setting of time used in the HM standard method of RDOQ, it is as shown in table 1 data can be obtained
1 video compression efficiency of table compares
According to experimental result it is recognized that while the time used in the AQP method based on HM standard is most short, but its compression effectiveness
Also worst, although while MQP method effect it is good compared with AQP method because MQP algorithm is equivalent within the scope of given QP
Exhaustion is carried out to obtain QP used in the best compression result of effect under rate-distortion optimization, so its compression time longest, for mark
6.46 times of quasi- HM.
In summary analysis of experimental results, the mentioned algorithm of the present invention is in compression efficiency and compression effectiveness two based on perception
Aspect has comprehensive advantage.
Tested using algorithm mentioned by the present embodiment and alignment algorithm, as shown in figure 3, the figure be 1920 ×
Under 1080 resolution ratio, under conditions of frame frequency is 50HZ, the QP result and HM standard in BasketballDrive video frame are adaptive
The QP of QP (AQP) and more QP (MQP) is answered to scheme.It can be concluded that algorithm provided by the invention can transported more significant in picture
The QP value of sportsman part in dynamic reduces, and the QP value of non-significant background area increases, to realize based on non-limiting QP
Selection, thus algorithm provided in this embodiment can the QP value effectively to CU block select, and avoid rate distortion it is excellent
Change the shortcomings that quantity algorithm increases encoder complexity.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with its
The difference of his embodiment, the same or similar parts in each embodiment may refer to each other.For being filled disclosed in embodiment
For setting, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is referring to method portion
It defends oneself bright.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
Various modifications to these embodiments will be readily apparent to those skilled in the art, defined herein
General Principle can realize in other embodiments without departing from the spirit or scope of the present invention.Therefore, originally
Invention is not intended to be limited to the embodiments shown herein, and is to fit to special with principles disclosed herein and novelty
The consistent widest scope of point.