CN109413422A - In conjunction with the adaptive insertion I frame method of picture quality and motion amplitude - Google Patents

In conjunction with the adaptive insertion I frame method of picture quality and motion amplitude Download PDF

Info

Publication number
CN109413422A
CN109413422A CN201811306472.4A CN201811306472A CN109413422A CN 109413422 A CN109413422 A CN 109413422A CN 201811306472 A CN201811306472 A CN 201811306472A CN 109413422 A CN109413422 A CN 109413422A
Authority
CN
China
Prior art keywords
frame
encoded
cost
video
video frame
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
CN201811306472.4A
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 CN201811306472.4A priority Critical patent/CN109413422A/en
Publication of CN109413422A publication Critical patent/CN109413422A/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/103Selection of coding mode or of prediction mode
    • H04N19/107Selection of coding mode or of prediction mode between spatial and temporal predictive coding, e.g. picture refresh
    • 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/176Methods 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
    • 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/177Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a group of pictures [GOP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/573Motion compensation with multiple frame prediction using two or more reference frames in a given prediction direction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/587Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal sub-sampling or interpolation, e.g. decimation or subsequent interpolation of pictures in a video sequence

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses the adaptive insertion I frame methods of a kind of combination picture quality and motion amplitude, which comprises obtains specific quantity video frame, the video frame includes at least one encoded frame and a frame to be encoded;The cost for obtaining each video frame is poor, the cost difference of the video frame is that the difference between the cost of the video frame and the cost of previous video frame determines judgment threshold according to the cost difference of each video frame, and whether cost and judgment threshold based on the frame to be encoded are encoded to I frame for the frame to be encoded come decision.Cost by video frame in image group is poor, judge whether frame to be encoded is the non-dynamic picture frame in resting state, and according to judging result and the fixed updated static coefficient of acquisition, and is determined according to updated static coefficient and the frame to be encoded is encoded to I frame.The present invention is adaptively incorporated into I frame when determining that video is in static scene by differentiating whether video is in static scene, improves code efficiency.

Description

In conjunction with the adaptive insertion I frame method of picture quality and motion amplitude
Technical field
The present invention relates to coding and decoding video field, in particular to a kind of combination picture quality and the adaptive of motion amplitude insert Enter I frame method.
Background technique
Current video using more and more extensive, require transmission video in many cases, current bandwidth still by Under the reality situation of limit, if directly transmitted when transmitting video, it is very big to will lead to transmitted data amount, thus transmission video it It is preceding to carry out compressed encoding to it and seem to be highly desirable.
I frame and P frame are generally included in existing video encoding standard, I frame is completely to be encoded current video frame The frame obtained afterwards, P frame are the frame obtained after being encoded according to the variance data between current video frame and previous video frame.Its In, it is reference frame that I frame, which completely remains the data in video frame, and P frame is to be referenced frame.It is wrapped in a usual image group Containing at least two I frames of head and the tail and multiple P frames.
Summary of the invention
It is described the embodiment of the invention provides the adaptive insertion I frame method of a kind of combination picture quality and motion amplitude Method includes:
Specific quantity video frame is obtained, the video frame includes at least one encoded frame and a frame to be encoded;
The cost for obtaining each video frame is poor, cost and previous video of the cost difference of the video frame for the video frame Difference between the cost of frame, the cost of the video frame be the video frame inter-prediction cost and intra prediction cost it Between ratio, the cost difference is used to indicate the fluctuation amplitude of video frame;
Cost according to each video frame is poor, determines whether the frame to be encoded is non-dynamic picture frame, described in determination When frame to be encoded is non-dynamic picture frame, updated static coefficient is obtained, the static coefficient is for indicating fixed company The number of the continuous non-dynamic picture frame in non-dynamic state, wherein when the cost absolute value of the difference of the frame to be encoded is less than the The absolute value of the cost difference summation of all video frames determines described wait compile less than the second threshold value in one threshold value and image group Static coefficient plus 1 are obtained updated static coefficient for non-dynamic picture frame by code frame, otherwise, it determines the frame to be encoded is not It is non-dynamic image frame, sets 0 for updated static coefficient;
When the updated static coefficient is less than the specific quantity, the frame to be encoded is encoded to P frame;
When the updated static coefficient is greater than or equal to the specific quantity, the frame to be encoded and image are obtained The spacing between the I frame before the frame to be encoded is occupied in group, and threshold is judged using the calculating of following mathematical expression according to the spacing Value:
Wherein, the VSceneIndicate fixed value, the D indicates the spacing, the GOPminIndicate image group it is default most Small length, the GOPmaxIndicate the default maximum length of image group, the FbiasIndicate the judgment threshold;
Whether cost and judgment threshold based on the frame to be encoded are encoded to I frame for the frame to be encoded come decision.
The cost and judgment threshold for being preferably based on the frame to be encoded come whether decision encodes the frame to be encoded Include: for I frame
Calculate the first difference of 1 with the judgment threshold;
Calculate the cost of the frame to be encoded and the second difference of first absolute difference;
It, will be described when second difference is greater than 0, and the cost of the frame to be encoded is greater than or equal to third threshold value Frame to be encoded is encoded to I frame.
Technical solution provided in an embodiment of the present invention has the benefit that the cost by video frame in image group Difference judges whether frame to be encoded is the non-dynamic picture frame in resting state, and more according to judging result and fixed acquisition Static coefficient after new, and determined according to updated static coefficient and the frame to be encoded is encoded to I frame.The present invention is by sentencing Whether other video is in static scene, and is adaptively incorporated into I frame when determining that video is in static scene, improves coding effect Rate.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is the adaptive insertion I frame method of a kind of combination picture quality provided in an embodiment of the present invention and motion amplitude Flow diagram.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
With reference to Fig. 1, the embodiment of the invention provides the frame sides adaptive insertion I of a kind of combination picture quality and motion amplitude Method includes the following steps:
Step 1: obtaining specific quantity video frame, the video frame includes at least one encoded frame and one wait compile Code frame.
In the embodiment of the present invention, by designing a sliding window, by sliding the cunning on complete sequence of frames of video Dynamic window, analyzes the video frame in sliding window, and the length of sliding window is equal to specific quantity, and specific quantity is just greater than 1 Integer.The specific quantity can determine according to the frame per second of video, such as can be 2/3rds of frame per second.
During encoding to video, certain amount of video frame can be determined using the sliding window every time, it is special The video frame of fixed number amount includes at least one encoded frame and a frame to be encoded, and the framing bit to be encoded is in the sliding window The last one position, coded frame is treated according to the video frame in sliding window at this time and is encoded.
For example, the specific quantity is m, then it is I frame by first coding video frames when starting to encode video, it will Second video frame to the m-1 video frame of video is encoded to P frame, and the m-1 video frame encoded at this time, which is located at, to be slided The preceding m-1 position of dynamic window includes m video frame in sliding window when getting m-th of video frame, starts to regard m-th at this time Frequency frame is encoded.
It should be noted that the embodiment of the present invention is illustrated by taking a frame to be encoded as an example, which can be M-th of video frame in video, or any video frame after m-th of video frame, m-th of video frame in practical application Coding method provided in an embodiment of the present invention can be used with each video frame after m-th of video frame to be encoded.As for Video frame before m-th of video frame in addition to first video frame, since these video frames are closer with the spacing of I frame, coding It is excessive coding quality decline is not will cause for P frame, therefore default code is P frame.
Step 2: the cost for obtaining each video frame is poor, the cost difference of the video frame be the video frame cost with Difference between the cost of previous video frame, the cost of the video frame are pre- in the inter-prediction cost and frame of the video frame The ratio between cost is surveyed, the cost difference is used to indicate the fluctuation amplitude of video frame.
The cost of video frame is the ratio between the inter-prediction cost and intra prediction cost of video frame, can indicate to regard Fluctuation amplitude of the frequency frame compared with previous video frame, the fluctuation amplitude of video frame and previous video frame is bigger, and cost is bigger, video Frame and the fluctuation amplitude of previous video frame are smaller, and cost is smaller.
And the cost difference of video frame is the difference between the cost of video frame and the cost of previous video frame, for indicating view Fluctuation situation between the fluctuation amplitude of frequency frame and the fluctuation amplitude of previous video frame, the bigger fluctuation for indicating video frame of cost difference Amplitude and the fluctuation of the fluctuation amplitude of previous video frame are more violent, the smaller fluctuation amplitude for indicating video frame of cost difference and previous view Fluctuation between the fluctuation amplitude of frequency frame is gentler.
With IcostIntra prediction cost is indicated, with PcostIndicate inter-prediction cost, the cost of n-th of video frameThe cost difference of n-th of video frame is ηnnn-1
Wherein, the intra prediction cost I of video framecostAfter can be by the way that video frame is carried out down-sampling, sampling be obtained Video frame be divided into multiple macro blocks of specified size, for each macro block, calculate the prediction in the multiple directions of the macro block Block, by the SATD of residual error between computing macro block and prediction block, to obtain optimal intra prediction cost Icost.Wherein, under Amplitude of samples when sampling can determine according to demand, such as the length of the video frame sampled can be original video frame The half of length, width can be the half of the width of original video frame, and in addition the specified size can also basis Forecast demand determines, such as can be 8*8.SATD refers to carries out absolute value after Hadamard (Hadamard) transformation for residual error again Summation.
The inter-prediction cost P of video framecostAfter video frame being carried out down-sampling, the video frame that sampling is obtained is drawn It is divided into multiple macro blocks of specified size.It for each macro block, predicts to obtain the optimal reference block of macro block using whole pixel diamond shape, lead to The SATD of residual error between computing macro block and reference block is crossed, so that optimal cost is obtained, by the I of the cost and macro blockcostMost P of the small value as macro blockcost, by the P of multiple macro blockscostThe sum of P as video framecost
The cost difference of each video frame can be calculated before being encoded, and encode to current video frame When, the cost that can calculate the video frame is poor, and since the video frame before the video frame has calculated that when being encoded Cost is poor, poor there is no need to recalculate the cost of these video frames, directly acquires.
Step 3: it is poor according to the cost of each video frame, determine whether the frame to be encoded is non-dynamic picture frame, when true When the fixed frame to be encoded is non-dynamic picture frame, updated static coefficient is obtained, the static coefficient is for indicating true The number of the fixed continuously non-dynamic picture frame in non-dynamic state, wherein when the cost absolute value of the difference of the frame to be encoded Less than the poor summation of cost of all video frames in the first threshold value and image group absolute value less than the second threshold value, determine institute It states frame to be encoded and static coefficient plus 1 is obtained into updated static coefficient for non-dynamic picture frame, otherwise, it determines described wait compile Code frame is not non-dynamic image frame, sets 0 for updated static coefficient.
(a) when the updated static coefficient is less than the specific quantity, the frame to be encoded is encoded to P frame.
(b) when the updated static coefficient is greater than or equal to the specific quantity, obtain the frame to be encoded with The spacing between the I frame before the frame to be encoded is occupied in image group, is sentenced according to the spacing using the calculating of following mathematical expression Disconnected threshold value:
Wherein, the VSceneIndicate fixed value, the D indicates the spacing, the GOPminIndicate image group it is default most Small length, the GOPmaxIndicate the default maximum length of image group, the FbiasIndicate the judgment threshold.
Non-dynamic picture frame refers to the video frame under static scene, and static coefficient is for indicating fixed continuous non- The number of dynamic image frame, in an encoding process increasing with determining continuous non-dynamic picture frame, the static coefficient can be by It gradually adds up, if it is non-dynamic image frame that, which there is any video frame in centre not, in cumulative process, static coefficient is reset to 0, again Start to add up.
When whether judge frame to be encoded is non-dynamic picture frame, whether judgement currently meets the first preset condition, this One preset condition is cost of the cost absolute value of the difference less than all video frames in the first threshold value and sliding window of frame to be encoded The absolute value of poor summation is less than the second threshold value.Therefore, video encoder judges that the cost absolute value of the difference of frame to be encoded is It is no less than the first threshold value, and judge all video frames in sliding window cost difference summation absolute value whether less than the second thresholding Value meets the first preset condition if so, determining, frame to be encoded is non-dynamic picture frame, and fixed static coefficient is added 1, Obtain updated static coefficient.If not, determining that frame to be encoded is not non-dynamic image when being unsatisfactory for the first preset condition Frame sets 0 for updated static coefficient, restarts the number for counting continuous non-dynamic picture frame.
In practical application, video encoder can use following formula, determine static coefficient:
Wherein, fnIndicate the static coefficient determined according to frame to be encoded, fn-1Indicate the previous video frame according to frame to be encoded Determining static coefficient, ηnIndicate that the cost of frame to be encoded is poor, ηnnn-1, αnIndicate the cost of frame to be encoded, αn-1It indicates The previous video frame of frame to be encoded, ξnIndicate the cost difference summation of all video frames in sliding window, n is the positive integer greater than 1, ηT Indicate the first threshold value, ξTIndicate the second threshold value.The value of a and b determines after can comprehensively considering code efficiency and coding quality And it is finely adjusted according to actual sequence of frames of video, such as ηT=0.2, ξT=1.
In the embodiment of the present invention, in order to avoid being incorporated into excessive P frame under static scene, the condition setting of I frame will be incorporated into Are as follows: the number of continuous non-dynamic picture frame reaches specific quantity, and under these conditions, video is in long-time static scene and root Enough P frames are had been programmed that according to the non-dynamic picture frame of enough numbers, be will lead to coding quality if continuing to be incorporated into P frame and are declined It is more, therefore to be incorporated into I frame.
So, when video encoder gets updated static coefficient, judge whether updated static coefficient is small In specific quantity.If updated static coefficient is less than specific quantity, indicate that the number of continuous non-dynamic picture frame does not surpass The upper limit is crossed, for the considerations of improving code efficiency, can continue to be incorporated into P frame.And if updated static coefficient is not less than spy Fixed number amount indicates that the number of continuous non-dynamic picture frame is excessive, for the considerations of improving coding quality, needs to be incorporated into I frame.
The condition of I frame is incorporated into addition to above-mentioned static coefficient is not less than certain amount of condition, can also include second pre- If condition, correspondingly, above-mentioned steps 304-306 can be replaced by following steps: judge whether updated static coefficient is less than Specific quantity, and judge whether to meet the second preset condition, static coefficient in the updated is not less than specific quantity and meets the When two preset conditions, frame to be encoded is encoded to I frame, and static coefficient in the updated is less than specific quantity or is unsatisfactory for the When two preset conditions, frame to be encoded is encoded to P frame.
0 < αn≤σ1And μI.nn-1> T1.n
σ1< αn≤σ2And μI.nn-1> T2.n
σ2< αn≤σ3And μI.nn-1> T3.n
σ3< αn≤σ4And μI.nn-1> T4.n
Wherein, n indicates the serial number of frame to be encoded, αnIndicate the cost of frame to be encoded, μI.nIndicate before frame to be encoded, The PSNR (Peak Signal to Noise Ratio, Y-PSNR) of the luminance component of the nearest I frame of spacing frame to be encoded, μn-1Indicate that the PSNR of the luminance component of the previous video frame of frame to be encoded, the PSNR of luminance component can be used for assessing corresponding view The coding quality of frequency frame, σ1、σ2、σ3And σ4And T1.n、T2.n、T3.nAnd T4.nFor positive-valued threshold, σ1、σ2、σ3And σ4To indicate figure As the threshold value that complexity changes, can set according to demand, σ1< σ2, σ2< σ3, σ3< σ4, such as can be set to σ1=0.2, σ2=0.3, σ3=0.4, σ4=0.5, T1.n> T2.n, T2.n> T3.n, T3.n> T4.n
Using above-mentioned second preset condition, it is ensured that in the lesser situation of cost of video frame, indicate video frame Picture is more stable, and it is excessive not will lead to coding quality decline when being incorporated into P frame at this time, can be with there is no need to be incorporated into excessive I frame It is incorporated into I frame again when PSNR declines by a relatively large margin, both ensure that coding quality, also improve code efficiency as much as possible.And In the biggish situation of the cost of video frame, indicate that the picture variation of video frame is violent, at this time in order to avoid coding quality declined It is more, the condition for being incorporated into I frame can be relaxed, I frame can be incorporated into when PSNR declines slightly smaller amplitude.
In the embodiment of the present invention, for T1、T2、T3And T4This four threshold values, the threshold value that different video frames uses can phase Deng can also be unequal.It, can be to T after the completion of being encoded to n-th of video frame in a kind of possible implementation1.n、 T2.n、T3.nAnd T4.nIt is updated, obtains updated T1.n+1、T2.n+1、T3.n+1And T4.n+1, using updated threshold value to n-th+ 1 video frame is judged.The update mode is as follows:
T1.n+1=(1- ωT)×T1.nT×(μIn-1) 0 < αn≤σ1
T2.n+1=(1- ωT)×T2.nT×(μIn-11< αn≤σ2
T3.n+1=(1- ωT)×T3.nT×(μIn-12< αn≤σ3
T4.n+1=(1- ωT)×T4.nT×(μIn-13< αn≤σ4
Wherein, above-mentioned T1、T2、T3、T4The initial value of threshold value can be according to being incorporated into first I frame after first I frame When PSNR the demand of fall determine, such as can be set are as follows: T1.1=5, T2.1=4.5, T3.1=3, T4.1=2.5.ωT To indicate the positive-valued threshold of weight that current PSNR difference occupies at no point in the update process, such as it can be set to ωT=0.2.
In the embodiment of the present invention, after the completion for the treatment of coded frame coding, available next frame to be encoded, according to one The spacing of video frame slides backward sliding window, makes the last one position of next framing bit to be encoded in sliding window, at this time after It is continuous that next frame to be encoded is encoded, and so on.
Step 4: whether cost and judgment threshold based on the frame to be encoded encode the frame to be encoded come decision For I frame.
Whether cost and judgment threshold based on the frame to be encoded are encoded to I frame packet for the frame to be encoded come decision It includes:
1, the first difference of 1 with the judgment threshold is calculated;
2, the cost of the frame to be encoded and the second difference of first absolute difference are calculated;
3, when second difference is greater than 0, and the cost of the frame to be encoded is greater than or equal to third threshold value, by institute It states frame to be encoded and is encoded to I frame.
Method provided in an embodiment of the present invention is equal to certain amount of sliding window by using length, according in sliding window The cost of each video frame is poor, judges whether frame to be encoded is the non-dynamic picture frame under static scene, and according to judgement As a result updated static coefficient is obtained with fixed, when updated static coefficient is not less than specific quantity, determines view Frequency is in static scene for a long time, then is incorporated into I frame.The present invention provides a kind of differentiation videos whether to be in static scene for a long time Mode, and determine video for a long time be in static scene when be incorporated into I frame, avoid being inserted into excessive P frame, improve coding matter Amount, and when being incorporated into I frame and being incorporated into P frame again, the bit number that P frame occupies reduces, and PSNR increases, to improve code efficiency.
The embodiment of the present invention indicates current cost using the ratio of inter-prediction cost and intra prediction cost, uses The PSNR of encoded frame indicates to be distorted, and preanalysis is carried out to the video frame in sliding window using sliding window, in conjunction with the change of cost Change situation, the algorithm for being adaptively incorporated into I frame is realized using a piecewise function, improves code efficiency.In real-time perfoming video Under the scene of call, biggish numerical value can be set by the default maximum length of the GOP in configuration file, guarantee will not be frequent Ground is incorporated into I frame according to default maximum length, and is more to be decided whether to be incorporated into I frame according to the case where video frame, greatly mentions Code efficiency is risen.Moreover, algorithm used in the embodiment of the present invention converges on the processor of the types such as armv7 and arm64 Optimization is compiled, processing speed can be improved.
Below as one example, come apparent explanation combination picture quality provided in an embodiment of the present invention and motion amplitude Adaptive insertion I frame method process:
A, setting length is equal to the sliding window of m, is I frame by first coding video frames in video, by the second of video A video frame to the m-1 video frame is encoded to P frame, and the m-1 video frame encoded at this time is located at the preceding m-1 of sliding window A position.When getting m-th of video frame, m-th of video frame is current frame to be encoded, and m-th of video frame is located at sliding window The last one position.Assume that m is 3 in the embodiment of the present invention.
If b, being determined according to the cost difference of m video frame in sliding window and meeting the first preset condition, m-th of video frame is Non-dynamic picture frame, static coefficient is 1 at this time, is P frame by m-th of coding video frames since static coefficient 1 is less than m.
C, the m+1 video frame is obtained, and slides backward sliding window according to the spacing of a video frame, at this time in sliding window Including the 2nd video frame to the m+1 video frame.
If d, being determined according to the cost difference of m video frame in sliding window and meeting the first preset condition, the m+1 video frame For non-dynamic picture frame, static coefficient is updated to 2 at this time, since static coefficient 2 is less than m, by the m+1 coding video frames For P frame.
E, the m+2 video frame is obtained, and slides backward sliding window according to the spacing of a video frame, at this time in sliding window Including the 3rd video frame to the m+2 video frame.
If f, being determined according to the cost difference of m video frame in sliding window and meeting the first preset condition, the m+2 video frame For non-dynamic picture frame, static coefficient is updated to 3 at this time, since static coefficient 3 is equal to m, by the m+2 coding video frames For I frame.
Method provided in an embodiment of the present invention, by guaranteeing that the cost in frame to be encoded is greater than the difference of 1 with judgment threshold And it is not less than third threshold value, it, will be to be encoded when the spacing between frame to be encoded and previous I frame is not less than five preset thresholds Frame is encoded to I frame, avoids and is incorporated into excessive I frame, improves code efficiency.
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (2)

1. the adaptive insertion I frame method of a kind of combination picture quality and motion amplitude, which is characterized in that the described method includes:
Specific quantity video frame is obtained, the video frame includes at least one encoded frame and a frame to be encoded;
The cost for obtaining each video frame is poor, and the cost difference of the video frame is the cost and previous video frame of the video frame Difference between cost, the cost of the video frame are between the inter-prediction cost and intra prediction cost of the video frame Ratio, the cost difference are used to indicate the fluctuation amplitude of video frame;
Cost according to each video frame is poor, determines whether the frame to be encoded is non-dynamic picture frame, described wait compile when determining When code frame is non-dynamic picture frame, updated static coefficient is obtained, the static coefficient is for indicating fixed continuous place In the number of the non-dynamic picture frame of non-dynamic state, wherein when the cost absolute value of the difference of the frame to be encoded is less than first The absolute value of the cost difference summation of all video frames determines the frame to be encoded less than the second threshold value in limit value and image group Static coefficient plus 1 are obtained into updated static coefficient for non-dynamic picture frame, otherwise, it determines the frame to be encoded not right and wrong Dynamic image frame sets 0 for updated static coefficient;
When the updated static coefficient is less than the specific quantity, the frame to be encoded is encoded to P frame;
When the updated static coefficient is greater than or equal to the specific quantity, obtain in the frame to be encoded and image group The spacing between the I frame before the frame to be encoded is occupied, judgment threshold is calculated using following mathematical expression according to the spacing:
Wherein, the VSceneIndicate fixed value, the D indicates the spacing, the GOPminIndicate the default minimum long of image group Degree, the GOPmaxIndicate the default maximum length of image group, the FbiasIndicate the judgment threshold;
Whether cost and judgment threshold based on the frame to be encoded are encoded to I frame for the frame to be encoded come decision.
2. the method according to claim 1, wherein cost and judgment threshold based on the frame to be encoded come Whether decision is encoded to I frame for the frame to be encoded
Calculate the first difference of 1 with the judgment threshold;
Calculate the cost of the frame to be encoded and the second difference of first absolute difference;
When second difference is greater than 0, and the cost of the frame to be encoded is greater than or equal to third threshold value, by described wait compile Code frame is encoded to I frame.
CN201811306472.4A 2018-11-05 2018-11-05 In conjunction with the adaptive insertion I frame method of picture quality and motion amplitude Pending CN109413422A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811306472.4A CN109413422A (en) 2018-11-05 2018-11-05 In conjunction with the adaptive insertion I frame method of picture quality and motion amplitude

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811306472.4A CN109413422A (en) 2018-11-05 2018-11-05 In conjunction with the adaptive insertion I frame method of picture quality and motion amplitude

Publications (1)

Publication Number Publication Date
CN109413422A true CN109413422A (en) 2019-03-01

Family

ID=65471509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811306472.4A Pending CN109413422A (en) 2018-11-05 2018-11-05 In conjunction with the adaptive insertion I frame method of picture quality and motion amplitude

Country Status (1)

Country Link
CN (1) CN109413422A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023142716A1 (en) * 2022-01-27 2023-08-03 腾讯科技(深圳)有限公司 Encoding method and apparatus, real-time communication method and apparatus, device, and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023142716A1 (en) * 2022-01-27 2023-08-03 腾讯科技(深圳)有限公司 Encoding method and apparatus, real-time communication method and apparatus, device, and storage medium

Similar Documents

Publication Publication Date Title
US8588296B2 (en) Bitrate control algorithm for video transcoding systems
US9071841B2 (en) Video transcoding with dynamically modifiable spatial resolution
JP5174958B2 (en) Method and system for simultaneous optimization of video coder and decoder
CN108012163B (en) Code rate control method and device for video coding
JP5164866B2 (en) Method and apparatus for adapting temporal frequency of video image sequences
KR101353304B1 (en) Video Encoding/Decoding Method and Apparatus Using Adaptive Interpolation Filter Coefficient
WO2014071728A1 (en) A hybrid-resolution encoding and decoding method and a video apparatus using the same
JP2005538606A (en) Method and apparatus for controlling rate of video sequence and video encoding apparatus
JP2008504750A (en) Multi-pass video encoding
CN113287319B (en) Method and apparatus for optimizing encoding operations
CA2798354A1 (en) A video encoding bit rate control technique using a quantization statistic threshold to determine whether re-encoding of an encoding-order picture group is required
US20240040127A1 (en) Video encoding method and apparatus and electronic device
KR102611939B1 (en) Efficient quantization parameter prediction method for low-latency video coding
US11303916B2 (en) Motion compensation techniques for video
Kaafarani et al. Evaluation of bitrate ladders for Versatile Video Coder
CN109413422A (en) In conjunction with the adaptive insertion I frame method of picture quality and motion amplitude
JP4695015B2 (en) Code amount estimation method, frame rate estimation method, code amount estimation device, frame rate estimation device, code amount estimation program, frame rate estimation program, and computer-readable recording medium recording those programs
JP2894137B2 (en) Prefilter control method and apparatus in video coding
KR100624404B1 (en) Adaptive coding method and apparatus considering human visual characteristics
KR20040048289A (en) Transcoding apparatus and method, target bit allocation, complexity prediction apparatus and method of picture therein
JP2007201975A (en) Code amount estimating method, frame rate estimating method, code amount estimating apparatus, frame rate estimating apparatus, code amount estimating program, frame rate estimating program, and computer readable storage medium for storing program
CN115883848A (en) Code control method, device, equipment, storage medium and product
CN101674480B (en) Method and device for selecting encoding modes
CN114793282A (en) Neural network based video compression with bit allocation
JP2008544621A (en) Encoding and decoding method and apparatus for improving video error concealment

Legal Events

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

Application publication date: 20190301

WD01 Invention patent application deemed withdrawn after publication