CN108024111A - A kind of frame type decision method and device - Google Patents

A kind of frame type decision method and device Download PDF

Info

Publication number
CN108024111A
CN108024111A CN201610966433.1A CN201610966433A CN108024111A CN 108024111 A CN108024111 A CN 108024111A CN 201610966433 A CN201610966433 A CN 201610966433A CN 108024111 A CN108024111 A CN 108024111A
Authority
CN
China
Prior art keywords
image
encoded
frames
target
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610966433.1A
Other languages
Chinese (zh)
Other versions
CN108024111B (en
Inventor
张贤国
朱政
金星
张二丽
范娟婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud 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 Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201610966433.1A priority Critical patent/CN108024111B/en
Publication of CN108024111A publication Critical patent/CN108024111A/en
Application granted granted Critical
Publication of CN108024111B publication Critical patent/CN108024111B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Abstract

The embodiment of the invention discloses a kind of frame type decision method and device, this method is applied to encoder, and this method includes:Any I frames for determining to encode before image to be encoded are target I frames;The coding result of first kind video frame is analyzed, obtains the first statistical model value;The coding result of the second class video frame is analyzed, obtains the second statistical model value;According to the first statistical model value and the second statistical model value, judge whether image to be encoded meets default I frames alternative condition;If so, it is I frames by the frame type decision of image to be encoded.Video coding is carried out using scheme provided in an embodiment of the present invention, coding rate can be accelerated, lifts the compression efficiency of video, reduces Video coding loss, improves the code efficiency of video.

Description

A kind of frame type decision method and device
Technical field
The present invention relates to technical field of video coding, more particularly to a kind of frame type decision method and device.
Background technology
With the continuous development of digital video service in multimedia application, and constantly carrying to video cloud computing demand Height, existing wired, wireless-transmission network bandwidth and storage resource can not already bear the big data quantity of original video information source.Cause And data compression of the vision signal in transmission, storing process becomes at present one of hot spot of research and application both at home and abroad;Video Data compression, also referred to as Video coding, the purpose is to eliminate the various data redundancies of vision signal.
At present, national and foreign standardsization work tissue has formulated various video coding standard in succession in the past few decades.For Reduce transmission bandwidth and memory space that video data takes, these standards are mostly by predicting, converting, scanning, quantifying, entropy The technologies such as coding are effectively to reduce above-mentioned various data redundancies.Predicting Technique is one of which common technology, its according to interframe or Prediction reference relation in frame, three kinds of I frames, P frames, B frames frame types are divided into by image encoding frame type.I frames are infra-frame prediction Image, in general encoder is realized, I frames have small quantization parameter, the low loss pattern of mode decision deviation selection, objective volume The characteristics of code loss is less, in the prediction reference as successive image, can lift the compression efficiency of successive image.Thus, I Frame is in addition to random access property, under also tending to periodically recovering Video coding loss, preventing that video quality is continuous The function of drop.
In the prior art, the interval between continuous two I frames is generally set in advance, and sets I in the manner described above Frame and when carrying out Video coding, is usually set to larger value by above-mentioned, can exist between so continuous two I frames compared with More P frames and B frames.Since existing method for video coding is mostly lossy coding, and P frames, the coding loss of B frames are compared to I Frame is big, in addition, P frames, B frames coding need to refer to complete the video frame of coding before it again, so, with I frames it The coding of each frame afterwards, the coding loss of follow-up each frame is increasing, in view of the foregoing, between the two I frames that are connected interval compared with When big, it is low to easily cause code efficiency.
The content of the invention
The embodiment of the invention discloses a kind of frame type decision method and device, for improving the code efficiency of video.Skill Art scheme is as follows:
In order to achieve the above object, in a first aspect, an embodiment of the present invention provides a kind of frame type decision method, applied to coding Device, the described method includes:
Any I frames for determining to encode before image to be encoded are target I frames;
The coding result of first kind video frame is analyzed, obtains the first statistical model value, wherein, the first kind video frame For:According to coded sequence, from the target I frames to the I frames the image to be encoded;
The coding result of the second class video frame is analyzed, obtains the second statistical model value, wherein, the second class video frame For:According to coded sequence, from the target I frames to the non-I frames the image to be encoded;
According to the first statistical model value and the second statistical model value, judge whether the image to be encoded is full The default I frames alternative condition of foot;
If so, it is I frames by the frame type decision of the image to be encoded.
Preferably, it is described according to the first statistical model value and the second statistical model value, wait to compile described in judgement Whether code image meets default I frames alternative condition, including:
The difference and/or ratio between the first statistical model value and the second statistical model value are calculated, is counted Calculate result;
According to the result of calculation, judge whether the image to be encoded meets default I frames alternative condition.
Preferably, the method further includes:
Determine whether occurrence scene changes between the image in target image set, wherein, the target image set, by According to coded sequence include the image to be encoded, continuous first default quantity group of picture into;
It is described according to the first statistical model value and the second statistical model value, judge that the image to be encoded is It is no to meet default I frames alternative condition, including:
Judge whether following relation is set up, if it is, judging that the image to be encoded meets default I frames alternative condition:
The first statistical model value and the second statistical model value meet default numerical relation, and the target figure Non- occurrence scene change between image in image set conjunction.
Preferably, whether occurrence scene changes between the image in the definite target image set, including:
Determine whether occurrence scene changes first object image relative to the second target image, if it is, judging target figure Occurrence scene changes between image in image set conjunction;Wherein,
The first object image is:According to coded sequence, second before or after the image to be encoded is default Quantity two field picture;
Second target image is:The reference picture of the first object image or according to coded sequence, described first The previous frame image of target image.
Preferably, the first object image is:The image to be encoded is currently located the 3rd present count in image sets Measure two field picture;
Relative to the second target image, whether occurrence scene changes the definite first object image, including:
The first object image is calculated compared to the sum of predicted distortion of second target image, obtains the first He Value;
The sum of infra-frame prediction distortion of second target image is calculated, obtains second and value;
Calculate described first and value and described second with the ratio of value;
Judge whether the ratio is in default value section;
If so, corresponding judge that the first object image changes relative to the second target image occurrence scene;
If not, corresponding judge that the first object image changes relative to the non-occurrence scene of second target image.
Preferably, the first object image is:The image to be encoded is currently located the 4th present count in image sets Measure two field picture;
Relative to the second target image, whether occurrence scene changes the definite first object image, including:
Relative to corresponding second target image of first object image described in each frame, each first object figure is obtained The motion amplitude of each image block as in;
According to the motion amplitude obtained, count motion amplitude in each first object image and be more than the first predetermined threshold value Image block;
For each first object image, the image block that counting statistics obtains respectively accounts for the ratio of whole two field picture;
According to the ratio being calculated, judge whether the first object image occurs relative to second target image Scene changes.
Preferably, whether occurrence scene changes between the image in the definite target image set, including:
Determine whether occurrence scene changes relative to the image to be encoded for the successive image of the image to be encoded, if It is that occurrence scene changes between the image judged in the target image set, wherein, the successive image is suitable according to encoding Sequence, the 5th default quantity two field picture after the image to be encoded.
Preferably, whether the successive image for determining the image to be encoded occurs field relative to the image to be encoded Scape changes, including:
Relative to the image to be encoded, the motion amplitude of each image in each successive image is obtained;
According to the motion amplitude obtained, count motion amplitude in each successive image and be more than the second predetermined threshold value Image block;
For each successive image, the image block that counting statistics obtains respectively accounts for the ratio of whole two field picture;
According to the ratio being calculated, judge the successive image of the image to be encoded is relative to the image to be encoded No occurrence scene change.
Preferably, whether the successive image for determining the image to be encoded occurs field relative to the image to be encoded Scape changes, including:
Calculate first predicted distortion of the successive image described in each frame relative to the image to be encoded;
According to all first predicted distortions, judge the successive image of the image to be encoded relative to described to be encoded Whether occurrence scene changes image.
Preferably, whether occurrence scene changes between the image in the definite target image set, including:
Based on current reference relation, determine whether the image to be encoded occurs content change with respect to its reference picture, if It is yes, occurrence scene changes between judging the image in target image set.
Preferably, it is described to be based on current reference relation, determine whether the image to be encoded occurs with respect to its reference picture Content change, including:
Based on current reference relation, calculate the image to be encoded and transported relative to the target of its corresponding reference picture recently Dynamic value, wherein, the reference picture recently is:According to display order, in the corresponding all reference pictures of the image to be encoded, The reference picture nearest apart from the image to be encoded, the target motion value are:In the image to be encoded, motion amplitude is big The ratio of whole two field picture is accounted in the data block of the 3rd predetermined threshold value;
Judge whether the target motion value is more than the 4th predetermined threshold value;
If so, judge that with respect to its reference picture content change occurs for the image to be encoded;
If not, judge that with respect to its reference picture content change does not occur for the image to be encoded.
Preferably, it is described to be based on current reference relation, determine whether the image to be encoded occurs with respect to its reference picture Content change, including:
Based on current reference relation, calculate the image to be encoded relative to its corresponding reference picture recently second is pre- Dendrometry is true, wherein, the reference picture recently is the corresponding all reference charts of the image to be encoded according to video display order As in, the reference picture nearest apart from the image to be encoded;
Judge whether second predicted distortion is more than the 5th predetermined threshold value;
If so, judge that with respect to its reference picture content change occurs for the image to be encoded;
If not, judge that with respect to its reference picture content change does not occur for the image to be encoded.
Preferably, after the frame type decision by the image to be encoded is I frames, the method further includes:
Reset the frame type of the current image for having determined that frame type and not starting coding.
Preferably, the first statistical model value and the second statistical model value include:Average number of bits, always than Special number, peak-peak signal-to-noise ratio, minimum peak signal-to-noise ratio, average peak signal to noise ratio, max architecture similarity, minimal structure phase Like property value, average structure similarity, default size data block maximum residul difference quadratic sum, the data block of the default size Least residual square and/or the default size at least one of the mean residual quadratic sum of data block.
Second aspect, the embodiment of the present invention additionally provides a kind of frame type decision device, applied to encoder, described device Including:
First determining module, any I frames for determining to encode before image to be encoded are target I frames;
First analysis module, for analyzing the coding result of first kind video frame, obtains the first statistical model value, wherein, The first kind video frame is:According to coded sequence, from the target I frames to the I frames the image to be encoded;
Second analysis module, for analyzing the coding result of the second class video frame, obtains the second statistical model value, wherein, The second class video frame is:According to coded sequence, from the target I frames to the non-I frames the image to be encoded;
Judgment module, for according to the first statistical model value and the second statistical model value, being treated described in judgement Whether coded image meets default I frames alternative condition;
Determination module, in the case of being in the judging result of the judgment module, by the image to be encoded Frame type decision is I frames.
Preferably, the judgment module, including:
First judging submodule, for calculating the difference between the first statistical model value and the second statistical model value Value and/or ratio, obtain result of calculation;
Second judgment submodule, for according to the result of calculation, judging whether the image to be encoded meets default I Frame alternative condition.
Preferably, described device further includes:
Second determining module, for determining whether occurrence scene changes between the image in target image set, wherein, institute Target image set is stated, by including the image to be encoded, continuous first default quantity group of picture according to coded sequence Into;
The judgment module, specifically for judging whether following relation is set up, if it is, judging that the image to be encoded is expired The default I frames alternative condition of foot:
The first statistical model value and the second statistical model value meet default numerical relation, and the target figure Non- occurrence scene change between image in image set conjunction.
Preferably, second determining module, is specifically used for:
Determine whether occurrence scene changes first object image relative to the second target image, if it is, judging target figure Occurrence scene changes between image in image set conjunction;Wherein,
The first object image is:According to coded sequence, second before or after the image to be encoded is default Quantity two field picture;
Second target image is:The reference picture of the first object image or according to coded sequence, described first The previous frame image of target image.
Preferably, the first object image is:The image to be encoded is currently located the 3rd present count in image sets Measure two field picture;
Second determining module, including:
First calculating sub module, for calculating pre- dendrometry of the first object image compared to second target image It is the sum of true, obtain first and value;
The sum of second calculating sub module, the infra-frame prediction distortion for calculating second target image, obtains the second He Value;
3rd calculating sub module, for calculate described first and value and described second with the ratio of value;
3rd judging submodule, for judging whether the ratio is in default value section;
First decision sub-module, in the case of being in the judging result of the 3rd judging submodule, correspondence is sentenced The fixed first object image changes relative to the second target image occurrence scene;In sentencing for the 3rd judging submodule It is corresponding to judge that the first object image becomes relative to the non-occurrence scene of second target image in the case that disconnected result is no Change.
Preferably, the first object image is:The image to be encoded is currently located the 4th present count in image sets Measure two field picture;
Second determining module, including:
First obtains submodule, for relative to corresponding second target image of first object image described in each frame, obtaining Obtain the motion amplitude of each image block in each first object image;
First statistic submodule, for according to the motion amplitude obtained, counting in each first object image and moving width Image block of the degree more than the first predetermined threshold value;
4th calculating sub module, for for each first object image, the image block that counting statistics obtains respectively to account for whole The ratio of two field picture;
4th judging submodule, for according to the ratio being calculated, judging the first object image relative to described Whether occurrence scene changes second target image.
Preferably, second determining module, is specifically used for:
Determine whether occurrence scene changes relative to the image to be encoded for the successive image of the image to be encoded, if It is that occurrence scene changes between the image judged in the target image set, wherein, the successive image is suitable according to encoding Sequence, the 5th default quantity two field picture after the image to be encoded.
Preferably, second determining module, including:
Second obtains submodule, for relative to the image to be encoded, obtaining each figure in each successive image The motion amplitude of picture;
Second statistic submodule, for according to the motion amplitude obtained, counting in each successive image and moving width Image block of the degree more than the second predetermined threshold value;
5th calculating sub module, for for each successive image, the image block that counting statistics obtains respectively to account for whole frame figure The ratio of picture;
5th judging submodule, for according to the ratio that is calculated, judging the successive image phase of the image to be encoded For the image to be encoded, whether occurrence scene changes.
Preferably, second determining module, including:
6th calculating sub module, for calculating successive image described in each frame relative to the first pre- of the image to be encoded Dendrometry is true;
6th judging submodule, for according to all first predicted distortions, judging the follow-up of the image to be encoded Relative to the image to be encoded, whether occurrence scene changes image.
Preferably, second determining module, is specifically used for:
Based on current reference relation, determine whether the image to be encoded occurs content change with respect to its reference picture, if It is yes, occurrence scene changes between judging the image in target image set.
Preferably, second determining module, including:
7th calculating sub module, for based on current reference relation, it is corresponding relative to its to calculate the image to be encoded The target motion value of nearest reference picture, wherein, the reference picture recently is:According to display order, the image to be encoded In corresponding all reference pictures, the reference picture nearest apart from the image to be encoded, the target motion value is:It is described to treat In coded image, motion amplitude accounts for the ratio of whole two field picture more than the data block of the 3rd predetermined threshold value;
7th judging submodule, for judging whether the target motion value is more than the 4th predetermined threshold value;
Second decision sub-module, in the case of being in the judging result of the 7th judging submodule, judges institute State image to be encoded and content change occurs with respect to its reference picture;In the feelings that the judging result of the 7th judging submodule is no Under condition, judge that with respect to its reference picture content change does not occur for the image to be encoded.
Preferably, second determining module, including:
8th calculating sub module, for based on current reference relation, it is corresponding relative to its to calculate the image to be encoded Second predicted distortion of nearest reference picture, wherein, the reference picture recently be according to video display order, it is described to be encoded In the corresponding all reference pictures of image, the reference picture nearest apart from the image to be encoded;
8th judging submodule, for judging whether second predicted distortion is more than the 5th predetermined threshold value;
3rd decision sub-module, in the case of being in the judging result of the 8th judging submodule, judges institute State image to be encoded and content change occurs with respect to its reference picture;In the feelings that the judging result of the 8th judging submodule is no Under condition, judge that with respect to its reference picture content change does not occur for the image to be encoded.
Preferably, described device further includes:
Module is reset, for after by the frame type decision of the image to be encoded for I frames, replacement currently to have determined that frame Type and the frame type for not starting the image of coding.
Preferably, the first statistical model value and the second statistical model value include:Average number of bits, always than Special number, peak-peak signal-to-noise ratio, minimum peak signal-to-noise ratio, average peak signal to noise ratio, max architecture similarity, minimal structure phase Like property value, average structure similarity, default size data block maximum residul difference quadratic sum, the data block of the default size Least residual square and/or the default size at least one of the mean residual quadratic sum of data block.
As seen from the above, in embodiments of the present invention, when judging the frame type of image to be encoded, it is first determined treated at this Any I frames encoded before coded image are target I frames;The coding result of first kind video frame is analyzed, obtains the first statistics mould Offset;The coding result of the second class video frame is analyzed, obtains the second statistical model value;According to the first statistical model value and second Statistical model value, judges whether the image to be encoded meets default I frames alternative condition;If so, by the image to be encoded Frame type decision is I frames.In embodiments of the present invention, first kind video frame is:According to coded sequence, treated from target I frames to this I frames between coded image;Second class video frame is:According to coded sequence, from target I frames to non-the image to be encoded I frames;So the embodiment of the present invention is when judging the frame type of image to be encoded, it is contemplated that the coding knot of encoded video frame Fruit, and according to the coding result of encoded video frame, it is determined whether image to be encoded is encoded to I frames.Based on of the invention real The frame type decision method for applying example offer carries out Video coding, can accelerate coding rate, lift the compression efficiency of video, reduces Video coding loses, and improves the code efficiency of video.
Certainly, implement any of the products of the present invention or method must be not necessarily required to reach all the above excellent at the same time Point.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is attached drawing needed in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, without creative efforts, can be with Other attached drawings are obtained according to these attached drawings.
Fig. 1 is a kind of flow diagram for frame type decision method that first embodiment of the invention provides;
Fig. 2 is a kind of flow diagram for frame type decision method that second embodiment of the invention provides;
Fig. 3 is a kind of flow diagram for frame type decision method that third embodiment of the invention provides;
Fig. 4 is a kind of flow diagram for frame type decision method that fourth embodiment of the invention provides;
Fig. 5 is a kind of flow diagram for frame type decision method that fifth embodiment of the invention provides;
Fig. 6 is a kind of structure diagram for frame type decision device that one embodiment of the invention provides;
Fig. 7 is a kind of structure diagram for frame type decision device that another embodiment of the present invention provides.
Embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other without creative efforts Embodiment, belongs to the scope of protection of the invention.
In the following, first to involved in the embodiment of the present invention to technical term simply introduced.
Frame type:Current video coding standards mainly include three kinds of frame type:I frames, P frames and B frames;I frames are pre- in frame Altimetric image, when decoding, only need this frame data to complete to decode;P frames are forward predicted frame, before the codings of P frames needs to refer to The I frames or P frames in face, and B frames are bi-directional predicted frames, the coding of B frames needs to refer to the I frames or P frames of front and back.
It is well known by those skilled in the art that coding is usually lossy coding, the number that each two field picture coding obtains afterwards Lost according to relative to raw image data all existence informations, the reference frame of each frame is all lossy, and the loss of reference frame is got over Greatly, the loss of the frame is also bigger after coding, and when reference frame of the corresponding big frame of the loss as subsequent frame can bring bigger Loss, and then bring the decline of video coding efficiency;Due to the presence of the above situation, to ensure the code efficiency of follow-up each frame, I frames need to be suitably inserted into, i.e., some images are suitably encoded to I frames.
In existing coding standard, calculated since a certain I frames, extremely all picture frames before next I frames form one A image sets (GOP, Group of Pictures), also known as picture group, in an image sets, an only I frame, for example, figure As group:I, B1, B2, P1, B3, B4, P2, B5 and B6.
In addition, before Video coding, it may be predetermined that frame type sets rule, for example, an image sets include 15 frames, 2 B frames etc. are inserted between neighboring reference frame, specifically for example, according to display order, pre-set each image in an image sets Frame type be I, B, B, P, B, B, P, B, B;In video coding process, encoder can also adjust the frame type of image, example As in existing scene change detection technology, encoder detects the change of the video image content of adjacent a little interframe, root in advance Insertion I frames are determined a need for according to the amplitude of change, I frames are inserted into when scene changes, such as in above-mentioned frame type frame class Type is in the image sets of I, B, B, P, B, B, P, B, B, when the image for being encoded to P frames to second preparation encodes, is detected The amplitude of variation for going out the video image content of adjacent a little interframe exceedes predetermined threshold value, then the image is encoded to I frames at this time.
Describe in detail below by specific embodiment to the present invention.
Fig. 1 is a kind of flow diagram for frame type decision method that first embodiment of the invention provides;It is appreciated that should Each two field picture of the method suitable for video image, this method are applied to encoder, and this method includes:
S101:Any I frames for determining to encode before image to be encoded are target I frames.
It is appreciated that target I frames are in whole video before image to be encoded, k-th encoded of I frame, wherein, k > 0;For example, the 3rd I frame encoded before image to be encoded coding.
S102:The coding result of first kind video frame is analyzed, obtains the first statistical model value;Wherein, first kind video frame For:According to coded sequence, from target I frames to the I frames the image to be encoded.
S103:The coding result of the second class video frame is analyzed, obtains the second statistical model value;Wherein, the second class video frame For:According to coded sequence, from target I frames to the non-I frames the image to be encoded.
It should be noted that the execution sequence of step S102 and S103 are without what is successively required, can first carry out step S102, then perform step S103;Can also first carry out step S103, then perform step S102;It can also be while perform step Rapid S102 and S103.
In embodiments of the present invention, above-mentioned first statistical model value and the second statistical model value include:Average bit Number, total bit number, peak-peak signal-to-noise ratio, minimum peak signal-to-noise ratio, average peak signal to noise ratio, max architecture similarity, most Small structure similarity, average structure similarity, the maximum residul difference quadratic sum of data block of default size, the number of default size According to the least residual square of block and/or at least one of the mean residual quadratic sum of data block of default size.
The Y-PSNR (PSNR, Peak Signal to Noise Ratio) and structural similarity of above-mentioned image The circular of (SSIM, structural similarity index) value refers to the prior art.
It should be noted that when the first statistical model value is determined as a certain or a variety of in above-mentioned model value, then The species of two statistical model values is inevitable identical with the species of the first statistical model value.For example, if the first statistical model value is:Press According to coded sequence, from target I frames to the total bit number of the I frames the image to be encoded, then the second statistical model value is from mesh I frames are marked to the total bit number of the non-I frames between the image to be encoded;If the first statistical model value is:According to coded sequence, from Target I frames to the I frames between the image to be encoded average number of bits and average peak signal to noise ratio, then the second statistical model value be From target I frames to the average number of bits and average peak signal to noise ratio of the non-I frames the image to be encoded.
In addition, in the embodiment of the present invention, the selection of statistical model value is not limited to mentioned kind or other can be with Reflect that the total bit number of encoded I frames accounts for the total bit number ratio of encoded all video images, or reflect encoded The statistical model value of the coding quality of non-I frames.
S104:According to the first statistical model value and the second statistical model value, it is pre- to judge whether the image to be encoded meets If I frame alternative conditions.
In embodiments of the present invention, obtained the first statistical model value and the second statistical model value can be utilized, into And the desired value of some compression ratios and coding loss that may determine that current encoded video image is obtained, which can Show to need to be inserted into I frames under present case, that is, need the image to be encoded being encoded to I frames.
In embodiments of the present invention, it is above-mentioned according to the first statistical model value and the second statistical model value, judge that this waits to compile Whether code image meets default I frames alternative condition (S104), can include:
The difference and/or ratio between the first statistical model value and the second statistical model value are calculated, obtains result of calculation;
According to result of calculation, judge whether image to be encoded meets default I frames alternative condition.
In embodiments of the present invention, when the first statistical model value and the second statistical model value are respectively:Correspond to according to volume Code order, during from target I frames to the I frames the image to be encoded with the average number of bits or total bit number of non-I frames, Ke Yiji The ratio of the first statistical model value and the second statistical model value is calculated, if the ratio is less than a certain predetermined threshold value, it is possible to determine that should Image to be encoded meets default I frames alternative condition, you can the image to be encoded is encoded to I frames.
When the first statistical model value and the second statistical model value are respectively:It is corresponding according to coded sequence, from target I frames to The peak-peak signal-to-noise ratio of I frames between the image to be encoded and non-I frames, minimum peak signal-to-noise ratio, average peak signal to noise ratio, most When big structure similarity, minimal structure similarity or average structure similarity, can calculate the first statistical model value with The ratio of second statistical model value, if the ratio exceedes a certain predetermined threshold value, it is possible to determine that the image to be encoded meets default I frame alternative conditions, you can the image to be encoded is encoded to I frames.
When the first statistical model value and the second statistical model value are respectively:It is corresponding according to coded sequence, from target I frames to The peak-peak signal-to-noise ratio of I frames between the image to be encoded and non-I frames, minimum peak signal-to-noise ratio, average peak signal to noise ratio, most When big structure similarity, minimal structure similarity or average structure similarity, the first statistical model value can also be calculated With the difference of the second statistical model value, if the difference exceedes a certain predetermined threshold value, it is possible to determine that the image to be encoded meets pre- If I frame alternative conditions, you can the image to be encoded is encoded to I frames.
When the first statistical model value and the second statistical model value are respectively:It is corresponding according to coded sequence, from target I frames to I frames and the maximum residul difference quadratic sum of the data block of the default size of non-I frames, the data of default size between the image to be encoded During the mean residual quadratic sum of the data block of the least residual square of block and/or default size, the first statistical model value can be calculated With the ratio of the second statistical model value, if the ratio is less than a certain predetermined threshold value, it is possible to determine that the image to be encoded meets pre- If I frame alternative conditions, you can the image to be encoded is encoded to I frames.
It should be noted that during reality, encoder can select only to count a kind of statistical model value, such as only Statistics is according to coded sequence, from target I frames to the first average specific corresponding with non-I frames of the I frames the image to be encoded Special number and the second average number of bits, can calculate the ratio of the first average number of bits and the second average number of bits, if the ratio Less than predetermined threshold value, it is possible to determine that the image to be encoded meets default I frames alternative condition.
Encoder is also an option that at least two statistical model values of statistics, in selected various first statistical model values and In second statistical model value, in the case that at least one meets preset condition, it is default equally to can be determined that image to be encoded meets I frame alternative conditions.
For example, encoder statistics are according to coded sequence, from target I frames to the I frames the image to be encoded corresponding One total bit number and the first average peak signal to noise ratio, have also counted according to coded sequence, from target I frames to the image to be encoded it Between corresponding second total bit number of non-I frames and the second average peak signal to noise ratio, if the first total bit number and second total bit Several ratio, not less than a predetermined threshold value, and the difference of the first average peak signal to noise ratio and the second average peak signal to noise ratio, exceed Another predetermined threshold value, then can be determined that the image to be encoded meets default I frames alternative condition.
If so, perform S105:It is I frames by the frame type decision of the image to be encoded.
It is appreciated that by the frame type decision of the image to be encoded for after I frames, encoder can encode the image to be encoded For I frames.For example, setting rule according to predetermined frame type, image to be encoded will be encoded as B frames, when this hair of use It is I frames by the frame type decision of the image to be encoded after the method that bright embodiment provides, then encoder compiles the image to be encoded Code is I frames.
In the embodiment of the present invention, after the above-mentioned frame type decision by image to be encoded is I frames (S105), this method is also It can include:
Reset the frame type of the current image for having determined that frame type and not starting coding.
It is well known by those skilled in the art that after image to be encoded is encoded to I frames, according to coded sequence, figure to be encoded As coding follow-up multiframe the referring-to relation of the image of pre-read and image frame types, it is necessary to be by I frames of present image Basis is reset.For example, it is P that image to be encoded, which is display order,ic1、Pic2、Pic3、Pic4、Pic5、Pic6、Pic7、Pic8 Hes PicImage P in 9 image setsic8, image Pic1、Pic2、Pic3、Pic4、Pic5、Pic6、Pic7、Pic8 and Pic9 corresponding frame classes Type is respectively I, B, B, P, B, B, P, B and B, it is clear that, the coded sequence of this image sets is Pic1、Pic4、Pic2、Pic3、Pic7、 Pic5、Pic6、Pic8 and Pic9, when by image PicAfter 8 are determined as I frames, then image Pic9 frame type is still set to B frames, but schemes As Pic9 reference frame is changed into image Pic8。
As seen from the above, in embodiments of the present invention, when judging the frame type of image to be encoded, it is first determined treated at this Any I frames encoded before coded image are target I frames;The coding result of first kind video frame is analyzed, obtains the first statistics mould Offset;The coding result of the second class video frame is analyzed, obtains the second statistical model value;According to the first statistical model value and second Statistical model value, judges whether the image to be encoded meets default I frames alternative condition;If so, by the image to be encoded Frame type decision is I frames.In embodiments of the present invention, first kind video frame is:According to coded sequence, treated from target I frames to this I frames between coded image;Second class video frame is:According to coded sequence, from target I frames to non-the image to be encoded I frames;So the embodiment of the present invention is when judging the frame type of image to be encoded, it is contemplated that the coding knot of encoded video frame Fruit, and according to the coding result of encoded video frame, it is determined whether image to be encoded is encoded to I frames.Based on of the invention real The frame type decision method for applying example offer carries out Video coding, can accelerate coding rate, lift the compression efficiency of video, reduces Video coding loses, and improves the code efficiency of video.
The embodiment of the present invention especially for the compression efficiency that TV news in TV news, can be improved well, and Frame type decision method based on the embodiment of the present invention, the video for encoding generation meet existing video encoding standard, can be with Directly decoded by common player.
Relative to embodiment of the method shown in Fig. 1, this method can also include:
S106:Determine whether occurrence scene changes between the image in target image set, wherein, the target image set Close, by according to coded sequence, comprising the image to be encoded, continuous first default quantity group of picture into.
It should be noted that whether the scene between image changes and can be judged by the prior art, this hair Bright embodiment is not limited for determination methods herein.Moreover, in target image set, Ke Yishi:As long as judge Any two image occurrence scene changes, that is, judges that there occurs scene changes between the image in target image set.
Determining for above-mentioned target image set should be according to coded sequence, for example, the image for same image sets, it is assumed that The display order of each image is I, B1, B2, P1, B3, B4, P2, B5, B6, then the coded sequence of this image sets be I, P1, B1, B2, P2, B3, B4, B5, B6, it is assumed that image to be encoded is B2, which is 5, then, and the target image set can be by I, the image collection of P1, B1, B2, P2 composition.
In the case of comprising step S106, method shown in the step S101~S103 and Fig. 1 of the embodiment of the present invention is implemented Example is identical, above-mentioned according to the first statistics mould in the case of comprising step S106 unlike embodiment of the method shown in Fig. 1 Offset and the second statistical model value, judge whether the image to be encoded meets default I frames alternative condition (S104), can be with For:
Judge whether following relation is set up, if it is, judging that the image to be encoded meets default I frames alternative condition:
First statistical model value and the second statistical model value meet default numerical relation, and in the target image set Non- occurrence scene change between image.
Certainly, in embodiments of the present invention, whether the first statistical model value and the second statistical model value are met default The deterministic process of numerical relation and the execution sequence of step S106 do not limit;Can first judge the first statistical model value and Whether two statistical model values meet default numerical relation, and meet to preset in the first statistical model value and the second statistical model value Numerical relation in the case of, perform step S106;It can also be and first carry out step S106, determining in the target image set Image between in the case of the change of non-occurrence scene, judge the first statistical model value and the second statistical model value whether meet it is pre- If numerical relation, as shown in Figure 2.
Fig. 2 is a kind of flow diagram for frame type decision method that second embodiment of the invention provides.
Such as Fig. 2, after execution of step S106, the frame type decision method of the embodiment of the present invention further includes:
S1041:Judge whether the first statistical model value and the second statistical model value meet default numerical relation.
It is appreciated that the judgement of step S1041 can be sentenced by the method provided in embodiment of the method shown in Fig. 1 herein Whether disconnected first statistical model value and the second statistical model value meet default numerical relation, i.e.,:Implement corresponding to the method for Fig. 1 Example, the judging result of step S104 are that the first statistical model value and the second statistical model value meet default numerical relation when being, When the judging result of step S104 is no, the first statistical model value and the second statistical model value are unsatisfactory for default numerical relation. And non-occurrence scene changes the specific determination methods of this goal condition except through existing between the image in target image set There is technology to realize outer, can also realize by the following method.
The determination methods of the first feasible goal condition, as shown in figure 3, the image in above-mentioned definite target image set Between whether occurrence scene change (S106), Ke Yiwei:
S1061:Determine whether occurrence scene changes first object image relative to the second target image, if it is, judging Occurrence scene changes between image in target image set.
Wherein, which is:According to coded sequence, second before or after the image to be encoded is pre- If quantity two field picture;Second target image is:The reference picture of the first object image or according to coded sequence, first mesh The previous frame image of logo image.
For example, the image to be encoded is the figure in the image sets that display order is I, B1, B2, P1, B3, B4, P2, B5, B6 As B3, the coded sequence of the image sets is I, P1, B1, B2, P2, B3, B4, B5, B6, if the second default quantity is 3, this One target image can be at least two field picture in B2, P2 and B4, such as first object image is image B2 and B4, the second mesh Logo image is the previous frame image of corresponding first object image according to coded sequence, then corresponding second targets of image B2 and B4 Image is respectively B1 and B3.If image B2 changes relative to image B1 and/or B4 relative to image B3 occurrence scenes, can sentence There occurs scene changes between the image to set the goal in image collection.
It is emphasized that during Video coding, rule is set due to being previously determined frame type, so to the figure to be encoded As when being encoded, there is the reference picture of the corresponding image to be encoded, for example, be I, B1 for display order, B2, P1, B3, An image sets of B4, P2, B5, B6, its coded sequence are I, P1, B1, B2, P2, B3, B4, B5, B6, when being encoded to image B3, i.e., When image B3 is image to be encoded, currently corresponding reference picture includes image P1 and P2 to device.
The first determine first object image relative to the second target image whether occurrence scene change method in, should First object image can be:The 3rd default quantity two field picture that the image to be encoded is currently located in image sets, certainly, this Three default quantity two field pictures are included in the above-mentioned second default quantity two field picture.At this time, above-mentioned definite first object image is opposite In the second target image, whether occurrence scene changes (S1061), Ke Yiwei:
First object image is calculated compared to the sum of predicted distortion of the second target image, obtains first and value;
The sum of infra-frame prediction distortion of the second target image is calculated, obtains second and value;
Calculate this first and value and this second with the ratio of value;
Judge whether the ratio is in default value section;
If so, corresponding judge that first object image changes relative to the second target image occurrence scene;
If not, corresponding judge that first object image changes relative to the non-occurrence scene of the second target image.
It should be noted that above-mentioned predicted distortion and the circular of infra-frame prediction distortion belong to the prior art, In the embodiment of the present invention, details are not described herein.
Under normal conditions, this first and value and this second and value ratio close to 1 when, show that first object image is opposite Change in the second target image occurrence scene, so in actual use, which can be [1, v], its Middle v can be according to actual selection, for example, v selected as 1.5.
For example, the default value section is [1,1.6], image to be encoded is that display order is I, B1, B2, P, B3, B4 Image P in image sets, the coded sequence of the image sets is I, P, B1, B2, B3, B4, should if the 3rd default quantity is 2 First object image can be image B1 and B2, and corresponding second target images of image B1 and B2 are respectively P and B1.
At this time, predicted distortion xs of the image B1 relative to image P is calculated, and image B2 is relative to the predicted distortion of image B1 Y, calculate x and y and value z;The sum of infra-frame prediction distortion of image B1 and B2 is calculated, is obtained and value w;Then calculate and value z and With the ratio of value w, it is assumed that the ratio is 1.1, then at this time, judges first object image relative to the second target image occurrence scene Change.
Second determine first object image relative to the second target image whether occurrence scene change method in, should First object image is:The 4th default quantity two field picture that the image to be encoded is currently located in image sets;Certainly, this is the 4th pre- If quantity two field picture is included in the above-mentioned second default quantity two field picture.At this time, above-mentioned definite first object image is relative to Whether occurrence scene changes (S1061) to two target images, can be following four steps:
Relative to corresponding second target image of each frame first object image, obtain each in each first object image The motion amplitude of image block;
According to the motion amplitude obtained, count motion amplitude in each first object image and be more than the first predetermined threshold value Image block;
For each first object image, the image block that counting statistics obtains respectively accounts for the ratio of whole two field picture;
According to the ratio being calculated, judge whether occurrence scene becomes first object image relative to the second target image Change.
It should be noted that when the quantity of first object image is more than one, correspond to each frame for what is obtained Each ratio of one target image, can select maximum from each ratio, and it is default to judge whether the maximum is more than one Threshold value, if it does, judging first object image, relative to the second target image, there occurs scene changes;Otherwise, it is determined that first Target image changes relative to the non-occurrence scene of the second target image;Alternatively, calculating the average value of each ratio, judge that this is flat Whether average is more than another predetermined threshold value, if it does, judging first object image, relative to the second target image, there occurs field Scape changes;Otherwise, it is determined that first object image changes relative to the non-occurrence scene of the second target image.
For example, judge whether first object image is sent out relative to the second target image by the maximum in each ratio Raw scene changes, predetermined threshold value 40%, above-mentioned first predetermined threshold value is 16 whole pixel values.First object image E and F distinguish Corresponding second target image G and H;Image E is more than accounting for for the image block of 16 whole pixel values relative to image G, motion amplitude The ratio of image E is 38.6%;Image F accounts for image relative to image H, motion amplitude more than the image block of 16 whole pixel values The ratio of F is 49.2%;Then the maximum is 49.2% at this time, since maximum 49.2% is more than predetermined threshold value 40%, at this time Judge that there occurs scene changes relative to the second target image for first object image.
It should be noted that the computational methods of above-mentioned motion amplitude and ratio belong to the prior art, implement in the present invention Details are not described herein for example.
Certainly, in embodiments of the present invention, it is not limited to the corresponding average value of obtained all proportions or maximum Value, come do first object image relative to the second target image whether occurrence scene change judgement, those skilled in the art It can be judged by other prior arts, details are not described herein for the embodiment of the present invention.
The determination methods of second of feasible goal condition, as shown in figure 4, the image in above-mentioned definite target image set Between whether occurrence scene change (S106), can include:
S1062:Determine whether occurrence scene changes relative to the image to be encoded for the successive image of the image to be encoded, such as Fruit is occurrence scene change between the image judged in the target image set.Wherein, the successive image is according to coding Sequentially, the 5th default quantity two field picture after the image to be encoded.
It is appreciated that the determination methods of second of feasible goal condition, be mainly used for determining image to be encoded relative to Its successive image whether there is reference value.
It should be noted that when the 5th default quantity is more than 1, if can be image to be encoded successive image in Any one image there occurs scene changes, is decided that and occurred between the image in target image set relative to image to be encoded Scene changes.
For example, the image to be encoded is the image B3 in the image sets that display order is I, B1, B2, B3, P, B4, B5, B6, The coded sequence of the image sets is I, P, B1, B2, B3, B4, B5, B6, if the default quantity two field picture of the 5th of selection is image B4 And B5, then judge respectively image B4 and B5 relative to image B3 whether occurrence scene change, if it is judged that image B4 relative to The change of image B3 non-occurrence scenes, and image B5 relative to image B3 there occurs scene changes, then judge in target image set Image between occurrence scene change.
In embodiments of the present invention, determine the successive image of the image to be encoded relative to this using the following two kinds method Whether occurrence scene changes image to be encoded, and certainly, the embodiment of the present invention is not limited to determine to be somebody's turn to do with following two methods Relative to the image to be encoded, whether occurrence scene changes the successive image of image to be encoded.
In the successive image that the first determines the image to be encoded, relative to the image to be encoded, whether occurrence scene changes Method in, it is above-mentioned determine the image to be encoded successive image relative to the image to be encoded whether occurrence scene change (S1062), following four steps can be included:
Relative to the image to be encoded, the motion amplitude of each image in each successive image is obtained;
According to the motion amplitude obtained, the image that motion amplitude in each successive image is more than the second predetermined threshold value is counted Block;
For each successive image, the image block that counting statistics obtains respectively accounts for the ratio of whole two field picture;
According to the ratio being calculated, judge whether the successive image of the image to be encoded is sent out relative to the image to be encoded Raw scene changes.
It should be noted that when the image to be encoded successive image quantity more than one when, for obtained correspondence In each ratio of each frame successive image, maximum can be selected from each ratio, judge whether the maximum is more than One predetermined threshold value, if it does, judging the successive image of the image to be encoded, relative to the image to be encoded, there occurs scene change Change;Otherwise, it is determined that the successive image of the image to be encoded changes relative to the non-occurrence scene of image to be encoded;Alternatively, calculate Go out the average value of each ratio, judge whether the average value is more than another predetermined threshold value, if it does, judging the image to be encoded Successive image relative to the image to be encoded, there occurs scene changes;Otherwise, it is determined that the successive image phase of the image to be encoded For the non-occurrence scene change of image to be encoded.
For example, judge that the successive image of the image to be encoded is waited to compile relative to this by the average value of each ratio herein Whether occurrence scene changes code image, and predetermined threshold value 45%, above-mentioned second predetermined threshold value is 12 whole pixel values.Successive image E, F and G is relative to image to be encoded, and what motion amplitude was more than the image block of 12 whole pixel values accounts for itself whole two field picture respectively Ratio is 30.2%, 49% and 53.8%;Then the average value of each ratio is 44.3% at this time, since average value 44.3% is less than Predetermined threshold value 45%, judges that the successive image of the image to be encoded changes relative to the non-occurrence scene of image to be encoded at this time.
It should be noted that the computational methods of above-mentioned motion amplitude and ratio belong to the prior art, implement in the present invention Details are not described herein for example.
Certainly, in embodiments of the present invention, it is not limited to the corresponding average value of obtained all proportions or maximum Value, to determine whether occurrence scene changes the successive image of the image to be encoded relative to the image to be encoded, art technology Personnel can also use the prior art provide itself it is determined that method, details are not described herein for the embodiment of the present invention.
Determine whether occurrence scene changes relative to the image to be encoded for the successive image of the image to be encoded at second Method in, it is above-mentioned determine the image to be encoded successive image relative to the image to be encoded whether occurrence scene change (S1062), Ke Yiwei:
Calculate first predicted distortion of each frame successive image relative to image to be encoded;
According to all first predicted distortions, judge the successive image of the image to be encoded relative to the image to be encoded whether Occurrence scene changes.
It should be noted that the computational methods of above-mentioned predicted distortion belong to the prior art, in the embodiment of the present invention herein not Repeat again.
In embodiments of the present invention, when the quantity of successive image is a frame, the frame successive image can be directly judged Whether it is more than a certain predetermined threshold value relative to the predicted distortion of image to be encoded, if it does, after judging the image to be encoded There occurs scene changes relative to the image to be encoded for continuous image.
In addition, if when the quantity of successive image is more than a frame, it can calculate and obtain each frame successive image relative to treating The predicted distortion of coded image;Then maximum can be obtained from the predicted distortion obtained, judges whether the maximum is big In a predetermined threshold value, if it does, judging the successive image of the image to be encoded, relative to the image to be encoded, there occurs scene Change, otherwise judges that the successive image of the image to be encoded changes relative to the non-occurrence scene of image to be encoded;Alternatively, can be with The average value of all predicted distortions obtained is calculated, judges whether the average value is more than another predetermined threshold value, if it does, sentencing The successive image of the fixed image to be encoded, there occurs scene changes, otherwise judges the image to be encoded relative to the image to be encoded Successive image change relative to the non-occurrence scene of the image to be encoded.
Certainly, in embodiments of the present invention, successive image quantity more than a frame in the case of, be not limited to use institute The obtained corresponding average value of all predicted distortions or maximum, to judge that the successive image of the image to be encoded is treated relative to this Whether occurrence scene changes coded image, and those skilled in the art can also be judged by other prior arts, the present invention Details are not described herein for embodiment.
The determination methods of the third feasible goal condition, as shown in figure 5, the image in above-mentioned definite target image set Between whether occurrence scene change (S106), Ke Yiwei:
S1063:Based on current reference relation, determine that the image to be encoded becomes with respect to whether its reference picture occurs content Change, if it is, judging that occurrence scene changes between the image in target image set.
It should be noted that content change is substantially similar to scene changes, be only data content changes between image degree not Together.
In the first determines whether the image to be encoded occurs the method for content change with respect to its reference picture, above-mentioned base In current reference relation, determine whether the image to be encoded occurs content change (S1063) with respect to its reference picture, can wrap Include:
Based on current reference relation, calculate the image to be encoded and moved relative to the target of its corresponding reference picture recently Value, wherein, nearest reference picture is:According to display order, in the corresponding all reference pictures of the image to be encoded, treated apart from this The nearest reference picture of coded image, target motion value are:In the image to be encoded, motion amplitude is more than the 3rd predetermined threshold value Data block accounts for the ratio of whole two field picture;
Judge whether target motion value is more than the 4th predetermined threshold value;
If so, judge that with respect to its reference picture content change occurs for the image to be encoded;
If not, judge that with respect to its reference picture content change does not occur for the image to be encoded.
It is appreciated that during Video coding, the possible more than frame of reference picture of image to be encoded, if there is multi-frame-reference Image, then nearest reference picture be:According to display order, the reference picture nearest apart from the image to be encoded, for example, for aobvious Show the image sets that order is I, B1, B2, P1, B3, B4, P2, B5, B6, it is assumed that current image to be encoded is image B4, image The corresponding reference pictures of B4 are image P1 and P2, then the nearest reference picture of correspondence image B4 is image P2 at this time.
The target motion value is:Relative to the corresponding nearest reference picture of image to be encoded, moved in the image to be encoded Amplitude accounts for the ratio of whole two field picture more than the data block of the 3rd predetermined threshold value.And the computational methods of the target motion value may be referred to The prior art, the embodiment of the present invention no longer describe the computational methods of the target motion value in detail.
In second determines whether the image to be encoded occurs the method for content change with respect to its reference picture, above-mentioned base In current reference relation, determine whether the image to be encoded occurs content change (S1063) with respect to its reference picture, can wrap Include:
Based on current reference relation, second prediction of the image to be encoded relative to its corresponding reference picture recently is calculated Distortion, wherein, nearest reference picture be according to video display order, in the corresponding all reference pictures of the image to be encoded, away from The reference picture nearest from the image to be encoded;
Judge whether second predicted distortion is more than the 5th predetermined threshold value;
If so, judge that with respect to its reference picture content change occurs for the image to be encoded;
If not, judge that with respect to its reference picture content change does not occur for the image to be encoded.
For example, image to be encoded is display order be I, B1, B2, P1, B3, B4, P2, B5, B6 an image sets in figure As B3, the corresponding reference pictures recently of image B3 are image P1, calculate predicted distortions of the image B3 relative to image P1, then Judge whether the predicted distortion is more than the 5th predetermined threshold value, if it does, judging that the image to be encoded is sent out with respect to its reference picture Content change has been given birth to, has otherwise judged that with respect to its reference picture content change does not occur for the image to be encoded.
In embodiments of the present invention, except determining that the successive image of the image to be encoded is opposite using as above two methods In the image to be encoded, whether occurrence scene changes, and can also use other prior arts, the embodiment of the present invention is not limited to Determine whether occurrence scene changes the successive image of the image to be encoded relative to the image to be encoded with above-mentioned two methods.
It is emphasized that in practical applications, three kinds of determination methods of above-mentioned goal condition, can select one of which Or more than a kind of determination methods, when using more than a kind of determination methods, it should be ensured that each used determination methods are all Non- occurrence scene changes between judging the image in target image set, just can determine that the establishment of goal condition.
For example, used the decision method of above-mentioned S1061 and S1062 at the same time, when in step S1061 and S1062 at most When one step is judged there occurs scene changes to judge between the image in target image set, encoder finally judges target Condition is invalid;Non- occurrence scene change is sentenced between only step S1061 and S1062 determines the image in target image set When disconnected, encoder just can finally judge that goal condition is set up.
It is identical with embodiment of the method shown in Fig. 1, in the embodiment of the present invention, in the above-mentioned frame type by image to be encoded It is determined as after I frames (S105), this method can also include:
Reset the frame type of the current image for having determined that frame type and not starting coding.
As seen from the above, in embodiments of the present invention, when judging the frame type of image to be encoded, it is first determined treated at this Any I frames encoded before coded image are target I frames;The coding result of first kind video frame is analyzed, obtains the first statistics mould Offset;The coding result of the second class video frame is analyzed, obtains the second statistical model value;According to the first statistical model value and second Statistical model value, judges whether the image to be encoded meets default I frames alternative condition;If so, by the image to be encoded Frame type decision is I frames.In embodiments of the present invention, first kind video frame is:According to coded sequence, treated from target I frames to this I frames between coded image;Second class video frame is:According to coded sequence, from target I frames to non-the image to be encoded I frames;So the embodiment of the present invention is when judging the frame type of image to be encoded, it is contemplated that the coding knot of encoded video frame Fruit, and according to the coding result of encoded video frame, it is determined whether image to be encoded is encoded to I frames.Based on of the invention real The frame type decision method for applying example offer carries out Video coding, can accelerate coding rate, lift the compression efficiency of video, reduces Video coding loses, and improves the code efficiency of video.
The embodiment of the present invention especially for the compression efficiency that TV news in TV news, can be improved well, and Frame type decision method based on the embodiment of the present invention, the video for encoding generation meet existing video encoding standard, can be with Directly decoded by common player.
Further, since need to meet default numerical relation in the first statistical model value and the second statistical model value, and should Between image in target image set in the case of non-occurrence scene change, just image to be encoded can will be encoded to I frames, can Effectively to avoid in the short time, such as in 1s, 2s period etc., excessive I frames are inserted into, cause I encoded in the short time The ratio that the total bit number of frame accounts for the total bit number of all encoded images in the short time is excessive, causes the fluctuation of code check Greatly, it further avoid resulting video and show unintelligible problem.
Describe in detail below by instantiation to the embodiment of the present invention.
For the image to be encoded in a video, image to be encoded is that display order is Pic1、Pic2、Pic3、Pic4、Pic5、 Pic6、Pic7、Pic8 and PicImage P in 9 image setsic8, image Pic1、Pic2、Pic3、Pic4、Pic5、Pic6、Pic7、Pic8 Hes Pic9 corresponding frame types are respectively I, B, B, P, B, B, P, B and B.It is appreciated that the coded sequence of the image sets is Pic1、 Pic4、Pic2、Pic3、Pic7、Pic5、Pic6、Pic8 and Pic9, in image PicDuring 8 coding, image Pic1、Pic4、Pic2、Pic3、 Pic7、Pic5 and Pic6 have completed to encode.
In this example, it is first determined the image P encoded before imageic1 is target I frames;It is then determined that image Pic1 coding For the bit number of I frames, and statistical picture Pic4、Pic2、Pic3、Pic7、Pic5 and PicTotal bit number after 6 codings, is then schemed As PicThe ratio with the total bit number of 1 bit number.
In addition, according to coded sequence, image P is judgedic3、Pic7、Pic5 and Pic6 relative to respective preceding piece image whether Occurrence scene changes, and specific judgment mode is:Relative to respective preceding piece image, process decision chart is as P respectivelyic3、Pic7、Pic5 And PicIn 6, whether the data block that motion amplitude is more than 16 whole pixel values accounts for the ratio of whole two field picture more than 30%.Meanwhile also Judge image P to be encodedic8 compare its reference picture PicWhether 7 occur content change, and specific decision method is, relative to figure As Pic7, image PicMotion amplitude accounts for whole two field picture P more than the data block of 8 whole pixel values in 8icWhether 8 ratio exceedes 50%.
Then, during frame type decision, if meeting condition at the same time:
(1) above-mentioned ratio is less than 5%;(2) relative to respective preceding piece image, image Pic3、Pic7、Pic5 and PicIn 6, Image of the ratio more than 30% of whole two field picture is accounted for more than the data block of 16 whole pixel values there is no motion amplitude;(3) wait to compile Code image Pic8 compare its reference picture Pic7 content change does not occur.
At this time can be by image Pic8 frame type is determined as I frames again, and by image Pic8 are encoded to I frames.Hereafter change Image Pic9 reference frame is image Pic8。
In the example using above-mentioned judgement frame type method, the code efficiency lifting of different video is as shown in the table.
Table 1
In table, the row of the leftmost side one represent different video names;Y, U, V and YUV row in table represent identical Y, U, V respectively And the code check under YUV merged-qualities is saved, wherein, negative value represents to save, and increases on the occasion of expression.As can be seen from the above table, it is right The compression efficiency of most video (video) has a castering action, and frame type decision method provided in an embodiment of the present invention can be with The compression efficiency of video is improved well.
Corresponding to embodiment of the method shown in Fig. 1, as shown in fig. 6, the embodiment of the present invention provides a kind of frame type decision device, Applied to encoder, described device includes:
First determining module 110, any I frames for determining to encode before image to be encoded are target I frames;
First analysis module 120, for analyzing the coding result of first kind video frame, obtains the first statistical model value, its In, the first kind video frame is:According to coded sequence, from the target I frames to the I frames the image to be encoded;
Second analysis module 130, for analyzing the coding result of the second class video frame, obtains the second statistical model value, its In, the second class video frame is:According to coded sequence, from the target I frames to the non-I frames the image to be encoded;
Judgment module 140, for according to the first statistical model value and the second statistical model value, described in judgement Whether image to be encoded meets default I frames alternative condition;
Determination module 150, will be described to be encoded in the case of being in the judging result of the judgment module 140 The frame type decision of image is I frames.
Specifically, the judgment module 140, can include the first judging submodule and second judgment submodule (in figure not Show):
First judging submodule, for calculating between the first statistical model value and the second statistical model value Difference and/or ratio, obtain result of calculation;
The second judgment submodule, for according to the result of calculation, judging whether the image to be encoded meets to preset I frame alternative conditions.
In actual use, specifically, described device can also include:
Module (not shown) is reset, for being replacement after I frames by the frame type decision of the image to be encoded The frame type of the current image for having determined that frame type and not starting coding.
Specifically, the first statistical model value and the second statistical model value include:Average number of bits, always than Special number, peak-peak signal-to-noise ratio, minimum peak signal-to-noise ratio, average peak signal to noise ratio, max architecture similarity, minimal structure phase Like property value, average structure similarity, default size data block maximum residul difference quadratic sum, the data block of the default size Least residual square and/or the default size at least one of the mean residual quadratic sum of data block.
As seen from the above, in embodiments of the present invention, when judging the frame type of image to be encoded, it is first determined treated at this Any I frames encoded before coded image are target I frames;The coding result of first kind video frame is analyzed, obtains the first statistics mould Offset;The coding result of the second class video frame is analyzed, obtains the second statistical model value;According to the first statistical model value and second Statistical model value, judges whether the image to be encoded meets default I frames alternative condition;If so, by the image to be encoded Frame type decision is I frames.In embodiments of the present invention, first kind video frame is:According to coded sequence, treated from target I frames to this I frames between coded image;Second class video frame is:According to coded sequence, from target I frames to non-the image to be encoded I frames;So the embodiment of the present invention is when judging the frame type of image to be encoded, it is contemplated that the coding knot of encoded video frame Fruit, and according to the coding result of encoded video frame, it is determined whether image to be encoded is encoded to I frames.Based on of the invention real The frame type decision method for applying example offer carries out Video coding, can accelerate coding rate, lift the compression efficiency of video, reduces Video coding loses, and improves the code efficiency of video.
The embodiment of the present invention especially for the compression efficiency that TV news in TV news, can be improved well, and Frame type decision method based on the embodiment of the present invention, the video for encoding generation meet existing video encoding standard, can be with Directly decoded by common player.
Corresponding to embodiment of the method shown in Fig. 2~5, relative to Fig. 6, as shown in fig. 7, described device can also include:
Second determining module 160, for determining whether occurrence scene changes between the image in target image set, its In, the target image set, by including the image to be encoded, continuous first default number of frames figure according to coded sequence As composition;
The judgment module 140, specifically for judging whether following relation is set up, if it is, judging the figure to be encoded As meeting default I frames alternative condition:
The first statistical model value and the second statistical model value meet default numerical relation, and the target figure Non- occurrence scene change between image in image set conjunction.
In practical applications, specifically, second determining module 160, can be specifically used for:
Determine whether occurrence scene changes first object image relative to the second target image, if it is, judging target figure Occurrence scene changes between image in image set conjunction;Wherein,
The first object image is:According to coded sequence, second before or after the image to be encoded is default Quantity two field picture;
Second target image is:The reference picture of the first object image or according to coded sequence, described first The previous frame image of target image.
In practical applications, more specifically, the first object image is:The image to be encoded is currently located image sets The default quantity two field picture of interior the 3rd;
Second determining module 160, can include the first calculating sub module, the second calculating sub module, the 3rd calculating Module, the first judging submodule and the first decision sub-module (not shown):
First calculating sub module, for calculating prediction of the first object image compared to second target image The sum of distortion, obtains first and value;
The sum of second calculating sub module, the infra-frame prediction distortion for calculating second target image, obtains second And value;
3rd calculating sub module, for calculate described first and value and described second with the ratio of value;
First judging submodule, for judging whether the ratio is in default value section;
First decision sub-module, it is corresponding in the case of being in the judging result of first judging submodule Judge that the first object image changes relative to the second target image occurrence scene;In first judging submodule It is corresponding to judge the first object image relative to the non-occurrence scene of the second target image in the case that judging result is no Change.
In practical applications, more specifically, the first object image is:The image to be encoded is currently located image sets The default quantity two field picture of interior the 4th;
Second determining module 160, can include first and obtain submodule, the first statistic submodule, the 4th calculating Module and second judgment submodule (not shown):
This first obtains submodule, for relative to corresponding second target image of first object image described in each frame, Obtain the motion amplitude of each image block in each first object image;
First statistic submodule, for according to the motion amplitude obtained, counting and being moved in each first object image Amplitude is more than the image block of the first predetermined threshold value;
4th calculating sub module, for for each first object image, the image block that counting statistics obtains respectively to account for The ratio of whole two field picture;
The second judgment submodule, for according to the ratio being calculated, judging the first object image relative to institute Stating the second target image, whether occurrence scene changes.
In practical applications, second determining module 160, can also be specifically used for:
Determine whether occurrence scene changes relative to the image to be encoded for the successive image of the image to be encoded, if It is that occurrence scene changes between the image judged in the target image set, wherein, the successive image is suitable according to encoding Sequence, the 5th default quantity two field picture after the image to be encoded.
More specifically, second determining module 160, can include second and obtain submodule, the second statistic submodule, the Five calculating sub modules and the 3rd judging submodule (not shown):
The second acquisition submodule, for relative to the image to be encoded, obtaining each in each successive image The motion amplitude of image;
Second statistic submodule, for according to the motion amplitude obtained, counting and being moved in each successive image Amplitude is more than the image block of the second predetermined threshold value;
5th calculating sub module, for for each successive image, the image block that counting statistics obtains respectively to account for whole frame The ratio of image;
3rd judging submodule, for according to the ratio that is calculated, judging the successive image of the image to be encoded Relative to the image to be encoded, whether occurrence scene changes.
More specifically, second determining module 160, can also include the 6th calculating sub module and the 4th judging submodule (not shown):
6th calculating sub module, for calculating successive image described in each frame relative to the first of the image to be encoded Predicted distortion;
4th judging submodule, for according to all first predicted distortions, after judging the image to be encoded Relative to the image to be encoded, whether occurrence scene changes continuous image.
In practical applications, specifically, second determining module 160, can be specifically used for:
Based on current reference relation, determine whether the image to be encoded occurs content change with respect to its reference picture, if It is yes, occurrence scene changes between judging the image in target image set.
More specifically, second determining module 160, can include the 7th calculating sub module, the 5th judging submodule and Second decision sub-module (not shown):
7th calculating sub module, for based on current reference relation, calculating the image to be encoded and being corresponded to relative to it Nearest reference picture target motion value, wherein, it is described recently reference picture be:According to display order, the figure to be encoded As in corresponding all reference pictures, the reference picture nearest apart from the image to be encoded, the target motion value is:It is described In image to be encoded, motion amplitude accounts for the ratio of whole two field picture more than the data block of the 3rd predetermined threshold value;
5th judging submodule, for judging whether the target motion value is more than the 4th predetermined threshold value;
Second decision sub-module, in the case of being in the judging result of the 5th judging submodule, judges With respect to its reference picture content change occurs for the image to be encoded;It is no in the judging result of the 5th judging submodule In the case of, judge that with respect to its reference picture content change does not occur for the image to be encoded.
More specifically, second determining module 160, can also include the 8th calculating sub module, the 6th judging submodule With the 3rd decision sub-module (not shown):
8th calculating sub module, for based on current reference relation, calculating the image to be encoded and being corresponded to relative to it Nearest reference picture the second predicted distortion, wherein, it is described recently reference picture be according to video display order, it is described to wait to compile In the corresponding all reference pictures of code image, the reference picture nearest apart from the image to be encoded;
6th judging submodule, for judging whether second predicted distortion is more than the 5th predetermined threshold value;
3rd decision sub-module, in the case of being in the judging result of the 6th judging submodule, judges With respect to its reference picture content change occurs for the image to be encoded;It is no in the judging result of the 6th judging submodule In the case of, judge that with respect to its reference picture content change does not occur for the image to be encoded.
As seen from the above, in embodiments of the present invention, when judging the frame type of image to be encoded, it is first determined treated at this Any I frames encoded before coded image are target I frames;The coding result of first kind video frame is analyzed, obtains the first statistics mould Offset;The coding result of the second class video frame is analyzed, obtains the second statistical model value;According to the first statistical model value and second Statistical model value, judges whether the image to be encoded meets default I frames alternative condition;If so, by the image to be encoded Frame type decision is I frames.In embodiments of the present invention, first kind video frame is:According to coded sequence, treated from target I frames to this I frames between coded image;Second class video frame is:According to coded sequence, from target I frames to non-the image to be encoded I frames;So the embodiment of the present invention is when judging the frame type of image to be encoded, it is contemplated that the coding knot of encoded video frame Fruit, and according to the coding result of encoded video frame, it is determined whether image to be encoded is encoded to I frames.Based on of the invention real The frame type decision method for applying example offer carries out Video coding, can accelerate coding rate, lift the compression efficiency of video, reduces Video coding loses, and improves the code efficiency of video.
The embodiment of the present invention especially for the compression efficiency that TV news in TV news, can be improved well, and Frame type decision method based on the embodiment of the present invention, the video for encoding generation meet existing video encoding standard, can be with Directly decoded by common player.
Further, since need to meet default numerical relation in the first statistical model value and the second statistical model value, and should Between image in target image set in the case of non-occurrence scene change, just image to be encoded can will be encoded to I frames, can Effectively to avoid being inserted into excessive I frames in same video, the total bit number of I frames in video is caused to account for the ratio mistake of video code flow Greatly, the total bit number of non-I frames account for video code flow ratio it is too small, further avoid resulting video and show unintelligible ask Topic.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant are intended to Non-exclusive inclusion, so that process, method, article or equipment including a series of elements not only will including those Element, but also including other elements that are not explicitly listed, or further include as this process, method, article or equipment Intrinsic key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that Also there are other identical element in process, method, article or equipment including the key element.
Each embodiment in this specification is described using relevant mode, identical similar portion between each embodiment Divide mutually referring to what each embodiment stressed is the difference with other embodiment.It is real especially for device For applying example, since it is substantially similar to embodiment of the method, so description is fairly simple, related part is referring to embodiment of the method Part explanation.
Can one of ordinary skill in the art will appreciate that realizing that all or part of step in above method embodiment is To instruct relevant hardware to complete by program, the program can be stored in computer read/write memory medium, The storage medium designated herein obtained, such as:ROM/RAM, magnetic disc, CD etc..
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (28)

  1. A kind of 1. frame type decision method, applied to encoder, it is characterised in that the described method includes:
    Any I frames for determining to encode before image to be encoded are target I frames;
    The coding result of first kind video frame is analyzed, obtains the first statistical model value, wherein, the first kind video frame is:Press According to coded sequence, from the target I frames to the I frames the image to be encoded;
    The coding result of the second class video frame is analyzed, obtains the second statistical model value, wherein, the second class video frame is:Press According to coded sequence, from the target I frames to the non-I frames the image to be encoded;
    According to the first statistical model value and the second statistical model value, it is pre- to judge whether the image to be encoded meets If I frame alternative conditions;
    If so, it is I frames by the frame type decision of the image to be encoded.
  2. It is 2. according to the method described in claim 1, it is characterized in that, described according to the first statistical model value and described Two statistical model values, judge whether the image to be encoded meets default I frames alternative condition, including:
    The difference and/or ratio between the first statistical model value and the second statistical model value are calculated, obtains and calculates knot Fruit;
    According to the result of calculation, judge whether the image to be encoded meets default I frames alternative condition.
  3. 3. according to the method described in claim 1, it is characterized in that, the method further includes:
    Determine whether occurrence scene changes between the image in target image set, wherein, the target image set, by according to Coded sequence include the image to be encoded, continuous first default quantity group of picture into;
    It is described according to the first statistical model value and the second statistical model value, judge whether the image to be encoded full The default I frames alternative condition of foot, including:
    Judge whether following relation is set up, if it is, judging that the image to be encoded meets default I frames alternative condition:
    The first statistical model value and the second statistical model value meet default numerical relation, and the target image set Non- occurrence scene change between image in conjunction.
  4. 4. according to the method described in claim 3, it is characterized in that, between image in the definite target image set whether Occurrence scene changes, including:
    Determine whether occurrence scene changes first object image relative to the second target image, if it is, judging target image set Occurrence scene changes between image in conjunction;Wherein,
    The first object image is:According to coded sequence, the second default quantity before or after the image to be encoded Two field picture;
    Second target image is:The reference picture of the first object image or according to coded sequence, the first object The previous frame image of image.
  5. 5. according to the method described in claim 4, it is characterized in that, the first object image is:The image to be encoded is worked as The 3rd default quantity two field picture in preceding place image sets;
    Relative to the second target image, whether occurrence scene changes the definite first object image, including:
    The first object image is calculated compared to the sum of predicted distortion of second target image, obtains first and value;
    The sum of infra-frame prediction distortion of second target image is calculated, obtains second and value;
    Calculate described first and value and described second with the ratio of value;
    Judge whether the ratio is in default value section;
    If so, corresponding judge that the first object image changes relative to the second target image occurrence scene;
    If not, corresponding judge that the first object image changes relative to the non-occurrence scene of second target image.
  6. 6. according to the method described in claim 4, it is characterized in that, the first object image is:The image to be encoded is worked as The 4th default quantity two field picture in preceding place image sets;
    Relative to the second target image, whether occurrence scene changes the definite first object image, including:
    Relative to corresponding second target image of first object image described in each frame, obtain in each first object image The motion amplitude of each image block;
    According to the motion amplitude obtained, the image that motion amplitude in each first object image is more than the first predetermined threshold value is counted Block;
    For each first object image, the image block that counting statistics obtains respectively accounts for the ratio of whole two field picture;
    According to the ratio being calculated, judge the first object image relative to second target image whether occurrence scene Change.
  7. 7. according to the method described in claim 3, it is characterized in that, between image in the definite target image set whether Occurrence scene changes, including:
    Determine whether occurrence scene changes relative to the image to be encoded for the successive image of the image to be encoded, if so, Judge that occurrence scene changes between the image in the target image set, wherein, the successive image be according to coded sequence, The 5th default quantity two field picture after the image to be encoded.
  8. 8. the method according to the description of claim 7 is characterized in that the successive image of the definite image to be encoded is opposite In the image to be encoded, whether occurrence scene changes, including:
    Relative to the image to be encoded, the motion amplitude of each image in each successive image is obtained;
    According to the motion amplitude obtained, the image that motion amplitude in each successive image is more than the second predetermined threshold value is counted Block;
    For each successive image, the image block that counting statistics obtains respectively accounts for the ratio of whole two field picture;
    According to the ratio being calculated, judge whether the successive image of the image to be encoded is sent out relative to the image to be encoded Raw scene changes.
  9. 9. the method according to the description of claim 7 is characterized in that the successive image of the definite image to be encoded is opposite In the image to be encoded, whether occurrence scene changes, including:
    Calculate first predicted distortion of the successive image described in each frame relative to the image to be encoded;
    According to all first predicted distortions, judge the successive image of the image to be encoded relative to the image to be encoded Whether occurrence scene changes.
  10. 10. according to the method described in claim 3, it is characterized in that, it is between image in the definite target image set No occurrence scene change, including:
    Based on current reference relation, determine whether the image to be encoded occurs content change with respect to its reference picture, if it is, Occurrence scene changes between judging the image in target image set.
  11. 11. according to the method described in claim 10, it is characterized in that, described be based on current reference relation, determine described to wait to compile Whether code image occurs content change with respect to its reference picture, including:
    Based on current reference relation, calculate the image to be encoded and moved relative to the target of its corresponding reference picture recently Value, wherein, the reference picture recently is:According to display order, in the corresponding all reference pictures of the image to be encoded, away from The reference picture nearest from the image to be encoded, the target motion value are:In the image to be encoded, motion amplitude is more than The data block of 3rd predetermined threshold value accounts for the ratio of whole two field picture;
    Judge whether the target motion value is more than the 4th predetermined threshold value;
    If so, judge that with respect to its reference picture content change occurs for the image to be encoded;
    If not, judge that with respect to its reference picture content change does not occur for the image to be encoded.
  12. 12. according to the method described in claim 10, it is characterized in that, described be based on current reference relation, determine described to wait to compile Whether code image occurs content change with respect to its reference picture, including:
    Based on current reference relation, second pre- dendrometry of the image to be encoded relative to its corresponding reference picture recently is calculated Very, wherein, the reference picture recently is the corresponding all reference pictures of the image to be encoded according to video display order In, the reference picture nearest apart from the image to be encoded;
    Judge whether second predicted distortion is more than the 5th predetermined threshold value;
    If so, judge that with respect to its reference picture content change occurs for the image to be encoded;
    If not, judge that with respect to its reference picture content change does not occur for the image to be encoded.
  13. 13. according to the method described in claim 1, it is characterized in that, the frame type decision by the image to be encoded is I After frame, the method further includes:
    Reset the frame type of the current image for having determined that frame type and not starting coding.
  14. 14. according to the method described in claim 1, it is characterized in that, the first statistical model value and second statistics Model value includes:Average number of bits, total bit number, peak-peak signal-to-noise ratio, minimum peak signal-to-noise ratio, average peak noise Than, max architecture similarity, minimal structure similarity, average structure similarity, default size data block maximum The data block of residual sum of squares (RSS), the least residual square of the data block of the default size and/or the default size it is average residual At least one of poor quadratic sum.
  15. A kind of 15. frame type decision device, applied to encoder, it is characterised in that described device includes:
    First determining module, any I frames for determining to encode before image to be encoded are target I frames;
    First analysis module, for analyzing the coding result of first kind video frame, obtains the first statistical model value, wherein, it is described First kind video frame is:According to coded sequence, from the target I frames to the I frames the image to be encoded;
    Second analysis module, for analyzing the coding result of the second class video frame, obtains the second statistical model value, wherein, it is described Second class video frame is:According to coded sequence, from the target I frames to the non-I frames the image to be encoded;
    Judgment module, for according to the first statistical model value and the second statistical model value, judging described to be encoded Whether image meets default I frames alternative condition;
    Determination module, in the case of being in the judging result of the judgment module, by the frame class of the image to be encoded Type is determined as I frames.
  16. 16. device according to claim 15, it is characterised in that the judgment module, including:
    First judging submodule, for calculating the difference between the first statistical model value and the second statistical model value And/or ratio, obtain result of calculation;
    Second judgment submodule, for according to the result of calculation, judging whether the image to be encoded meets default I frames choosing Select condition.
  17. 17. device according to claim 15, it is characterised in that described device further includes:
    Second determining module, for determining whether occurrence scene changes between the image in target image set, wherein, the mesh Logo image set, by according to coded sequence include the image to be encoded, continuous first default quantity group of picture into;
    The judgment module, specifically for judging whether following relation is set up, if it is, it is pre- to judge that the image to be encoded meets If I frame alternative conditions:
    The first statistical model value and the second statistical model value meet default numerical relation, and the target image set Non- occurrence scene change between image in conjunction.
  18. 18. device according to claim 17, it is characterised in that second determining module, is specifically used for:
    Determine whether occurrence scene changes first object image relative to the second target image, if it is, judging target image set Occurrence scene changes between image in conjunction;Wherein,
    The first object image is:According to coded sequence, the second default quantity before or after the image to be encoded Two field picture;
    Second target image is:The reference picture of the first object image or according to coded sequence, the first object The previous frame image of image.
  19. 19. device according to claim 18, it is characterised in that the first object image is:The image to be encoded The 3rd default quantity two field picture being currently located in image sets;
    Second determining module, including:
    First calculating sub module, for calculate the first object image compared to second target image predicted distortion it With obtain first and value;
    The sum of second calculating sub module, the infra-frame prediction distortion for calculating second target image, obtains second and value;
    3rd calculating sub module, for calculate described first and value and described second with the ratio of value;
    3rd judging submodule, for judging whether the ratio is in default value section;
    First decision sub-module, it is corresponding to judge institute in the case of being in the judging result of the 3rd judging submodule First object image is stated relative to the second target image occurrence scene to change;In the judgement knot of the 3rd judging submodule It is corresponding to judge that the first object image changes relative to the non-occurrence scene of second target image in the case that fruit is no.
  20. 20. device according to claim 18, it is characterised in that the first object image is:The image to be encoded The 4th default quantity two field picture being currently located in image sets;
    Second determining module, including:
    First obtains submodule, for relative to corresponding second target image of first object image described in each frame, obtaining every The motion amplitude of each image block in the one first object image;
    First statistic submodule, for according to the motion amplitude obtained, it is big to count motion amplitude in each first object image In the image block of the first predetermined threshold value;
    4th calculating sub module, for for each first object image, the image block that counting statistics obtains respectively to account for whole frame figure The ratio of picture;
    4th judging submodule, for according to the ratio being calculated, judging the first object image relative to described second Whether occurrence scene changes target image.
  21. 21. device according to claim 17, it is characterised in that second determining module, is specifically used for:
    Determine whether occurrence scene changes relative to the image to be encoded for the successive image of the image to be encoded, if so, Judge that occurrence scene changes between the image in the target image set, wherein, the successive image be according to coded sequence, The 5th default quantity two field picture after the image to be encoded.
  22. 22. device according to claim 21, it is characterised in that second determining module, including:
    Second obtains submodule, for relative to the image to be encoded, obtaining each image in each successive image Motion amplitude;
    Second statistic submodule, for according to the motion amplitude obtained, it is big to count motion amplitude in each successive image In the image block of the second predetermined threshold value;
    5th calculating sub module, for for each successive image, the image block that counting statistics obtains respectively to account for whole two field picture Ratio;
    5th judging submodule, for according to the ratio that is calculated, judge the successive image of the image to be encoded relative to Whether occurrence scene changes the image to be encoded.
  23. 23. device according to claim 21, it is characterised in that second determining module, including:
    6th calculating sub module, for calculating first pre- dendrometry of the successive image described in each frame relative to the image to be encoded Very;
    6th judging submodule, for according to all first predicted distortions, judging the successive image of the image to be encoded Relative to the image to be encoded, whether occurrence scene changes.
  24. 24. device according to claim 17, it is characterised in that second determining module, is specifically used for:
    Based on current reference relation, determine whether the image to be encoded occurs content change with respect to its reference picture, if it is, Occurrence scene changes between judging the image in target image set.
  25. 25. device according to claim 24, it is characterised in that second determining module, including:
    7th calculating sub module, for based on current reference relation, it is corresponding recently relative to its to calculate the image to be encoded The target motion value of reference picture, wherein, the reference picture recently is:According to display order, the image to be encoded corresponds to All reference pictures in, the reference picture nearest apart from the image to be encoded, the target motion value is:It is described to be encoded In image, motion amplitude accounts for the ratio of whole two field picture more than the data block of the 3rd predetermined threshold value;
    7th judging submodule, for judging whether the target motion value is more than the 4th predetermined threshold value;
    Second decision sub-module, in the case of being in the judging result of the 7th judging submodule, is treated described in judgement With respect to its reference picture content change occurs for coded image;In the situation that the judging result of the 7th judging submodule is no Under, judge that with respect to its reference picture content change does not occur for the image to be encoded.
  26. 26. device according to claim 24, it is characterised in that second determining module, including:
    8th calculating sub module, for based on current reference relation, it is corresponding recently relative to its to calculate the image to be encoded Second predicted distortion of reference picture, wherein, the reference picture recently is according to video display order, the image to be encoded In corresponding all reference pictures, the reference picture nearest apart from the image to be encoded;
    8th judging submodule, for judging whether second predicted distortion is more than the 5th predetermined threshold value;
    3rd decision sub-module, in the case of being in the judging result of the 8th judging submodule, is treated described in judgement With respect to its reference picture content change occurs for coded image;In the situation that the judging result of the 8th judging submodule is no Under, judge that with respect to its reference picture content change does not occur for the image to be encoded.
  27. 27. device according to claim 15, it is characterised in that described device further includes:
    Module is reset, for after by the frame type decision of the image to be encoded for I frames, replacement currently to have determined that frame type And do not start the frame type of the image of coding.
  28. 28. device according to claim 15, it is characterised in that the first statistical model value and second statistics Model value includes:Average number of bits, total bit number, peak-peak signal-to-noise ratio, minimum peak signal-to-noise ratio, average peak noise Than, max architecture similarity, minimal structure similarity, average structure similarity, default size data block maximum The data block of residual sum of squares (RSS), the least residual square of the data block of the default size and/or the default size it is average residual At least one of poor quadratic sum.
CN201610966433.1A 2016-10-28 2016-10-28 Frame type judgment method and device Active CN108024111B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610966433.1A CN108024111B (en) 2016-10-28 2016-10-28 Frame type judgment method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610966433.1A CN108024111B (en) 2016-10-28 2016-10-28 Frame type judgment method and device

Publications (2)

Publication Number Publication Date
CN108024111A true CN108024111A (en) 2018-05-11
CN108024111B CN108024111B (en) 2019-12-06

Family

ID=62084581

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610966433.1A Active CN108024111B (en) 2016-10-28 2016-10-28 Frame type judgment method and device

Country Status (1)

Country Link
CN (1) CN108024111B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110324708A (en) * 2019-07-16 2019-10-11 浙江大华技术股份有限公司 Method for processing video frequency, terminal device and computer storage medium
CN113938679A (en) * 2021-10-09 2022-01-14 腾讯科技(深圳)有限公司 Image type determination method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020037050A1 (en) * 2000-09-27 2002-03-28 Nec Corporation Moving picture high-speed coder and moving picture high-speed coding method
CN101720044A (en) * 2009-12-10 2010-06-02 四川长虹电器股份有限公司 Adaptive frame structure-based AVS coding method
CN102300096A (en) * 2011-09-19 2011-12-28 盛乐信息技术(上海)有限公司 Frame type detection method and frame type detection system
US20130279585A1 (en) * 2010-12-17 2013-10-24 Huawei Technologies Co., Ltd. Method and apparatus for detecting frame types
WO2014082279A1 (en) * 2012-11-30 2014-06-05 Thomson Licensing Method and apparatus for estimating video quality

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020037050A1 (en) * 2000-09-27 2002-03-28 Nec Corporation Moving picture high-speed coder and moving picture high-speed coding method
CN101720044A (en) * 2009-12-10 2010-06-02 四川长虹电器股份有限公司 Adaptive frame structure-based AVS coding method
US20130279585A1 (en) * 2010-12-17 2013-10-24 Huawei Technologies Co., Ltd. Method and apparatus for detecting frame types
CN102300096A (en) * 2011-09-19 2011-12-28 盛乐信息技术(上海)有限公司 Frame type detection method and frame type detection system
WO2014082279A1 (en) * 2012-11-30 2014-06-05 Thomson Licensing Method and apparatus for estimating video quality

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110324708A (en) * 2019-07-16 2019-10-11 浙江大华技术股份有限公司 Method for processing video frequency, terminal device and computer storage medium
CN113938679A (en) * 2021-10-09 2022-01-14 腾讯科技(深圳)有限公司 Image type determination method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN108024111B (en) 2019-12-06

Similar Documents

Publication Publication Date Title
CN100461867C (en) Inage predicting encoding method in frame
JP5606591B2 (en) Video compression method
EP1259081B1 (en) Encoding continuous image data
CN102883157B (en) Method for video coding and video encoder
CN101404767A (en) Parameter-variable automated video transcoding method based on image analysis and artificial intelligence
JPH04185172A (en) High-efficiency coding device for digital image signal
CN110401833B (en) Image transmission method and device
CN100574447C (en) Fast intraframe predicting mode selecting method based on the AVS video coding
EP2041984A1 (en) Method and apparatus for adapting a default encoding of a digital video signal during a scene change period
CN112738511B (en) Fast mode decision method and device combined with video analysis
CN108574841A (en) A kind of coding method and device based on adaptive quantizing parameter
CN107222748A (en) The treating method and apparatus of view data code check
CN107820095A (en) A kind of long term reference image-selecting method and device
CN100425066C (en) Image compression method
CN110062230A (en) Image encoding method and device
CN108024111A (en) A kind of frame type decision method and device
CN104902281B (en) A kind of information concealing method of the HEVC videos based on Hamming code+1
CN1194544C (en) Video encoding method based on prediction time and space domain conerent movement vectors
CN107105240A (en) A kind of HEVC SCC complexity control methods and its system
US8175150B1 (en) Methods and/or apparatus for implementing rate distortion optimization in video compression
US20010014123A1 (en) Method for processing video
CN114189688B (en) Chrominance component prediction method based on luminance template matching
JP2001076166A (en) Encoding method of animation dynamic image
CN112165619A (en) Method for compressed storage of surveillance video
CN110677664B (en) Low-jitter code rate control method for 4K/8K ultra-high-definition video coding

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant