Video bit rate control method

Abstract
This invention is directed to a video bit rate control method for encoding a video sequence based on a decoder buffer condition and a group of picture (GOP) size limitation of the encoded video sequence. The method includes iteratively adjusting a quantization parameter and/or a masking strength parameter and encoding the video sequence at the adjusted parameters until the buffer condition and GOP size limitation are satisfied. The method makes the above adjustments to avoid buffer underflow and GOP oversizing.
Description
BACKGROUND

There are several constraints on the video bit rate of a sequence coded on a DVD, e.g., device processing capacity, read rate, and seek time. The problem has been how to meet these constraints, yet provide acceptable video quality and DVD performance.


One approach has been to apply a rate control algorithm based on MPEG-2 TM5 to video sequences. However, this algorithm does not handle frame complexity changes due to scene changes very well, failing to allocate bits proportionately and timely with the scene changes. A two-pass version of this algorithm has been implemented to react more rapidly to the scene changes. However, there is an initial learning period after each scene change in which the algorithm must determine the appropriate bit allocation. Moreover, the rate control algorithm does not adequately model decoder buffer conditions, such that the determined bit rate may result in buffer underflow.


Accordingly, there is a need in the art for an efficient way to control the video bit rate within the above-mentioned constraints and provide acceptable video quality and DVD performance.





BRIEF DESCRIPTION OF THE DRAWINGS


FIG. 1 is a flowchart of a method according to an embodiment of the present invention for controlling video bit rates of a video sequence.



FIG. 2 is a flowchart of another method according to an embodiment of the present invention for controlling video bit rates with limitations on the method.



FIG. 3 illustrates a computer system upon which embodiments of the present invention may be implemented.





DETAILED DESCRIPTION

The following terms are used throughout this description with respect to the methods for controlling video bit rates according to embodiments of the present invention.


Nominal quantization parameter QPnom refers to a reference value for the quantization parameters that may be used for encoding the frames within the video sequence. A quantization parameter defines the granularity with which a video frame within a sequence may be coded. The value of QPnom may be adjusted during each iteration of a method according to embodiments of the present invention in order to reach a target video bit rate for the encoded video sequence.


Reference masking strength parameter φref refers to a reference measure of the visual activity of the frames within the video sequence. The value of φref may be adjusted during each iteration to reach a target video bit rate for the encoded video sequence.


Frame masking strength parameter φframe refers to a measure of the visual activity of a particular frame within the video sequence. A frame's value of φframe may be used to calculate that frame's quantization parameter during each iteration to be used to allocate bits for the encoded frame.


Frame quantization parameter QPframe refers to the quantization parameter calculated for a particular frame. A frame's value of QPframe may be calculated based on the nominal quantization parameter QPnom and the reference and frame masking strength parameters φref, φframe during each iteration to be used to allocate bits for that encoded frame.


Average masking quantization parameter AMQP refers to an average of the frame quantization parameters QPframe. The value of AMQP may be compared to the nominal quantization parameter QPnom during each iteration to determine how the nominal quantization parameter QPnom and the reference masking strength parameter φref should be adjusted to reach a target video bit rate for the encoded video sequence.


A segment of a video sequence refers to a group of contiguous video frames in the sequence in display order. In embodiments of the present invention, a video sequence may be partitioned into segments and coded on a segment-by-segment basis.


Embodiments of the present invention provide a method for controlling the video bit rate of segments of a video sequence by adjusting a nominal quantization parameter QPnom and a reference masking strength parameter φref in order to reach a target bit rate, while avoiding sequence file oversizing, decoder buffer underflow, and coded group of picture (GOP) oversizing. This advantageously results in acceptable video quality and DVD performance within the constraints of the DVD device, such as device processing capacity, read rate, and seek time.


Related U.S. Patent Publication No. 2005-0286631 describes a method for controlling the video bit rate. Related U.S. Patent Publication No. 2006-0013298 describes a masking strength parameter.



FIG. 1 is a flowchart of an iterative method according to an embodiment of the present invention for controlling video bit rates per video segment. For each segment, the encoder may iteratively adjust the nominal quantization parameter and/or the reference masking strength parameter to provide a target video bit rate for that segment within the DVD performance constraints.


