CN107071405A - A kind of method for video coding and device - Google Patents
A kind of method for video coding and device Download PDFInfo
- Publication number
- CN107071405A CN107071405A CN201610956784.4A CN201610956784A CN107071405A CN 107071405 A CN107071405 A CN 107071405A CN 201610956784 A CN201610956784 A CN 201610956784A CN 107071405 A CN107071405 A CN 107071405A
- Authority
- CN
- China
- Prior art keywords
- frame
- reference frame
- term reference
- difference
- short
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 77
- 230000007774 longterm Effects 0.000 claims abstract description 171
- 238000004321 preservation Methods 0.000 claims abstract description 72
- 241000208340 Araliaceae Species 0.000 claims description 19
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 claims description 19
- 235000003140 Panax quinquefolius Nutrition 0.000 claims description 19
- 235000008434 ginseng Nutrition 0.000 claims description 19
- 238000012217 deletion Methods 0.000 claims description 3
- 230000037430 deletion Effects 0.000 claims description 3
- 238000004364 calculation method Methods 0.000 abstract description 8
- 230000015654 memory Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 10
- 238000004590 computer program Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 238000012986 modification Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 230000000052 comparative effect Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000035945 sensitivity Effects 0.000 description 2
- 238000003860 storage Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000013144 data compression Methods 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012806 monitoring device Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
- H04N19/105—Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/186—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The embodiment of the invention discloses a kind of method for video coding and device, to solve the problem of video coding efficiency is low in the prior art.Methods described includes:Determine the first brightness histogram of picture frame to be encoded;Determine the difference of the brightness histogram of each reference frame second that is preserved in the first brightness histogram and reference frame lists and;Corresponding minimum first difference of the long term reference frame that selects the difference to be preserved with described in reference frame lists and, and corresponding minimum second difference of short-term reference frame and;The first threshold of preservation is compared with minimum first difference and is compared with Second Threshold with minimum second difference, coded system and reference coding frame is determined, picture frame is encoded.Due in embodiments of the present invention it is determined that described image frame coded system and reference coding frame when, need to only calculate in the brightness histogram and reference frame lists of picture frame to be encoded the difference of the second brightness histogram of each reference frame and.Amount of calculation is small, so as to improve the speed of coding.
Description
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
With the continuous progress of science and technology, the application of video technique is more and more extensive, such as online video conferencing, online government affairs,
All videos in the business such as online school, these business are required for being transmitted, and the data volume of transmission is simple with expansion than larger
Large memories capacity, the transmission means of increase communication trunk is unpractical, and can effectively be dropped using data compression technique
Low amount of transmitting data, this is accomplished by encoding the picture frame in video.
In the prior art, when each picture frame in video is encoded, it is necessary to by current image to be encoded
Frame is divided at least two piecemeals, for the picture frame of each section technique piecemeal reference, and for picture frame to be encoded
It is determined that during the picture frame of each piecemeal reference, amount of calculation is larger, if the quantity of piecemeal is relatively more, amount of calculation will be bigger, so that
The serious efficiency that have impact on Video coding.
The content of the invention
The present invention provides a kind of method for video coding and device, to each figure for solving to be directed in the prior art in video
It is computationally intensive when determining reference coding frame as frame, the problem of influence video coding efficiency.
To reach above-mentioned purpose, the embodiment of the invention discloses a kind of method for video coding, this method includes:
According to the brightness value of each pixel in picture frame to be encoded, the first brightness Nogata of described image frame is determined
Figure;
For the second brightness histogram of each reference frame preserved in reference frame lists, the first brightness Nogata is determined
Figure and second brightness histogram difference and;
For the long term reference frame preserved in the reference frame lists, according to each long term reference frame of determination corresponding
One difference and, using first difference and in minimum value as minimum first difference and;For being protected in the reference frame lists
The short-term reference frame deposited, according to corresponding second difference of each short-term reference frame of determination and, by second difference and in
Minimum value as minimum second difference and;
By the corresponding first threshold of the long term reference frame of preservation Second Threshold corresponding with the short-term reference frame preserved, with length
Corresponding minimum first difference of phase reference frame minimum second difference corresponding with short-term reference frame is compared, and determines the figure
As the coded system and reference coding frame of frame, described image frame is carried out according to the reference coding frame using the coded system
Coding.
Further, the difference for determining first brightness histogram and second brightness histogram and including:
For each brightness section, same brightness region in first brightness histogram and second brightness histogram is determined
Between pixel quantity difference absolute value;
By the sum of the absolute value of each brightness section, it is defined as first brightness histogram and the second brightness Nogata
The difference of figure and.
Further, it is determined that the process of the corresponding first threshold of the long term reference frame includes:
Resolution ratio, the first coefficient and the 3rd threshold value set for the long term reference frame of the video are obtained, by institute
State resolution ratio and the product of the 3rd threshold value and be defined as the corresponding first threshold of the long term reference frame;Or
According to encoded first picture frame adjacent with described image frame of preservation and adjacent with described first image frame
The second encoded picture frame brightness histogram, for each brightness section, determine described first image frame and the second figure
The absolute value of the pixel quantity difference of same brightness section in the brightness histogram of picture frame, by the absolute value of each brightness section
And be defined as described first image frame and the second picture frame brightness histogram the 3rd difference and, will the 3rd difference with
It is defined as the corresponding first threshold of the long term reference frame with the product of the 3rd coefficient of the long term reference frame of preservation;Or
Resolution ratio, the first coefficient and the 3rd threshold value set for the long term reference frame of the video are obtained, by institute
State resolution ratio and the product of the 3rd threshold value and be defined as corresponding first threshold value to be selected of the long term reference frame;According to preservation
Encoded first picture frame adjacent with described image frame and encoded second image adjacent with described first image frame
The brightness histogram of frame, for each brightness section, in the brightness histogram for determining described first image frame and the second picture frame
Same brightness section pixel quantity difference absolute value, by the absolute value of each brightness section and be defined as described first
3rd difference of the brightness histogram of picture frame and the second picture frame and the long term reference frame by the 3rd difference and with preservation
The product of the 3rd coefficient be defined as corresponding second threshold value to be selected of the long term reference frame;By the described first threshold value to be selected and
Minimum value in two threshold values to be selected is defined as the corresponding first threshold of the long term reference frame.
Further, it is determined that the process of the corresponding Second Threshold of the short-term reference frame includes:
Resolution ratio, the second coefficient and the 4th threshold value set for the short-term reference frame of the video are obtained, by institute
State resolution ratio and be defined as the short-term reference frame corresponding with the product of the 4th threshold value described in the Shang Zaiyu of second coefficient
Two threshold values;Or
According to encoded first picture frame adjacent with described image frame of preservation and adjacent with described first image frame
The second encoded picture frame brightness histogram, for each brightness section, determine described first image frame and the second figure
The absolute value of the pixel quantity difference of same brightness section in the brightness histogram of picture frame, by the absolute value of each brightness section
And be defined as described first image frame and the second picture frame brightness histogram the 3rd difference and;By the 3rd difference and
It is defined as the corresponding Second Threshold of the short-term reference frame with the product of the 4th coefficient of the short-term reference frame of preservation;Or
Resolution ratio, the second coefficient and the 4th threshold value set for the short-term reference frame of the video are obtained, by institute
State resolution ratio and be defined as the short-term reference frame corresponding with the product of the 4th threshold value described in the Shang Zaiyu of second coefficient
Three threshold values to be selected;According to encoded first picture frame adjacent with described image frame of preservation and with described first image frame phase
The brightness histogram of adjacent the second encoded picture frame, for each brightness section, determines described first image frame and second
The absolute value of the pixel quantity difference of same brightness section in the brightness histogram of picture frame, this by each brightness section is absolute
Value and be defined as described first image frame and the second picture frame brightness histogram the 3rd difference and, by the 3rd difference
It is defined as corresponding 4th threshold value to be selected of the short-term reference frame with the product with the 4th coefficient of the short-term reference frame of preservation;Will
Minimum value in 3rd threshold value to be selected and the 4th threshold value to be selected is defined as corresponding second threshold of the short-term reference coding frame
Value.
Further, the corresponding first threshold of the long term reference frame by preservation is corresponding with the short-term reference frame preserved
Second Threshold, corresponding minimum second difference of corresponding with long term reference frame minimum first difference and short-term reference frame is compared
Compared with determining the coded system and reference coding frame of described image frame includes:
If corresponding minimum first difference of the long term reference frame is more than the first threshold, and the short-term reference frame
Corresponding minimum second difference is more than the Second Threshold, and the coded system for determining described image frame is intraframe coding, the figure
As frame is without reference to any picture frame in the reference frame lists;
If corresponding minimum first difference of the long term reference frame is not more than the first threshold, and the short term reference
Corresponding minimum second difference of frame is more than the Second Threshold, and the coded system for determining described image frame is to be encoded with reference to previous frame,
Described image frame refers to minimum first difference and corresponding long term reference frame;
If corresponding minimum second difference of the short-term reference frame is not more than the Second Threshold, described image frame is determined
Coded system be with reference to previous frame coding, described image frame refer to minimum second difference and corresponding short-term reference frame.
Further, methods described also includes:
If it is determined that the coded system of described image frame is intraframe coding, described image frame is without reference to the reference frame lists
In any picture frame, methods described further comprises:The reference frame lists are emptied, described image frame are regard as long-term ginseng
Frame is examined to be added in the reference frame lists;
If it is determined that the coded system of described image frame is with reference to previous frame coding, described image frame refers to described minimum first
Difference and corresponding long term reference frame, methods described further comprise:By all short-term reference frames in the reference frame lists
Delete, be added to described image frame as short-term reference frame in the reference frame lists;
If it is determined that the coded system of described image frame is with reference to previous frame coding, described image frame refers to described minimum second
Difference and corresponding short-term reference frame, methods described further comprise:By with the described image frame time interval most long ginseng
The short-term reference frame examined in frame list is removed, and is added to described image frame as short-term reference frame in the reference frame lists.
Further, it is described by with the short-term reference frame in described image frame time interval most long reference frame lists
Before removal, methods described also includes:
Judge the short-term reference frame in the reference frame lists most long with described image frame time interval whether be
Minimum second difference and corresponding short-term reference frame, if it is not, carrying out subsequent step.
Further, the short-term reference frame in the reference frame lists most long with described image frame time interval is
When minimum second difference and corresponding short-term reference frame, methods described also includes:
Will be most long with described image frame time interval in addition to minimum second difference and corresponding short-term reference frame
Reference frame lists in short-term reference frame remove.
The embodiment of the invention discloses a kind of video coding apparatus, described device includes:
First determining module, for the brightness value according to each pixel in picture frame to be encoded, determines described image
First brightness histogram of frame;
Second determining module, for the second brightness histogram of each reference frame for being preserved in reference frame lists, really
The difference of fixed first brightness histogram and second brightness histogram and;
3rd determining module, for the long term reference frame for being preserved in the reference frame lists, according to each of determination
Corresponding first difference of long term reference frame and, using first difference and in minimum value as minimum first difference and;For
The short-term reference frame preserved in the reference frame lists, according to corresponding second difference of each short-term reference frame of determination and general
Second difference and in minimum value as minimum second difference and;
Coding module, for the corresponding first threshold of the long term reference frame of preservation is corresponding with the short-term reference frame preserved
Second Threshold, minimum first difference corresponding with long term reference frame and minimum second difference corresponding with short-term reference frame are compared
Compared with the coded system and reference coding frame of described image frame being determined, using the coded system according to the reference coding frame pair
Described image frame is encoded.
Further, second determining module, specifically for for each brightness section, determining that first brightness is straight
The absolute value of the pixel quantity difference of same brightness section in side's figure and second brightness histogram;By being somebody's turn to do for each brightness section
The sum of absolute value, be defined as first brightness histogram and second brightness histogram difference and.
Further, described device also includes:
First threshold determining module, for obtaining the resolution ratio of the video, the first coefficient and for the long term reference
3rd threshold value of frame setting, the long term reference frame corresponding the is defined as by the resolution ratio and the product of the 3rd threshold value
One threshold value;Or encoded first picture frame adjacent with described image frame according to preservation and adjacent with described first image frame
The second encoded picture frame brightness histogram, for each brightness section, determine described first image frame and the second figure
The absolute value of the pixel quantity difference of same brightness section in the brightness histogram of picture frame, by the absolute value of each brightness section
And be defined as described first image frame and the second picture frame brightness histogram the 3rd difference and, will the 3rd difference with
It is defined as the corresponding first threshold of the long term reference frame with the product of the 3rd coefficient of the long term reference frame of preservation;Or obtain institute
State the resolution ratio of video, the first coefficient and the 3rd threshold value set for the long term reference frame, by the resolution ratio with it is described
The product of 3rd threshold value is defined as corresponding first threshold value to be selected of the long term reference frame;According to preservation and described image frame phase
The brightness histogram of the first encoded picture frame of neighbour and encoded second picture frame adjacent with described first image frame,
For each brightness section, the picture of same brightness section in the brightness histogram of described first image frame and the second picture frame is determined
Vegetarian refreshments quantity difference absolute value, by the absolute value of each brightness section and be defined as described first image frame and the second image
3rd difference of the brightness histogram of frame and the product by the 3rd difference and with the 3rd coefficient of the long term reference frame of preservation
It is defined as corresponding second threshold value to be selected of the long term reference frame;By in the described first threshold value to be selected and the second threshold value to be selected most
Small value is defined as the corresponding first threshold of the long term reference frame.
Further, described device also includes:
Second Threshold determining module, for obtaining the resolution ratio of the video, the second coefficient and for the short term reference
4th threshold value of frame setting, institute is defined as by the product of the 4th threshold value described in the Shang Zaiyu of the resolution ratio and second coefficient
State the corresponding Second Threshold of short-term reference frame;Or encoded first picture frame adjacent with described image frame according to preservation and
The brightness histogram of encoded second picture frame adjacent with described first image frame, for each brightness section, determines institute
The absolute value of the pixel quantity difference of same brightness section in the brightness histogram of the first picture frame and the second picture frame is stated, will be every
The 3rd of brightness histogram that the is absolute value of individual brightness section and being defined as described first image frame and the second picture frame is poor
Value and;It is defined as the short-term reference frame pair by the 3rd difference and with the product of the 4th coefficient of the short-term reference frame of preservation
The Second Threshold answered;Or obtain resolution ratio, the second coefficient and the 4th threshold set for the short-term reference frame of the video
Value, the short-term reference frame pair is defined as by the product of the 4th threshold value described in the Shang Zaiyu of the resolution ratio and second coefficient
The 3rd threshold value to be selected answered;According to encoded first picture frame adjacent with described image frame of preservation and with first figure
As the brightness histogram of adjacent the second encoded picture frame of frame, for each brightness section, described first image frame is determined
The poor absolute value with the pixel quantity of same brightness section in the brightness histogram of the second picture frame, by each brightness section
3rd difference of brightness histogram that the is absolute value and being defined as described first image frame and the second picture frame and, by described the
Three differences and to be defined as the short-term reference frame with the product of the 4th coefficient of the short-term reference frame of preservation corresponding 4th to be selected
Threshold value;Minimum value in 3rd threshold value to be selected and the 4th threshold value to be selected is defined as the short-term reference coding frame corresponding
Second Threshold.
Further, the coding module, if big specifically for corresponding minimum first difference of the long term reference frame
In the first threshold, and corresponding minimum second difference of the short-term reference frame is more than the Second Threshold, determines the figure
The coded system of picture frame is intraframe coding, and described image frame is without reference to any picture frame in the reference frame lists;If institute
State corresponding minimum first difference of long term reference frame and be not more than the first threshold, and the short-term reference frame corresponding minimum
Two differences are more than the Second Threshold, and the coded system for determining described image frame is with reference to previous frame coding, the reference of described image frame
Minimum first difference and corresponding long term reference frame;If corresponding minimum second difference of the short-term reference frame is not more than
The Second Threshold, the coded system for determining described image frame is that described image frame is with reference to described minimum the with reference to previous frame coding
Two differences and corresponding short-term reference frame.
Further, described device also includes:
First removing module, for if it is determined that the coded system of described image frame is intraframe coding, described image frame to be not
With reference to any picture frame in the reference frame lists, the reference frame lists are emptied, described image frame are regard as long-term ginseng
Frame is examined to be added in the reference frame lists;
Second removing module, for if it is determined that the coded system of described image frame is with reference to previous frame coding, described image
Frame refers to minimum first difference and corresponding long term reference frame, and all short-term reference frames in the reference frame lists are deleted
Remove, be added to described image frame as short-term reference frame in the reference frame lists;
3rd removing module, for if it is determined that the coded system of described image frame is with reference to previous frame coding, described image
Frame refers to minimum second difference and corresponding short-term reference frame, by with the most long reference of described image frame time interval
Short-term reference frame in frame list is removed, and is added to described image frame as short-term reference frame in the reference frame lists.
Further, described device also includes:
Judge module, for by with the short-term reference frame in described image frame time interval most long reference frame lists
Before removal, judge the short-term reference frame in the reference frame lists most long with described image frame time interval whether be
Minimum second difference and corresponding short-term reference frame.
Further, described device also includes:
4th removing module, the result for judge module is that when being, will remove minimum second difference and corresponding short
Being removed with the short-term reference frame in described image frame time interval most long reference frame lists outside phase reference frame.
The embodiment of the invention discloses a kind of method for video coding and device, methods described includes:According to figure to be encoded
As the brightness value of each pixel in frame, the first brightness histogram of described image frame is determined;For being preserved in reference frame lists
Each reference frame the second brightness histogram, determine the difference of first brightness histogram and second brightness histogram
With;It is corresponding first poor according to each long term reference frame of determination for the long term reference frame preserved in the reference frame lists
Value and, using first difference and in minimum value as minimum first difference and;For what is preserved in the reference frame lists
Short-term reference frame, according to corresponding second difference of each short-term reference frame of determination and, by second difference and in minimum
Value as minimum second difference and;The corresponding first threshold of the long term reference frame of preservation is corresponding with the short-term reference frame preserved
Second Threshold, minimum first difference corresponding with long term reference frame and minimum second difference corresponding with short-term reference frame are compared
Compared with the coded system and reference coding frame of described image frame being determined, using the coded system according to the reference coding frame pair
Described image frame is encoded.Due in embodiments of the present invention according to the first brightness histogram of picture frame to be encoded and ginseng
Examine the difference of the second brightness histogram of each reference frame preserved in frame list and corresponding with the long term reference frame of preservation
One threshold value is compared with the corresponding Second Threshold of short-term reference frame preserved, it is determined that described image frame coded system and volume
Code reference frame, only need to calculate once, and calculate be picture frame to be encoded brightness histogram and reference frame lists in protect
The difference of second brightness histogram of each reference frame deposited and, amount of calculation is small, so as to improve the efficiency of Video coding.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with
Other accompanying drawings are obtained according to these accompanying drawings.
Figure 1A is a kind of video coding process schematic diagram that the embodiment of the present invention 1 is provided;
Figure 1B is a kind of the first brightness histogram of picture frame provided in an embodiment of the present invention;
Fig. 2A is a kind of reference frame lists provided in an embodiment of the present invention;
Fig. 2 B are a kind of video coding process schematic diagram that the embodiment of the present invention 4 is provided;
Fig. 3 is a kind of video coding apparatus structure chart that the embodiment of the present invention 1 is provided;
Fig. 4 is a kind of video coding apparatus structure chart that the embodiment of the present invention 4 is provided.
Embodiment
In order to reduce during Video coding, it is determined that the amount of calculation of the reference coding frame of each picture frame, improves Video coding effect
Rate, the embodiments of the invention provide a kind of method for video coding and device.
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
Embodiment 1:
Figure 1A is a kind of video coding process schematic diagram provided in an embodiment of the present invention, and the process comprises the following steps:
S101:According to the brightness value of each pixel in picture frame to be encoded, the first brightness of described image frame is determined
Histogram.
The embodiments of the invention provide a kind of method for video coding, this method can apply to electronic equipment, the electronics
Equipment can be PC, can also be monitoring device, and electronic equipment can obtain picture frame to be encoded from video source, can also be from
Picture frame to be encoded is obtained in the video locally preserved.
There is the pixel of identical quantity in each picture frame of same video, pixel is more, and the resolution ratio of picture is got over
Height, image is more fine and smooth true to nature.The brightness value of pixel is different, constitutes the picture of different color brightness.Because in picture frame
The brightness value of pixel is general within a brightness range, therefore brightness range can be divided at least two brightness regions
Between, each brightness section is as a brightness degree, according to the brightness value of each pixel in picture frame, counts each brightness
Pixel quantity under grade.Using transverse axis as brightness section, the longitudinal axis is that pixel quantity builds coordinate system, so that according to picture frame
In all corresponding brightness value of pixel, statistics and then determines brightness Nogata positioned at the pixel quantity of each brightness section
Figure.
For example, the brightness value of pixel is located in the range of 0~255 in a picture frame, then 0~255 scope can be drawn
It is divided into N number of brightness section, wherein N value is not more than 256, and N is integer more than 1, N.If it is 32 to take N, by 0~255
Be divided into 0~7,8~15,16~23,24~31,32~39 ..., 248~255, this 32 brightness sections are designated as bright respectively
Interval i is spent, i is the integer between 1 to 32.Count in described image frame, brightness value is located at the pixel of each brightness section respectively
Quantity, represents that the brightness value of described image frame is located between 0~7 by Hi, i.e. H0 is designated as positioned at brightness section i pixel quantity
Pixel quantity, H1 represent described image frame brightness value be 8~15 between pixel quantity, by that analogy.
As shown in Figure 1B, be the first brightness histogram of picture frame, the longitudinal axis be brightness section 0~7,8~15,16~23,
24~31,32~39 ..., 248~255, transverse axis is pixel quantity, wherein brightness value be located at brightness section 0~7 pixel
Point is 9, and the pixel that brightness value is located at brightness section 8~15 is 6, and brightness value is located at the pixel of brightness section 16~23
For 10, the pixel that brightness value is located at brightness section 248~255 is 2 ... ..., and brightness value is located at other brightness sections
Pixel quantity and brightness value are located at the pixel quantity statistical method of brightness section 0~7,8~15,16~23,248~255
Equally, pixel quantity can be any integer value.
In embodiments of the present invention it is determined that each picture frame brightness histogram when, all drawn using identical brightness section
The mode of dividing, thereby may be ensured that the accuracy subsequently compared.
S102:For the second brightness histogram of each reference frame preserved in reference frame lists, determine that described first is bright
Spend histogram and second brightness histogram difference and.
At least one in store reference frame in reference frame lists, can be true for each reference frame in reference frame lists
Its fixed corresponding each brightness histogram, and brightness histogram can be stored in histogram memory cell.Using certain
During the brightness histogram of individual reference frame, it only need to directly obtain, without determining again, enter from the histogram memory cell of electronic equipment
One step improves the efficiency of Video coding.Second brightness histogram of in store each reference frame in histogram memory cell, its
In the brightness section that includes in second brightness histogram it is identical with the brightness section included in the first brightness histogram.
For each second brightness histogram, it is determined that the difference of first brightness histogram and second brightness histogram
Value and when, for each brightness section, determine same brightness region in first brightness histogram and second brightness histogram
Between pixel quantity difference absolute value;By the sum of the absolute value of each brightness section, it is defined as the first brightness Nogata
Figure and second brightness histogram difference and.
S103:For the long term reference frame preserved in the reference frame lists, according to each long term reference frame pair of determination
The first difference for answering and, using first difference and in minimum value as minimum first difference and;For the reference frame list
The short-term reference frame preserved in table, according to corresponding second difference of each short-term reference frame of determination and, by second difference
Minimum value with as minimum second difference and.
It is specific that reference frame is preserved in reference frame lists, and have the mark of the reference frame for each frame recording that refers to
Information, and each reference frame is long term reference frame or short-term reference frame.Wherein long reference frame can be in reference frame lists
Keep longer time.Reference frame lists as shown in Figure 2 A, it can be seen that the reference frame lists include two long term references
Frame and three short-term reference frames.
Multiple reference frames are typically had in one reference frame lists, and there can be long term reference simultaneously in most cases
Frame and short-term reference frame.Calculated in S102 each in the first brightness histogram and the reference frame lists of described image frame
The difference of corresponding second brightness histogram of reference frame and, and record has each reference frame to be long-term ginseng in reference frame lists
Frame or short-term reference frame are examined, therefore the long term reference frame preserved in the reference frame lists can be directed to, according to the every of determination
Corresponding first difference of individual long term reference frame and, using first difference and in minimum value be used as minimum first difference and, institute
State the first difference and be probably one, that just using this first difference and as minimum first difference and, if at least two,
Just using first difference and in minimum value as minimum first difference and.It is short-term for what is preserved in the reference frame lists
Reference frame, according to corresponding second difference of each short-term reference frame of determination and, by second difference and in minimum value make
For minimum second difference and, second difference and be probably one, that just using this second difference and is used as minimum first
Difference and, if at least two, just using second difference and in minimum value as minimum second difference with.
S104:By the corresponding first threshold of the long term reference frame of preservation the second threshold corresponding with the short-term reference frame preserved
Value, minimum first difference corresponding with long term reference frame and minimum second difference corresponding with short-term reference frame are compared, really
The coded system and reference coding frame of described image frame are determined, using the coded system according to the reference coding frame to the figure
As frame is encoded.
The corresponding first threshold of in store long term reference frame and the corresponding Second Threshold of short-term reference frame in the electronic device,
The first threshold and Second Threshold are directly proportional to the resolution ratio of video, and the resolution ratio of video is bigger, and its value is bigger.Described first
Threshold value and Second Threshold can be that the progress that user is manually entered into electronic equipment is preserved or electronic equipment is calculated
Automatically saved after out.
By the corresponding first threshold of the long term reference frame of preservation minimum first difference corresponding with long term reference frame and progress
Compare, and by the corresponding Second Threshold of the short-term reference frame of preservation minimum second difference corresponding with short-term reference frame and compared
Compared with, the coded system and reference coding frame of described image frame are determined, and using the coded system according to the reference coding frame
Described image frame is encoded.
According to comparative result, when determining reference frame of the described image frame in coding, it is confirmed that a reference coding frame,
The reference coding frame can be preserve in the long term reference frame or reference frame lists preserved in reference frame lists short-term
Reference frame, described image frame can also be without reference to any reference frame in reference frame lists in coding.
Due in embodiments of the present invention according in the first brightness histogram of picture frame to be encoded and reference frame lists
The difference of second brightness histogram of each reference frame preserved and first threshold corresponding with the long term reference frame of preservation and guarantor
The corresponding Second Threshold of short-term reference frame deposited is compared, it is determined that described image frame coded system and reference coding frame,
Need to only calculate once, and calculate be picture frame to be encoded brightness histogram and reference frame lists in each ginseng for preserving
Examine frame the second brightness histogram difference and, amount of calculation is small, so as to improve the efficiency of Video coding.
Embodiment 2:
It is determined that when first threshold and Second Threshold, can be determined in the method in above-described embodiment, it would however also be possible to employ other
Method determines that in embodiments of the present invention, determining the process of the corresponding first threshold of the long term reference frame includes:
Resolution ratio, the first coefficient and the 3rd threshold value set for the long term reference frame of the video are obtained, by institute
State resolution ratio and the product of the 3rd threshold value and be defined as the corresponding first threshold of the long term reference frame;Or
According to encoded first picture frame adjacent with described image frame of preservation and adjacent with described first image frame
The second encoded picture frame brightness histogram, for each brightness section, determine described first image frame and the second figure
The absolute value of the pixel quantity difference of same brightness section in the brightness histogram of picture frame, by the absolute value of each brightness section
And be defined as described first image frame and the second picture frame brightness histogram the 3rd difference and;By the 3rd difference and
It is defined as the corresponding first threshold of the long term reference frame with the product of the 3rd coefficient of the long term reference frame of preservation;Or
Resolution ratio, the first coefficient and the 3rd threshold value set for the long term reference frame of the video are obtained, by institute
State resolution ratio and the product of the 3rd threshold value and be defined as corresponding first threshold value to be selected of the long term reference frame;According to preservation
Encoded first picture frame adjacent with described image frame and encoded second image adjacent with described first image frame
The brightness histogram of frame, for each brightness section, in the brightness histogram for determining described first image frame and the second picture frame
Same brightness section pixel quantity difference absolute value, by the absolute value of each brightness section and be defined as described first
3rd difference of the brightness histogram of picture frame and the second picture frame and the long term reference frame by the 3rd difference and with preservation
The product of the 3rd coefficient be defined as corresponding second threshold value to be selected of the long term reference frame;By the described first threshold value to be selected and
Minimum value in two threshold values to be selected is defined as the corresponding first threshold of the long term reference frame.
In embodiments of the present invention, when determining the corresponding first threshold of the long term reference frame, can be obtain described in regard
The resolution ratio of frequency, the first coefficient and the 3rd threshold value set for the long term reference frame, by the resolution ratio and described first
The product of the 3rd threshold value is defined as the corresponding first threshold of the long term reference frame described in the Shang Zaiyu of coefficient.3rd threshold value
It is the predetermined threshold value unrelated with the resolution of video image, the 3rd threshold value can be used for regulation and judge the image to be encoded
Frame and the sensitivity of the difference of the long term reference frame in reference frame lists.It is determined that during first threshold, specifically can according to
Lower formula is calculated:
THresh_long=(image_width*image_height/2N)*thresh_long_pre
Wherein, Thresh_long is the first threshold;Image_width*image_height divides for the video
Resolution;2NFor the first coefficient;Thresh_long_pre is the 3rd threshold value.First coefficient is 2 Nth power, preferably, can
Think 26 powers, as 64.
Histogram memory cell in electronic equipment preserves encoded first picture frame adjacent with described image frame
And the brightness histogram of encoded second picture frame adjacent with described first image frame.Because first picture frame and second
Picture frame is all encoded picture frame, when being encoded to each picture frame, can all determine the brightness Nogata of the picture frame
Figure, can be by first picture frame and the therefore after the brightness histogram of first picture frame and the second picture frame is determined
The brightness histogram of two picture frames is added in histogram memory cell.
The 3rd coefficient is preserved also directed to the long term reference frame in reference frame lists in electronic equipment, the 3rd coefficient
Span can be 1~100.
It is determined that during the corresponding first threshold of the long term reference frame, can be preserved according in histogram memory cell
Encoded first picture frame adjacent with described image frame and encoded second image adjacent with described first image frame
The brightness histogram of frame, first determines same brightness section correspondence in the brightness histogram of described first image frame and the second picture frame
Pixel number the 3rd difference, the 3rd difference is taken absolute value, then by the absolute value of the 3rd difference and with
The product of 3rd coefficient of the long term reference frame of preservation is defined as the corresponding first threshold of the long term reference frame;By the described 3rd
The absolute value of difference is defined as the short-term reference frame corresponding second with the product of the 4th coefficient of the short-term reference frame preserved
Threshold value.
Determine during the corresponding first threshold of the long term reference frame or obtain the resolution ratio of the video, first
Coefficient and the 3rd threshold value set for the long term reference frame, the product of the resolution ratio and the 3rd threshold value is defined as
Corresponding first threshold value to be selected of the long term reference frame;According to encoded first image adjacent with described image frame of preservation
The brightness histogram of frame and encoded second picture frame adjacent with described first image frame, for each brightness section, really
Determine the absolute value of the pixel quantity difference of same brightness section in the brightness histogram of described first image frame and the second picture frame,
By the of brightness histogram that the is absolute value of each brightness section and being defined as described first image frame and the second picture frame
Three differences and, be defined as the long term reference by the 3rd difference and with the product of the 3rd coefficient of the long term reference frame of preservation
Corresponding second threshold value to be selected of frame;Minimum value in described first threshold value to be selected and the second threshold value to be selected is defined as described long-term
The corresponding first threshold of reference frame.So when first threshold and minimum first difference are compared, the institute of determination can be made
The coded system and reference coding frame for stating picture frame are more accurate, improve the accuracy of coding.
Determining the process of the corresponding Second Threshold of the short-term reference frame includes:
Resolution ratio, the second coefficient and the 4th threshold value set for the short-term reference frame of the video are obtained, by institute
State resolution ratio and be defined as the short-term reference frame corresponding with the product of the 4th threshold value described in the Shang Zaiyu of second coefficient
Two threshold values;Or
According to encoded first picture frame adjacent with described image frame of preservation and adjacent with described first image frame
The second encoded picture frame brightness histogram, for each brightness section, determine described first image frame and the second figure
The absolute value of the pixel quantity difference of same brightness section in the brightness histogram of picture frame, by the absolute value of each brightness section
And be defined as described first image frame and the second picture frame brightness histogram the 3rd difference and;By the 3rd difference and
It is defined as the corresponding Second Threshold of the short-term reference frame with the product of the 4th coefficient of the short-term reference frame of preservation;Or
Resolution ratio, the second coefficient and the 4th threshold value set for the short-term reference frame of the video are obtained, by institute
State resolution ratio and be defined as the short-term reference frame corresponding with the product of the 4th threshold value described in the Shang Zaiyu of second coefficient
Three threshold values to be selected;According to encoded first picture frame adjacent with described image frame of preservation and with described first image frame phase
The brightness histogram of adjacent the second encoded picture frame, for each brightness section, determines described first image frame and second
The absolute value of the pixel quantity difference of same brightness section in the brightness histogram of picture frame, this by each brightness section is absolute
Value and be defined as described first image frame and the second picture frame brightness histogram the 3rd difference and, by the 3rd difference
It is defined as corresponding 4th threshold value to be selected of the short-term reference frame with the product with the 4th coefficient of the short-term reference frame of preservation;Will
Minimum value in 3rd threshold value to be selected and the 4th threshold value to be selected is defined as corresponding second threshold of the short-term reference coding frame
Value.
In embodiments of the present invention, it is determined that can obtain described during the corresponding Second Threshold of the short-term reference frame
The resolution ratio of video, the second coefficient and the 4th threshold value set for the short-term reference frame, by the resolution ratio and described the
The product of the 4th threshold value is defined as the corresponding Second Threshold of the short-term reference frame described in the Shang Zaiyu of two coefficients.4th threshold
Value is the predetermined threshold value unrelated with the resolution ratio of video image, and the 4th threshold value can be used for regulation and judge the figure to be encoded
As frame and the sensitivity of the difference of the short-term reference frame in reference frame lists., specifically can basis it is determined that during Second Threshold
Below equation is calculated:
THresh_short=(image_width*image_height/2N)*thresh_short_pre
Wherein, Thresh_short is the Second Threshold;Image_width*image_height is the video
Resolution ratio;2NFor the second coefficient;Thresh_short_pre is the 4th threshold value.Second coefficient is 2 Nth power, preferably,
Can be 26 powers, as 64.
The 4th coefficient is preserved also directed to the short-term reference frame in reference frame lists in electronic equipment, the 4th coefficient
Span can be 1~100.
It is determined that during the corresponding Second Threshold of the short-term reference frame, can be preserved according in histogram memory cell
Encoded first picture frame adjacent with described image frame and encoded second image adjacent with described first image frame
The brightness histogram of frame, first determines same brightness section correspondence in the brightness histogram of described first image frame and the second picture frame
Pixel number the 3rd difference, the 3rd difference is taken absolute value, then by the absolute value of the 3rd difference and with
The product of 4th coefficient of the short-term reference frame of preservation is defined as the corresponding Second Threshold of the short-term reference frame;By the described 3rd
The absolute value of difference is defined as the short-term reference frame corresponding second with the product of the 4th coefficient of the short-term reference frame preserved
Threshold value.When calculating, the 3rd coefficient and the 4th coefficient can be identical value or different values.
Determine during the corresponding first threshold of the long term reference frame or obtain the resolution ratio of the video, second
Coefficient and the 4th threshold value set for the short-term reference frame, by described in the Shang Zaiyu of the resolution ratio and second coefficient
The product of 4th threshold value is defined as corresponding 3rd threshold value to be selected of the short-term reference frame;According to preservation and described image frame phase
The brightness histogram of the first encoded picture frame of neighbour and encoded second picture frame adjacent with described first image frame,
For each brightness section, the picture of same brightness section in the brightness histogram of described first image frame and the second picture frame is determined
Vegetarian refreshments quantity difference absolute value, by the absolute value of each brightness section and be defined as described first image frame and the second image
3rd difference of the brightness histogram of frame and the product by the 3rd difference and with the 4th coefficient of the short-term reference frame of preservation
It is defined as corresponding 4th threshold value to be selected of the short-term reference frame;By in the 3rd threshold value to be selected and the 4th threshold value to be selected most
Small value is defined as the corresponding Second Threshold of the short-term reference coding frame.So carried out by Second Threshold and minimum second difference
When comparing, the coded system and reference coding frame of the described image frame of determination can be made more accurate, the accurate of coding is improved
Property.
It is determined that when the first threshold and the Second Threshold, identical method can be taken to determine, it would however also be possible to employ
Different methods is determined.
Embodiment 3:
On the basis of the various embodiments described above, according to the comparative result and Second Threshold of first threshold and minimum first difference
With the comparative result of minimum second difference, it may be determined that the coded system and reference coding frame of described image frame, of the invention real
Apply in example, the corresponding first threshold of the long term reference frame by preservation Second Threshold corresponding with the short-term reference frame preserved,
Corresponding minimum second difference of corresponding with long term reference frame minimum first difference and short-term reference frame is compared, it is determined that described
The coded system and reference coding frame of picture frame include:
If corresponding minimum first difference of the long term reference frame is more than the first threshold, and the short-term reference frame
Corresponding minimum second difference is more than the Second Threshold, and the coded system for determining described image frame is intraframe coding, the figure
As frame is without reference to any picture frame in the reference frame lists;
If corresponding minimum first difference of the long term reference frame is not more than the first threshold, and the short term reference
Corresponding minimum second difference of frame is more than the Second Threshold, and the coded system for determining described image frame is to be encoded with reference to previous frame,
Described image frame refers to minimum first difference and corresponding long term reference frame;
If corresponding minimum second difference of the short-term reference frame is not more than the Second Threshold, described image frame is determined
Coded system be with reference to previous frame coding, described image frame refer to minimum second difference and corresponding short-term reference frame.
In the present invention is implemented, the corresponding first threshold of long term reference frame is preserved in electronic equipment and short-term ginseng is preserved
The corresponding Second Threshold of frame is examined, electronic equipment is by the first threshold of preservation minimum first difference corresponding with long term reference frame and enters
Row compares, and by the Second Threshold of preservation minimum second difference corresponding with short-term reference frame and is compared, according to comparing knot
Fruit determines the coded system and reference coding frame of described image frame.
If corresponding minimum first difference of long term reference frame is more than the first threshold, and short-term reference frame correspondence
Minimum second difference be more than the Second Threshold, then show that all reference frames in described image frame and reference frame lists have
Larger difference, it is determined that the picture frame is encoded to I frames by needs, its corresponding type of coding is intraframe coding.Because by image
Frame is encoded to I frames without reference to frame, and all reference frames in described image frame and reference frame lists have larger difference, therefore should
Intraframe coding method is without reference to frame.The process that picture frame is encoded to I frames is wherein belonged to by existing skill by intraframe coding method
Art, in embodiments of the present invention to the process without repeating.
If corresponding minimum first difference of the long term reference frame is not more than the first threshold, and the short term reference
Corresponding minimum second difference of frame is more than the Second Threshold, then shows described image frame and minimum first difference and corresponding length
The difference of phase reference frame is smaller, it is determined that the picture frame is encoded to P frames by needs, and its corresponding type of coding is to be compiled with reference to previous frame
Code.P frames need to refer to picture frame encoded in reference frame lists when encoding, described image frame and minimum first difference and right
The difference for the long term reference frame answered is smaller, it is therefore desirable to determines the reference coding frame of picture frame, in embodiments of the present invention should
The reference coding frame of picture frame is defined as minimum first difference and corresponding long term reference frame.Wherein by reference to previous frame coding staff
The process that picture frame is encoded to P frames is belonged to prior art by formula, in embodiments of the present invention to the process without repeating.
If corresponding minimum second difference of the short-term reference frame is not more than the Second Threshold, show described image
The difference of frame and minimal difference and corresponding short-term reference frame is minimum, it is determined that the picture frame is encoded to P frames by needs, its correspondence
Type of coding be with reference to previous frame coding.Now corresponding minimum first difference of long term reference frame can be more than first threshold
Value, might be less that the first threshold, can also be equal to the first threshold.P frames need to refer to reference frame lists when encoding
In encoded picture frame, the difference of described image frame and minimal difference and corresponding short-term reference frame is minimum, it is therefore desirable to
The reference coding frame of picture frame is determined, it is poor that the reference coding frame of the picture frame is defined as into minimum second in embodiments of the present invention
Value and corresponding short-term reference frame.The process that picture frame is encoded to P frames is wherein belonged to existing by reference to preceding frame coding mode
Technology, in embodiments of the present invention to the process without repeating.
The coded system of described image frame can be intraframe coding or be encoded with reference to previous frame.
Reference frame of the described image frame in coding can be the long term reference frame that preserves in reference frame lists or
The short-term reference frame preserved in reference frame lists, described image frame can also be without reference to any in reference frame lists in coding
Picture frame.Described image frame coding when reference frame be at most reference frame lists in a reference frame.
Embodiment 4:
It is determined that described image frame coded system and reference coding frame when can also to the reference frame lists carry out more
Newly, so as to the picture frame that encodes the need for follow-up it is determined that when coded system and reference coding frame it is more accurate, in above-mentioned each reality
Apply on the basis of example, in embodiments of the present invention, methods described also includes:
If it is determined that the coded system of described image frame is intraframe coding, described image frame is without reference to the reference frame lists
In any picture frame, methods described further comprises:The reference frame lists are emptied, described image frame are regard as long-term ginseng
Frame is examined to be added in the reference frame lists;
If it is determined that the coded system of described image frame is with reference to previous frame coding, described image frame refers to described minimum first
Difference and corresponding long term reference frame, methods described further comprise:By all short-term reference frames in the reference frame lists
Delete, be added to described image frame as short-term reference frame in the reference frame lists;
If it is determined that the coded system of described image frame is with reference to previous frame coding, described image frame refers to described minimum second
Difference and corresponding short-term reference frame, methods described further comprise:By the reference frame lists farthest from described image frame
In short-term reference frame remove, be added to described image frame as short-term reference frame in the reference frame lists.
In embodiments of the present invention, after the coded system and reference coding frame of described image frame is determined, also to reference
Reference frame in frame list is updated, specifically, if it is determined that the coded system of described image frame is intraframe coding, the figure
Picture frame is without reference to any picture frame in the reference frame lists, and methods described further comprises:The reference frame lists are clear
Sky, is added to described image frame as long term reference frame in the reference frame lists, and by the reference frame labeled as long-term
Reference frame.
If it is determined that the coded system of described image frame is with reference to previous frame coding, described image frame refers to described minimum first
Difference and corresponding long term reference frame, methods described further comprise:By all short-term reference frames in the reference frame lists
Delete, be added to described image frame as short-term reference frame in the reference frame lists.
If it is determined that the coded system of described image frame is with reference to previous frame coding, described image frame refers to described minimum second
Difference and corresponding short-term reference frame, methods described further comprise:By with the described image frame time interval most long ginseng
The short-term reference frame examined in frame list is removed, and is added to described image frame as short-term reference frame in the reference frame lists.
Embodiment 5:
It is described in embodiments of the present invention in order to ensure the accuracy of accuracy and the reference frame lists updated during coding
By before being removed with the short-term reference frame in described image frame time interval most long reference frame lists, methods described is also wrapped
Include:
Judge the short-term reference frame in the reference frame lists most long with described image frame time interval whether be
Minimum second difference and corresponding short-term reference frame, if it is not, carrying out subsequent step.
If not being the minimum with the short-term reference frame in described image frame time interval most long reference frame lists
Second difference and corresponding short-term reference frame, it is possible to by with described image frame time interval most long reference frame lists
Short-term reference frame remove.
Short-term reference frame in the reference frame lists most long with described image frame time interval is the minimum
When the second difference and corresponding short-term reference frame, methods described also includes:
Will be most long with described image frame time interval in addition to minimum second difference and corresponding short-term reference frame
Reference frame lists in short-term reference frame remove.
If updating reference frame lists before described image frame coding because with described image frame time interval most long institute
Short-term reference frame is stated for minimum second difference and corresponding short-term reference frame, is needed to refer to when described image frame is in coding
Minimum second difference and corresponding short-term reference frame, then can not remove it from reference frame lists, now will be except described in most
Outside small second difference and corresponding short-term reference frame with it is short in described image frame time interval most long reference frame lists
Phase reference frame is removed.It ensure that the accuracy of coding.
If updating reference frame lists after described image frame coding, because described minimum the second of the reference of described image frame
Difference and corresponding short-term reference frame and described image frame difference are minimum, adjacent uncoded first picture frame of described image frame
Very possible minimum second difference and corresponding short-term reference frame with reference to the reference of described image frame in coding, if so
It is minimum second difference and right with the short-term reference frame in described image frame time interval most long reference frame lists
The short-term reference frame answered, then can not by with the short-term reference frame in described image frame time interval most long reference frame lists
Remove, but will be most long with described image frame time interval in addition to minimum second difference and corresponding short-term reference frame
Reference frame lists in short-term reference frame remove.It ensure that the accuracy of the reference frame lists of renewal.
, can be using first judging whether first threshold is more than minimum first difference when being compared, whether Second Threshold
Method more than minimum second difference is compared, specifically can be as shown in Figure 2:
Fig. 2 B are a kind of video coding process schematic diagram provided in an embodiment of the present invention, and the process comprises the following steps:
S101:According to the brightness value of each pixel in picture frame to be encoded, the first brightness of described image frame is determined
Histogram.
S102:For the second brightness histogram of each reference frame preserved in reference frame lists, determine that described first is bright
Spend histogram and second brightness histogram difference and.
S103:For the long term reference frame preserved in the reference frame lists, according to each long term reference frame pair of determination
The first difference for answering and, using first difference and in minimum value as minimum first difference and;For the reference frame list
The short-term reference frame preserved in table, according to corresponding second difference of each short-term reference frame of determination and, by second difference
Minimum value with as minimum second difference and.
S105:By the corresponding first threshold of the long term reference frame of preservation the second threshold corresponding with the short-term reference frame preserved
Value, minimum first difference corresponding with long term reference frame and minimum second difference corresponding with short-term reference frame are compared.
S201:Judge whether that corresponding minimum first difference of the long term reference frame is more than the first threshold, and it is short
Corresponding minimum second difference of phase reference frame is more than the Second Threshold, if so, S202 is then carried out, if it is not, then carrying out S204.
S202:The coded system for determining described image frame is intraframe coding, and described image frame is without reference to the reference frame list
Any picture frame in table.
S203:The reference frame lists are emptied, the reference frame is added to using described image frame as long term reference frame
In list.
S204:Judge whether corresponding minimum second difference of the short-term reference frame is more than the Second Threshold, if so, then
S205 is carried out, if it is not, then carrying out S207.
S205:The coded system for determining described image frame is that described image frame is with reference to described minimum the with reference to previous frame coding
One difference and corresponding long term reference frame.
S206:By all short term reference frame deletions in the reference frame lists, described image frame is regard as short term reference
Frame is added in the reference frame lists.
S207:The coded system for determining described image frame is that described image frame is with reference to described minimum the with reference to previous frame coding
Two differences and corresponding short-term reference frame.
S208:Judging the short-term reference frame in the reference frame lists most long with described image frame time interval is
No is minimum second difference and corresponding short-term reference frame, if so, S209 is carried out, if it is not, carrying out S2010.
S209:By in addition to minimum second difference and corresponding short-term reference frame with described image frame time interval
Short-term reference frame in most long reference frame lists is removed.
S2010:It will be removed with the short-term reference frame in described image frame time interval most long reference frame lists.
Fig. 3 is a kind of video coding apparatus structure chart that the embodiment of the present invention 1 is provided, and described device includes:
First determining module 31, for the brightness value according to each pixel in picture frame to be encoded, determines the figure
As the first brightness histogram of frame;
Second determining module 32, for the second brightness histogram of each reference frame for being preserved in reference frame lists,
Determine first brightness histogram and second brightness histogram difference and;
3rd determining module 33, for the long term reference frame for being preserved in the reference frame lists, according to the every of determination
Corresponding first difference of individual long term reference frame and, using first difference and in minimum value as minimum first difference and;Pin
To the short-term reference frame preserved in the reference frame lists, according to corresponding second difference of each short-term reference frame of determination and,
Using second difference and in minimum value as minimum second difference and;
Coding module 34, for the corresponding first threshold of the long term reference frame of preservation is corresponding with the short-term reference frame preserved
Second Threshold, minimum first difference corresponding with long term reference frame and minimum second difference corresponding with short-term reference frame are carried out
Compare, the coded system and reference coding frame of described image frame are determined, using the coded system according to the reference coding frame
Described image frame is encoded.
Second determining module 32, specifically for for each brightness section, determine first brightness histogram and
The absolute value of the pixel quantity difference of same brightness section in second brightness histogram;By the absolute value of each brightness section
Sum, be defined as first brightness histogram and second brightness histogram difference and.
Described device also includes:
First threshold determining module, for obtaining the resolution ratio of the video, the first coefficient and for the long term reference
3rd threshold value of frame setting, the long term reference frame corresponding the is defined as by the resolution ratio and the product of the 3rd threshold value
One threshold value;Or encoded first picture frame adjacent with described image frame according to preservation and adjacent with described first image frame
The second encoded picture frame brightness histogram, for each brightness section, determine described first image frame and the second figure
The absolute value of the pixel quantity difference of same brightness section in the brightness histogram of picture frame, by the absolute value of each brightness section
And be defined as described first image frame and the second picture frame brightness histogram the 3rd difference and, will the 3rd difference with
It is defined as the corresponding first threshold of the long term reference frame with the product of the 3rd coefficient of the long term reference frame of preservation;Or obtain institute
State the resolution ratio of video, the first coefficient and the 3rd threshold value set for the long term reference frame, by the resolution ratio with it is described
The product of 3rd threshold value is defined as corresponding first threshold value to be selected of the long term reference frame;According to preservation and described image frame phase
The brightness histogram of the first encoded picture frame of neighbour and encoded second picture frame adjacent with described first image frame,
For each brightness section, the picture of same brightness section in the brightness histogram of described first image frame and the second picture frame is determined
Vegetarian refreshments quantity difference absolute value, by the absolute value of each brightness section and be defined as described first image frame and the second image
3rd difference of the brightness histogram of frame and the product by the 3rd difference and with the 3rd coefficient of the long term reference frame of preservation
It is defined as corresponding second threshold value to be selected of the long term reference frame;By in the described first threshold value to be selected and the second threshold value to be selected most
Small value is defined as the corresponding first threshold of the long term reference frame.
Described device also includes:
Second Threshold determining module, for obtaining the resolution ratio of the video, the second coefficient and for the short term reference
4th threshold value of frame setting, institute is defined as by the product of the 4th threshold value described in the Shang Zaiyu of the resolution ratio and second coefficient
State the corresponding Second Threshold of short-term reference frame;Or encoded first picture frame adjacent with described image frame according to preservation and
The brightness histogram of encoded second picture frame adjacent with described first image frame, for each brightness section, determines institute
The absolute value of the pixel quantity difference of same brightness section in the brightness histogram of the first picture frame and the second picture frame is stated, will be every
The 3rd of brightness histogram that the is absolute value of individual brightness section and being defined as described first image frame and the second picture frame is poor
Value and;It is defined as the short-term reference frame pair by the 3rd difference and with the product of the 4th coefficient of the short-term reference frame of preservation
The Second Threshold answered;Or obtain resolution ratio, the second coefficient and the 4th threshold set for the short-term reference frame of the video
Value, the short-term reference frame pair is defined as by the product of the 4th threshold value described in the Shang Zaiyu of the resolution ratio and second coefficient
The 3rd threshold value to be selected answered;According to encoded first picture frame adjacent with described image frame of preservation and with first figure
As the brightness histogram of adjacent the second encoded picture frame of frame, for each brightness section, described first image frame is determined
The poor absolute value with the pixel quantity of same brightness section in the brightness histogram of the second picture frame, by each brightness section
3rd difference of brightness histogram that the is absolute value and being defined as described first image frame and the second picture frame and, by described the
Three differences and to be defined as the short-term reference frame with the product of the 4th coefficient of the short-term reference frame of preservation corresponding 4th to be selected
Threshold value;Minimum value in 3rd threshold value to be selected and the 4th threshold value to be selected is defined as the short-term reference coding frame corresponding
Second Threshold.
The coding module 34, if being more than described the specifically for corresponding minimum first difference of the long term reference frame
One threshold value, and corresponding minimum second difference of the short-term reference frame is more than the Second Threshold, determines the volume of described image frame
Code mode is intraframe coding, and described image frame is without reference to any picture frame in the reference frame lists;If the long-term ginseng
Examine corresponding minimum first difference of frame and be not more than the first threshold, and corresponding minimum second difference of the short-term reference frame is big
In the Second Threshold, the coded system for determining described image frame is that, with reference to previous frame coding, described image frame refers to the minimum
First difference and corresponding long term reference frame;If corresponding minimum second difference of the short-term reference frame is not more than described second
Threshold value, the coded system for determining described image frame be with reference to previous frame coding, described image frame with reference to minimum second difference and
Corresponding short-term reference frame.
Fig. 4 is a kind of video coding apparatus structure chart that the embodiment of the present invention 4 is provided, on the basis of Fig. 1, described device
Also include:
First removing module 41, for if it is determined that the coded system of described image frame is intraframe coding, described image frame
Without reference to any picture frame in the reference frame lists, the reference frame lists are emptied, using described image frame as long-term
Reference frame is added in the reference frame lists;
Second removing module 42, for if it is determined that the coded system of described image frame is with reference to previous frame coding, the figure
As frame refers to minimum first difference and corresponding long term reference frame, by all short-term reference frames in the reference frame lists
Delete, be added to described image frame as short-term reference frame in the reference frame lists;
3rd removing module 43, for if it is determined that the coded system of described image frame is with reference to previous frame coding, the figure
As frame refers to minimum second difference and corresponding short-term reference frame, by with the described image frame time interval most long ginseng
The short-term reference frame examined in frame list is removed, and is added to described image frame as short-term reference frame in the reference frame lists.
Described device also includes:
Judge module 44, for by with the short term reference in described image frame time interval most long reference frame lists
Before frame is removed, judge whether is short-term reference frame in the reference frame lists most long with described image frame time interval
For minimum second difference and corresponding short-term reference frame.
Described device also includes:
4th removing module 45, the result for judge module is that when being, will remove minimum second difference and corresponding
Being removed with the short-term reference frame in described image frame time interval most long reference frame lists outside short-term reference frame.
The embodiment of the invention discloses a kind of method for video coding and device, methods described includes:According to figure to be encoded
As the brightness value of each pixel in frame, the first brightness histogram of described image frame is determined;For being preserved in reference frame lists
Each reference frame the second brightness histogram, determine the difference of first brightness histogram and second brightness histogram
With;It is corresponding first poor according to each long term reference frame of determination for the long term reference frame preserved in the reference frame lists
Value and, using first difference and in minimum value as minimum first difference and;For what is preserved in the reference frame lists
Short-term reference frame, according to corresponding second difference of each short-term reference frame of determination and, by second difference and in minimum
Value as minimum second difference and;The corresponding first threshold of the long term reference frame of preservation is corresponding with the short-term reference frame preserved
Second Threshold, minimum first difference corresponding with long term reference frame and minimum second difference corresponding with short-term reference frame are compared
Compared with the coded system and reference coding frame of described image frame being determined, using the coded system according to the reference coding frame pair
Described image frame is encoded.Due in embodiments of the present invention according to the first brightness histogram of picture frame to be encoded and ginseng
Examine the difference of the second brightness histogram of each reference frame preserved in frame list and corresponding with the long term reference frame of preservation
One threshold value is compared with the corresponding Second Threshold of short-term reference frame preserved, it is determined that described image frame coded system and volume
Code reference frame, only need to calculate once, and calculate be picture frame to be encoded brightness histogram and reference frame lists in protect
The difference of second brightness histogram of each reference frame deposited and, amount of calculation is small, so as to improve the efficiency of Video coding.
For systems/devices embodiment, because it is substantially similar to embodiment of the method, so the comparison of description is simple
Single, the relevent part can refer to the partial explaination of embodiments of method.
It should be noted that herein, such as first and second or the like relational terms are used merely to a reality
Body or an operation make a distinction with another entity or another operation, and not necessarily require or imply these entities
Or there is any this actual relation or order between operation.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or computer program
Product.Therefore, the application can be using the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the application can be used in one or more computers for wherein including computer usable program code
The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The application is the flow with reference to method, equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram are described.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which is produced, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
Although having been described for the preferred embodiment of the application, those skilled in the art once know basic creation
Property concept, then can make other change and modification to these embodiments.So, appended claims are intended to be construed to include excellent
Select embodiment and fall into having altered and changing for the application scope.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the application to the application
God and scope.So, if these modifications and variations of the application belong to the scope of the application claim and its equivalent technologies
Within, then the application is also intended to comprising including these changes and modification.
Claims (16)
1. a kind of method for video coding, it is characterised in that methods described includes:
According to the brightness value of each pixel in picture frame to be encoded, the first brightness histogram of described image frame is determined;
For the second brightness histogram of each reference frame preserved in reference frame lists, determine first brightness histogram and
The difference of second brightness histogram and;
It is corresponding first poor according to each long term reference frame of determination for the long term reference frame preserved in the reference frame lists
Value and, using first difference and in minimum value as minimum first difference and;For what is preserved in the reference frame lists
Short-term reference frame, according to corresponding second difference of each short-term reference frame of determination and, by second difference and in minimum
Value as minimum second difference and;
By the corresponding first threshold of the long term reference frame of preservation Second Threshold corresponding with the short-term reference frame preserved, with long-term ginseng
Examine corresponding minimum first difference of frame minimum second difference corresponding with short-term reference frame to be compared, determine described image frame
Coded system and reference coding frame, described image frame is compiled according to the reference coding frame using the coded system
Code.
2. according to the method described in claim 1, it is characterised in that described to determine first brightness histogram and this is second bright
Spend histogrammic difference and including:
For each brightness section, same brightness section in first brightness histogram and second brightness histogram is determined
The absolute value of pixel quantity difference;
By the sum of the absolute value of each brightness section, it is defined as first brightness histogram and second brightness histogram
Difference and.
3. according to the method described in claim 1, it is characterised in that determine the mistake of the corresponding first threshold of the long term reference frame
Journey includes:
Resolution ratio, the first coefficient and the 3rd threshold value set for the long term reference frame of the video are obtained, will be described point
Resolution and the product of the 3rd threshold value are defined as the corresponding first threshold of the long term reference frame;Or
According to encoded first picture frame adjacent with described image frame of preservation and it is adjacent with described first image frame
The brightness histogram of second picture frame of coding, for each brightness section, determines described first image frame and the second picture frame
Brightness histogram in same brightness section pixel quantity difference absolute value, by the sum of the absolute value of each brightness section
Be defined as described first image frame and the second picture frame brightness histogram the 3rd difference and, by the 3rd difference and with guarantor
The product of 3rd coefficient of the long term reference frame deposited is defined as the corresponding first threshold of the long term reference frame;Or
Resolution ratio, the first coefficient and the 3rd threshold value set for the long term reference frame of the video are obtained, will be described point
Resolution and the product of the 3rd threshold value are defined as corresponding first threshold value to be selected of the long term reference frame;According to preservation and institute
State adjacent the first encoded picture frame of picture frame and encoded second picture frame adjacent with described first image frame
Brightness histogram, for each brightness section, is determined same in the brightness histogram of described first image frame and the second picture frame
Brightness section pixel quantity difference absolute value, by the absolute value of each brightness section and be defined as described first image
3rd difference of the brightness histogram of frame and the second picture frame and, the by the 3rd difference and with the long term reference frame of preservation
The product of three coefficients is defined as corresponding second threshold value to be selected of the long term reference frame;Described first threshold value to be selected and second are treated
The minimum value in threshold value is selected to be defined as the corresponding first threshold of the long term reference frame.
4. the method according to claim 1 or 3, it is characterised in that determine the corresponding Second Threshold of the short-term reference frame
Process include:
Resolution ratio, the second coefficient and the 4th threshold value set for the short-term reference frame of the video are obtained, will be described point
Resolution and the product of the 4th threshold value described in the Shang Zaiyu of second coefficient are defined as corresponding second threshold of the short-term reference frame
Value;Or
According to encoded first picture frame adjacent with described image frame of preservation and it is adjacent with described first image frame
The brightness histogram of second picture frame of coding, for each brightness section, determines described first image frame and the second picture frame
Brightness histogram in same brightness section pixel quantity difference absolute value, by the sum of the absolute value of each brightness section
Be defined as described first image frame and the second picture frame brightness histogram the 3rd difference and;By the 3rd difference and with guarantor
The product of 4th coefficient of the short-term reference frame deposited is defined as the corresponding Second Threshold of the short-term reference frame;Or
Resolution ratio, the second coefficient and the 4th threshold value set for the short-term reference frame of the video are obtained, will be described point
Resolution is defined as the short-term reference frame the corresponding 3rd with the product of the 4th threshold value described in the Shang Zaiyu of second coefficient and treated
Select threshold value;According to encoded first picture frame adjacent with described image frame of preservation and adjacent with described first image frame
The brightness histogram of the second encoded picture frame, for each brightness section, determines described first image frame and the second image
The absolute value of the pixel quantity difference of same brightness section in the brightness histogram of frame, by the absolute value of each brightness section
With the 3rd difference of the brightness histogram for being defined as described first image frame and the second picture frame and, by the 3rd difference and with
The product of 4th coefficient of the short-term reference frame of preservation is defined as corresponding 4th threshold value to be selected of the short-term reference frame;Will be described
Minimum value in 3rd threshold value to be selected and the 4th threshold value to be selected is defined as the corresponding Second Threshold of the short-term reference coding frame.
5. according to the method described in claim 1, it is characterised in that the corresponding first threshold of the long term reference frame by preservation
Second Threshold corresponding with the short-term reference frame of preservation, corresponding with long term reference frame minimum first difference and short-term reference frame pair
Minimum second difference answered is compared, and is determined the coded system and reference coding frame of described image frame and is included:
If corresponding minimum first difference of the long term reference frame is more than the first threshold, and short-term reference frame correspondence
Minimum second difference be more than the Second Threshold, determine described image frame coded system be intraframe coding, described image frame
Without reference to any picture frame in the reference frame lists;
If corresponding minimum first difference of the long term reference frame is not more than the first threshold, and the short-term reference frame pair
Minimum second difference answered is more than the Second Threshold, and the coded system for determining described image frame is to be encoded with reference to previous frame, described
Picture frame refers to minimum first difference and corresponding long term reference frame;
If corresponding minimum second difference of the short-term reference frame is not more than the Second Threshold, the volume of described image frame is determined
Code mode is that, with reference to previous frame coding, described image frame refers to minimum second difference and corresponding short-term reference frame.
6. method according to claim 5, it is characterised in that methods described also includes:
If it is determined that the coded system of described image frame is intraframe coding, described image frame is without reference in the reference frame lists
Any picture frame, methods described further comprises:The reference frame lists are emptied, described image frame are regard as long term reference frame
It is added in the reference frame lists;
If it is determined that the coded system of described image frame is with reference to previous frame coding, described image frame refers to minimum first difference
With corresponding long term reference frame, methods described further comprises:By all short term reference frame deletions in the reference frame lists,
It is added to described image frame as short-term reference frame in the reference frame lists;
If it is determined that the coded system of described image frame is with reference to previous frame coding, described image frame refers to minimum second difference
With corresponding short-term reference frame, methods described further comprises:By with the described image frame time interval most long reference frame
Short-term reference frame in list is removed, and is added to described image frame as short-term reference frame in the reference frame lists.
7. method according to claim 6, it is characterised in that it is described by with described image frame time interval it is most long described in
Before short-term reference frame in reference frame lists is removed, methods described also includes:
Judge whether the short-term reference frame in the reference frame lists most long with described image frame time interval is described
Minimum second difference and corresponding short-term reference frame, if it is not, carrying out subsequent step.
8. method according to claim 7, it is characterised in that the ginseng most long with described image frame time interval
When the short-term reference frame examined in frame list is minimum second difference and corresponding short-term reference frame, methods described also includes:
By in addition to minimum second difference and corresponding short-term reference frame with described image frame time interval most long ginseng
The short-term reference frame examined in frame list is removed.
9. a kind of video coding apparatus, it is characterised in that described device includes:
First determining module, for the brightness value according to each pixel in picture frame to be encoded, determines described image frame
First brightness histogram;
Second determining module, for the second brightness histogram of each reference frame for being preserved in reference frame lists, determines institute
State the first brightness histogram and second brightness histogram difference and;
3rd determining module, for the long term reference frame for being preserved in the reference frame lists, according to each long-term of determination
Corresponding first difference of reference frame and, using first difference and in minimum value as minimum first difference and;For described
The short-term reference frame preserved in reference frame lists, according to corresponding second difference of each short-term reference frame of determination and, will be described
Second difference and in minimum value as minimum second difference and;
Coding module, for by the corresponding first threshold of the long term reference frame of preservation and preserve short-term reference frame corresponding second
Threshold value, minimum first difference corresponding with long term reference frame and minimum second difference corresponding with short-term reference frame are compared,
The coded system and reference coding frame of described image frame are determined, using the coded system according to the reference coding frame to described
Picture frame is encoded.
10. device according to claim 9, it is characterised in that second determining module, specifically for for each bright
Degree is interval, determines the pixel quantity difference of same brightness section in first brightness histogram and second brightness histogram
Absolute value;By the sum of the absolute value of each brightness section, it is defined as first brightness histogram and the second brightness Nogata
The difference of figure and.
11. device according to claim 9, it is characterised in that described device also includes:
First threshold determining module, for obtaining the resolution ratio of the video, the first coefficient and being set for the long term reference frame
The 3rd fixed threshold value, corresponding first threshold of the long term reference frame is defined as by the resolution ratio and the product of the 3rd threshold value
Value;Or encoded first picture frame adjacent with described image frame according to preservation and it is adjacent with described first image frame
The brightness histogram of second picture frame of coding, for each brightness section, determines described first image frame and the second picture frame
Brightness histogram in same brightness section pixel quantity difference absolute value, by the sum of the absolute value of each brightness section
Be defined as described first image frame and the second picture frame brightness histogram the 3rd difference and, by the 3rd difference and with guarantor
The product of 3rd coefficient of the long term reference frame deposited is defined as the corresponding first threshold of the long term reference frame;Or regarded described in obtaining
The resolution ratio of frequency, the first coefficient and the 3rd threshold value set for the long term reference frame, by the resolution ratio and the described 3rd
The product of threshold value is defined as corresponding first threshold value to be selected of the long term reference frame;It is adjacent with described image frame according to preservation
The brightness histogram of encoded the first picture frame and encoded second picture frame adjacent with described first image frame, for
Each brightness section, determines the pixel of same brightness section in the brightness histogram of described first image frame and the second picture frame
The absolute value of quantity difference, will be the absolute value of each brightness section and being defined as described first image frame and the second picture frame
3rd difference of brightness histogram and the product determination by the 3rd difference and with the 3rd coefficient of the long term reference frame of preservation
For corresponding second threshold value to be selected of the long term reference frame;By the minimum value in the described first threshold value to be selected and the second threshold value to be selected
It is defined as the corresponding first threshold of the long term reference frame.
12. the device according to claim 9 or 11, it is characterised in that described device also includes:
Second Threshold determining module, for obtaining the resolution ratio of the video, the second coefficient and being set for the short-term reference frame
The 4th fixed threshold value, the product of the resolution ratio and the 4th threshold value described in the Shang Zaiyu of second coefficient is defined as described short
The corresponding Second Threshold of phase reference frame;Or encoded first picture frame adjacent with described image frame according to preservation and with institute
The brightness histogram of adjacent the second encoded picture frame of the first picture frame is stated, for each brightness section, described is determined
The absolute value of the pixel quantity difference of same brightness section in the brightness histogram of one picture frame and the second picture frame, will be each bright
Spend brightness histogram that the is interval absolute value and being defined as described first image frame and the second picture frame the 3rd difference and;
It is defined as the short-term reference frame by the 3rd difference and with the product of the 4th coefficient of the short-term reference frame of preservation corresponding
Second Threshold;Or resolution ratio, the second coefficient and the 4th threshold value set for the short-term reference frame of the video are obtained, will
It is corresponding that the resolution ratio is defined as the short-term reference frame with the product of the 4th threshold value described in the Shang Zaiyu of second coefficient
3rd threshold value to be selected;According to encoded first picture frame adjacent with described image frame of preservation and with described first image frame
The brightness histogram of adjacent the second encoded picture frame, for each brightness section, determines described first image frame and
The absolute value of the pixel quantity difference of same brightness section in the brightness histogram of two picture frames, this by each brightness section is exhausted
To value and be defined as described first image frame and the second picture frame brightness histogram the 3rd difference and, it is poor by the described 3rd
Value and it is defined as corresponding 4th threshold value to be selected of the short-term reference frame with the product of the 4th coefficient of the short-term reference frame of preservation;
Minimum value in 3rd threshold value to be selected and the 4th threshold value to be selected is defined as the short-term reference coding frame corresponding second
Threshold value.
13. device according to claim 9, it is characterised in that the coding module, if specifically for the long-term ginseng
Corresponding minimum first difference of frame is examined more than the first threshold, and corresponding minimum second difference of the short-term reference frame to be more than
The Second Threshold, the coded system for determining described image frame is intraframe coding, and described image frame is without reference to the reference frame list
Any picture frame in table;If corresponding minimum first difference of the long term reference frame is not more than the first threshold, and institute
Corresponding minimum second difference of short-term reference frame is stated more than the Second Threshold, it is reference to determine the coded system of described image frame
Previous frame is encoded, and described image frame refers to minimum first difference and corresponding long term reference frame;If the short-term reference frame
Corresponding minimum second difference is not more than the Second Threshold, and the coded system for determining described image frame is to be encoded with reference to previous frame,
Described image frame refers to minimum second difference and corresponding short-term reference frame.
14. device according to claim 13, it is characterised in that described device also includes:
First removing module, for if it is determined that described image frame coded system be intraframe coding, described image frame without reference to
Any picture frame in the reference frame lists, the reference frame lists are emptied, and regard described image frame as long term reference frame
It is added in the reference frame lists;
Second removing module, for if it is determined that the coded system of described image frame is with reference to previous frame coding, described image frame ginseng
Minimum first difference and corresponding long term reference frame are examined, by all short term reference frame deletions in the reference frame lists,
It is added to described image frame as short-term reference frame in the reference frame lists;
3rd removing module, for if it is determined that the coded system of described image frame is with reference to previous frame coding, described image frame ginseng
Examine minimum second difference and corresponding short-term reference frame, by with the described image frame time interval most long reference frame list
Short-term reference frame in table is removed, and is added to described image frame as short-term reference frame in the reference frame lists.
15. device according to claim 14, it is characterised in that described device also includes:
Judge module, for will be removed with the short-term reference frame in described image frame time interval most long reference frame lists
Before, judge whether the short-term reference frame in the reference frame lists most long with described image frame time interval is described
Minimum second difference and corresponding short-term reference frame.
16. device according to claim 15, it is characterised in that described device also includes:
4th removing module, the result for judge module is that when being, will remove minimum second difference and corresponding short-term ginseng
Examine being removed with the short-term reference frame in described image frame time interval most long reference frame lists outside frame.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610956784.4A CN107071405B (en) | 2016-10-27 | 2016-10-27 | A kind of method for video coding and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610956784.4A CN107071405B (en) | 2016-10-27 | 2016-10-27 | A kind of method for video coding and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN107071405A true CN107071405A (en) | 2017-08-18 |
| CN107071405B CN107071405B (en) | 2019-09-17 |
Family
ID=59617190
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610956784.4A Active CN107071405B (en) | 2016-10-27 | 2016-10-27 | A kind of method for video coding and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN107071405B (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110166776A (en) * | 2018-02-11 | 2019-08-23 | 腾讯科技(深圳)有限公司 | Method for video coding, device and storage medium |
| CN113766273A (en) * | 2021-01-05 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Method and device for processing video data |
Citations (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2591441B2 (en) * | 1993-09-28 | 1997-03-19 | 日本電気株式会社 | Moving vector detection device for moving image signal |
| US6785645B2 (en) * | 2001-11-29 | 2004-08-31 | Microsoft Corporation | Real-time speech and music classifier |
| US20070147512A1 (en) * | 2000-04-18 | 2007-06-28 | Ati International Srl | Method and apparatus for rate control for constant-bit-rate-finite-buffer-size video encoder |
| US20070199011A1 (en) * | 2006-02-17 | 2007-08-23 | Sony Corporation | System and method for high quality AVC encoding |
| CN101340511A (en) * | 2008-08-07 | 2009-01-07 | 中兴通讯股份有限公司 | Adaptive video image enhancing method based on lightness detection |
| CN102378008A (en) * | 2011-11-02 | 2012-03-14 | 深圳市融创天下科技股份有限公司 | Video encoding method, video encoding device and video encoding system for shortening waiting time for playing |
| CN102387364A (en) * | 2011-10-27 | 2012-03-21 | 江苏大学 | Fast intra-frame mode selecting algorithm |
| CN103596004A (en) * | 2013-11-19 | 2014-02-19 | 北京邮电大学 | Intra-frame prediction method and device based on mathematical statistics and classification training in HEVC |
| CN103647975A (en) * | 2013-12-02 | 2014-03-19 | 国家广播电影电视总局广播科学研究院 | Improved sample adaptive offset filtering method based on histogram analysis |
| CN104519364A (en) * | 2014-12-10 | 2015-04-15 | 北京中星微电子有限公司 | Video encoding method and device |
| CN105898296A (en) * | 2015-12-24 | 2016-08-24 | 乐视云计算有限公司 | Video coding frame selection method and device |
-
2016
- 2016-10-27 CN CN201610956784.4A patent/CN107071405B/en active Active
Patent Citations (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2591441B2 (en) * | 1993-09-28 | 1997-03-19 | 日本電気株式会社 | Moving vector detection device for moving image signal |
| US20070147512A1 (en) * | 2000-04-18 | 2007-06-28 | Ati International Srl | Method and apparatus for rate control for constant-bit-rate-finite-buffer-size video encoder |
| US6785645B2 (en) * | 2001-11-29 | 2004-08-31 | Microsoft Corporation | Real-time speech and music classifier |
| US20070199011A1 (en) * | 2006-02-17 | 2007-08-23 | Sony Corporation | System and method for high quality AVC encoding |
| CN101340511A (en) * | 2008-08-07 | 2009-01-07 | 中兴通讯股份有限公司 | Adaptive video image enhancing method based on lightness detection |
| CN102387364A (en) * | 2011-10-27 | 2012-03-21 | 江苏大学 | Fast intra-frame mode selecting algorithm |
| CN102378008A (en) * | 2011-11-02 | 2012-03-14 | 深圳市融创天下科技股份有限公司 | Video encoding method, video encoding device and video encoding system for shortening waiting time for playing |
| CN103596004A (en) * | 2013-11-19 | 2014-02-19 | 北京邮电大学 | Intra-frame prediction method and device based on mathematical statistics and classification training in HEVC |
| CN103647975A (en) * | 2013-12-02 | 2014-03-19 | 国家广播电影电视总局广播科学研究院 | Improved sample adaptive offset filtering method based on histogram analysis |
| CN104519364A (en) * | 2014-12-10 | 2015-04-15 | 北京中星微电子有限公司 | Video encoding method and device |
| CN105898296A (en) * | 2015-12-24 | 2016-08-24 | 乐视云计算有限公司 | Video coding frame selection method and device |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110166776A (en) * | 2018-02-11 | 2019-08-23 | 腾讯科技(深圳)有限公司 | Method for video coding, device and storage medium |
| CN110166776B (en) * | 2018-02-11 | 2023-08-04 | 腾讯科技(深圳)有限公司 | Video encoding method, device and storage medium |
| CN113766273A (en) * | 2021-01-05 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Method and device for processing video data |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107071405B (en) | 2019-09-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111327945A (en) | Method and apparatus for segmenting video | |
| CN104217417B (en) | A kind of method and device of video multi-target tracking | |
| US11909999B2 (en) | Coding management method and apparatus based on high efficiency video coding | |
| Bulut et al. | Key frame extraction from motion capture data by curve saliency | |
| CN102754440A (en) | Image encoding method, image encoding device, and camera system | |
| CN106572352A (en) | Keyframe size control method and device | |
| CN107071405A (en) | A kind of method for video coding and device | |
| CN113205495A (en) | Image quality evaluation and model training method, device, equipment and storage medium | |
| US8111751B2 (en) | Encoding video | |
| WO2024120396A1 (en) | Video coding method and apparatus, and electronic device and storage medium | |
| US20140133575A1 (en) | Electronic device and method for splitting image | |
| Duvignau et al. | Piecewise linear approximation in data streaming: Algorithmic implementations and experimental analysis | |
| US12155822B2 (en) | Video compression method and system | |
| CN107454408A (en) | A kind of method of Image Coding code check dynamic adjustment | |
| CN118400543A (en) | Foreign matter detection method and system for overhead transmission line based on image processing | |
| CN112613365A (en) | Pedestrian detection and behavior analysis method and device and computing equipment | |
| CN108765503B (en) | Skin color detection method, device and terminal | |
| CN116051605A (en) | A multi-level deep feature fusion and adaptive re-detection target tracking method | |
| CN116248918A (en) | Video shot segmentation method and device, electronic equipment and readable medium | |
| CN112465859B (en) | Method, device, equipment and storage medium for detecting fast moving object | |
| CN113347497A (en) | Target user identification method and device, electronic equipment and storage medium | |
| CN104837027A (en) | Sub-pixel motion estimation method and device | |
| CN103905823A (en) | Method and device for video coding | |
| CN111988612A (en) | Video coding processing method and device and electronic equipment | |
| CN113810695A (en) | Video encoding method, apparatus and computer-readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |