1. Field of the Invention
The present invention relates to the area of video compression, more particularly to video encoding techniques with stable bit stream.
2. Description of Related Art
There are three types of frames or pictures used in video compression: I frames, P frames, and B frames. I frames are coded without reference to any frames except themselves. P frames are coded with reference to preceding frames. B-frames are coded with reference to preceding and following frames of a current frame. I frames is ‘Intra-frame encoded pictures’, and the B frames and the P frames are ‘inter-frame encoded pictures’.
I frame is a fully-specified picture like a conventional static image and has a lower video compression rate. P frame holds only changes in a current image from a previous frame. The encoder does not need to store the unchanging background pixels in the P frame, so saving space. B frame saves even more space by using differences between the current frame and both the preceding and following frames to specify its content. I frame typically requires tens times or even several tens times bit steams to be encoded than P frame or the B frame. Hence, an average bit rate is reduced by increasing interval of I frame usually when the video monitor is realized based on a narrow-channel (e.g., wireless network or ADSL uplink channel).
Thus, improved techniques for a video encoding method with more even bit stream are desired to overcome the above disadvantages.
This section is for the purpose of summarizing some aspects of the present invention and to briefly introduce some preferred embodiments. Simplifications or omissions in this section as well as in the abstract or the title of this description may be made to avoid obscuring the purpose of this section, the abstract and the title. Such simplifications or omissions are not intended to limit the scope of the present invention.
In general, the present invention pertains to a video encoding technique with. An output bit stream obtained using the video encoding technique is more even than that obtained using a conventional way. According to one aspect of the present invention, an instantaneous peak of the output bit stream is greatly reduced by dividing one image frame into a key area and a background area, then inter-frame encoding the key area and the background area in different frames respectively. In other words, a whole bit stream of one I frame in the prior art is distributed into two or more image frames in the present invention.
One of the features, benefits and advantages in the present invention is to provide techniques for
Other objects, features, and advantages of the present invention will become apparent upon examining the following detailed description of an embodiment thereof, taken in conjunction with the attached drawings.
These and other features, aspects, and advantages of the present invention will become better understood with regard to the following description, appended claims, and accompanying drawings where:
The detailed description of the present invention is presented largely in terms of procedures, steps, logic blocks, processing, or other symbolic representations that directly or indirectly resemble the operations of devices or systems contemplated in the present invention. These descriptions and representations are typically used by those skilled in the art to most effectively convey the substance of their work to others skilled in the art.
Reference herein to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase “in one embodiment” in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Further, the order of blocks in process flowcharts or diagrams or the use of sequence numbers representing one or more embodiments of the invention do not inherently indicate any particular order nor imply any limitations in the invention.
Embodiments of the present invention are discussed herein with reference to
An improved video coding method is provided according to one embodiment of the present invention. An output bit stream obtained by using the video coding method of the present invention is more even than that obtained by using a conventional way. In the present invention, an instantaneous peak of the output bit stream is greatly reduced by dividing one image frame into a key area and a background area and inter-frame encoding the key area and the background area in different frames respectively. In other words, a whole bit stream of one I frame in the prior art is distributed into two or more image frames in the present invention.
A variable K is provided to indicate a frame number between a current image frame and a latest I frame. For example, K=0 indicates that the frame number between the current image frame and the latest I frame image is zero, namely the current image frame should be encoded as the I frame. Generally, an encoder may be configured to insert one I frame every N image frames, wherein N is a predetermined integer (e.g. 30 or 40). So, a next image frame should be encoded as the I frame if K=N−1. The process 100 proceeds at 104, where to determine whether K=0. If yes, that means that the current image frame should be encoded as the I frame, the process 100 is taken to 105; otherwise, that means that the current image frame should not be encoded as the I frame, the process 100 is taken to 106.
Another predetermined integer M less than N is configured to indicate where the intra-frame coding to the background area should be processed. The value of M is relative to the size of the key area. If the size of the key area is larger, a larger M should be determined to efficiently distribute the peak of the bit stream. In one embodiment, M may be equal to about a half of N. At 106, it is further determined whether K=M. If yes, that means that the intra-frame coding to the background area should be processed at the current image frame, the process 100 is taken to 110; otherwise, that means that the intra-frame coding to the background area should not be processed at the current image frame, the process 100 is taken to 108.
At 105, the key area of the current image frame is intra-frame encoded without reference to any frames except themselves and the background area of the current image frame is skipped. Thus, an output bit stream of the current image frame is formed. Subsequently, the process 100 proceeds at 118.
At 108, the key area of the current image frame is inter-frame encoded with reference to a preceding frame or/and a following frame. Then, it is determined whether there is available background area in previous reference frame at 112. If yes, the background area of the current image frame is also inter-frame encoded at 114; otherwise, the background area of the current image frame is skipped. Thus, the output bit stream of the current image frame is formed. Subsequently, the process 100 proceeds at 118.
At 110, the key area of the current image frame is inter-frame encoded with reference to the preceding frame or/and the following frame. Then, the background area of the current image frame is intra-frame encoded without reference to any frames except themselves at 116. Thus, the output bit stream of the current image frame is formed. Subsequently, the process 100 proceeds at 118.
At 118, whether the next image frame should be coded as the I frame is determined. If yes, K is set to equal to 0 at 122; otherwise, K is added by 1 at 120. Then, the process 100 returns to 102 to proceed until all image frames are encoded. In one embodiment, if K=N−1, it concludes that the next image frame should be coded as the I frame; otherwise, it concludes that the next image frame should not be coded as the I frame.
In order to decode the encoded bit stream, some special parameters including parameters in relation to the key area and parameters in relation to the background area are added into a head of the current image frame in addition to some conventional parameters in the prior art. The parameters in relation to the key area comprise a number of sensitive areas, and a position and size parameter of each sensitive area. It should is noted that the key area comprises all sensitive areas. Other areas except for the sensitive areas belong to the background area. The parameters in relation to the background area comprise a parameter indicating whether the background area is skipped and a parameter indicating that the background area is inter-frame encoded or intra-frame encoded when the background area is not skipped.
In addition to some conventional I frame parameters, the head of the current image frame when K=0 further comprises:
If the sensitive area number is larger than 1 in other examples, the position and size parameter of each sensitive area should be included.
In addition to some conventional P or B frame parameters, the head of the current image frame when K=M further comprises:
In addition to some conventional P or B frame parameters, the head of the current image frame when K is from 1 to M−1 or from M+1 to N−1 further comprises:
It can be seen that the first I frame and the following M−1 image frames have no the background area when the video monitoring system just begins since no available background area can be referred before the first time to intra-frame encode the background area. However, the overall visual effect in the present invention has no obvious changes.
Referring to
As described above, the bit stream of the I frame in the prior art is distributed into two image frames by inter-frame encoding the key area when K=0 and inter-frame encoding the background area when K=M. Thus, the instantaneous peak of the output bit stream is greatly reduced.
When the image frame is reconstructed in a decoder, if the background area in the head of the image frame is marked as “skip-mode”, the following operations is preformed: directly copying the background area of previous decoded image frame as the background area of the current decoded image frame if the previous decoded image frame has available background area; setting all pixel values of the background area of the current decoded image frame to a predetermined value (e.g., 128 or 0).
The present invention has been described in sufficient details with a certain degree of particularity. It is understood to those skilled in the art that the present disclosure of embodiments has been made by way of examples only and that numerous changes in the arrangement and combination of parts may be resorted without departing from the spirit and scope of the invention as claimed. Accordingly, the scope of the present invention is defined by the appended claims rather than the foregoing description of embodiments.
Number | Date | Country | Kind |
---|---|---|---|
200810226587.2 | Nov 2008 | CN | national |