The encoder may initialize (205) the nominal quantization parameter QPnom, the reference masking strength parameter φref, and the frame masking strength parameter φframe by setting QPnom and φref to initial values by any known parameter initialization method and by measuring an initial value for φframe. The initial values may be arbitrary values or values selected based on experimental results that are known to produce acceptable video quality at the target bit rate.


The encoder may calculate (210) each segment frame's quantization parameter QPframe based on QPnom and the difference between φref and φframe. For example, if the frame's masking strength parameter φframe is higher than the reference masking strength parameter φref, then the frame may have higher visual activity or lower sensitivity to visual artifacts in the frame, such that the calculated quantization parameter QPframe should have a higher value than the nominal quantization parameter QPnom to provide a lower bit rate for the frame. Conversely, if φframe is lower than φref, then the frame may have lower visual activity or higher sensitivity to visual artifacts in the frame, such that QPframe should have a lower value than QPnom to provide a higher bit rate for the frame.


The encoder may then encode (215) the segment frames using respective calculated frame quantization parameters QPframe's. The encoder may use any known coding technique to encode the segment.


After the segment has been encoded, the encoder may check whether any of three undesirable conditions—sequence file oversizing, decoder buffer underflow, or GOP oversizing—has occurred as a result of the encoding. In which case, re-encoding with adjusted coding parameters may be done to reach the target bit rate while correcting these undesirable conditions. In FIG. 1, all three conditions are checked. However, it is to be understood that any one or more of these conditions may be checked in any order during an iteration according to embodiments of the present invention. It is further to be understood that embodiments are not limited to checking for these three conditions, but may check for any other conditions that may adversely affect coding.


The encoder may determine (225) whether the encoded segment causes the file size (or, equivalently, bit rate) limitation that was set for the entire video sequence to be exceeded. If the file size limitation is exceeded (225), the encoder may calculate (240) the average masked quantization parameter AMQP, which is the mathematical average of the segment frames'calculated quantization parameters QPframe. Alternatively, the AMQP may be the median of the QPframe's or any other appropriate value in accordance with embodiments of the present invention.


The AMQP is directly related to the bit rate, where an increase in the AMQP generally decreases the bit rate and a decrease in the AMQP generally increases the bit rate. Such a relationship between the bit rate and the AMQP may form the basis of the desired AMQP calculation, described below.


The encoder may calculate (245) the desired average masked quantization parameter AMQPd, which is the AMQP to be reached in the next iteration in an attempt to achieve the target bit rate. In one embodiment, the AMQPd for iteration i+1 may be extrapolated from the AMQP in iteration i based on the target bit rate versus the actual bit rate achieved in iteration i. In an alternate embodiment, the AMQPd for iteration i+1 may be interpolated from the AMQP's and corresponding actual bit rates of any two or more previous iterations in which the actual bit rates were closest to the target bit rate. In another alternate embodiment, the AMQPd for iteration i+1 may be approximated from a higher order polynomial relationship between AMQP and bit rate using the AMQP's and corresponding actual bit rates from any two or more previous iterations. Other such calculations may be used to find AMQPd for the next iteration.


The encoder may then calculate (255) the adjustments to be made to QPnom and φref in order to reach the QPnom and φref that may give an AMQP value close to AMQPd, for example, by doing an iterative calculation. The encoder may adjust (260) QPnom and φref accordingly. The adjusted QPnom and φref may then be used in the next iteration to calculate each segment frame's QPframe in order to move the segment's actual bit rate closer to the target bit rate.


In this embodiment, both the QPnom and φref may be adjusted in each iteration. In an alternate embodiment, the QPnom and φref may be adjusted in alternate iterations or in any other iteration frequency or pattern in order to reach the target bit rate.


The encoder may then increment (265) the number of iterations, or passes, n.


The encoder may repeat the segment encoding at adjusted QPnom's and φref's until the file size limitation is not exceeded.


If the file size limitation is not exceeded (225), the encoder may determine (230) whether the buffer underflows. The underflow may indicate that the decoder is ready to decode the next frame before that frame has completely arrived at the decoder. The encoder may simulate the decoder buffer and re-encodes segment frames to prevent underflow.


