CN109618156A - A kind of video frequency coding rate method of adjustment - Google Patents

A kind of video frequency coding rate method of adjustment Download PDF

Info

Publication number
CN109618156A
CN109618156A CN201811342342.6A CN201811342342A CN109618156A CN 109618156 A CN109618156 A CN 109618156A CN 201811342342 A CN201811342342 A CN 201811342342A CN 109618156 A CN109618156 A CN 109618156A
Authority
CN
China
Prior art keywords
frame
quantization parameter
graphic
current graphics
current
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
Application number
CN201811342342.6A
Other languages
Chinese (zh)
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.)
Jianhu Yunfei Data Technology Co Ltd
Original Assignee
Jianhu Yunfei Data Technology Co Ltd
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 Jianhu Yunfei Data Technology Co Ltd filed Critical Jianhu Yunfei Data Technology Co Ltd
Priority to CN201811342342.6A priority Critical patent/CN109618156A/en
Publication of CN109618156A publication Critical patent/CN109618156A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods 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/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods 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/17Methods 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/172Methods 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 picture, frame or field

Abstract

The present invention relates to a kind of video frequency coding rate methods of adjustment, the present invention is based in Hierarchical structure, video compression efficiency can be improved using different code rate ratios between layer layers different, by obtaining current Graphics frame and level to be encoded, the corresponding actual coding quantization parameter correction value of current Graphics frame is obtained according to level, obtain the corresponding reference quantization parameter of control graphic frame of current Graphics frame, the corresponding actual coding quantization parameter of current Graphics frame is obtained according to reference quantization parameter and actual coding quantization parameter correction value, Data Rate Distribution is carried out to current Graphics frame according to actual coding quantization parameter, code efficiency can be improved using the present invention.

Description

