Rate control (three): TMN8

Rate control (three): TMN8

TMN8 is a rate control algorithm designed for low-latency video communication. TMN8 rate control is divided into frame level rate control and macro block (MB) level rate control. Frame-level rate control will select the appropriate target number of bits for the current frame, and MB-level rate control will calculate QP (or quantization step size) for each MB in the frame. If the buffer overflows, the encoding of the current frame is skipped.

Frame-level rate control

In frame-level rate control, the target number of bits of the frame is determined by the buffer fullness, frame rate and channel rate. Before encoding the current frame, the buffer fullness W is calculated by the following formula:

 

among them,

D=The number of bits actually used in the frame before encoding.

W_prev=The number of bits in the previous buffer.

R=channel rate.

F=frame rate.

If W is greater than the predefined threshold M=R/F, the encoder skips the following frames until the buffer fullness is less than the threshold.

The target bits allocated in the current frame are as follows:

 

MB level rate control

MB-level rate control calculates the quantization step size for each MB in the frame according to the scanning order (from left to right and top to bottom). The quantization step of the i-th MB is generated in the following way:

 

among them:

 

MB-level rate control uses the above formula to calculate Q1 from the first MB, and then encodes MB with Q1. Then subtract the estimated number of header bits and the number of used bits from the target bits of the frame to obtain the remaining target number of bits. Use the remaining bits to encode the next MB in the same way. The model parameters K and C are updated every time one MB is encoded.

It can be found that the current MB Q is determined by the complexity of L, sigma, and MB. This shows that if the remaining bits are few (maybe 0), the quantization scale of the current MB will be very large, causing great distortion.

The above is a brief introduction to the TMN8 rate control process. For specific model parameter initialization and update strategies, please refer to Reference 1.

reference

  1. Rate Control in DCT Video Coding for Low-Delay Communications

  2. Modified TMN8 Rate Control for Low-Delay Video Communications

If you are interested, please follow the WeChat public account Video Coding

 

Guess you like

Origin blog.csdn.net/Dillon2015/article/details/105978295