If the buffer underflows (230), the encoder may, as described above, calculate (240) the AMQP, calculate (245) the AMQPd for the next iteration based on the calculated AMQP, calculate (255) the adjustments to QPnom and φref, make (260) the adjustments, increment (265) the number of iterations, and repeat the segment encoding at adjusted QPnom's and φref's until both the file size and the buffer conditions are satisfied.


If the buffer does not underflow (230), the encoder may determine (235) whether the GOP maximum size is exceeded. If the GOP maximum size is exceeded (235), the encoder may, as described above, calculate (240) the AMQP, calculate (245) the AMQPd for the next iteration based on the calculated AMQP, calculate (255) the adjustments to QPnom and φref, make (260) the adjustments, increment (265) the number of iterations, and repeat the segment encoding at adjusted QPnom's and φref's until the file size, the buffer, and the GOP size conditions are satisfied.


If the file size limitation is not exceeded (225), the buffer is not in underflow (230), and the GOP maximum size is not exceeded (235), the segment is deemed successfully encoded at an appropriate video bit rate. The method may repeat for the remaining segments.



FIG. 2 is a flowchart of another method according to an embodiment of the present invention for controlling video bit rates with the following limitations on the method. The number of iterations n may be limited to avoid infinite iterations. Or the ranges of QPnom and φref may be limited to prevent unreasonable values and/or adjustments.


The encoder may initialize (305) QPnom, φref, φframe by setting initial values for QPnom and φref and by measuring an initial value for φframe. The encoder may calculate (310) each segment frame's QPframe based on QPnom and the difference between φref and φframe. The encoder may then encode (315) the segment frames using respective calculated QPframe's.


After the segment has been encoded, the encoder may check whether any of the above-described three undesirable conditions have occurred as a result of the encoding.


The encoder may determine (325) whether the encoded segment causes the file size limitation that was set for the entire video sequence to be exceeded. If the file size limitation is exceeded (325), the encoder may calculate (340) the AMQP. The encoder may calculate (345) the AMQPd based on the calculated AMQP. The encoder may then calculate (355) adjustments to QPnom and φref.


In this embodiment, the encoder may then determine (360) whether the calculated adjustments are valid, i.e., within an appropriate range. If not, the encoder may stop encoding this segment and accept the segment as encoded in the previous iteration at its bit rate.


If, however, the adjustments are valid (360), the encoder may adjust (365) QPnom and φref accordingly. The adjusted QPnom and φref may then be used in the next iteration to calculate each segment frame's QPframe in order to move the segment's actual bit rate closer to the target bit rate. The encoder may increment (370) the number of iterations, or passes, n.


In this embodiment, if the number of iterations exceeds (380) a maximum, nmax, the encoder may stop encoding this segment and accept the segment as encoded in the previous iteration at its bit rate.


If, however, the number of iterations has not exceeded the maximum (380), the encoder may repeat the segment encoding at adjusted QPnom's and φref's until the file size limitation is not exceeded.


If the file size limitation is not exceeded (325), the encoder may determine (330) whether the buffer underflows. If the buffer underflows (330), the encoder may, as described above, calculate (340) the AMQP, calculate (345) the AMQPd for the next iteration based on the calculated AMQP, calculate (355) the adjustments to QPnom and φref, determine (360) whether the calculated adjustments are valid, make (365) the adjustments, increment (370) the number of iterations, determine (380) whether the number of iterations has not exceeded a maximum, and repeat the segment encoding at adjusted QPnom's and φref's until both the file size and the buffer conditions are satisfied.


If the buffer does not underflow (330), the encoder may determine (335) whether the GOP maximum size is exceeded. If the GOP maximum size is exceeded (335), the encoder may, as described above, calculate (340) the AMQP, calculate (345) the AMQPd for the next iteration based on the calculated AMQP, calculate (355) the adjustments to QPnom and φref, determine (360) whether the calculated adjustments are valid, make (365) the adjustments, increment (370) the number of iterations, determine (380) whether the number of iterations has not exceeded a maximum, and repeat the segment encoding at adjusted QPnom's and φref's until the file size, the buffer, and the GOP size conditions are satisfied.


If the file size limitation is not exceeded (325), the buffer is not in underflow (330), and the GOP maximum size is not exceeded (335), the segment is deemed successfully encoded at an appropriate video bit rate. The method may repeat for the remaining segments.


