Patent ID: 8401076

Claim:
A method for rate controlling in video encoding of a video stream, the method comprising: specifying a maximum bitrate and an average bitrate for the video stream; calculating an Inter frame size based on a position of the Inter frame relative to an Intra frame so as to ensure that the specified maximum bitrate is not exceeded; and adjusting the calculated Inter frame size so as to ensure that both the specified maximum bitrate is not exceeded and the specified average bitrate is substantially obtained; wherein the calculating the Inter frame size comprises calculating an ideal Inter frame size based on the specified maximum bitrate according to the following equation, provided the position of the Inter frame indicates that an Intra frame has been encoded during a last-occurred time period or is going to be encoded during an upcoming time period: B 2 = R MAX - B I ( F - 1 ) where B 2 is the ideal Inter frame size, R MAX is the specified maximum bitrate, F is a frame rate, and B 1 is the Intra frame size.