CN109660801A - The method for video coding that quantization parameter is limited - Google Patents
The method for video coding that quantization parameter is limited Download PDFInfo
- Publication number
- CN109660801A CN109660801A CN201811324490.5A CN201811324490A CN109660801A CN 109660801 A CN109660801 A CN 109660801A CN 201811324490 A CN201811324490 A CN 201811324490A CN 109660801 A CN109660801 A CN 109660801A
- Authority
- CN
- China
- Prior art keywords
- quantization parameter
- encoded
- frame
- unit
- video
- 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
- 238000013139 quantization Methods 0.000 title claims abstract description 301
- 238000000034 method Methods 0.000 title claims abstract description 20
- 230000000875 corresponding effect Effects 0.000 claims description 164
- 241000208340 Araliaceae Species 0.000 claims description 5
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 claims description 5
- 235000003140 Panax quinquefolius Nutrition 0.000 claims description 5
- 235000008434 ginseng Nutrition 0.000 claims description 5
- 230000002596 correlated effect Effects 0.000 claims description 4
- 230000006835 compression Effects 0.000 abstract description 47
- 238000007906 compression Methods 0.000 abstract description 47
- 239000002699 waste material Substances 0.000 abstract description 6
- 230000009466 transformation Effects 0.000 abstract 1
- 238000013507 mapping Methods 0.000 description 7
- 238000004364 calculation method Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000001276 controlling effect Effects 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
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/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/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
-
- 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/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
- H04N21/2343—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/4402—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
This application involves the method for video coding that a kind of pair of quantization parameter is limited, the method passes through first to be predicted, the spatial redundancy and time redundancy of video image are reduced according to intra prediction and inter-prediction.Next is converted, and by the transformation from time domain to frequency domain, is removed the correlation between adjacent data, is removed spatial redundancy.Finally quantified again, directly adopt the quantization parameter being calculated different from traditional, by being adjusted to the quantization parameter being calculated, is conducive to improve compression efficiency, code stream is avoided to waste;Finally coding unit is encoded by the way of entropy coding.Compression efficiency can be improved under the premise of guaranteeing subjective quality using the present invention, reduce bandwidth cost.
Description
Technical field
This application involves Video coding processing technology field, the video limited more particularly to a kind of pair of quantization parameter
Coding method.
Background technique
Video coding refers to through specific compress technique, and the file of some video format is converted into another video lattice
The mode of formula file.
Traditional client uploads compressed video and compiles to server, server needs to the video received
Code, the method for video coding limited quantization parameter (Quantization Parameter, QP) only simply carry out
It recompiles, compression ratio can not be improved, cause bandwidth at high cost.
Summary of the invention
Based on this, it is necessary to it is above-mentioned cannot improve compression ratio aiming at the problem that, propose and a kind of guaranteeing subjective quality
Under the premise of improve compression ratio, the method for video coding limited quantization parameter, device, the computer for saving bandwidth cost are set
Standby and storage medium.
The method for video coding that a kind of pair of quantization parameter provided by the invention is limited, comprising:
The current decoded frame being decoded to the current video frame is obtained, is obtained each first in the current decoded frame
Corresponding first quantization parameter of coding unit;
Corresponding first quantization parameter of each first coding unit is ranked up, the smallest first amount that will be obtained
Change parameter as the corresponding reference quantization parameter of unit to be encoded in the current video frame;
Calculate corresponding second quantization parameter of the unit to be encoded;
Calculate the relative mistake between the corresponding reference quantization parameter of the unit to be encoded and corresponding second quantization parameter
Value obtains each first in the corresponding current decoded frame of current video frame when the relative difference is greater than or equal to threshold value
Corresponding first quantization parameter of coding unit carries out mean value according to corresponding first quantization parameter of each first coding unit
Third quantization parameter is calculated, third quantization parameter calculates the difference of the third quantization parameter and the reference quantization parameter
Regulation coefficient is calculated according to the difference amplitude in amplitude, and the regulation coefficient is positively correlated with the difference amplitude, according to
Quantization parameter increment is calculated in the regulation coefficient and the relative difference, according to the quantization parameter increment and list to be encoded
Target quantization parameter is calculated in corresponding second quantization parameter of member, wherein described according to the regulation coefficient and the relative mistake
The method that quantization parameter increment is calculated in value includes: when the current video frame where the unit to be encoded is a kind of video frame
When, the first adjustment coefficient is obtained, quantization parameter increment is calculated according to the first adjustment coefficient and the relative difference;When
When current video frame where the unit to be encoded is two class video frame, second adjustment coefficient is obtained, is adjusted according to described second
Quantization parameter increment is calculated in integral coefficient and the relative difference;
Coding unit is treated according to the Target quantization parameter to be encoded.
Method for video coding provided by the invention, the first coding unit is corresponding when encoding initial compression video by obtaining
First quantization parameter determines reference quantization parameter corresponding with unit to be encoded according to the first quantization parameter, then according to wait compile
Relative difference between corresponding second quantization parameter of code unit and reference quantization parameter, carries out increase tune to the second quantization parameter
It is whole, Target quantization parameter is obtained, coding unit is finally treated according to Target quantization parameter and is encoded.Guaranteeing subjective quality
Under the premise of, increase adjustment is carried out to the second quantization parameter, is conducive to improve compression efficiency.
Detailed description of the invention
Fig. 1 is the flow chart of the method for video coding limited in one embodiment quantization parameter.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood
The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, and
It is not used in restriction the application.
As shown in Figure 1, the method for video coding provided in an embodiment of the present invention limited quantization parameter specifically includes
Following steps:
Step 1: obtaining the current decoded frame being decoded to the current video frame, obtain in the current decoded frame
Corresponding first quantization parameter of each first coding unit.
Quantization parameter is the parameter for measure of quantization step-length, can influence picture quality, and quantization parameter is smaller, accordingly
Picture quality it is better.For example, for H.264 video encoding standard, quantization parameter QP is the sequence of quantization step Qstep
Number, value 0-51.When quantization parameter QP is minimized 0, indicate that quantization is most fine, on the contrary, quantization parameter QP is maximized 51
When, indicate that quantization is most coarse.Quantization parameter is positively correlated with compression ratio, i.e., quantization parameter is smaller, and corresponding compression ratio is smaller, amount
Change parameter is bigger, and corresponding compression ratio is higher.Wherein, compression ratio here refers to the size before compression and compressed size
Ratio.
Video is made of video frame one by one, and includes coding unit in each video frame, each coding unit
A corresponding quantization parameter.Need to calculate the corresponding quantization parameter of each coding unit when being encoded, then according to quantization
Parameter encodes corresponding coding unit.Initial compression video is for this Video coding, before coding
Video be known as initial compression video.First coding unit refers to the coding unit for including in initial compression video, the first quantization
Parameter refers to the corresponding quantization parameter of the first coding unit.
Coding unit is the unit for forming video frame, and coding unit can be the encoding block in video frame, be also possible to regard
Encoding strip thereof in frequency frame includes multiple encoding blocks in encoding strip thereof, due to the corresponding quantization of encoding block in encoding strip thereof
Parameter is identical, it is possible to regard encoding strip thereof as a coding unit, correspond to a quantization parameter.
Specifically, initial compression video is obtained, initial compression video is decoded, initial decoding frame, initial solution are obtained
Code frame refers to the decoded video frame that decoding initial compression video obtains, and obtains each first coding unit corresponding first
Quantization parameter.
Step 2: being ranked up to corresponding first quantization parameter of each first coding unit, the minimum that will be obtained
The first quantization parameter as the corresponding reference quantization parameter of unit to be encoded in the current video frame.
Current video frame refers to current video frame to be encoded, and unit to be encoded refers to the coding list in current video frame
Member.Reference quantization parameter is the reference point for measuring corresponding second quantization parameter of unit to be encoded.Specifically, Video coding
Essence be one and first decode, then the process recompiled.In order to be encoded to initial compression video, firstly, it is necessary to first
Beginning compression video is decoded, and is obtained initial decoding frame, then using initial decoding frame as current video frame to be encoded, is convenient for
It is subsequent to re-start coding.
The unit to be encoded in current video frame is obtained, then according to the corresponding first quantization parameter meter of the first coding unit
Calculate the corresponding reference quantization parameter of unit to be encoded.There are many ways to calculating unit to be encoded corresponding reference quantization parameter,
In one embodiment, it firstly, obtaining the first coding unit of target corresponding with unit to be encoded, is obtained due to that will decode
Then initial decoding frame re-starts coding as current video frame to be encoded, thus initial decoding frame with it is currently to be encoded
Video frame have one-to-one relationship.The specification of the first coding unit in initial decoding frame and current video to be encoded
The specification of unit to be encoded in frame may be the same or different.For example, when the first coding unit is encoding block, wait compile
Code unit can be encoding block, or encoding strip thereof.Regardless of whether the specification of the two is identical, unit to be encoded and first is compiled
All there is corresponding matching relationship between code unit.For example, if unit to be encoded is encoding strip thereof, and the first coding unit is
Encoding block, then first coding unit corresponding with unit to be encoded it is corresponding have it is multiple.In one embodiment, firstly, obtaining
The first coding unit of target corresponding with unit to be encoded is taken, is then joined according to corresponding first quantization of the first coding unit of target
Number calculates reference quantization parameter corresponding with unit to be encoded.It specifically, can be by the first coding unit of target corresponding first
Quantization parameter, which subtracts a number, is worth reference quantization parameter.
In one embodiment, current decoded frame corresponding with current video frame is obtained, is obtained each in current decoded frame
Corresponding first quantization parameter of first coding unit, to corresponding first quantization parameter of each first coding unit according to size into
Row sequence obtains ranking results, determines reference quantization parameter corresponding with unit to be encoded according to ranking results.
Step 3: calculating corresponding second quantization parameter of the unit to be encoded.
Unit to be encoded to be encoded is obtained, corresponding second quantization parameter of unit to be encoded is calculated.Since coding relies on
In the corresponding quantization parameter of coding unit, so before encoding, it is necessary first to corresponding second quantization parameter of calculation code unit.
The factors such as the calculating of the second quantization parameter and image complexity, target bit rate are related, and specific calculate can be controlled using code rate
Algorithm is calculated, and can also use adaptive quantizing calculation method of parameters, naturally it is also possible to be calculated using other algorithms
It arrives.Here the calculating of the second quantization parameter is not limited.
Step 4: calculating between the corresponding reference quantization parameter of unit to be encoded and corresponding second quantization parameter
Relative difference obtains each in the corresponding current decoded frame of current video frame when the relative difference is greater than or equal to threshold value
Corresponding first quantization parameter of a first coding unit, according to corresponding first quantization parameter of each first coding unit into
Row mean value computation obtains third quantization parameter, and third quantization parameter calculates the third quantization parameter and the reference quantization parameter
Difference amplitude, regulation coefficient is calculated according to the difference amplitude, the regulation coefficient and the difference amplitude are at positive
Close, quantization parameter increment be calculated according to the regulation coefficient and the relative difference, according to the quantization parameter increment and
Target quantization parameter is calculated in corresponding second quantization parameter of unit to be encoded, wherein described according to the regulation coefficient and institute
Stating the method that quantization parameter increment is calculated in relative difference includes: when the current video frame where the unit to be encoded is one
When class video frame, the first adjustment coefficient is obtained, quantization ginseng is calculated according to the first adjustment coefficient and the relative difference
Number increment;When the current video frame where the unit to be encoded is two class video frame, second adjustment coefficient is obtained, according to institute
It states second adjustment coefficient and quantization parameter increment is calculated in the relative difference.
Relative difference refers to the size of the difference between the corresponding reference quantization parameter of unit to be encoded and the second quantization parameter.
Corresponding second quantization parameter of coding unit is treated according to the relative difference being calculated and carries out corresponding increase adjustment, obtains mesh
Scalarization parameter.The quantization parameter eventually for coding that Target quantization parameter refers to.
Specifically, reference quantization parameter has reacted the big of the quantization parameter used when encoding to the first coding unit
It is small, and quantization parameter has reacted the fineness of image.Due to the not instead of original video decoded to initial compression video,
Compressed video, so if compressed video quality is bad, when second-compressed, even if using comparing
Small quantization parameter, which is encoded, can not also further increase video quality, can waste code rate instead.So by by reference quantity
Change parameter as reference point, calculates the relative difference of reference quantization parameter and the second quantization parameter, when relative difference is bigger,
Illustrate that the second quantization parameter is smaller, corresponding increase adjustment can be carried out to the second quantization parameter according to relative difference to improve
Compression ratio.In one embodiment, the amplitude of quantization parameter increase adjustment is positively correlated with relative difference, and relative difference is bigger,
It is bigger that corresponding quantization parameter increases adjustment amplitude.This method by suitably increasing the second quantization parameter according to relative difference,
The compression ratio of coding can be improved under the premise of guaranteeing subjective quality, avoid waste code rate, and reduce corresponding bandwidth
Cost.
It is encoded Step 5: treating coding unit according to the Target quantization parameter.
Target quantization parameter is final coded quantization parameter corresponding with unit to be encoded.Specifically, it is obtained according to adjustment
Target quantization parameter treat coding unit and encoded, and then obtain compressing video accordingly, due to be calculated
Two quantization parameters have carried out increasing adjustment, so being conducive to the compression ratio for improving video under the premise of guaranteeing subjective quality, drop
Low corresponding code rate, and then save corresponding bandwidth cost.
In one embodiment, while improving video compression ratio, in order to guarantee the important target in video
Picture quality corresponding to content is unaffected, identifies to current video frame to be encoded, if including in current video frame
There is object content, then increase adjustment is not carried out to current second quantization parameter.
The above-mentioned method for video coding limited quantization parameter, first compiles when encoding initial compression video by obtaining
Corresponding first quantization parameter of code unit determines reference quantization parameter corresponding with unit to be encoded according to the first quantization parameter,
Then according to the relative difference between corresponding second quantization parameter of unit to be encoded and reference quantization parameter, the second quantization is joined
Number carries out increase adjustment, obtains Target quantization parameter, finally treats coding unit according to Target quantization parameter and encoded.It is protecting
Under the premise of demonstrate,proving subjective quality, increase adjustment is carried out to the second quantization parameter, is conducive to improve compression efficiency, to reduce band
Wide cost.
In one embodiment, for the step 2, unit to be encoded in current video frame is obtained, according to the first coding
Corresponding first quantization parameter of unit determines that the step of unit to be encoded corresponding reference quantization parameter includes:
Step A obtains the corresponding current decoded frame of current video frame.
Initial decoding frame refers to the video frame that decoding initial compression video obtains.Current decoded frame refers to and current video frame
Corresponding initial decoding frame.Current video frame refers to current video frame to be encoded.Specifically, server receives initial compression
Video is decoded the initial compression video, obtains initial decoding frame, then using initial decoding frame as video to be encoded
Frame again encodes video.So video frame to be encoded and initial decoding frame are one-to-one relationships.To be encoded
Matching relationship between video frame and initial decoding frame can be customized, in one embodiment, can directly by with work as forward sight
The corresponding initial decoding frame of frequency frame is as current decoded frame.In another embodiment, can also by current video frame with it is multiple
Initial decoding frame matching, for example, the decoding that current video frame is adjacent with corresponding initial decoding frame and the initial decoding frame
Frame is as corresponding current decoded frame.For example, it is assumed that the initial decoding frame that decoding initial compression video obtains has 6 frames, point
It Wei 1,2,3,4,5,6.Assuming that current video frame to be encoded is 3, can be obtained and current according to preparatory customized rule
The corresponding current decoded frame of video frame 3 directly regard corresponding initial decoding frame 3 as corresponding current solution for example, can be set
Code frame, also can be set initial decoding frame 2,3 and 4 together as current decoded frame.
Step B obtains unit to be encoded corresponding first coding unit of target in current decoded frame.
Unit to be encoded refers to that current coding unit to be encoded, unit to be encoded are included in current video frame.
Obtain unit to be encoded corresponding first coding unit of target in current decoded frame.Coding unit to be encoded and the first coding
The matching relationship of unit equally can be customized.For example, in one embodiment, it can be by one first in current decoded frame
Coding unit is as the first coding unit of target corresponding with unit to be encoded.It in another embodiment, can also will be current
Multiple initial decoding units in decoding frame are together as the first coding unit of target corresponding with unit to be encoded.It can will work as
Corresponding first coding unit of cell position in preceding decoding frame and to be encoded is as target corresponding with unit to be encoded
One coding unit.
Step C determines the corresponding reference of unit to be encoded according to corresponding first quantization parameter of the first coding unit of target
Quantization parameter.
Reference quantization parameter is the standard for measuring corresponding second quantization parameter of unit to be encoded, subsequent according to reference
Quantization parameter is adjusted quantization parameter to be encoded.Specifically, corresponding first quantization of the first coding unit of target is obtained
Then the corresponding reference quantization parameter of unit to be encoded is calculated according to the first quantization parameter in parameter.In one embodiment,
Assuming that the first quantization parameter of the corresponding initial decoding frame of some current video frame can not obtain, due to the quantization parameter of consecutive frame
Relatively, then corresponding first quantization parameter of available consecutive frame is determined wait compile as corresponding first quantization parameter
The corresponding reference quantization parameter of code unit.In one embodiment, the first quantization parameter a certain default value can be subtracted to obtain
To reference quantization parameter corresponding with unit to be encoded.
In another embodiment, for the step 2, the unit to be encoded in current video frame is obtained, according to first
Corresponding first quantization parameter of coding unit determines that the step of unit to be encoded corresponding reference quantization parameter includes:
Step a obtains the corresponding current decoded frame of current video frame.
Initial decoding frame refers to the video frame that decoding initial compression video obtains.Current decoded frame refers to and current video frame
Corresponding initial decoding frame.Current video frame refers to current video frame to be encoded.Specifically, server receives initial compression
Video is decoded the initial compression video, obtains initial decoding frame, then using initial decoding frame as video to be encoded
Frame again encodes video.So video frame to be encoded and initial decoding frame are one-to-one relationships.To be encoded
Matching relationship between video frame and initial decoding frame can be customized, in one embodiment, can directly by with work as forward sight
The corresponding initial decoding frame of frequency frame is as current decoded frame.In another embodiment, can also by current video frame with it is multiple
Initial decoding frame matching, for example, the decoding frame that current video frame is adjacent with corresponding initial decoding frame and initial decoding frame
Together as corresponding current decoded frame.Assuming that the obtained initial decoding frame of decoding initial compression video has 6 frames, respectively 1,2,
3,4,5,6.Assuming that current video frame to be encoded is 3, can be obtained and current video frame 3 according to preparatory customized rule
Corresponding current decoded frame directly regard corresponding initial decoding frame 3 as corresponding current decoded frame for example, can be set,
It can be set initial decoding frame 2,3 and 4 together as corresponding current decoded frame.
Step b obtains corresponding first quantization parameter of each first coding unit in current decoded frame.
Wherein, include multiple first coding units in each initial decoding frame, getting corresponding current decoded frame
Afterwards, need to obtain corresponding first quantization parameter of each first coding unit in current decoded frame.
Step c is ranked up corresponding first quantization parameter of each first coding unit according to size to obtain sequence knot
Fruit determines reference quantization parameter corresponding with unit to be encoded according to ranking results.
It, will according to the size of the first quantization parameter after getting corresponding first quantization parameter of each first coding unit
Each first quantization parameter is ranked up, and obtains corresponding ranking results, wherein sequence can be from big to small, be also possible to
From small to large.Reference quantization parameter corresponding with unit to be encoded is determined according to ranking results later.In one embodiment,
The the first small quantization parameter second from the bottom that sequence can be obtained is as reference quantization parameter corresponding with unit to be encoded.?
In another embodiment, then available preceding 10% the first small quantization parameter calculates this 10% the first quantization parameter
Average value, using the average value being calculated as reference quantization parameter corresponding with unit to be encoded.
In one embodiment, the step of determining reference quantization parameter corresponding with unit to be encoded according to ranking results is wrapped
It includes: using the first quantization parameter the smallest in ranking results as the corresponding reference quantization parameter of unit to be encoded.
After getting ranking results, using the first quantization parameter the smallest in ranking results as the corresponding ginseng of unit to be encoded
Quantization parameter is examined, since quantization parameter is smaller, the fineness represented is higher, so by making the minimum value in ranking results
For reference quantization parameter, be conducive to it is subsequent increase adjustment is carried out to quantization parameter to be encoded according to reference quantization parameter, to increase
Add corresponding compression ratio, saves bandwidth cost.
Unit to be encoded in current video frame is obtained, is determined according to corresponding first quantization parameter of the first coding unit wait compile
The step of code unit corresponding reference quantization parameter includes: to obtain the corresponding initial video coding standard of initial compression video, is obtained
Take the corresponding current video coding standards of current video frame;It is determined according to initial video coding standard and current video coding standards
The mapping relations of quantization parameter;Reference quantization ginseng is obtained according to corresponding first quantization parameter of the first coding unit and mapping relations
Number.
If coding front and back is using different video compression standards, in order to guarantee the corresponding compression of quantization parameter
Quality is suitable, needs the quantization parameter being mapped as former quantization parameter in the corresponding current video coding standards of current video frame.
Wherein, the determination of mapping relations is determined according to initial video coding standard and current video coding standards, it is assumed that initial
Video encoding standard is as current video coding standards, then the value for mapping front and back is identical, and corresponding formula can indicate are as follows: f
(qp)=qp.If initial video coding standard and current video coding standards are different, corresponding formula can be expressed as
Qp'=fi(qp), wherein fiIt is the mapping function of one of linear discrete in mapping function F, selection rule indicates such as
Under: fi=F (S1,S2), S1For initial compression video encoding standard, S2For current video coding standards.
In one embodiment, calculate the corresponding reference quantization parameter of unit to be encoded and corresponding second quantization parameter it
Between relative difference, corresponding second quantization parameter of unit to be encoded is increased according to relative difference, comprising:
Step 1, judge whether relative difference is greater than threshold value, if so, 2 are entered step, if it is not, then entering step 4.
Wherein, relative difference refers to the size of the difference between the second quantization parameter and reference quantization parameter.Judge relative mistake
Whether value is greater than threshold value, if so, illustrating to need to carry out increase adjustment to the second quantization parameter, by obtaining regulation coefficient, root
Quantization parameter increment is calculated according to regulation coefficient and relative difference;If it is not, then without adjusting the second quantization parameter, directly by the
Two quantization parameters are as Target quantization parameter.
Step 2, regulation coefficient is obtained, quantization parameter increment is calculated according to regulation coefficient and relative difference.
Wherein, regulation coefficient is the coefficient for controlling adjustment amplitude size, can be preset.It is opposite being calculated
After difference, corresponding quantization parameter increment can be calculated according to regulation coefficient and relative difference.In one embodiment, may be used
Directly by the product of regulation coefficient and relative difference as quantization parameter increment.In another embodiment, it can also will adjust
Integral coefficient and the product of relative difference are along with a constant is as quantization parameter increment.
Step 3, Target quantization is calculated according to quantization parameter increment and corresponding second quantization parameter of unit to be encoded
Parameter.Quantization parameter increment refers to the adjustment amount increased the second quantization parameter, by quantifying quantization parameter increment and second
Parameter sums up operation and obtains Target quantization parameter.
Step 4, directly using the second quantization parameter as Target quantization parameter.If relative difference is less than or equal to threshold value,
Then directly using the second quantization parameter as Target quantization parameter, without being adjusted.
By determining that reference quantization parameter, reference quantization parameter reflect according to the corresponding quantization parameter of the first coding unit
The quantization parameter used when being encoded to the first coding unit, and quantization parameter has reacted the fineness of image.Due to first
The not instead of original video that beginning compressed video decoder obtains, compressed video, if compressed video quality is bad, even if compiling
The quantization parameter used when code is small again can not also to further increase video quality, can waste code rate instead.So if reference quantization
Parameter and the difference of the second quantization parameter are greater than threshold value, illustrate that the second quantization parameter is too small, not only can not further mention at this time
High video quality, and will lead to code rate waste, it is possible to it is appropriate to increase the second quantization parameter, convenient for guaranteeing subjective quality
Under the premise of, the compression ratio of coding is improved, avoids waste code rate, and reduce corresponding bandwidth cost.
The corresponding Target quantization parameter of unit to be encoded can be calculated using piecewise function, when the second quantization being calculated
Parameter is greater than reference quantization parameter when subtracting threshold value, then without adjusting the second quantization parameter, i.e., will directly be calculated to
Coded quantization is as Target quantization parameter.Door is subtracted when the second quantization parameter being calculated is less than or equal to reference quantization parameter
When limit value, then corresponding quantization is calculated with the difference of the second quantization parameter according to regulation coefficient and reference quantization parameter and joined
Number increment.So Target quantization parameter is equal to the sum of the second quantization parameter and quantization parameter increment.Specific formula indicates such as
Under:
Wherein, qp' represents Target quantization parameter, and qp indicates the second quantization parameter, qp0Indicate reference quantization parameter, α is indicated
Regulation coefficient, β indicate threshold value.
It is corresponding according to the first coding unit in current decoded frame after getting current decoded frame corresponding with current video frame
The first quantization parameter calculate the corresponding third quantization parameter of unit to be encoded.It in one embodiment, can directly will be each
Corresponding first quantization parameter of first coding unit carries out mean value computation and obtains third quantization parameter.In another embodiment,
First quantization parameter can also be ranked up according to size, then using the corresponding value of the first quantization parameter in middle position as
Third quantization parameter.In one embodiment, if the video encoding standard difference that coding front and back uses, it is also necessary to will calculate
To third quantization parameter carry out mapping calculation obtain final third quantization parameter.
The determination of regulation coefficient can be calculated according to the difference between third quantization parameter and reference quantization parameter,
Difference between the third quantization parameter being calculated and reference quantization parameter is known as " difference amplitude ".In order to avoid excessively adjusting
Whole, setting regulation coefficient and difference amplitude are at inverse correlation.When i.e. difference amplitude is bigger, the regulation coefficient being calculated is smaller,
When difference Amplitude Ratio is smaller, the regulation coefficient being calculated is bigger.In one embodiment, it can be calculated using the following equation
It obtains, α=k/ (qpave-qp0), wherein α indicates that regulation coefficient, k indicate constant, qpaveIndicate third quantization parameter, qp0It indicates
Reference quantization parameter.By that can be adjusted to avoid excessive using the product of regulation coefficient and difference amplitude as quantization parameter increment,
Influence picture quality.
It in embodiments of the present invention, can also be according to the corresponding frame third quantization parameter of current video frame to current video frame
The step of being classified, comprising the following steps:
Step 1, the initial decoding frame that decoding initial compression video obtains is obtained, the corresponding frame of each initial decoding frame is calculated
Video third quantization parameter corresponding with initial compression video is calculated according to frame third quantization parameter in third quantization parameter.
Initial decoding frame is the video frame for decoding initial compression video and obtaining.Frame third quantization parameter refers to initial decoding frame
Corresponding third quantization parameter, frame third quantization parameter can be corresponding by obtaining each first coding unit in initial decoding frame
The first quantization parameter, then according to corresponding first quantization parameter of each first coding unit carry out average calculating operation obtain it is flat
Mean value can be used as frame third quantization parameter.Similarly, the corresponding frame third quantization ginseng of each initial decoding frame is being calculated
After number, it can be calculated according to the corresponding frame third quantization parameter of initial decoding frame each in initial compression video and initially be pressed
The corresponding video third quantization parameter of contracting video.
Step 2, whether the difference of judgment frame third quantization parameter and video third quantization parameter is greater than parameter preset, if
It is then to enter step 3, if it is not, then entering step 4.
The difference of judgment frame third quantization parameter and video third quantization parameter, if it is greater than parameter preset (for example, 5),
So using this kind of video frame as a kind of video frame, otherwise, as two class video frames.
Step 3, it regard current video frame corresponding with initial decoding frame as a kind of video frame.
Step 4, will current video frame corresponding with initial decoding frame as two class video frames.
Initial decoding frame is divided into two classes according to the size of video third quantization parameter and the difference of frame third quantization parameter.
Due to being that will decode obtained initial decoding frame as current video frame to be encoded, so initial decoding frame and current video frame
Be it is one-to-one, when the difference of frame third quantization parameter and video third quantization parameter is greater than parameter preset, will with it is initial
The corresponding current video frame of decoding frame otherwise will current video frame conduct corresponding with initial decoding frame as a kind of video frame
Two class video frames.By the way that video frame to be encoded is divided into two classes, convenient for subsequent targetedly corresponding to inhomogeneity video frame
The second quantization parameter be adjusted.If frame third quantization parameter and the difference comparsion of video third quantization parameter are big, explanation
The corresponding quantization parameter of the first coding unit of video frame is larger, and corresponding picture quality is poor.Conversely, picture quality is preferable.
By the way that corresponding video frame to be encoded is divided into two classes according to frame third quantization parameter, convenient for subsequent targetedly to adjustment
Coefficient is adjusted.
The step of obtaining regulation coefficient, quantization parameter increment is calculated according to regulation coefficient and relative difference includes: to work as
When current video frame where unit to be encoded is a kind of video frame, obtain the first adjustment coefficient, according to the first adjustment coefficient and
Quantization parameter increment is calculated in relative difference;When the current video frame where unit to be encoded is two class video frame, obtain
Quantization parameter increment is calculated according to second adjustment coefficient and relative difference in second adjustment coefficient.
In order to further increase compression efficiency under the premise of guaranteeing subjective quality, it is directed to inhomogeneous video frame and sets
Different regulation coefficients is set, the video frame bigger for those frame third quantization parameters can accordingly set regulation coefficient
Set it is big a bit because the corresponding frame third quantization parameter of initial decoding frame is bigger, illustrate the picture quality of the script of the frame
It is very poor, so quality is unable to improve encoding using lesser quantization parameter now, and by the way that system will be adjusted
Number tunes up, and is conducive to further increase compression efficiency.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously
The limitation to the application the scope of the patents therefore cannot be interpreted as.It should be pointed out that for those of ordinary skill in the art
For, without departing from the concept of this application, various modifications and improvements can be made, these belong to the guarantor of the application
Protect range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.
Claims (1)
1. the method for video coding that a kind of pair of quantization parameter is limited characterized by comprising
The current decoded frame being decoded to the current video frame is obtained, each first coding in the current decoded frame is obtained
Corresponding first quantization parameter of unit;
Corresponding first quantization parameter of each first coding unit is ranked up, the smallest first quantization ginseng that will be obtained
Number is as the corresponding reference quantization parameter of unit to be encoded in the current video frame;
Calculate corresponding second quantization parameter of the unit to be encoded;
The relative difference between the corresponding reference quantization parameter of the unit to be encoded and corresponding second quantization parameter is calculated, when
When the relative difference is greater than or equal to threshold value, it is single to obtain each first coding in the corresponding current decoded frame of current video frame
Corresponding first quantization parameter of member carries out mean value computation according to corresponding first quantization parameter of each first coding unit and obtains
To third quantization parameter, third quantization parameter calculates the difference amplitude of the third quantization parameter and the reference quantization parameter,
Regulation coefficient is calculated according to the difference amplitude, the regulation coefficient is positively correlated with the difference amplitude, according to described
Quantization parameter increment is calculated in regulation coefficient and the relative difference, according to the quantization parameter increment and unit pair to be encoded
Target quantization parameter is calculated in the second quantization parameter answered, wherein described according to the regulation coefficient and the relative difference meter
Calculate the method for obtaining quantization parameter increment include: when the current video frame where the unit to be encoded is a kind of video frame,
The first adjustment coefficient is obtained, quantization parameter increment is calculated according to the first adjustment coefficient and the relative difference;Work as institute
When current video frame where stating unit to be encoded is two class video frame, second adjustment coefficient is obtained, according to the second adjustment
Quantization parameter increment is calculated in coefficient and the relative difference;
Coding unit is treated according to the Target quantization parameter to be encoded.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811324490.5A CN109660801A (en) | 2018-11-08 | 2018-11-08 | The method for video coding that quantization parameter is limited |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811324490.5A CN109660801A (en) | 2018-11-08 | 2018-11-08 | The method for video coding that quantization parameter is limited |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109660801A true CN109660801A (en) | 2019-04-19 |
Family
ID=66110154
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811324490.5A Pending CN109660801A (en) | 2018-11-08 | 2018-11-08 | The method for video coding that quantization parameter is limited |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109660801A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111586413A (en) * | 2020-06-05 | 2020-08-25 | 广州繁星互娱信息科技有限公司 | Video adjusting method and device, computer equipment and storage medium |
CN112004084A (en) * | 2019-05-27 | 2020-11-27 | 北京君正集成电路股份有限公司 | Code rate control optimization method and system by utilizing quantization parameter sequencing |
CN113115040A (en) * | 2021-04-20 | 2021-07-13 | 上海交通大学 | Visual lossless image compression method and device |
CN116828229A (en) * | 2023-08-30 | 2023-09-29 | 湖南马栏山视频先进技术研究院有限公司 | Transmission method and system for audio and video streams |
-
2018
- 2018-11-08 CN CN201811324490.5A patent/CN109660801A/en active Pending
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112004084A (en) * | 2019-05-27 | 2020-11-27 | 北京君正集成电路股份有限公司 | Code rate control optimization method and system by utilizing quantization parameter sequencing |
CN112004084B (en) * | 2019-05-27 | 2022-03-29 | 北京君正集成电路股份有限公司 | Code rate control optimization method and system by utilizing quantization parameter sequencing |
CN111586413A (en) * | 2020-06-05 | 2020-08-25 | 广州繁星互娱信息科技有限公司 | Video adjusting method and device, computer equipment and storage medium |
CN111586413B (en) * | 2020-06-05 | 2022-07-15 | 广州繁星互娱信息科技有限公司 | Video adjusting method and device, computer equipment and storage medium |
CN113115040A (en) * | 2021-04-20 | 2021-07-13 | 上海交通大学 | Visual lossless image compression method and device |
CN116828229A (en) * | 2023-08-30 | 2023-09-29 | 湖南马栏山视频先进技术研究院有限公司 | Transmission method and system for audio and video streams |
CN116828229B (en) * | 2023-08-30 | 2023-11-24 | 湖南马栏山视频先进技术研究院有限公司 | Transmission method and system for audio and video streams |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109660801A (en) | The method for video coding that quantization parameter is limited | |
EP3001885B1 (en) | Region-of-interest aware video coding | |
US9667980B2 (en) | Content-adaptive background skipping for region-of-interest video coding | |
US10645394B2 (en) | Method and apparatus for SSIM-based bit allocation | |
US20100272171A1 (en) | Self-adapting code rate distribution method of video image macro-block level | |
CN108574841B (en) | Coding method and device based on self-adaptive quantization parameter | |
WO2014139396A1 (en) | Video coding method using at least evaluated visual quality and related video coding apparatus | |
CN109660825A (en) | Video transcoding method, device, computer equipment and storage medium | |
WO2004056124A1 (en) | Method of selecting among n 'spatial video codecs' the optimum codec for a same input signal | |
KR20080063352A (en) | Two pass rate control techniques for video coding using a min-max approach | |
US20200068200A1 (en) | Methods and apparatuses for encoding and decoding video based on perceptual metric classification | |
US9560386B2 (en) | Pyramid vector quantization for video coding | |
US20060256858A1 (en) | Method and system for rate control in a video encoder | |
WO2022021422A1 (en) | Video coding method and system, coder, and computer storage medium | |
US8687710B2 (en) | Input filtering in a video encoder | |
Sanz-Rodríguez et al. | A rate control algorithm for HEVC with hierarchical GOP structures | |
US9503740B2 (en) | System and method for open loop spatial prediction in a video encoder | |
EP3434014A1 (en) | Complexity control of video codec | |
CN116437090B (en) | Efficient parallelizable image compression code rate control method and processing equipment | |
US20220264111A1 (en) | Video coding efficiency improvement using dynamic frame boost scaling | |
US11330258B1 (en) | Method and system to enhance video quality in compressed video by manipulating bit usage | |
US11979587B2 (en) | Hybrid inter-frame coding using an autoregressive model | |
Huang et al. | A novel two-pass VBR coding algorithm for the H. 264/AVC video coder based on a new analytical RD model | |
US8064526B2 (en) | Systems, methods, and apparatus for real-time encoding | |
Wu et al. | A content-adaptive distortion-quantization model for intra coding in H. 264/AVC |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20190419 |