In this embodiment, the adjustments are made based on segment coding results. In alternate embodiments, the method may make the adjustments based on frame coding results, macroblock coding results, or a combination of both.



FIG. 3 illustrates the components of a basic computing device in accordance with an embodiment of the present invention. The computing device may be a personal computer, workstation, handheld personal digital assistant (“PDA”), or any other type of microprocessor-based device. The computing device may include one or more of processor 510, input device 520, output device 530, storage 540, and communication device 560.


Input device 520 may include a keyboard, mouse, pen-operated touch screen or monitor, voice-recognition device, or any other device that provides input. Output device 530 may include a monitor, printer, disk drive, speakers, or any other device that provides output.


Storage 540 may include volatile and nonvolatile data storage, including one or more electrical, magnetic or optical memories such as a RAM, cache, hard drive, CD-ROM drive, tape drive or removable storage disk. Communication device 560 may include a modem, network interface card, or any other device capable of transmitting and receiving signals over a network. The components of the computing device may be connected via an electrical bus or wirelessly.


Software 550, which may be stored in storage 540 and executed by processor 510, may include, for example, the application programming that embodies the functionality of the present invention.


The computing device may implement any operating system, such as Windows or UNIX. Software 550 may be written in any programming language, such as ABAP, C, C++, Java or Visual Basic. In various embodiments, application software embodying the functionality of the present invention may be deployed on a standalone machine, in a client/server arrangement or through a Web browser as a Web-based application or Web service, for example.


Several embodiments of the invention are specifically illustrated and/or described herein. However, it will be appreciated that modifications and variations of the invention are covered by the above teachings and within the purview of the appended claims without departing from the spirit and intended scope of the invention.

