CN108737838A - A kind of method for video coding and device - Google Patents

A kind of method for video coding and device Download PDF

Info

Publication number
CN108737838A
CN108737838A CN201710256698.7A CN201710256698A CN108737838A CN 108737838 A CN108737838 A CN 108737838A CN 201710256698 A CN201710256698 A CN 201710256698A CN 108737838 A CN108737838 A CN 108737838A
Authority
CN
China
Prior art keywords
image
frame
encoded
group unit
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710256698.7A
Other languages
Chinese (zh)
Inventor
张贤国
朱政
金星
张二丽
范娟婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN201710256698.7A priority Critical patent/CN108737838A/en
Publication of CN108737838A publication Critical patent/CN108737838A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/573Motion compensation with multiple frame prediction using two or more reference frames in a given prediction direction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/577Motion compensation with bidirectional frame interpolation, i.e. using B-pictures
    • 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/59Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial sub-sampling or interpolation, e.g. alteration of picture size or resolution

Abstract

An embodiment of the present invention provides a kind of method for video coding and device, this method determines image group unit to be encoded first, in accordance with pre-set image group cell size;Target scene amplitude of variation of the first image of every frame relative to corresponding second image is obtained again;Then according to the target scene amplitude of variation obtained, the size of the image group unit to be encoded when determining actual coding, as target sizes;When target sizes and pre-set image group cell size are unequal, according to display order, which is updated to:Preceding target sizes frame image in uncoded image finally carries out Video coding to updated image group unit to be encoded.When carrying out Video coding using scheme provided in an embodiment of the present invention, video coding efficiency can be improved.

Description