A kind of video frequency coding rate method of adjustment
Technical field
The present invention relates to field of video encoding, more particularly to a kind of video frequency coding rate method of adjustment.
Background technique
In traditional video coding technique, Data Rate Distribution bidirectional interframe predictive only is carried out to MB of prediction frame control graphic frame Frame is controlled without code rate, and carries out Data Rate Distribution using the quantization parameter of nearest MB of prediction frame control graphic frame, due to Its quantization parameter is relatively fixed, causes it to have the shortcomings that more obvious, video compression efficiency is lower.
Summary of the invention
Based on this, the present invention provides a kind of video frequency coding rate method of adjustment,
A kind of video frequency coding rate method of adjustment provided by the invention, comprising:
Obtain the level of current Graphics frame and the current Graphics frame;According to the level and preset quantization parameter The corresponding actual coding quantization parameter correction value of the current Graphics frame is obtained in correction value database, wherein the quantization parameter The corresponding relationship of each level and corresponding quantization parameter correction values in video coding and layering structure is maintained in correction value database; The control frame type and its actual coding quantization parameter for obtaining the corresponding control graphic frame of the current Graphics frame, wherein described right Control frame type according to graphic frame is bidirectional interframe predictive frame B frame, according to the control frame type and the actual coding amount Change parameter and obtains the corresponding reference quantization parameter of the control graphic frame;Obtain each control graphic frame and the current figure Frame pitch between shape frame obtains the corresponding weight of the current control graphic frame, the frame according to the obtained frame pitch Spacing and weight are negative correlativing relation, according to each corresponding weight of control graphic frame and corresponding reference quantization parameter Obtain corresponding first quantization parameter of the current Graphics frame;According to corresponding first quantization parameter of the current Graphics frame and The actual coding quantization parameter correction value obtains the corresponding actual coding quantization parameter of the current Graphics frame, according to the reality Border coded quantization parameter carries out Data Rate Distribution to the current Graphics frame.
Further, the step for carrying out Data Rate Distribution to the current Graphics frame according to the actual coding quantization parameter Suddenly include:
The corresponding current quantisation step-length of the current Graphics frame is obtained according to the actual coding quantization parameter;According to described Current quantisation step-length carries out Data Rate Distribution to the current Graphics frame, obtains the corresponding current code rate of the current Graphics frame;It obtains Take the quantization corrected parameter between the graphic frame and single directional prediction frame of the preset level;It is corresponding according to the current Graphics frame Current code rate and the quantization corrected parameter obtain corresponding calculating degree and update numerical value;Before the current Graphics frame Numerical value, which is updated, to the corresponding image complexity parameter of graphic frame and the calculating degree obtains updated image complexity parameter; Obtain the corresponding frame type of the posterior backward graphic frame of the corresponding coding of the current Graphics frame;When the backward graphic frame is When non-bidirectional prediction frame, according to preset code rate Controlling model and the updated image complexity parameter obtain it is described after To the corresponding quantization parameter of graphic frame.
Above-mentioned video frequency coding rate method of adjustment provided by the invention, when to carry out Data Rate Distribution to current Graphics frame, Current Graphics frame level locating in the graphic frame group at place is obtained, the corresponding amount of current Graphics frame is then obtained according to level Change parameter correction values, and the corresponding reference quantization parameter of control graphic frame for obtaining current Graphics frame, according to reference quantization parameter And quantization parameter correction value obtains the corresponding actual coding quantization parameter of current Graphics frame, quantifies to join thus according to actual coding Several pairs of current Graphics frames carry out Data Rate Distribution, the corresponding quantization parameter of level as locating for through current Graphics frame to be encoded Correction value and the corresponding actual coding quantization parameter of control graphic frame obtain the corresponding actual coding quantization ginseng of current Graphics frame Number, computation complexity is small, and the needs for adapting to different levels graphic frame flexibly change quantization parameter correction values, code efficiency It is high.
Detailed description of the invention
Fig. 1 is the flow chart of the video frequency coding rate method of adjustment provided in one embodiment.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
A kind of video frequency coding rate method of adjustment provided in an embodiment of the present invention, refering to what is shown in Fig. 1, main includes following step It is rapid:
Step 1, the level for obtaining current Graphics frame and the current Graphics frame;
Step 2 obtains the current Graphics frame according in the level and preset quantization parameter correction value database Corresponding actual coding quantization parameter correction value, wherein maintaining video coding and layering in the quantization parameter correction value database The corresponding relationship of each level and corresponding quantization parameter correction values in structure;
Step 3, the control frame type and its actual coding quantization for obtaining the corresponding control graphic frame of the current Graphics frame Parameter, wherein the control frame type of the comparative diagram shape frame is bidirectional interframe predictive frame B frame, according to the control frame type and The actual coding quantization parameter obtains the corresponding reference quantization parameter of the control graphic frame;
Step 4 obtains each frame pitch compareed between graphic frame and the current Graphics frame, according to obtained institute It states frame pitch and obtains the corresponding weight of the current control graphic frame, the frame pitch and weight are negative correlativing relation, according to institute It states the corresponding weight of each control graphic frame and corresponding reference quantization parameter obtains the current Graphics frame corresponding first Quantization parameter;
Step 5 is repaired according to corresponding first quantization parameter of the current Graphics frame and the actual coding quantization parameter Positive value obtains the corresponding actual coding quantization parameter of the current Graphics frame, is worked as according to the actual coding quantization parameter to described Preceding graphic frame carries out Data Rate Distribution.
When carrying out Video coding, since the content of frame each in video image is different, complexity is also different, therefore encodes Each frame video bits number all constantly changes, and transmission channel is also constantly changing, and therefore, it is necessary to encoder is arranged Balance code bit rate and bandwidth are come in buffer area.
In a specific embodiment, the method can specifically include following steps:
Step 1 obtains current Graphics frame to be encoded.
Specifically, video is made of image sequence.Each image can be considered as a frame.Current Graphics frame refers to currently Need to carry out the graphic frame of Data Rate Distribution.When to carry out Data Rate Distribution to video, sequence of video images is input to video and is compiled In code device, video encoder obtains graphic frame to be encoded according to preset sequence and carries out Data Rate Distribution.
Step 2 obtains current Graphics frame level locating in the graphic frame group at place, and graphic frame group includes multiple figures Shape frame, the level of graphic frame is obtained according to preset encoded hierarchy structure in graphic frame group.
Graphic frame group (Group Of Picture, GOP) refers to one group of continuous image, can will be in sequence of video images Continuous a few width graphic frames form a group, carry out arbitrary access editor to facilitate.Graphic frame in one graphic frame group Number can be specifically configured according to actual needs, such as can be 8.It may include I frame, P frame and B frame three in graphic frame group The frame of seed type.Wherein I frame is intra prediction frame, and P frame is single directional prediction frame, can be predicted using inter-prediction mode.B Frame is bi-directional predicted frames, can be predicted with reference to the graphic frame of front or with reference to subsequent graphic frame.Telescopic video Vision signal is carried out hierarchical coding by (Scalable Video Coding, the SVC) technology of coding, can adapt dynamically to net Network bandwidth changes and meets user demand.Encoded hierarchy structure be it is pre-set, encoded hierarchy structure middle layer can be set Referring-to relation between secondary number, corresponding graphic frame at all levels and graphic frame.It is high-level in encoded hierarchy structure Graphic frame can carry out Data Rate Distribution with reference to the graphic frame of low level.Level in encoded hierarchy structure specifically can be according to reality It needs to be arranged, for example, the level of graphic frame group can be 2 layers, 3 layers or 4 layers.Graphic frame is obtained according to encoded hierarchy structure The coded sequence of graphic frame in group carries out Data Rate Distribution to the graphic frame in graphic frame group, after obtaining current Graphics frame, can obtain To the corresponding level of current Graphics frame.
By taking preset encoded hierarchy structure is time hierarchical B-frame coding hierarchical structure as an example, a graphic frame group includes 8 Graphic frame, the B frame of graphic frame group are divided into 3 layers: B0 layer, B1 layers and B2 layers, wherein B0 layers be the 4th B frame, B1 layer be the 2nd with And the 6th B frame, remaining is B2 layers.In hierarchical coding hierarchical structure, high-level graphic frame can refer to the figure of low level Shape frame carries out Data Rate Distribution, for example, the control graphic frame of B0 layers of graphic frame is the P frame at both ends.B2 layers of graphic frame can join It examines B1 layers of graphic frame and carries out Data Rate Distribution.It is appreciated that time hierarchical B-frame coding structure is not limited to three layers of coding structure, Such as it can be the coding structures such as two layers, four layers.
Step 3 obtains the corresponding actual coding quantization parameter correction value of current Graphics frame according to level.
The prediction residual that graphic frame is predicted is quantified after being converted to reach and reduce data volume Prediction residual is carried out the value after discrete cosine transform when quantization and is mapped to lesser numerical value by purpose, for example, can by divided by Quantization step obtains a lesser value.Quantization parameter is the serial number of quantization step, can find correspondence according to quantization parameter Quantization step.Quantization parameter is small, then the most details of graphic frame can be all retained, and corresponding code rate is high.Quantization parameter Greatly, then corresponding code rate is low, but image fault is larger, of low quality.That is the relationship that is negatively correlated of quantization parameter and code rate, is being compiled The basic skills that code rate controls during code is exactly to control the corresponding code rate of image by adjusting quantization parameter.Quantization parameter is repaired Positive value refers to that the graphic frame of coding compares the quantization parameter deviant of graphic frame relative to it.Each level pair can be preset The quantization parameter correction value answered, can specifically be configured according to actual needs.It is high-level due in layered encoding structure Graphic frame can carry out Data Rate Distribution with reference to the graphic frame of low level, therefore the higher graphic frame of level is referenced number less, layer Secondary lower graphic frame is referenced often, therefore the corresponding quantization parameter correction value of the high quantization parameter of level can be set Greatly.I.e. the level of graphic frame and quantization parameter correction value are positive correlation, to improve the compression efficiency of Video coding.
Step 4 obtains the corresponding reference quantization parameter of control graphic frame of current Graphics frame.
For control graphic frame for predicting the graphic frame of coding, the choosing method for compareing graphic frame can be according to reality It needs to be configured.Control graphic frame is to select the control figure come from the candidate control graphic frame list of current Graphics frame Frame.Control graphic frame can for example be selected based on space similarity etc..It in one embodiment, is B with current Graphics frame For frame, that is, bi-directional predicted frames, there are two candidate control figure frame sequences for each B frame, can take two candidate comparative diagrams respectively First graphic frame of shape frame sequence is as control graphic frame.Reference quantization parameter can be control graphic frame and carry out Data Rate Distribution When actual coding quantization parameter.In one embodiment, it can be combined with the corresponding actual coding quantization ginseng of control graphic frame Several and corresponding quantization parameter correction value obtains reference quantization parameter.For example, reference quantization parameter is that control graphic frame is corresponding Actual coding quantization parameter subtract the corresponding quantization parameter correction value of the control graphic frame.In one embodiment, if control There are multiple actual coding quantization parameters, such as the corresponding quantization parameter of each coding unit in graphic frame, then reference quantization is joined Number can be the average value of quantization parameter in control graphic frame.
In the step 4, the step of obtaining the control graphic frame corresponding reference quantization parameter of current Graphics frame, includes:
First, it obtains the control frame type of control graphic frame and compares the actual coding quantization parameter of graphic frame.
Compareing frame type may include I frame, B frame and P frame.The type of control graphic frame specifically can according to need setting Or it is arranged by different video encoding standards.Such as in some video encoding standards such as H26.3, B frame cannot function as comparative diagram Shape frame.And in some video encoding standards, B frame can be as control graphic frame.The actual coding for compareing graphic frame quantifies ginseng Number refers to the quantization parameter used when carrying out Data Rate Distribution to control graphic frame.
Second, the corresponding reference quantization of control graphic frame is obtained according to control frame type and actual coding quantization parameter and is joined Number.
The corresponding actual coding quantization parameter of control graphic frame can be adjusted according to the difference of control frame type To reference quantization parameter.Such as I frame and P frame, can will compare the corresponding actual coding quantization parameter of graphic frame as Reference quantization parameter.For B frame, since B frame has many levels, the corresponding quantization parameter correction value of different levels is different, therefore Reference quantization parameter can be obtained in conjunction with quantization parameter correction values and actual coding quantization parameter.For example, when control graphic frame When for B frame, the corresponding actual coding quantization parameter of graphic frame will be compareed and subtract the corresponding quantization parameter correction value of control graphic frame Obtain reference quantization parameter.
It is corresponding to obtain current Graphics frame according to reference quantization parameter and actual coding quantization parameter correction value for step 5 Actual coding quantization parameter.
The corresponding practical volume of current Graphics frame is obtained in conjunction with reference quantization parameter and actual coding quantization parameter correction value Code quantization parameter.In one embodiment, actual coding quantization parameter can be reference quantization parameter and actual coding quantization is joined The sum of number correction value.In one embodiment, when current Graphics frame is bi-directional predicted frames, due to there are two control graphic frames, Therefore the frame pitch that can be combined with control graphic frame and current Graphics frame obtains actual coding quantization parameter.For example, setting frame The corresponding weight of spacing is somebody's turn to do according to the corresponding weight of control graphic frame and the actual coding quantization parameter for compareing graphic frame The corresponding influence value of graphic frame is compareed, obtains actual coding quantization further according to influence value and actual coding quantization parameter correction value Parameter.
In the step 5, current Graphics frame is bi-directional predicted frames, obtains the corresponding reality of current Graphics frame according to level The step of coded quantization parameter correction values includes:
The first, the quantization corrected parameter between the graphic frame and single directional prediction frame of preset level is obtained.It can be each Corresponding quantization corrected parameter is arranged in the level of coding structure.Quantization parameter correction value is calculated according to quantization corrected parameter 's.The public affairs that quantization offset is obtained by quantization corrected parameter can be obtained according to the corresponding relationship of quantization step and quantization parameter Formula, such as current luminance coding, quantization step shares 52 values, is the integer between 0~51, and quantify ginseng Several to have correlation with quantization step, quantization parameter increases with the increase of quantization step, whenever quantization parameter increase by 6, amount Change for parameter just doubles, quantization parameter correction value be with 2 be bottom quantization corrected parameter logarithm and 6 product.With Formula is expressed as follows: pbOffset_i=6*log2(pbFactor_i) .. is indicated wherein, and i-th layer of PbOffset_i expression is right The quantization parameter correction value answered, PbFactor_i indicate i-th layer of corresponding quantization corrected parameter.Quantify corrected parameter specific value It can according to need or experience is preset.Since the number that high-level graphic frame is referenced is few, can quantify to repair The level of positive parameter and encoded hierarchy structure can be with positive correlation.I.e. level is high, and corresponding quantization corrected parameter is big.Therefore High-level corresponding quantization parameter is big, and code rate is also low.In one embodiment, B0 layers, B1 layers and B2 layers corresponding quantization are repaired Positive parameter can be respectively 1.05,1.10 and 1.15.
The second, the corresponding actual coding quantization parameter correction value of current Graphics frame is obtained according to quantization corrected parameter.It obtains After quantifying corrected parameter, it is corresponding that current Graphics frame can be obtained according to obtained quantization corrected parameter and corresponding calculation formula Actual coding quantization parameter correction value.
Step 6 carries out Data Rate Distribution to current Graphics frame according to actual coding quantization parameter.
It specifically includes, the corresponding current quantisation step-length of current Graphics frame is obtained according to actual coding quantization parameter, obtains reality After the coded quantization parameter of border, the corresponding amount of actual coding quantization parameter is obtained according to quantization parameter and the corresponding relationship of quantization step Change step-length as current quantisation step-length.And Data Rate Distribution is carried out to current Graphics frame according to current quantisation step-length, it obtains current The corresponding current code rate of graphic frame, code rate refer to the data bits of unit time transmission.Current code rate refers to be walked with current quantisation Corresponding code rate after the long coding progress Data Rate Distribution to current Graphics frame.Code rate unit can be the bit number of transmission per second, code Rate is higher, and transmission data speed is faster.Data Rate Distribution is carried out according to current quantisation step-length, current Graphics frame is corresponding after being encoded Current code rate.
It is previously provided with the corresponding relationship of quantization parameter and quantization step, therefore can be obtained according to actual coding quantization parameter Corresponding quantization step is got, quantization encoding is carried out to current Graphics frame according to quantization step.For example, in general, quantization Principle is formulated as follows: FQ=round (y/Qstep).Wherein, the corresponding value of graphic frame before y is quantization, Qstep are Quantization step, FQ are the quantized value of y.Round (x) function, which refers to, round up by the value after quantization taking idol.Quantization parameter with The corresponding relationship of quantization step, which specifically can according to need, to be configured.For example, in current video encoding standard, for bright For degree coding, quantization step shares 52 values, is the integer between 0~51, for chroma coder, the value of quantization step is Integer between 0~39, and quantization step increases with the increase of quantization parameter, whenever quantization parameter increases by 6, quantization is walked Length just doubles.It, can be with it is appreciated that when quantization parameter is integer in the corresponding relationship of quantization parameter and quantization step Actual coding quantization parameter is rounded, rounding method can be round number.
Above-mentioned video frequency coding rate method of adjustment can be used for the compression of video file, such as the compression of wechat small video. When to carry out Data Rate Distribution to current Graphics frame, current Graphics frame level locating in the graphic frame group at place is obtained, so The corresponding quantization parameter correction value of current Graphics frame is obtained according to level afterwards, and the control graphic frame for obtaining current Graphics frame is corresponding Reference quantization parameter, the corresponding actual coding of current Graphics frame is obtained according to reference quantization parameter and quantization parameter correction value Quantization parameter carries out Data Rate Distribution to current Graphics frame thus according to actual coding quantization parameter, due to working as by be encoded The corresponding quantization parameter correction value of level locating for preceding graphic frame and the corresponding actual coding quantization parameter of control graphic frame obtain To the corresponding actual coding quantization parameter of current Graphics frame, computation complexity is small, and adapts to the needs of different levels graphic frame Flexibly change quantization parameter correction values, code efficiency is high.
When current Graphics frame is B frame, that is, bi-directional predicted frames, can use provided in an embodiment of the present invention according to comparative diagram The method that the reference quantization parameter and actual coding quantization parameter correction value of shape frame obtain actual coding quantization parameter.And work as Preceding graphic frame is P frame, then the corresponding actual coding quantization parameter of current Graphics frame can be calculated according to code rate Controlling model, To control code rate, avoid code rate error big.Code rate Controlling model can use RM8 (reference mode 8) and VM8 (verification mode 8) etc., specifically with no restrictions.And when current Graphics frame is I frame, mould can be controlled using code rate The corresponding actual coding quantization parameter of current Graphics frame is calculated in type, and the quantization parameter that P frame also can be set relative to I frame is repaired Then positive value obtains current Graphics frame relative to the quantization parameter correction value of I frame according to the corresponding quantization parameter of P frame and P frame Corresponding actual coding quantization parameter.In one embodiment, the corresponding quantization parameter of I frame is the corresponding actual coding amount of P frame Change parameter and subtract quantization parameter correction value of the P frame relative to I frame, is i.e. the corresponding quantization parameter of I frame ratio P frame is small, the corresponding volume of I frame Code precision is high, and image fault degree is small.It can choose actual coding quantization parameter corresponding with the P frame that I frame is nearest and subtract P frame phase For the quantization parameter correction value of I frame.
Current Graphics frame is bi-directional predicted frames, obtains control figure according to control frame type and actual coding quantization parameter The step of frame corresponding reference quantization parameter includes: to obtain control graphic frame in institute when compareing frame type is bi-directional predicted frames Graphic frame group in locating level.Control graphic frame pair is obtained according to control graphic frame level locating in graphic frame group The reference quantization parameter correction values answered.It is repaired according to actual coding quantization parameter and the corresponding reference quantization parameter of control graphic frame Positive value obtains stating the corresponding reference quantization parameter of control graphic frame.
The corresponding quantization parameter correction value of level where reference quantization parameter correction values refer to control graphic frame.Due to graphic frame When for bi-directional predicted frames, need to obtain quantization parameter correction value according to the corresponding level of graphic frame, and corrected according to quantization parameter Value and the reference quantization parameter for compareing graphic frame obtain corresponding actual coding quantization parameter, therefore, if control graphic frame is When bi-directional predicted frames, the corresponding actual coding quantization parameter of control graphic frame is also with the corresponding quantization of level where itself What parameter correction values and its corresponding reference quantization parameter of comparative diagram shape frame obtained.Therefore when control graphic frame is bi-directional predicted When frame, need to obtain control graphic frame level locating for graphic frame group, and locating in graphic frame group according to control graphic frame Level obtain the corresponding reference quantization parameter correction values of control graphic frame.Then quantified according to the actual coding of control graphic frame Parameter and the corresponding reference quantization parameter correction values of control graphic frame obtain stating the corresponding reference quantization parameter of control graphic frame. For example, reference quantization parameter is the difference of actual coding quantization parameter and reference quantization parameter correction values.Specifically it can according to need It is configured.
Step 7 obtains the graphic frame of preset level and the quantization corrected parameter of single directional prediction frame.
Quantization parameter correction value is calculated according to quantization corrected parameter.Due to the actual coding amount of current Graphics frame Changing parameter is obtained according to the actual coding quantization parameter correction value of current Graphics frame, so calculating image complexity parameter When the corresponding code rate of current Graphics frame can be corrected according to quantization corrected parameter, the code rate after being corrected calculates pair again The image complexity parameter answered, to improve the accuracy of image complexity parameter.
Step 8 obtains corresponding calculating degree more according to the corresponding current code rate of current Graphics frame and quantization corrected parameter New numerical value.
Image complexity parameter is used to indicate the complexity of graphic frame.Image complexity parameter is in code rate Controlling model A parameter, for calculating the quantization step of graphic frame.Image complexity parameter is bigger, then illustrates that the information such as image texture are got over Complexity needs higher code rate to be transmitted.Calculating degree updates numerical value for being updated to image complexity parameter, with can Dynamically update the complexity parameter of image.
Step 9 updates number according to the corresponding image complexity parameter of the forward direction graphic frame of current Graphics frame and calculating degree Value obtains updated image complexity parameter.
The image complexity that the corresponding image complexity parameter of forward direction graphic frame updates after encoding before referring to graphic frame Parameter.Forward direction graphic frame refers to the graphic frame that Data Rate Distribution is carried out before current Graphics frame.It can be a graphic frame, with can Timely update image complexity parameter, naturally it is also possible to be other forward direction graphic frames, specifically can according to need and be configured.Benefit Numerical value is updated with calculating degree to be updated to preceding to the corresponding image complexity parameter of graphic frame, and it is complicated to obtain updated image Parameter is spent, to be updated to the image complexity parameter in code rate Controlling model.
Calculating degree updates numerical value and is obtained according to the corresponding correction code rate of current Graphics frame and current quantisation step-length.After update Image complexity parameter can be current Graphics frame the corresponding image complexity parameter of forward direction graphic frame and calculatings degree update The sum of numerical value is formulated as follows:
Wherein, if current Graphics frame it is suitable Sequence is jth frame, and the previous frame of forward direction is j-1 frame, and the complexity parameter after coding -1 graphic frame of jth is cplxsumj-1, BitjIt is the jth frame i.e. corresponding code rate of current Graphics frame, ScalejIt is the corresponding current quantisation step-length of jth frame, if current Graphics frame It is divided into multiple coding units, each coding unit corresponds to a quantization step, then ScalejIt is corresponding to can be current Graphics frame Average quantiser step size.PbFactor_i indicates the quantization corrected parameter of i-th layer of bi-directional predicted frames and single directional prediction frame.pre_ paramjIt is the preanalysis parameter of jth frame, can is the jth frame, that is, corresponding SAD of current Graphics frame (Sum of Absolute Difference, absolute error and), SAD refer to the predicted value of current Graphics frame and the absolute error of actual value and.
Step 10 obtains the corresponding frame type of the posterior backward graphic frame of the corresponding coding of current Graphics frame.
Forward direction graphic frame refers to the graphic frame that Data Rate Distribution is carried out after current Graphics frame.It can be next graphic frame, when So it is also possible to other backward graphic frames, specifically can according to need and be configured.The type of frame may include include I frame, B frame And P frame.
Step 11, when it is rear to graphic frame be non-bidirectional prediction frame when, according to preset code rate Controlling model and update Image complexity parameter afterwards obtain after to the corresponding quantization parameter of graphic frame.
Non-bidirectional prediction frame includes I frame and P frame, naturally it is also possible to be P frame just according to preset code rate Controlling model and Updated image complexity parameter obtain after to the corresponding quantization parameter of graphic frame.Image complexity is joined in code rate Controlling model Number is model parameter, therefore updates code rate Controlling model using updated image complexity parameter, according to code rate Controlling model To the corresponding quantization parameter of graphic frame after obtaining.Code rate Controlling model, which specifically can according to need, to be configured.Such as it can be TM5 (test mode 5) algorithm.Due to it is rear to graphic frame be non-bidirectional prediction frame when using code rate Controlling model calculating after to The quantization parameter of graphic frame, therefore can make the error of video code rate will not be excessive with increasing for graphic frame.
Step 12 obtains the frame pitch between each control graphic frame and current Graphics frame.
Specifically, frame pitch can be indicated with graphic frame and the frame number of figure frame period, can also use graphic frame and figure The time difference of display time between frame indicates.The frame number of graphic frame and figure frame period can be suitable with the display between graphic frame Sequence difference indicates.For example, current Graphics frame is the 6 of the same graphic frame group if control graphic frame is the 2nd frame of graphic frame group Frame, then frame pitch is 4.Compareing graphic frame can be 2, for example, the control graphic frame of B frame is 2.
Step 13, according to the frame pitch and corresponding reference quantization between each control graphic frame and current Graphics frame Corresponding first quantization parameter of current Graphics frame is calculated in parameter.
The corresponding proportionality coefficient of frame pitch can be set, then obtained according to proportionality coefficient and corresponding reference quantization parameter To corresponding first quantization parameter of graphic frame.It in one embodiment, can be according to current control graphic frame and current Graphics frame Between frame pitch obtain currently compareing the corresponding weight of graphic frame, then according to the corresponding weight of each control graphic frame and Corresponding reference quantization parameter obtains corresponding first quantization parameter of current Graphics frame.Frame pitch and weight can close to be negatively correlated System, so that the control graphic frame corresponding quantization parameter close from current Graphics frame pitch influences the quantization parameter of current Graphics frame Greatly.In one embodiment, weight can be the inverse of frame pitch.
Using current Graphics frame as bi-directional predicted frames, compare there are two graphic frames, first control graphic frame and current Graphics Frame pitch is n1The reference quantization parameter of frame, first control graphic frame is equal to qp1, second control graphic frame and current Graphics Frame pitch is n2The reference quantization parameter of frame, second control graphic frame is equal to qp2.Wherein n1And n2It is all positive integer, then first Quantization parameter is equal to the reference quantization parameter of two control graphic frames and the weighted average of weight, wherein first control figure The weight of the quantization parameter of frame is the frame pitch of the second control graphic frame and current Graphics frame and the ratio of total frame pitch.Second The weight of the quantization parameter of a control graphic frame is the frame pitch and total frame pitch of the first control graphic frame and current Graphics frame Ratio, according to it is each control graphic frame and current Graphics frame between frame pitch and corresponding reference quantization parameter calculate It can be as follows shown in formula to corresponding first quantization parameter of current Graphics frame.
Step 14 is obtained according to corresponding first quantization parameter of current Graphics frame and actual coding quantization parameter correction value To the corresponding actual coding quantization parameter of current Graphics frame.
Specifically, to obtain current Graphics frame in conjunction with the first quantization parameter and actual coding quantization parameter correction value corresponding Actual coding quantization parameter.In one embodiment, actual coding quantization parameter can be the first quantization parameter and actual coding The sum of quantization parameter correction value.
In one embodiment, current Graphics frame is bi-directional predicted frames, and control graphic frame is two.Step S210, that is, root The corresponding actual coding quantization parameter of current Graphics frame is obtained according to reference quantization parameter and actual coding quantization parameter correction value The step of further include judging to compare whether graphic frame is I frame, in one embodiment, if in control graphic frame one of them is right It is I frame according to graphic frame, another control graphic frame is P frame, then does not execute step S802~806, and be P frame according to frame type It is corresponding that the sum of the corresponding reference quantization parameter of control graphic frame and actual coding quantization parameter correction value obtains current Graphics frame Actual coding quantization parameter.In one embodiment, if one of control graphic frame in control graphic frame is I frame, separately One control graphic frame is B frame, then does not execute step S802~806, and corresponding according to the control graphic frame that frame type is B frame Reference quantization parameter and the sum of actual coding quantization parameter correction value obtain the corresponding actual coding quantization of current Graphics frame Parameter.It in one embodiment, can be according to two control figures if two graphic frames in control graphic frame are I frame The actual coding quantization parameter of frame obtains the second quantization parameter, obtains further according to the sum of the second quantization parameter and default value Actual coding quantization parameter.Second quantization parameter can be the mean value of the actual coding quantization parameter of two control graphic frames.In advance If numerical value can be configured according to actual needs.For example, default value can be corrected for P frame relative to the quantization parameter of I frame Value.
Below with time hierarchical B-frame coding hierarchical structure, graphic frame group includes 8 graphic frames, and the type of 8 graphic frames is First 7 are B frame, the last one is P frame, is illustrated to video frequency coding rate method of adjustment provided in this embodiment.
1, the graphic frame of first progress Data Rate Distribution is the last one graphic frame in graphic frame group, therefore obtains graphic frame The last one graphic frame of group, since current Graphics frame is P frame, according to the code rate Controlling model and target bit rate meter of setting The quantization parameter for calculating the last one graphic frame of graphic frame group carries out code rate point to the graphic frame according to the quantization parameter being calculated Match.
2, the 4th graphic frame for obtaining graphic frame group, obtaining the 4th graphic frame is B frame, and is B0 layers, therefore obtain B0 The corresponding quantization parameter correction value of layer.
3,2 control graphic frames for obtaining the 4th graphic frame, obtain the corresponding actual coding amount of this 2 control graphic frames Change parameter and frame type, if control graphic frame is B frame, obtains the corresponding quantization parameter of level locating for control graphic frame and repair Positive value, the difference of computation map shape frame corresponding actual coding quantization parameter and quantization parameter correction value, obtains each control The corresponding reference quantization parameter of graphic frame.If compareing graphic frame is I frame or P frame, the corresponding actual coding of graphic frame will be compareed Quantization parameter is as reference quantization parameter.
If 4, having one in 2 control graphic frames of the 4th graphic frame is I frame, by the ginseng of the control graphic frame of non-I frame It examines quantization parameter quantization parameter correction value corresponding with B0 layers to be added, obtains the corresponding actual coding quantization ginseng of the 4th graphic frame Number, i.e. actual coding quantization parameter.If being all I frame in 2 control graphic frames of the 4th graphic frame, two comparative diagrams are calculated The mean value of the corresponding reference quantization parameter of shape frame, quantization parameter correction value of the mean value with the P frame of setting relative to I frame are added, then In addition quantization parameter correction value corresponding with B0 layers, obtains the corresponding actual coding quantization parameter of the 4th graphic frame.Ruo Ruo 4 Be not I frame in 2 control graphic frames of a graphic frame, then obtain the two control graphic frames respectively with the 4th graphic frame The corresponding weight of control graphic frame is calculated according to frame pitch in frame pitch, then according to the corresponding weight of each graphic frame with And corresponding reference quantization parameter obtains weighted average, and obtained weighted average quantization parameter corresponding with B0 layers is corrected Value addition obtains the corresponding actual coding quantization parameter of the 4th graphic frame.
5, Data Rate Distribution is carried out to the 4th graphic frame according to the corresponding actual coding quantization parameter of the 4th graphic frame.
6, the 4th corresponding code rate of graphic frame and B0 layers of corresponding quantization corrected parameter are obtained, the 4th figure is calculated The corresponding image complexity parameter of shape frame, and update code rate using the corresponding image complexity parameter of the 4th graphic frame and control mould Image complexity parameter in type.
7, the 2nd graphic frame, the 6th graphic frame, the 1st graphic frame, the 3rd graphic frame, the 5th figure are successively obtained Frame, the 7th graphic frame carry out Data Rate Distribution, the process of coding be referred to the 4th graphic frame performed by step 2~6 Process, details are not described herein.
8, according to the last one graphic frame for obtaining next graphic frame group, i.e. P frame, according to code rate Controlling model and the 7th The corresponding quantization ginseng of the last one graphic frame that next graphic frame group is calculated in the corresponding image complexity parameter of a graphic frame Number.
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
Only several embodiments of the present invention are expressed for above embodiments, and the description thereof is more specific and detailed, but can not Therefore limitations on the scope of the patent of the present invention are interpreted as.It should be pointed out that for those of ordinary skill in the art, Without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to protection model of the invention It encloses.Therefore, the scope of protection of the patent of the invention shall be subject to the appended claims.

