9.9 Buffer regulation

9.9 Buffer regulation

Regulation of output bit rates for better distribution of the target bit rate among the encoding parameters is an important part of any video encoder. This is particularly vital in the H.263 encoder, at least for the following reasons:

  • better bit rate regulation requires larger buffer sizes, hence longer delays

  • H.263 is intended for visual telephony, and the encoding delay should be limited, hence smaller buffer sizes are preferred

  • the target bit rate is in the order of 24 kbit/s, and even small size buffers can introduce long delays.

There is no best known method for buffer regulation, and Recommendation H.263 does not standardise any method (neither do other standard encoders). However, at least for the laboratory simulations, one can use those methods designed for the test models. The following is a method that can be used in the simulations [5]. The bit rate is controlled at a macroblock level, by changing the quantiser parameter, QP, depending on the bit rate, the source and target frame rates.

For the first picture, which is intraframe coded, the quantisation parameter is set to its mid range QP = 16 (QP varies from 1 to 31). After the first picture, the buffer content is set to:

(9.17) 

For the following pictures the quantiser parameter is updated at the beginning of each new macroblock line. The formula for calculating the new quantiser parameter is:

(9.18) 

where:

=

mean quantiser parameter for the previous picture

Bi-1

=

number of bits spent for the previous picture

=

target number of bits per picture

mb

=

present macroblock number

MB

=

number of macroblocks in a picture

Bi,mb

=

number of bits spent until now for the picture

R

=

bit rate

FR

=

frame rate of the source picture (typically 25 or 30 Hz)

f target

=

target frame rate

The first two terms of the above formula are fixed for macroblocks within a picture. The third term adjusts the quantiser parameter during coding of the picture.

The calculated new quantisation parameter, QPnew, must be adjusted so that the difference fits within the definition of dquant. The buffer content is updated after each complete picture by using the following C function:

 buffer_content=buffer_content+Bi,99 ; while(buffer_content>(3R/FR)){ buffer_content=buffer_content - (R/FR); frame_incr++; } 

The variable frame_incr indicates how many times the last coded picture must be displayed. It also indicates which picture from the source is coded next.

To regulate the frame rate, ftarget, a new is calculated at the start of each frame:

(9.19) 

For this buffer regulation, it is assumed that the process of encoding is temporarily stopped when the physical transmission buffer is nearly full, preventing buffer overflow. However, this means that no minimum frame rate and delay can be guaranteed.



Standard Codecs(c) Image Compression to Advanced Video Coding
Standard Codecs: Image Compression to Advanced Video Coding (IET Telecommunications Series)
ISBN: 0852967101
EAN: 2147483647
Year: 2005
Pages: 148
Authors: M. Ghanbari

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net