A kind of method for video coding and device
Technical field
The present invention relates to technical field of video coding, more particularly to a kind of method for video coding and device.
Background technology
In existing common method for video coding, fixed image group cell size can be generally pre-set, it is entire to encode The size of image group unit remains unchanged in the process, specifically, when carrying out Video coding, according to the size of above-mentioned image group unit It determines image group unit, Video coding then is carried out to each video frame in identified image group unit, complete to be directed to one The coding of a image group unit.
Above-mentioned image group unit refers to one group of continuous image, according to display order, the last frame figure in this group of image As without reference to other images in group, the size of image group unit is the quantity of image in image group unit.For example, according to default Reference frame selection mode, according to display order, each reference chart with previous I frame pitches from the image for 4k (k is natural number) As with the I frame pitches from for 4k-4,4k-6 and 4k-8;With each reference picture of the previous I frame pitches from the image for 4k-2 and the I frames Distance is 4k-4,4k-6,4k-8 and 4k;With each reference picture of the previous I frame pitches from the image for 4k-3 and the I frame pitches from for 4k-4,4k-6,4k-2 and 4k;With each reference picture of the previous I frame pitches from the image for 4k-1 and the I frame pitches from for 4k-2, 4k-4,4k-6 and 4k;At this point, as shown in Figure 1, with 4 group of picture of the previous I frame pitches from 4k-3 to 4k at an image group list The size of member, the image group unit is 4.
The size of image group unit determines the maximum distance between image and its reference picture in image group unit, that is, joins Distance is examined, image group cell size is bigger, and reference distance is longer, and when such as image group cell size being 4, frame number is the image of 4k The frame number of first width reference picture is 4k-4, reference distance 4;And image group cell size is when being 8, frame number is the image of 8k The frame number of first width reference picture is 8k-8, reference distance 8.
It is appreciated that the length of reference distance is both advantageous and disadvantageous:When reference distance is long, in the case where scene changes are small, hold The object not having in adjacent image is easily found from remote reference picture, but in the case where scene changes are big, can lose phase With the more similar references object of present image texture in adjacent image;Reference distance is in short-term, then on the contrary.When i.e. scene changes are big, ginseng It examines apart from long or scene changes hour, reference distance is too short, can all there is a problem of that code efficiency is low.
And in entire video sequence, the speed of scene changes be it is unfixed, it is sometimes fast and sometimes slow, so using above-mentioned existing When method carries out Video coding, due to using fixed image group cell size, there can be image reference distance in cataloged procedure Long or too short reference distance phenomenon causes the problem that code efficiency is low.
Invention content
The embodiment of the present invention is designed to provide a kind of method for video coding and device, and the coding to improve video is imitated Rate.Specific technical solution is as follows:
In order to achieve the above object, in a first aspect, an embodiment of the present invention provides a kind of method for video coding, the method packet It includes:
According to pre-set image group cell size, image group unit to be encoded is determined;
It obtains per target scene amplitude of variation of the first image of frame relative to corresponding second image;Wherein, described First image is:At least one in the image collection be made of the image group unit to be encoded and its previous image group unit Frame image, corresponding second image of first image of frame are:It is no more than default frame according to coded sequence and first image spacing Several images;
According to the target scene amplitude of variation obtained, the big of the image group unit to be encoded when actual coding is determined It is small, as target sizes;
When the target sizes and the pre-set image group cell size are unequal, according to display order, waited for described Coded image group unit is updated to:The preceding target sizes frame image in uncoded image;
Video coding is carried out to updated image group unit to be encoded.
Preferably, the target scene obtained per the first image of frame relative to corresponding the second image of each frame changes The step of amplitude, including:
For the first image of each frame, following steps are executed:
Obtain the first image intra prediction distortion and the first image relative to the second image of each frame corresponding to it Inter-prediction is distorted;
Calculate the ratio of the average value and intra prediction distortion of each inter-prediction distortion obtained;
Determine the first image relative to its corresponding the second image of each frame target scene amplitude of variation be the ratio.
Preferably, the method further includes:
After carrying out Video coding to target image, obtains and locally recording the target image relative to third image Inter-prediction is distorted and the intra prediction of the target image is distorted, wherein the target image is:Updated figure to be encoded As the frame image in group unit, the third image is:It is no more than according to coded sequence and the target image interval described The image of default frame number;
The intra prediction distortion for obtaining the first image and the first image are relative to the second figure of each frame corresponding to it The step of inter-prediction distortion of picture, including:
Judge the local intra prediction distortion for whether recording the first image and the first image relative to corresponding to it The inter-prediction of the second image of each frame is distorted;
If so, obtain the intra prediction distortion of the first recorded image, and the first image for being recorded relative to The inter-prediction of the second image of each frame corresponding to it is distorted;
If not, calculate the first image intra prediction distortion and the first image relative to each frame corresponding to it the The inter-prediction of two images is distorted.
Preferably, described to obtain per target scene amplitude of variation of the first image of frame relative to corresponding second image The step of, including:
For the first image of each frame, following steps are executed:
It obtains each target data block in the first image and is respectively relative to the second image of each frame corresponding to the first image Motion amplitude, wherein the target data block is the data block with default size;
Relative to corresponding each second image of the first image, motion amplitude in the first image is counted respectively and is more than default threshold The destination number of the target data block of value, and calculate the ratio that destination number accounts for target data block sum in the first image;
Determine that the first image is relative to the target scene amplitude of variation of its corresponding the second image of each frame:It is calculated The average value of all proportions.
Preferably, described according to the target scene amplitude of variation obtained, determine the image to be encoded when actual coding The size of group unit, the step of as target sizes, including:
Using preset statistical analysis technique, to the corresponding target scene amplitude of variation of the first image of each frame that is obtained into Row statistical analysis obtains statistical-reference value;
If the statistical-reference value is more than the first default value, the image group unit to be encoded when actual coding is determined Size be less than pre-set image group cell size numerical value, and by the size of the identified image group unit to be encoded make For target sizes;
If the statistical-reference value is less than the second default value, the image group unit to be encoded when actual coding is determined Size be numerical value more than the pre-set image group cell size, and by the big of the identified image group unit to be encoded It is small to be used as target sizes, wherein second default value is less than first default value.
Preferably, described the step of Video coding is carried out to updated image group unit to be encoded, including:
According to the target sizes, the reference picture of each image in updated image group unit to be encoded is set;
According to set reference picture, Video coding is carried out to updated image group unit to be encoded.
Preferably, described according to the target sizes, the ginseng of each image in updated image group unit to be encoded is set The step of examining image, including:
Reference image setting rule when according to preset image group unit update to be encoded, setting is updated to be waited for The reference picture of each image in coded image group unit;Wherein, record waits compiling before having update in the reference image setting rule The size of image group unit to be encoded and updated image group unit to be encoded after the code size of image group unit, update In each image reference picture three between the rule of correspondence.
Preferably, described according to the target sizes, the ginseng of each image in updated image group unit to be encoded is set The step of examining image, including:
According to the image being resident in the target sizes and present image buffering area, updated image group to be encoded is set The reference picture of each image in unit.
Preferably, second image is according to coded sequence, the previous frame image and/or reference chart of described first image Picture.
Second aspect, an embodiment of the present invention provides a kind of video coding apparatus, described device includes:
First determining module, for according to pre-set image group cell size, determining image group unit to be encoded;
Module is obtained, changes width relative to the target scene of corresponding second image for obtaining the first image of every frame Degree;Wherein, described first image is:The image set being made of the image group unit to be encoded and its previous image group unit An at least frame image in conjunction, corresponding second image of first image of frame are:According to coded sequence and first image spacing No more than the image of default frame number;
Second determining module, for waiting compiling described according to the target scene amplitude of variation obtained, determining when actual coding The size of code image group unit, as target sizes;
Update module is used for when the target sizes and the pre-set image group cell size are unequal, according to display Sequentially, the image group unit to be encoded is updated to:The preceding target sizes frame image in uncoded image;
Video encoding module, for carrying out Video coding to updated image group unit to be encoded.
Preferably, the acquisition module, including:
Obtaining unit obtains intra prediction distortion and the first figure of the first image for being directed to the first image of each frame As the inter-prediction distortion relative to the second image of each frame corresponding to it;
Computing unit calculates the corresponding each inter-prediction distortion of the first image for being directed to the first image of each frame The ratio of average value intra prediction distortion corresponding with first image;
First determination unit determines the first image relative to its corresponding each frame for being directed to the first image of each frame The target scene amplitude of variation of two images is:The corresponding ratio of first image.
Preferably, described device further includes:
Logging modle obtains after carrying out Video coding to target image and is locally recording the target image phase The intra prediction of inter-prediction distortion and the target image for third image is distorted, wherein the target image is:More The frame image in image group unit to be encoded after new, the third image are:According to coded sequence and the target image Image of the interval no more than the default frame number;
The obtaining unit, is specifically used for:
For the first image of each frame, the local intra prediction distortion and first for whether recording the first image is judged Inter-prediction distortion of the image relative to the second image of each frame corresponding to it;If so, obtaining the first recorded image Intra prediction is distorted, and the inter-prediction distortion of the first image for being recorded relative to the second image of each frame corresponding to it; If not, calculate the first image intra prediction distortion and the first image relative to the second image of each frame corresponding to it Inter-prediction is distorted.
Preferably, the acquisition module, is specifically used for:
For the first image of each frame, following steps are executed:It is opposite respectively to obtain each target data block in the first image The motion amplitude of the second image of each frame corresponding to the first image, wherein the target data block is with default size Data block;Relative to corresponding each second image of the first image, motion amplitude in the first image is counted respectively and is more than default threshold The destination number of the target data block of value, and calculate the ratio that destination number accounts for target data block sum in the first image;It determines First image is relative to the target scene amplitude of variation of its corresponding the second image of each frame:The all proportions being calculated are put down Mean value.
Preferably, second determining module, including:
Statistical analysis unit, it is corresponding to the first image of each frame obtained for using preset statistical analysis technique Target scene amplitude of variation is for statistical analysis, obtains statistical-reference value;
Second determination unit, in the case where the statistical-reference value is more than the first default value, determining practical compile The size of the image group unit to be encoded is the numerical value less than pre-set image group cell size when code, and will be identified described The size of image group unit to be encoded is as target sizes;
Third determination unit, in the case where the statistical-reference value is less than the second default value, determining practical compile The size of the image group unit to be encoded is the numerical value more than the pre-set image group cell size when code, and will be identified The size of the image group unit to be encoded is as target sizes, wherein it is default that second default value is less than described first Numerical value.
Preferably, the video encoding module, including:
Setting unit, for according to the target sizes, each image in updated image group unit to be encoded to be arranged Reference picture;
Video encoding unit, for according to set reference picture, being carried out to updated image group unit to be encoded Video coding.
Preferably, the setting unit, is specifically used for:
Reference image setting rule when according to preset image group unit update to be encoded, setting is updated to be waited for The reference picture of each image in coded image group unit;Wherein, record waits compiling before having update in the reference image setting rule The size of image group unit to be encoded and updated image group unit to be encoded after the code size of image group unit, update In each image reference picture three between the rule of correspondence.
Preferably, the setting unit, is specifically used for:
According to the image being resident in the target sizes and present image buffering area, updated image group to be encoded is set The reference picture of each image in unit.
Preferably, second image is according to coded sequence, the previous frame image and/or reference chart of described first image Picture.
As seen from the above, in scheme provided in an embodiment of the present invention, first, in accordance with pre-set image group cell size, determination waits for Coded image group unit;Target scene amplitude of variation of the first image of every frame relative to corresponding second image is obtained again; Then according to the target scene amplitude of variation obtained, the size of the image group unit to be encoded when determining actual coding, as Target sizes;When target sizes and pre-set image group cell size are unequal, according to display order, by the image group to be encoded Unit is updated to:Preceding target sizes frame image in uncoded image finally regards updated image group unit to be encoded Frequency encodes.Wherein, the first image is:The image set being made of above-mentioned image group unit to be encoded and its previous image group unit An at least frame image in conjunction, corresponding second image of first image of frame are:According to coded sequence and first image spacing No more than the image of default frame number.
Compared with prior art, scheme provided in an embodiment of the present invention is when carrying out Video coding, each image group unit Size be not be fixed, but the determination according to actual scene changes amplitude when coding, i.e., image group unit is big The speed of small matching scene changes, thus can be to avoid the image reference in the presence of the cataloged procedure of the prior art apart from long Or the phenomenon that reference distance is too short, improve the efficiency of Video coding.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with Obtain other attached drawings according to these attached drawings.
Fig. 1 is the size of image group unit in the prior art when being 4, and the referring-to relation of each frame image shows in image group unit It is intended to;
Fig. 2 is the size of image group unit in the prior art when being 8, and the referring-to relation of each frame image shows in image group unit It is intended to;
Fig. 3 is a kind of the first flow diagram of method for video coding provided in an embodiment of the present invention;
Fig. 4 is, for the first image of each frame, to obtain it relative to its corresponding second image in the embodiment of the present invention The first flow diagram of the first way of target scene amplitude of variation;
Fig. 5 is, for the first image of each frame, to obtain it relative to its corresponding second image in the embodiment of the present invention Second of flow diagram of the first way of target scene amplitude of variation;
Fig. 6 is, for the first image of each frame, to obtain it relative to its corresponding second image in the embodiment of the present invention The flow diagram of the second way of target scene amplitude of variation;
Fig. 7 is a kind of second of flow diagram of method for video coding provided in an embodiment of the present invention;
Fig. 8 is a kind of the third flow diagram of method for video coding provided in an embodiment of the present invention;
Fig. 9 is a kind of the first structural schematic diagram of video coding apparatus provided in an embodiment of the present invention;
Figure 10 is a kind of second of structural schematic diagram of video coding apparatus provided in an embodiment of the present invention;
Figure 11 is a kind of the third structural schematic diagram of video coding apparatus provided in an embodiment of the present invention;
Figure 12 is a kind of 4th kind of structural schematic diagram of video coding apparatus provided in an embodiment of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
In the following, first to the technical term that is arrived involved in the embodiment of the present invention and method for video coding in the prior art into Row is simple to be introduced.
Video coding:Refer to that the file of some video format is converted by another video by specific compress technique Formatted file.It is well known by those skilled in the art that with the continuous development of digital video service in multimedia application and right The continuous improvement of video cloud computing demand, the big data volume of original video information source is existing wired, wireless-transmission network band Wide and storage resource is unaffordable.Thus, data compression of the vision signal in transmission, storing process becomes at present both at home and abroad The hot spot of research and application;Based on this, national and foreign standards job engineering has formulated a variety of regard in succession in the past few decades Frequency coding standard, method for video coding under above-mentioned video encoding standard is eliminating the various data redundancies of vision signal.
In order to reduce the transmission bandwidth and memory space of vision signal, these method for video coding are mostly by predicting, becoming It changes, scan, quantifying, the technologies such as entropy coding effectively reduce data redundancy.Predicting Technique therein is a key technology, prediction The selection of the prediction reference relationship of interframe is the basis of other Predicting Techniques in technology, for the prediction ginseng for finding appropriate per frame image It examines, advantageously reduces the prediction loss of data block in image, improve code efficiency.It is provided according to video encoding standard, between image Projected relationship can freely configure, but in specific encoder design, the referring-to relation freely configured can cause the time multiple Miscellaneous degree is significantly increased with design difficulty, thus the referring-to relation periodically between configuration image is a kind of design side of practicality Method.
Example 1, by taking the one group of non-I frames image of 1 I frames image and display behind as an example, according to display order, the I frames The frame number of image is 0, then according to pre-set reference frame selection mode, in above-mentioned non-I frames image, frame number is that (k is nature to 4k Number) image reference picture frame number be 4k-4,4k-6,4k-8;The frame number of the reference picture for the image that frame number is 4k-2 is 4k-4,4k-6,4k-8,4k;The frame number of the reference picture for the image that frame number is 4k-3 is 4k-4,4k-6,4k-2,4k;Frame number is The frame number of the reference picture of the image of 4k-1 is 4k-2,4k-4,4k-6,4k.
Image group unit:As stated in the background art, refer to one group of continuous image, according to display order, this group of image In last frame image without reference to group in other images, the size of image group unit is the frame of image in image group unit Number.It should distinguish, image group unit is different from image group (GOP, Group of Pictures), and image group can be with Including multiple images group unit.
For example, for an image group, according to display order, frame sequence I, B1, B2, B3, P1, B4, B5, B6, P2, B7, B8,B9,P3,B10,B11,B12,P4;The image group includes 4 image group units, and the size of each image group unit is 4, such as B1, B2, B3, P1 therein constitute an image group unit.
In existing method for video coding, the big of fixed image group unit can be pre-set in video coding process Small, the size of any one image group unit is all identical, such as 2, and 4,8,16 etc., in the image group unit of fixed size, often The reference frame of a image has all been determined according to pre-set reference frame selection mode, such as above-mentioned example 1, image group unit it is big Small is 4, and encoder can be the 4 of 4k-3 to 4k to frame number according to pre-set reference frame selection mode in Video coding Frame image carries out Video coding.The method for video coding of the prior art reduces the complexity of encoder design, is also easy to frame level The realization of the logics such as parallel encoding.
It should be noted that the size of image group unit is bigger, and it is more using bi-directional predicted image, as shown in Figure 1, figure When picture group size is 4, use bi-directional predicted number of image frames for 3 frames, the ratio for accounting for total number of images in image group unit is 75%; As shown in Fig. 2, 8k-7~8k in Fig. 2 indicates each frame image at a distance from previous I frames respectively, and as seen from the figure, gop size When being 8, use bi-directional predicted number of image frames for 7 frames, the ratio for accounting for total number of images in image group unit is 87.5%.In conjunction with the back of the body Content described in scape technology when reference distance is long, i.e. when the size of image group unit is larger, is easy in scene changes hour from long distance From finding the object not having in adjacent image in reference picture, and be conducive to the ratio of the bidirectional predictive picture of small movements estimation Expand, but can lose when scene changes are big in adjacent image with the more similar references object of present image texture;Reference distance In short-term, then on the contrary.It is not thus a kind of optimization Video coding using the method for video coding of fixed image group cell size The method of efficiency.
It describes in detail to the present invention below by specific embodiment.
Fig. 3 is a kind of the first flow diagram of method for video coding provided in an embodiment of the present invention;It is appreciated that should Method is applied to encoder, as shown in figure 3, this method includes:
S101:According to pre-set image group cell size, image group unit to be encoded is determined.
It is appreciated that in method for video coding provided in an embodiment of the present invention, a pre-set image group list is still remained First size, and by that in the image group unit of pre-set image group cell size determination, can lead to for each image It crosses preset reference frame selection mode and determines corresponding reference picture.
As previously mentioned, reference frame selection mode herein is the image group list determined by the pre-set image group cell size In member, the setting rule of the reference picture of each frame image, for example, pre-set image group cell size is 4, reference frame selection mode For:According to display order, the reference picture of first frame and third frame image is respective former frame and a later frame image, and second The reference picture of frame image is its preceding 2nd frame image and rear 2nd frame image, the reference picture of last frame image be its preceding 4th Frame image and the 6th frame image.
For step S101, for example, pre-set image group cell size is 8 frames, a current image group cell encoding knot Shu Hou determines image group unit to be encoded for preceding 8 frame under current time not according to the image display order for the video to be encoded The image group unit of the image composition of coding.
S102:It obtains per target scene amplitude of variation of the first image of frame relative to corresponding second image.Wherein, First image is:At least one in the image collection be made of above-mentioned image group unit to be encoded and its previous image group unit Frame image, corresponding second image of first image of frame are:It is no more than default frame according to coded sequence and first image spacing Several images.
The first image in the embodiment of the present invention can be from above-mentioned image group unit to be encoded and its previous image group list At least frame image selected in image collection that member is formed, it will be understood that the frame number of the first image is more, and calculation amount is got over Greatly, so in practical applications, can according to display order, select last frame image in image group unit to be encoded as First image.For example, according to display order, currently determined image group unit to be encoded includes image Pic1、Pic2、Pic3With Pic4, then image P can be selectedic4As the first image.
For the second image in the embodiment of the present invention is opposite the first image of Mr. Yu, according to coded sequence and first figure As interval is no more than the image of default frame number;Obvious, for a certain first image, the quantity of corresponding second image is at least For a frame, and in practical applications, the second image can be according to coded sequence, the previous frame image and/or ginseng of the first image Examine image.
For example, according to display order, image sequence Pic1~Pic8In, Pic1~Pic4For encoded image, Pic5~Pic8Structure At above-mentioned image group unit to be encoded, Pic8For above-mentioned first image, currently determined image group unit to be encoded includes image Pic5、Pic6、Pic7And Pic8, then image P can be selectedic8As the first image, according to preset reference frame selection mode, image Pic4For image Pic8Reference picture, then can determine image Pic4For corresponding first image Pic4The second image.
It should be noted that target scene amplitude of variation described herein of the embodiment of the present invention refers to that can reflect above-mentioned wait for The numerical value of coded image group unit scene changes size, the embodiment of the present invention do not limit the tool of target scene amplitude of variation herein Body type.
It is further to note that in the case of one kind, step S102 can be:It is directed to the first image of every frame, needs to obtain Target scene amplitude of variation when first image is respectively relative to its each corresponding second image is obtained, for example, for first Image x, the second image of correspondence are image a~d, then need to obtain target when the first image x is respectively relative to image a~d Scene changes amplitude is to get to 4 target scene amplitudes;In another case, step S102 can be, it is directed to every frame first Image needs to obtain the whole target scene variation width that first image is constituted relative to its corresponding all second image Degree, for example, for the first image x, the second image of correspondence is image a~d, then needs to obtain the first image x relative to image a The whole target scene amplitude of variation that~d is constituted is to get to a target scene amplitude of variation.
In the embodiment of the present invention, as the first realization method of step S102, above-mentioned acquisition is opposite per the first image of frame In target scene amplitude of variation (S102) of corresponding the second image of each frame the step of, as shown in figure 4, may include:
For the first image of each frame, following steps are executed:
S201:Obtain the first image intra prediction distortion and the first image relative to each frame second corresponding to it The inter-prediction of image is distorted.
In embodiments of the present invention, above-mentioned intra prediction distortion and inter-prediction can be obtained by calculating, and image Intra prediction and image between the computational methods of inter-prediction distortion belong to the prior art, those skilled in the art can be with It is calculated in acquisition frame by prior art means and inter-prediction distortion, the embodiment of the present invention is no longer discussed in detail herein.
As previously mentioned, the above-mentioned above-mentioned image group unit to be encoded of first image is formed with its previous image group unit An at least frame image in image collection, so the first image can be encoded image, it will be appreciated by those skilled in the art that , in coding, encoder accounting nomogram is distorted and image is relative to its corresponding ginseng image as corresponding intra prediction The inter-prediction distortion of the images such as image is examined, so in order to more quickly perform step S201, it is in embodiments of the present invention, above-mentioned Method for video coding can also include:
After carrying out Video coding to target image, obtains and locally recording interframe of the target image relative to third image The intra prediction of predicted distortion and target image is distorted.Wherein, target image is:In updated image group unit to be encoded One frame image, third image are:It is no more than the image of default frame number according to coded sequence and target image interval.
It should be noted that the target image can be each frame image in updated image to be encoded.In addition, certain Corresponding second image of one the first image of frame is:It is no more than the figure of default frame number according to coded sequence and first image spacing Picture, and third image is:It is no more than the image of default frame number according to coded sequence and target image interval, so in practical application In, the second image and third image be respectively on the basis of the first image and target image, it is regular and true according to identical setting Fixed;For example, the reference picture of the first image corresponds to the second image for it, similarly, the reference picture of target image corresponds to for it Third image.
It is appreciated that the frame in local record target image relative to the inter-prediction distortion and target image of third image After interior prediction distortion, before the image group unit after the image group unit to being next to where target image encodes, if First image determined by the moment is target image herein, since local record has target image relative to third image Inter-prediction is distorted and the intra prediction of target image is distorted, that is, indicates that local record has the intra prediction of the first image to be distorted, And first inter-prediction distortion of the image relative to the second image of each frame corresponding to it, it is possible to directly be obtained from local The intra prediction of first image is distorted and the first image loses relative to the inter-prediction of the second image of each frame corresponding to it Very.
So in embodiments of the present invention, correspondingly, the intra prediction distortion of the first image of above-mentioned acquisition and the first figure As the step of being distorted (S201) relative to the inter-prediction of the second image of each frame corresponding to it, as shown in figure 5, may include:
S2011:Judge the local intra prediction distortion for whether recording the first image and the first image relative to its institute The inter-prediction of corresponding the second image of each frame is distorted.
If the judging result of step S2011 is yes, S2012:The intra prediction distortion of the first recorded image is obtained, And inter-prediction distortion of the first image recorded relative to the second image of each frame corresponding to it.
If the judging result of step S2011 is no, S2013:Calculate the intra prediction distortion and first of the first image Inter-prediction distortion of the image relative to the second image of each frame corresponding to it.
Illustrate step S2011~S2013, it is assumed that after the image a codings in a certain image group unit to be encoded, compile Code device is distorted in the intra prediction distortion and image a for having locally recorded image a relative to the inter-prediction of its reference picture. The Video coding of next image group unit to be encoded will be carried out after all images of the image group unit to be encoded are encoded When, if using image a as the first image, the reference picture of image a is as the second image, due to having locally recorded image a's Intra prediction is distorted and image a is distorted relative to the inter-prediction of its reference picture, it is possible to directly obtain institute from local The intra prediction distortion of first image of record, and the first image for being recorded is relative to the second image of each frame corresponding to it Inter-prediction distortion.
If using the image x in above-mentioned next image group unit to be encoded as the first image, the reference picture of image x is made For the second image, it is clear that, the local intra prediction distortion for not recording image x and image x are relative to its reference picture Inter-prediction is distorted, and needs the interframe of the intra prediction distortion and image x that calculate image x relative to its reference picture at this time Predicted distortion.
As shown in figure 4, S202:The average value for calculating each inter-prediction distortion obtained is distorted with the intra prediction Ratio;
S203:Determine the first image relative to its corresponding the second image of each frame target scene amplitude of variation be above-mentioned ratio Value.
For step S201~S203, for example, a certain first image x, is corresponding with the second image 1~4, then it can be first The intra prediction distortion a of the first image x is calculated, and calculates the interframe that the first image x is respectively relative to the second image 1~4 Predicted distortion b~e;Then the average value of inter-prediction distortion b~e is calculated, then calculates the average value and is distorted a with intra prediction Ratio, finally determine the first image x relative to its corresponding second image 1~4 target scene amplitude of variation to be determined Ratio.
In the embodiment of the present invention, as second of realization method of step S102, above-mentioned acquisition is opposite per the first image of frame In target scene amplitude of variation (S102) of corresponding second image the step of, as shown in fig. 6, may include:
For the first image of each frame, following steps are executed:
S301:It obtains each target data block in the first image and is respectively relative to the second figure of each frame corresponding to the first image The motion amplitude of picture, wherein the target data block is the data block with default size.
In embodiments of the present invention, motion amplitudes of the frame image A relative to image B, can be by image A relative to figure As the motion vector of B indicates that the motion vector can be obtained according to each image block in image A relative to the motion vector of image B It arrives, for example, it may be the mean value of motion vector etc. of above-mentioned image block.
It should be noted that similarly with step S201, image is in coding, the data in encoder accounting nomogram picture Motion amplitude of the block relative to images such as its corresponding reference pictures, in order to more quickly perform step S301, of the invention real It applies in example, above-mentioned method for video coding can also include:
After carrying out Video coding to target image, obtains and each target data block is distinguished in locally recording target image Motion amplitude relative to each frame third image corresponding to the target image.Wherein, target image is:It is updated to be encoded A frame image in image group unit, third image are:It is no more than default frame number according to coded sequence and target image interval Image.
Likewise, each target data block is respectively relative to corresponding to the target image in locally recording target image After the motion amplitude of each frame third image, the image group unit after the image group unit to being next to where target image carries out Before coding, if identified first image is target image herein, local record has each target data in target image Block is respectively relative to the motion amplitude of each frame third image corresponding to the target image, that is, indicates that local record has the first image In each target data block be respectively relative to the motion amplitude of the second image of each frame corresponding to the first image.
So in embodiments of the present invention, correspondingly, each target data block is opposite respectively in the first image of above-mentioned acquisition It the step of motion amplitude (S301) of the second image of each frame corresponding to the first image, may include steps of:
Judge that locally whether recording each target data block in the first image is respectively relative to corresponding to the first image The motion amplitude of the second image of each frame;It is respectively relative to if so, obtaining each target data block in the first recorded image The motion amplitude of the second image of each frame corresponding to first image;If not, calculating each target data block point in the first image Motion amplitude not relative to the second image of each frame corresponding to the first image.
As shown in fig. 6, S302:Relative to corresponding each second image of the first image, counts transported in the first image respectively Dynamic amplitude is more than the destination number of the target data block of predetermined threshold value, and calculates destination number and account for target data block in the first image The ratio of sum.
For example, target data block is the data block of 16 × 16 sizes, for a certain first image a, corresponding two the Two image b and c.Relative to image b, the quantity that motion amplitude in the first image a is more than the target data block of predetermined threshold value is counted M1, and calculate the ratio that m1 accounts for target data block sum m in the first image a;Meanwhile relative to image c, counting the first image a Middle motion amplitude is more than the quantity m2 of the target data block of predetermined threshold value, and calculates m2 to account for target data block in the first image a total The ratio of number m.
S303:Determine that the first image is relative to the target scene amplitude of variation of its corresponding the second image of each frame:It calculates The average value of obtained all proportions.
For step S301~S303, for example, the first image is the previous image group list of above-mentioned image group unit to be encoded Image a in member, the second image are the reference picture b of first image and according to coded sequence, the former frames of the first image Image b, then encoder local whether recorded can be judged respectively:Each target data block is respectively relative to image b in image a With the motion amplitude of c, it is assumed that judging result is yes, then each target data block is respectively relative to figure from local acquisition image a As the motion amplitude of b and c.
Then relative to image b, motion amplitude is more than the quantity n1 of the target data block of predetermined threshold value in statistical picture a, And calculate the ratio that n1 accounts for target data block sum n in image a;Meanwhile relative to image c, motion amplitude is big in statistical picture a In the quantity n2 of the target data block of predetermined threshold value, and calculate the ratio that n2 accounts for target data block sum n in image a.Finally count The average value of obtained all proportions is calculated, i.e. (n1+n2)/2n, and determines the first image relative to its corresponding each frame second The target scene amplitude of variation of image is (n1+n2)/2n.
As shown in figure 3, S103:According to the target scene amplitude of variation obtained, the figure to be encoded when determining actual coding As the size of group unit, as target sizes.
It should be noted that in practical applications, above-mentioned steps S201~S203 and step S301~S303 are carried respectively And two kinds of realization methods may be performed simultaneously, then when specifically executing step S103, two kinds of realization methods point can be directed to The target scene amplitude of variation that does not obtain integrates determining target sizes.
In embodiments of the present invention, the target scene amplitude of variation obtained can reflect big according to pre-set image group unit The scene changes size of image in the image group unit to be encoded of small determination, it will be understood that scene changes are bigger, identified mesh It is smaller to mark size, certainly, the embodiment of the present invention does not limit the specific method for determining the target sizes.
In embodiments of the present invention, realization method as one preferred, it is above-mentioned to be changed according to the target scene obtained Amplitude determines the size of image group unit to be encoded when actual coding, the step of as target sizes (S103), as shown in fig. 7, May include:
S1031:Using preset statistical analysis technique, the corresponding target scene of the first image of each frame obtained is changed Amplitude is for statistical analysis, obtains statistical-reference value.
First it should be noted that statistical-reference value described herein may include the systems such as average value, maximum value median Evaluation.
For example, the statistical-reference value is average value, if the corresponding target scene amplitude of variation of first image of frame is:Step The ratio that rapid S203 is calculated, then statistical-reference value herein is the average value of the corresponding ratio of all first images;Such as The corresponding target scene amplitude of variation of one the first image of frame of fruit is:The average value that step S303 is calculated, then herein statistics ginseng Examine the average value that value is the corresponding average value of all first images.
S1032:If the statistical-reference value is more than the first default value, image group unit to be encoded when actual coding is determined Size be numerical value less than pre-set image group cell size, and using the size of identified image group unit to be encoded as mesh Mark size.
When determining the target sizes in step S1032, it is big to obtain target that pre-set image group cell size can be reduced It is small, such as pre-set image group cell size 8 is reduced into original half, i.e. target sizes are 4;One can also be randomly choosed Less than the numerical value of pre-set image group cell size, for example, pre-set image group cell size is 8, the statistical-reference value calculated is big In the first default value, then the target sizes can be determined as to an integer less than 8, such as 4 at this time at random.
S1033:If the statistical-reference value is less than the second default value, image group unit to be encoded when actual coding is determined Size be numerical value more than pre-set image group cell size, and using the size of identified image group unit to be encoded as mesh Mark size, wherein the second default value is less than the first default value.
When determining the target sizes in step S1033, it is big to obtain target that pre-set image group cell size can be amplified It is small, such as pre-set image group cell size 4 is put and is twice, obtain target sizes 8;One can also be randomly choosed more than default The numerical value of image group cell size, such as pre-set image group cell size are 4, and it is default that the statistical-reference value calculated is more than second The target sizes can be then determined as an integer more than 4, such as 8 at random by numerical value at this time.
It should be noted that the first default value is more than the second default value, so in practical applications, step S1031 Calculated statistical-reference value be also possible within the section constituted just at the second default value and the first default value, i.e., The statistical-reference value, which meets, is more than or equal to the second default value, and less than or equal to the condition of the first default value.In the case, It can be directly to carry out video volume to image group unit to be encoded determined by step S101 according in a manner of preset reference frame selection Code completes the Video coding to the image group unit to be encoded.
Certainly, for directly according to preset reference frame selection mode to image group list to be encoded determined by step S101 Each frame image in member, after carrying out Video coding, encoder can also obtain and record the image relative to the 4th image Inter-prediction distortion and the image intra prediction distortion;So that encoder is carrying out video to next image group unit Before coding, after executing above-mentioned steps S2011 again, obtained result is yes.Wherein, the 4th image is:According to coded sequence with The image spacing is no more than the image of default frame number.
Similarly, for directly according to preset reference frame selection mode to image group list to be encoded determined by step S101 Each frame image in member, after carrying out Video coding, encoder can also obtain each target data block difference in the image Motion amplitude relative to the 4th image of each frame corresponding to the image;So that encoder to next image group unit into Before row Video coding, execute above-mentioned steps " judge locally whether to have recorded each target data block difference in the first image again After motion amplitude relative to the second image of each frame corresponding to the first image ", obtained result is yes.
As shown in figure 3, S104:It, will according to display order when target sizes and pre-set image group cell size are unequal The image group unit to be encoded is updated to:Preceding target sizes frame image in uncoded image.
For example, conventional images sequence Pic1~Pic12, Pic1~Pic4For encoded image, Pic5~Pic12Before constituting update Image group unit to be encoded, i.e., pre-set image group cell size be 8, it is assumed that target sizes determined by step S103 be 4, then The image group unit to be encoded is updated to by P at this timeic5~Pic8The image group unit constituted.
S105:Video coding is carried out to updated image group unit to be encoded.
After determining updated image group unit to be encoded, it can be determined according to the prior art in image group unit to be encoded Then the reference picture of each frame image treats coded image group unit according to the reference picture of each frame image and carries out Video coding.
In embodiments of the present invention, the above-mentioned step that Video coding (S105) is carried out to updated image group unit to be encoded Suddenly, as shown in figure 8, may include:
S1051:According to target sizes, the reference picture of each image in updated image group unit to be encoded is set.
As the first feasible realization method in the embodiment of the present invention, it can pre-set that different size is corresponding to be waited for The reference image setting rule of each frame image in coded image group unit, thus when executing step S1051, directly inquire target The corresponding reference image setting rule of size, then according to the reference image setting rule inquired, setting is updated to be waited compiling The reference picture of each image in code image group unit.
For example, when the size for image group unit is 4, the reference image setting rule of each frame image is:According to display Sequentially, the reference picture of first frame and third frame image is respective former frame and a later frame image, the ginseng of the second frame image It is its preceding 2nd frame image and rear 2nd frame image to examine image, and the reference picture of last frame image is its preceding 4th frame image and the 6th Frame image.
It is above-mentioned according to target sizes as second of feasible realization method in the embodiment of the present invention, after setting update Image group unit to be encoded in each image reference picture (S1051) the step of, may include:
Reference image setting rule when according to preset image group unit update to be encoded, setting is updated to be waited for The reference picture of each image in coded image group unit;Wherein, record has figure to be encoded before update in reference image setting rule As each in the size of image group unit to be encoded after the group size of unit, update and updated image group unit to be encoded The rule of correspondence between the reference picture three of image.
It is appreciated that in the reference image setting rule that second of realization method described herein provides, in known update In the case of the size of forward and backward image group unit to be encoded, so that it may respectively be schemed with knowing in updated image group unit to be encoded The reference picture of picture;In practical applications, which can be a formula, and the formula is to update forward and backward wait for The size of coded image group unit is independent variable, and the reference picture of each image is because becoming in updated image group unit to be encoded Amount.
The reference image setting rule can also be a rule list, at least be recorded in the rule list to be encoded before having update After the size of image group unit, update in the size of image group unit to be encoded and updated image group unit to be encoded Three column data of reference picture of each image.For example, preserving a record in the rule list:
The size of image group unit to be encoded is 8 before update, and the size of image group unit to be encoded is 4 after update, and The reference picture of updated 4 frame image of image group unit kind to be encoded is:According to display order, first frame and third frame image Reference picture be respective former frame and a later frame image, the reference picture of the second frame image be its preceding 2nd frame image and The reference picture of 2nd frame image afterwards, last frame image is its preceding 4th frame image and the 6th frame image.
It is above-mentioned according to target sizes as the third feasible realization method in the embodiment of the present invention, after setting update Image group unit to be encoded in each image reference picture (S1051) the step of, may include:
According to the image being resident in the target sizes and present image buffering area, updated image group to be encoded is set The reference picture of each image in unit.
It will be appreciated by persons skilled in the art that using the image being resident in image buffer as the ginseng of uncoded image When examining image, can quickly it be encoded.In practical applications, updated to be encoded for being not belonging to reference before needing The image of image in image group unit, forward direction reference picture can be directly disposed as the image being resident in image buffer.
For example, being resident image a and b in image buffer, there are 4 frame images in updated image group unit to be encoded, Frame number is respectively 8~11, then can be arranged:In 4 frame images, according to display order, the reference picture of first frame image is it The reference picture of a later frame image and image a and b, the second frame image are the 2nd frame image and image a and b thereafter, third frame The reference picture of image is its previous frame image and a later frame image, and the reference picture of the 4th frame image is image a and b.
S1052:According to set reference picture, Video coding is carried out to updated image group unit to be encoded.
In updated image group unit to be encoded is determined after the reference picture of each frame image, encoder i.e. both can be with According to existing Video coding mode, updated image group unit to be encoded is encoded.
It will be appreciated by persons skilled in the art that when scene changes are obvious, due to image to be encoded and long distance Correlation from image is significantly deteriorated, bi-directional predicted to significantly estimation improved efficiency unobvious, and image to be encoded To the dependency degree higher of its adjacent image, the size of image group unit should not be arranged larger at this time, if image group unit Size is larger, can there is the low problem of code efficiency;Conversely, when scene changes unobvious, the size of image group unit is not at this time What is be preferably arranged is smaller, if the size of image group unit is smaller, can equally there is the low problem of code efficiency.
And in summary, in scheme provided in an embodiment of the present invention, the size of image group unit to be encoded when actual coding It is the scene changes amplitude in the image group unit to be encoded based on determined by step S101 between image and adaptively determines , when scene changes are obvious, adaptively reduce the size of image group unit to be encoded;When scene changes unobvious, Adaptively increase the size of image group unit to be encoded, thus the embodiment of the present invention can significantly improve general scene, especially The code efficiency of the sometimes fast and sometimes slow video of scene changes.In addition, the scheme code generation provided through the embodiment of the present invention regards Frequency meets existing video encoding standard, can directly be decoded by common player, versatility is good.
As seen from the above, compared with prior art, scheme provided in this embodiment is when carrying out Video coding, each image The size of group unit be not be fixed, but the determination according to actual scene changes amplitude when coding, i.e. image group list Member size matching scene changes speed, thus can to avoid the image reference in the presence of the cataloged procedure of the prior art away from From long or too short reference distance phenomenon, the efficiency of Video coding is improved.
The embodiment of the present invention is briefly described below by a specific example.
After encoder is to upper image group cell encoding, according to display order, in current uncoded image, preceding 8 frame Image is Pic1~Pic8, it is assumed that pre-set image group cell size is 4, then determines that image group unit to be encoded is image P at this timeic1 ~Pic4For the image group unit formed.
In this example, the first image is the last frame image of current image group unit to be encoded according to display order Pic4, the second image is the reference picture of the first image, and according to preset reference frame selection mode, image Pic4Reference picture For according to display order, image Pic4Preceding 4th frame image Pic0
So when encoder calculate image Pic4Intra prediction distortion, image Pic4Relative to image Pic0Inter-prediction Distortion, then calculate the ratio of inter-prediction distortion and intra prediction distortion;Image P is also calculated simultaneouslyic4Interior each 16 × 16 Data block is relative to image Pic0Motion vector, and statistical picture Pic4The mesh of 16 × 16 data blocks of the interior motion vector more than 16 Quantity is marked, then counts the destination number and accounts for image Pic4The ratio of interior 16 × 16 data block total number amount.
Assuming that in this example, the ratio is preset more than 2/3rds or when the ratio is more than 0.5, determines practical compile The size of image group unit to be encoded is a random number less than pre-set image group cell size when code, and it is small to set the ratio When a quarter, determine that the size of image group unit to be encoded when actual coding is more than the one of pre-set image group cell size A random number.
And in this example, the above-mentioned ratio calculated is 1/5th, ratio 0.45, then determines target at random at this time Size is the numerical value 8 more than 4.Then the image group unit to be encoded is updated to:Pic1~Pic8For the image group unit formed.
Assuming that the image for currently residing at the image buffer of encoder is:According to display order, image Pic8Preceding 10th frame Image x and preceding 12nd frame image y, then can be arranged:In 8 frame images, according to display order, the reference picture of first frame image For its a later frame image and image x and y, the reference picture of the second frame image is the 2nd frame image and image x and y thereafter, the The reference picture of three frame images is its previous frame image and a later frame image, and the reference picture of the 4th frame image is the thereafter the 4th The reference picture of frame image and image x and y, the 5th frame image are its previous frame image and a later frame image, the 6th frame figure The reference picture of picture is its preceding 2nd frame image and rear 2nd frame image, and the reference picture of the 7th frame image is its previous frame image And a later frame image, the reference picture of the 8th frame image is image x and y.
Finally, for 8 frame images in unit group to be encoded, according to respectively set reference picture, to each frame image Carry out Video coding.
In the example for stating method for video coding in use, the code efficiency of different video is promoted as shown in table 1 below.
Table 1
In table, the row of the leftmost side one indicate the title and its resolution ratio of video;Y, U, V and YUV row in table indicate phase respectively Code check under same Y, U, V and YUV merged-quality is saved, wherein negative value indicates to save, and positive value indicates to increase.It can be with from upper table Find out there is a castering action to the compression efficiency of most video (video), therefore Video coding side provided in an embodiment of the present invention Method can improve the compression efficiency of video well, that is, improve code efficiency.
Corresponding to embodiment of the method shown in Fig. 3, the embodiment of the present invention additionally provides a kind of video coding apparatus, such as Fig. 9 institutes Show, described device includes:
First determining module 110, for according to pre-set image group cell size, determining image group unit to be encoded;
Module 120 is obtained, is become relative to the target scene of corresponding second image for obtaining the first image of every frame Change amplitude;Wherein, described first image is:The figure being made of the image group unit to be encoded and its previous image group unit An at least frame image in image set conjunction, corresponding second image of first image of frame are:According to coded sequence and first image Interval is no more than the image of default frame number;
Second determining module 130, for waiting for described according to the target scene amplitude of variation obtained, determining when actual coding The size of coded image group unit, as target sizes;
Update module 140 is used for when the target sizes and the pre-set image group cell size are unequal, according to aobvious Show sequence, the image group unit to be encoded is updated to:The preceding target sizes frame image in uncoded image;
Video encoding module 150, for carrying out Video coding to updated image group unit to be encoded.
Corresponding to embodiment of the method shown in Fig. 4, as shown in Figure 10, the acquisition module 120 may include:
Obtaining unit 1201 obtains the intra prediction distortion of the first image, Yi Ji for being directed to the first image of each frame Inter-prediction distortion of one image relative to the second image of each frame corresponding to it;
Computing unit 1202 calculates the corresponding each inter-prediction of the first image and loses for being directed to the first image of each frame The really ratio of average value intra prediction distortion corresponding with first image;
First determination unit 1203 determines that the first image is corresponding each relative to its for being directed to the first image of each frame The target scene amplitude of variation of the second image of frame is:The corresponding ratio of first image.
In practical applications, specifically, described device can also include:
Logging modle (not shown) obtains and after carrying out Video coding to target image in local record institute It states target image to be distorted relative to the inter-prediction distortion of third image and the intra prediction of the target image, wherein described Target image is:A frame image in updated image group unit to be encoded, the third image are:According to coded sequence with The target image interval is no more than the image of the default frame number;
Corresponding to embodiment of the method shown in Fig. 5, the obtaining unit 1201 can be specifically used for:
For the first image of each frame, the local intra prediction distortion and first for whether recording the first image is judged Inter-prediction distortion of the image relative to the second image of each frame corresponding to it;If so, obtaining the first recorded image Intra prediction is distorted, and the inter-prediction distortion of the first image for being recorded relative to the second image of each frame corresponding to it; If not, calculate the first image intra prediction distortion and the first image relative to the second image of each frame corresponding to it Inter-prediction is distorted.
Corresponding to embodiment of the method shown in Fig. 6, specifically, the acquisition module 120, can be specifically used for:
For the first image of each frame, following steps are executed:It is opposite respectively to obtain each target data block in the first image The motion amplitude of the second image of each frame corresponding to the first image, wherein the target data block is with default size Data block;Relative to corresponding each second image of the first image, motion amplitude in the first image is counted respectively and is more than default threshold The destination number of the target data block of value, and calculate the ratio that destination number accounts for target data block sum in the first image;It determines First image is relative to the target scene amplitude of variation of its corresponding the second image of each frame:The all proportions being calculated are put down Mean value.
Corresponding to embodiment of the method shown in Fig. 7, as shown in figure 11, second determining module 130 may include:
Statistical analysis unit 1301, for using preset statistical analysis technique, to the first image pair of each frame obtained The target scene amplitude of variation answered is for statistical analysis, obtains statistical-reference value;
Second determination unit 1302, in the case where the statistical-reference value is more than the first default value, determining real The size of border image group unit to be encoded when encoding is the numerical value less than pre-set image group cell size, and will be identified The size of the image group unit to be encoded is as target sizes;
Third determination unit 1303, in the case where the statistical-reference value is less than the second default value, determining real The size of the image group unit to be encoded is the numerical value more than the pre-set image group cell size when border encodes, and by really The size of the fixed image group unit to be encoded is as target sizes, wherein second default value is less than described first Default value.
Corresponding to embodiment of the method shown in Fig. 8, as shown in figure 12, the video encoding module 150 may include:
Setting unit 1501, for according to the target sizes, being arranged in updated image group unit to be encoded and respectively scheming The reference picture of picture;
Video encoding unit 1502 is used for according to set reference picture, to updated image group unit to be encoded Carry out Video coding.
In practical applications, as the first realization method, the setting unit 1501 can be specifically used for:
Reference image setting rule when according to preset image group unit update to be encoded, setting is updated to be waited for The reference picture of each image in coded image group unit;Wherein, record waits compiling before having update in the reference image setting rule The size of image group unit to be encoded and updated image group unit to be encoded after the code size of image group unit, update In each image reference picture three between the rule of correspondence.
In practical applications, as second of realization method, the setting unit 1501 can be specifically used for:
According to the image being resident in the target sizes and present image buffering area, updated image group to be encoded is set The reference picture of each image in unit.
In practical applications, second image can be according to coded sequence, the previous frame image of described first image And/or reference picture.
As seen from the above, compared with prior art, scheme provided in this embodiment is when carrying out Video coding, each image The size of group unit be not be fixed, but the determination according to actual scene changes amplitude when coding, i.e. image group list Member size matching scene changes speed, thus can to avoid the image reference in the presence of the cataloged procedure of the prior art away from From long or too short reference distance phenomenon, the efficiency of Video coding is improved.
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 actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, identical similar portion between each embodiment Point just to refer each other, and each embodiment focuses on the differences from other embodiments.Especially for device reality For applying example, since it is substantially similar to the method embodiment, so description is fairly simple, related place is referring to embodiment of the method Part explanation.
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 (18)