Claims
  • 1. A method for controlling, with an encoder, a video bit rate for encoding a video sequence, comprising: coding a video sequence as a plurality of Groups of Pictures (GOPs);iteratively adjusting with the encoder a reference quantization parameter and a reference masking strength parameter to encode the video sequence based on an estimated decoder buffer condition, and GOP size limitation of the encoded video sequence,stopping the adjusting with the encoder when the buffer condition and the GOP size limitation are satisfied.
  • 2. The method of claim 1, wherein the adjusting comprises: encoding with the encoder, a segment of the video sequence based on the reference quantization parameter;determining with the encoder, whether the buffer condition is satisfied; andif the buffer condition is not satisfied, adjusting with the encoder, the reference quantization parameter, andrepeating the encoding and the determining at the adjusted reference quantization parameter until the buffer condition is satisfied.
  • 3. The method of claim 1, wherein the adjusting comprises: encoding with the encoder a segment of the video sequence based on the reference quantization parameter;determining with the encoder, whether the GOP size limitation is satisfied; andif the GOP size limitation is not satisfied, adjusting with the encoder, the reference quantization parameter, andrepeating the encoding and the determining at the adjusted reference quantization parameter until the GOP size limitation is satisfied.
  • 4. The method of claim 1, wherein the adjusting comprises: encoding with the encoder, a segment of the video sequence based on the reference masking strength parameter;determining with the encoder, whether the buffer condition is satisfied; andif the buffer condition is not satisfied, adjusting with the encoder, the reference masking strength parameter, andrepeating the encoding and the determining at the adjusted reference masking strength parameter until the buffer condition is satisfied.
  • 5. The method of claim 1, wherein the adjusting comprises: encoding with the encoder, a segment of the video sequence based on the reference masking strength parameter;determining with the encoder, whether the GOP size limitation is satisfied; andif the GOP size limitation is not satisfied, adjusting with the encoder, the reference masking strength parameter, andrepeating the encoding and the determining at the adjusted reference masking strength parameter until the GOP size limitation is satisfied.
  • 6. The method of claim 1, wherein the adjusting comprises: encoding with the encoder, a segment of the video sequence based on the reference quantization parameter and the reference masking strength parameter;determining with the encoder, whether the buffer condition is satisfied; andif the buffer condition is not satisfied, adjusting with the encoder, the reference quantization parameter and the reference masking strength parameter, andrepeating the encoding and the determining at the adjusted reference quantization parameter and the adjusted reference masking strength parameter until the buffer condition is satisfied.
  • 7. The method of claim 1, wherein the adjusting comprises: encoding with the encoder, a segment of the video sequence based on the reference quantization parameter and the reference masking strength parameter;determining with the encoder, whether the GOP size limitation is satisfied; andif the GOP size limitation is not satisfied, adjusting with the encoder, the reference quantization parameter and the reference masking strength parameter, andrepeating the encoding and the determining at the adjusted reference quantization parameter and the adjusted reference masking strength parameter until the GOP size limitation is satisfied.
  • 8. The method of claim 1, wherein the adjusting comprises: determining with the encoder, the buffer condition and the GOP size limitation.
  • 9. The method of claim 1, wherein the buffer condition indicates that the buffer is in underflow.
  • 10. The method of claim 1, wherein the GOP size limitation indicates that the GOP maximum size has been exceeded.
  • 11. The method of claim 1, wherein the stopping comprises: stopping the adjusting with the encoder, if the number of iterations exceeds a maximum number or if the reference quantization parameter after adjustment exceeds a predetermined value or if the amount of the adjustment of the reference quantization parameter exceeds a predetermined amount.
  • 12. The method of claim 1, wherein the stopping comprises: stopping the adjusting with the encoder, if the reference masking strength parameter after adjustment exceeds a predetermined value or if the amount of the adjustment of the reference masking strength parameter exceeds a predetermined amount.
  • 13. The method of claim 1, wherein the stopping comprises: stopping the adjusting with the encoder, if a target video bit rate is reached.
  • 14. The method of claim 1, wherein the adjusting comprises: iteratively adjusting with the encoder, the reference quantization parameter and the reference masking strength parameter after the encoding of each frame of the video sequence or after the encoding of at least one macroblock of each frame of the video sequence.
  • 15. The method of claim 1 wherein the reference quantization parameter and the reference masking strength parameter are set by the encoder, distinct from a quantization parameter and a masking strength parameter calculated by the encoder based on image content of the sequence.
  • 16. The method of claim 1, further comprising: iteratively adjusting with the encoder, the reference quantization parameter based on a predetermined file size limitation of the video sequence.
  • 17. The method of claim 16, wherein the adjusting based on the predetermined file size limitation comprises: encoding with the encoder, a segment of the video sequence based on the reference quantization parameter;determining with the encoder, whether the predetermined file size limitation is satisfied; andif the predetermined file size limitation is not satisfied, adjusting with the encoder, the reference quantization parameter, andrepeating the encoding and the determining at the adjusted reference quantization parameter until the predetermined file size limitation is satisfied.
  • 18. The method of claim 16, wherein the adjusting based on the predetermined file size limitation comprises: encoding with the encoder, a segment of the video sequence based on the reference masking strength parameter;determining with the encoder, whether the predetermined file size limitation is satisfied; andif the predetermined file size limitation is not satisfied, adjusting with the encoder, the reference masking strength parameter, andrepeating the encoding and the determining at the adjusted reference masking strength parameter until the predetermined file size limitation is satisfied.
  • 19. An encoder for controlling video bit rate, comprising: an input device to receive a video sequence;a processor to: code the video sequence as a plurality of Groups of Pictures (GOPs),iteratively adjust a reference quantization parameter and a reference masking strength parameter for encoding the video sequence based on a decoder buffer condition and-a GOP size limitation of the encoded video sequence, andencode the video sequence based on the adjusted reference quantization parameter and the adjusted reference masking strength parameter, an output device to send the encoded video sequence to the decoder.
  • 20. The encoder of claim 19, wherein the processor is to stop adjusting the reference quantization parameter and the reference masking strength parameter when the buffer condition and the GOP size limitation are satisfied.
  • 21. The encoder of claim 19, wherein the processor is to adjust the reference quantization parameter and the reference masking strength parameter after encoding each frame of the video sequence or after encoding at least one macroblock of each frame of the video sequence.
RELATED APPLICATION

This application claims priority under 35 U.S.C. 119(e) to U.S. Provisional Application No. 60/737,801, filed Nov. 18, 2005, the contents of which are hereby incorporated by reference.