Claims (2)

1. a kind of video frequency coding rate method of adjustment, which is characterized in that the described method includes:
Obtain the level of current Graphics frame and the current Graphics frame;
According to obtaining the corresponding reality of the current Graphics frame in the level and preset quantization parameter correction value database Coded quantization parameter correction values, wherein being maintained in the quantization parameter correction value database each in video coding and layering structure The corresponding relationship of level and corresponding quantization parameter correction values;
The control frame type and its actual coding quantization parameter of the corresponding control graphic frame of the current Graphics frame are obtained, wherein institute The control frame type for stating control graphic frame is bidirectional interframe predictive frame B frame, according to the control frame type and the practical volume Code quantization parameter obtains the corresponding reference quantization parameter of the control graphic frame;
The frame pitch between each control graphic frame and the current Graphics frame is obtained, is obtained according to the obtained frame pitch To the corresponding weight of the current control graphic frame, the frame pitch and weight are negative correlativing relation, according to each control The corresponding weight of graphic frame and corresponding reference quantization parameter obtain corresponding first quantization parameter of the current Graphics frame;
Institute is obtained according to corresponding first quantization parameter of the current Graphics frame and the actual coding quantization parameter correction value State the corresponding actual coding quantization parameter of current Graphics frame, according to the actual coding quantization parameter to the current Graphics frame into Row Data Rate Distribution.
2. the method according to claim 1, wherein described work as according to the actual coding quantization parameter to described Preceding graphic frame carries out the step of Data Rate Distribution and includes:
The corresponding current quantisation step-length of the current Graphics frame is obtained according to the actual coding quantization parameter;
Data Rate Distribution is carried out to the current Graphics frame according to the current quantisation step-length, it is corresponding to obtain the current Graphics frame Current code rate;
Obtain the quantization corrected parameter between the graphic frame and single directional prediction frame of the preset level;
Corresponding calculating degree is obtained according to the corresponding current code rate of the current Graphics frame and the quantization corrected parameter to update Numerical value;
Numerical value is updated according to the corresponding image complexity parameter of the forward direction graphic frame of the current Graphics frame and the calculating degree Obtain updated image complexity parameter;
Obtain the corresponding frame type of the posterior backward graphic frame of the corresponding coding of the current Graphics frame;
When the backward graphic frame is non-bidirectional prediction frame, according to preset code rate Controlling model and the updated figure As complexity parameter obtains the corresponding quantization parameter of the backward graphic frame.
CN201811342342.6A 2018-11-13 2018-11-13 A kind of video frequency coding rate method of adjustment Pending CN109618156A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811342342.6A CN109618156A (en) 2018-11-13 2018-11-13 A kind of video frequency coding rate method of adjustment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811342342.6A CN109618156A (en) 2018-11-13 2018-11-13 A kind of video frequency coding rate method of adjustment