1. a kind of method for video coding, which is characterized in that the method includes:
According to pre-set image group cell size, image group unit to be encoded is determined;
It obtains per target scene amplitude of variation of the first image of frame relative to corresponding second image;Wherein, described first Image is:An at least frame figure in the image collection be made of the image group unit to be encoded and its previous image group unit Picture, corresponding second image of first image of frame are:It is no more than default frame number according to coded sequence and first image spacing Image;
According to the target scene amplitude of variation obtained, the size of the image group unit to be encoded when actual coding is determined, make For target sizes;
It, will be described to be encoded according to display order when the target sizes and the pre-set image group cell size are unequal Image group unit is updated to:The preceding target sizes frame image in uncoded image;
Video coding is carried out to updated image group unit to be encoded.
2. according to the method described in claim 1, it is characterized in that, described obtain per the first image of frame relative to corresponding The step of target scene amplitude of variation of the second image of each frame, including:
For the first image of each frame, following steps are executed:
Obtain the interframe of the intra prediction distortion and the first image of the first image relative to the second image of each frame corresponding to it Predicted distortion;
Calculate the ratio of the average value and intra prediction distortion of each inter-prediction distortion obtained;
Determine the first image relative to its corresponding the second image of each frame target scene amplitude of variation be the ratio.
3. according to the method described in claim 2, it is characterized in that, the method further includes:
After carrying out Video coding to target image, obtains and locally recording interframe of the target image relative to third image The intra prediction of predicted distortion and the target image is distorted, wherein the target image is:Updated image group to be encoded A frame image in unit, the third image are:It is no more than according to coded sequence and the target image interval described default The image of frame number;
The intra prediction distortion for obtaining the first image and the first image are relative to the second image of each frame corresponding to it The step of inter-prediction is distorted, including:
Judge the local intra prediction distortion for whether recording the first image and the first image relative to each frame corresponding to it The inter-prediction of second image is distorted;
If so, the intra prediction distortion of the first recorded image is obtained, and the first image recorded is relative to its institute The inter-prediction of corresponding the second image of each frame is distorted;
If not, calculate the first image intra prediction distortion and the first image relative to the second figure of each frame corresponding to it The inter-prediction of picture is distorted.
4. according to the method described in claim 1, it is characterized in that, described obtain per the first image of frame relative to corresponding The step of target scene amplitude of variation of second image, including:
For the first image of each frame, following steps are executed:
Obtain the movement for the second image of each frame that each target data block in the first image is respectively relative to corresponding to the first image Amplitude, wherein the target data block is the data block with default size;
Relative to corresponding each second image of the first image, motion amplitude in the first image is counted respectively and is more than predetermined threshold value The destination number of target data block, and calculate the ratio that destination number accounts for target data block sum in the first image;
Determine that the first image is relative to the target scene amplitude of variation of its corresponding the second image of each frame:What is be calculated is all The average value of ratio.
5. according to Claims 1 to 4 any one of them method, which is characterized in that described to be become according to the target scene obtained Change amplitude determines the size of the image group unit to be encoded when actual coding, the step of as target sizes, including:
Using preset statistical analysis technique, unite to the corresponding target scene amplitude of variation of the first image of each frame obtained Meter analysis, obtains statistical-reference value;
If the statistical-reference value is more than the first default value, the big of the image group unit to be encoded when actual coding is determined The small numerical value for less than pre-set image group cell size, and using the size of the identified image group unit to be encoded as mesh Mark size;
If the statistical-reference value is less than the second default value, the big of the image group unit to be encoded when actual coding is determined The small numerical value for more than the pre-set image group cell size, and the size of the identified image group unit to be encoded is made For target sizes, wherein second default value is less than first default value.
6. according to the method described in claim 5, it is characterized in that, described regard updated image group unit to be encoded The step of frequency encodes, including:
According to the target sizes, the reference picture of each image in updated image group unit to be encoded is set;
According to set reference picture, Video coding is carried out to updated image group unit to be encoded.
7. according to the method described in claim 6, it is characterized in that, described according to the target sizes, setting is updated to be waited for In coded image group unit the step of the reference picture of each image, including:
Reference image setting rule when according to preset image group unit update to be encoded, setting are updated to be encoded The reference picture of each image in image group unit;Wherein, record has figure to be encoded before update in the reference image setting rule As each in the size of image group unit to be encoded after the group size of unit, update and updated image group unit to be encoded The rule of correspondence between the reference picture three of image.
8. according to the method described in claim 6, it is characterized in that, described according to the target sizes, setting is updated to be waited for In coded image group unit the step of the reference picture of each image, including:
According to the image being resident in the target sizes and present image buffering area, updated image group unit to be encoded is set In each image reference picture.
9. according to the method described in claim 6, it is characterized in that, second image is according to coded sequence, described first The previous frame image and/or reference picture of image.
10. a kind of video coding apparatus, which is characterized in that described device includes:
First determining module, for according to pre-set image group cell size, determining image group unit to be encoded;
Module is obtained, for obtaining target scene amplitude of variation of the first image of every frame relative to corresponding second image; Wherein, described first image is:The image collection being made of the image group unit to be encoded and its previous image group unit In an at least frame image, corresponding second image of first image of frame is:Not according to coded sequence and first image spacing More than the image of default frame number;
Second determining module, for according to the target scene amplitude of variation obtained, determining the figure to be encoded when actual coding As the size of group unit, as target sizes;
Update module, for when the target sizes and the pre-set image group cell size are unequal, according to display order, The image group unit to be encoded is updated to:The preceding target sizes frame image in uncoded image;
Video encoding module, for carrying out Video coding to updated image group unit to be encoded.
11. device according to claim 10, which is characterized in that the acquisition module, including:
Obtaining unit obtains intra prediction distortion and the first image phase of the first image for being directed to the first image of each frame Inter-prediction distortion for the second image of each frame corresponding to it;
Computing unit calculates being averaged for the corresponding each inter-prediction distortion of the first image for being directed to the first image of each frame The ratio of value intra prediction distortion corresponding with first image;
First determination unit determines the first image relative to its corresponding the second figure of each frame for being directed to the first image of each frame The target scene amplitude of variation of picture is:The corresponding ratio of first image.
12. according to the devices described in claim 11, which is characterized in that described device further includes:
Logging modle, after carrying out Video coding to target image, obtain and locally record the target image relative to The inter-prediction distortion of third image and the intra prediction of the target image are distorted, wherein the target image is:After update Image group unit to be encoded in a frame image, the third image is:According to coded sequence and the target image interval No more than the image of the default frame number;
The obtaining unit, is specifically used for:
For the first image of each frame, the local intra prediction distortion for whether recording the first image and the first image are judged Inter-prediction distortion relative to the second image of each frame corresponding to it;If so, obtaining in the frame of the first recorded image Predicted distortion, and the inter-prediction distortion of the first image for being recorded relative to the second image of each frame corresponding to it;If It is no, calculate the interframe of the intra prediction distortion and the first image of the first image relative to the second image of each frame corresponding to it Predicted distortion.
13. device according to claim 10, which is characterized in that the acquisition module is specifically used for:
For the first image of each frame, following steps are executed:It obtains each target data block in the first image and is respectively relative to The motion amplitude of the second image of each frame corresponding to one image, wherein the target data block is the data with default size Block;Relative to corresponding each second image of the first image, motion amplitude in the first image is counted respectively and is more than predetermined threshold value The destination number of target data block, and calculate the ratio that destination number accounts for target data block sum in the first image;Determine first Image is relative to the target scene amplitude of variation of its corresponding the second image of each frame:The all proportions being calculated are averaged Value.
14. according to claim 10~13 any one of them device, which is characterized in that second determining module, including:
Statistical analysis unit, for using preset statistical analysis technique, to the corresponding target of the first image of each frame obtained Scene changes amplitude is for statistical analysis, obtains statistical-reference value;
Second determination unit is used in the case where the statistical-reference value is more than the first default value, when determining actual coding The size of the image group unit to be encoded is the numerical value less than pre-set image group cell size, and described waits compiling by identified The size of code image group unit is as target sizes;
Third determination unit is used in the case where the statistical-reference value is less than the second default value, when determining actual coding The size of the image group unit to be encoded is the numerical value more than the pre-set image group cell size, and will be identified described The size of image group unit to be encoded is as target sizes, wherein second default value is less than first default value.
15. device according to claim 14, which is characterized in that the video encoding module, including:
Setting unit, for according to the target sizes, the reference of each image in updated image group unit to be encoded to be arranged Image;
Video encoding unit, for according to set reference picture, video to be carried out to updated image group unit to be encoded Coding.
16. device according to claim 15, which is characterized in that the setting unit is specifically used for:
Reference image setting rule when according to preset image group unit update to be encoded, setting are updated to be encoded The reference picture of each image in image group unit;Wherein, record has figure to be encoded before update in the reference image setting rule As each in the size of image group unit to be encoded after the group size of unit, update and updated image group unit to be encoded The rule of correspondence between the reference picture three of image.
17. device according to claim 15, which is characterized in that the setting unit is specifically used for:
According to the image being resident in the target sizes and present image buffering area, updated image group unit to be encoded is set In each image reference picture.
18. device according to claim 15, which is characterized in that second image is according to coded sequence described the The previous frame image and/or reference picture of one image.
CN201710256698.7A 2017-04-19 2017-04-19 A kind of method for video coding and device Pending CN108737838A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710256698.7A CN108737838A (en) 2017-04-19 2017-04-19 A kind of method for video coding and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710256698.7A CN108737838A (en) 2017-04-19 2017-04-19 A kind of method for video coding and device