US Referenced Citations (89)
Number Name Date Kind
3716851 Neumann Feb 1973 A
4023110 Oliver May 1977 A
4131765 Kahn Dec 1978 A
4217609 Hatori et al. Aug 1980 A
4394774 Widergren et al. Jul 1983 A
4437119 Matsumoto et al. Mar 1984 A
4670851 Murakami et al. Jun 1987 A
4698672 Chen et al. Oct 1987 A
4760446 Ninomiya et al. Jul 1988 A
4837618 Hatori et al. Jun 1989 A
4864393 Harradine Sep 1989 A
4901075 Vogel Feb 1990 A
5010401 Murakami et al. Apr 1991 A
5021879 Vogel Jun 1991 A
5068724 Krause et al. Nov 1991 A
5091782 Krause et al. Feb 1992 A
5093720 Krause et al. Mar 1992 A
5113255 Nagata et al. May 1992 A
5168375 Reisch et al. Dec 1992 A
5175618 Ueda et al. Dec 1992 A
5223949 Honjo Jun 1993 A
5260783 Dixit Nov 1993 A
5293229 Iu Mar 1994 A
5298991 Yagasaki et al. Mar 1994 A
5317397 Odaka et al. May 1994 A
5329318 Keith Jul 1994 A
5343248 Fujinami Aug 1994 A
5377051 Lane et al. Dec 1994 A
5412430 Nagata May 1995 A
RE34965 Sugiyama Jun 1995 E
5428396 Yagasaki et al. Jun 1995 A
RE35093 Wang et al. Nov 1995 E
5469208 Dea Nov 1995 A
5469212 Lee Nov 1995 A
RE35158 Sugiyama Feb 1996 E
5497239 Kwon Mar 1996 A
5510840 Yonemitsu et al. Apr 1996 A
5539466 Igarashi et al. Jul 1996 A
5543843 Kato Aug 1996 A
5543847 Kato Aug 1996 A
5557330 Astle Sep 1996 A
5557684 Wang et al. Sep 1996 A
5559557 Kato Sep 1996 A
5565920 Lee et al. Oct 1996 A
5568200 Pearlstein et al. Oct 1996 A
5587806 Yamada et al. Dec 1996 A
5625355 Takeuo et al. Apr 1997 A
5648733 Worrell et al. Jul 1997 A
5654706 Jeong Aug 1997 A
5666461 Igarashi et al. Sep 1997 A
5684534 Harney et al. Nov 1997 A
5703646 Oda Dec 1997 A
5711012 Bottoms et al. Jan 1998 A
5719986 Kato et al. Feb 1998 A
5831688 Yamada et al. Nov 1998 A
5841939 Takahashi et al. Nov 1998 A
5852664 Iverson et al. Dec 1998 A
5887111 Takahashi et al. Mar 1999 A
5917954 Girod et al. Jun 1999 A
5929916 Legall et al. Jul 1999 A
5946043 Lee et al. Aug 1999 A
5949948 Krause et al. Sep 1999 A
5991447 Eifrig et al. Nov 1999 A
5991503 Miyasaka et al. Nov 1999 A
6052507 Niida et al. Apr 2000 A
6064776 Kikuchi et al. May 2000 A
6081296 Fukunaga et al. Jun 2000 A
6081551 Etoh Jun 2000 A
RE36761 Fujiwara Jul 2000 E
6088391 Auld et al. Jul 2000 A
6115070 Song et al. Sep 2000 A
6125146 Frencken et al. Sep 2000 A
6141383 Yu Oct 2000 A
6144698 Poon et al. Nov 2000 A
6167087 Kato Dec 2000 A
6169821 Fukunaga et al. Jan 2001 B1
6188725 Sugiyama Feb 2001 B1
6217234 Dewar et al. Apr 2001 B1
6256420 Sako et al. Jul 2001 B1
6563549 Sethuraman May 2003 B1
6591016 Fert et al. Jul 2003 B2
6873654 Rackett Mar 2005 B1
7409097 Zhang et al. Aug 2008 B2
7535959 Lightstone et al. May 2009 B2
20020168012 Ramaswamy Nov 2002 A1
20030123552 Prakash et al. Jul 2003 A1
20040233995 Abe et al. Nov 2004 A1
20050286631 Wu et al. Dec 2005 A1
20060013298 Tong et al. Jan 2006 A1
Related Publications (1)
Number Date Country
20070116115 A1 May 2007 US
Provisional Applications (1)
Number Date Country
60737801 Nov 2005 US