Publications (1)

Publication Number Publication Date
CN109618156A true CN109618156A (en) 2019-04-12

Family

ID=66003766

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811342342.6A Pending CN109618156A (en) 2018-11-13 2018-11-13 A kind of video frequency coding rate method of adjustment

Country Status (1)

Country Link
CN (1) CN109618156A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112165618A (en) * 2020-09-27 2021-01-01 北京金山云网络技术有限公司 Video coding method, device, equipment and computer readable storage medium
CN112165620A (en) * 2020-09-24 2021-01-01 北京金山云网络技术有限公司 Video encoding method and device, storage medium and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112165620A (en) * 2020-09-24 2021-01-01 北京金山云网络技术有限公司 Video encoding method and device, storage medium and electronic equipment
CN112165618A (en) * 2020-09-27 2021-01-01 北京金山云网络技术有限公司 Video coding method, device, equipment and computer readable storage medium
CN112165618B (en) * 2020-09-27 2022-08-16 北京金山云网络技术有限公司 Video coding method, device, equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN103561266B (en) The bit rate control method distributed based on logarithm R-Q model and stratification bit
CN103024387B (en) A kind of multi-view video rate control based on perception
CN109819253A (en) Method for video coding, device, computer equipment and storage medium
RU2420914C1 (en) Method and device for controlling coding speed and data medium storing programme to this end
CN109862359A (en) Bit rate control method, device and electronic equipment based on hierarchical B-frame
CN102186084B (en) Spatial enhancement layer code rate control realization method for scalable video coding
CN101572806B (en) Frame I code rate control method based on H264
CN102137258B (en) Method for controlling three-dimensional video code rates
CN1910934A (en) Encoder with adaptive rate control
CN101795415A (en) Method and device for controlling code rate in video coding
CN101159867A (en) Patch based self-adaptive code rate control method
CN101917614A (en) Bit rate control method based on H.264 hierarchical B-frame coding structure
CN103501438B (en) A kind of content-adaptive method for compressing image based on principal component analysis
CN110225343A (en) A kind of bit rate control method and device of Video coding
CN101895758B (en) H.264 code rate control method based on frame complexity
CN104159095B (en) A kind of multiple views texture video and the bit rate control method of depth map encoding
CN104754335B (en) A kind of code rate controlling method for video coding
CN107707918A (en) Optimized algorithm based on the control of HEVC/H.265 average bit rates
CN108200431A (en) A kind of video frequency coding rate controls frame-layer Bit distribution method
CN101917618B (en) Calculation complexity control method for multi-viewpoint video coding and layering B frame predicting structure
CN109618156A (en) A kind of video frequency coding rate method of adjustment
CN111447446B (en) HEVC (high efficiency video coding) rate control method based on human eye visual region importance analysis
CN100448295C (en) Integration code rate control method of low complexity
CN101420601B (en) Method and device for code rate control in video coding
CN103051897B (en) A kind of H264 code rate controlling method for video coding

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190412

WD01 Invention patent application deemed withdrawn after publication