Publications (1)

Publication Number Publication Date
CN108737838A true CN108737838A (en) 2018-11-02

Family

ID=63924318

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710256698.7A Pending CN108737838A (en) 2017-04-19 2017-04-19 A kind of method for video coding and device

Country Status (1)

Country Link
CN (1) CN108737838A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08163554A (en) * 1994-12-02 1996-06-21 Electron & Telecommun Res Inst Controlling method of bit ratio of video
US20020021756A1 (en) * 2000-07-11 2002-02-21 Mediaflow, Llc. Video compression using adaptive selection of groups of frames, adaptive bit allocation, and adaptive replenishment
WO2005045764A1 (en) * 2003-11-07 2005-05-19 Koninklijke Philips Electronics N.V. Video encoding method and device
CN104038762A (en) * 2013-03-06 2014-09-10 三星电子株式会社 Video Encoder, Method Of Detecting Scene Change And Method Of Controlling Video Encoder
CN105744270A (en) * 2014-12-10 2016-07-06 中国移动通信集团公司 Cloud-platform-based video coding method and apparatus
CN110430398A (en) * 2019-08-06 2019-11-08 杭州微帧信息科技有限公司 A kind of Video coding distributed method based on intensified learning

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08163554A (en) * 1994-12-02 1996-06-21 Electron & Telecommun Res Inst Controlling method of bit ratio of video
US20020021756A1 (en) * 2000-07-11 2002-02-21 Mediaflow, Llc. Video compression using adaptive selection of groups of frames, adaptive bit allocation, and adaptive replenishment
WO2005045764A1 (en) * 2003-11-07 2005-05-19 Koninklijke Philips Electronics N.V. Video encoding method and device
CN104038762A (en) * 2013-03-06 2014-09-10 三星电子株式会社 Video Encoder, Method Of Detecting Scene Change And Method Of Controlling Video Encoder
CN105744270A (en) * 2014-12-10 2016-07-06 中国移动通信集团公司 Cloud-platform-based video coding method and apparatus
CN110430398A (en) * 2019-08-06 2019-11-08 杭州微帧信息科技有限公司 A kind of Video coding distributed method based on intensified learning

Similar Documents

Publication Publication Date Title
US11240498B2 (en) Independently coding frame areas
CN103650509B (en) Adaptive configuration of reference frame buffer based on camera and background motion
CN104205772B (en) Improved DASH clients and receiver with buffer water level decision-making
Paul et al. A long-term reference frame for hierarchical B-picture-based video coding
CN102065302B (en) H.264 based flexible video coding method
CN109862359A (en) Bit rate control method, device and electronic equipment based on hierarchical B-frame
JP2010141824A (en) Data processing apparatus, program and method, and, network system
CN106961603A (en) Intracoded frame code rate allocation method and device
CN113905221B (en) Stereoscopic panoramic video asymmetric transport stream self-adaption method and system
CN101390396A (en) Method and apparatus for encoding and decoding multi-view video to provide uniform picture quality
CN112995636B (en) 360-degree virtual reality video transmission system based on edge calculation and active cache and parameter optimization method
CN109688407A (en) Reference block selection method, device, electronic equipment and the storage medium of coding unit
CN110324623A (en) A kind of bidirectional interframe predictive method and device
CN103108186A (en) Method of achieving high-definition transmission of videos
Aksu et al. Viewport-driven rate-distortion optimized scalable live 360° video network multicast
CN104159095B (en) A kind of multiple views texture video and the bit rate control method of depth map encoding
JP2010206822A (en) Wavelet image-encoding method and corresponding decoding method
CN104506870A (en) Video coding processing method and device suitable for multiple code streams
CN101568038B (en) Multi-viewpoint error resilient coding scheme based on disparity/movement joint estimation
Li et al. Towards optimal real-time volumetric video streaming: A rolling optimization and deep reinforcement learning based approach
CN104506866A (en) Video coding processing method suitable for multiple code streams and video coder
CN101711001B (en) Evaluating method of compression properties of layered B forecasting structures
CN108737838A (en) A kind of method for video coding and device
CN103260090B (en) A kind of for the video-frequency band scheduling in P2P three-dimensional flow media system and transmission method
JP5987798B2 (en) Information processing system, information processing apparatus, and program

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181102