Principle of Rate Control Algorithm TMN5

The core of TMN5 is the virtual buffer, the size of which is specified by r = alpha * bits_per_frame, where alpha is the multiple, typically 2. The larger value of alpha provides larger dynamical range, but less adjustment sensitivity. The current fullness of the buffer 'd' serves as the reference of quantization level 'Q', specifically, Q = 31 * d / r (31 is the maximal value for Q reached only when the buffer is full or overflown). The remaining available bits for coding within the GOP 'R' is calculated across the GOPs, say, 'R' for the current GOP no matter a surplus or a deficit, is carried over to the next GOP. This avoids the drifting caused by 'R' is restricted within GOP. In the case that B frames are absent, for I frame, the expected coding bits T = R * Xi / (Xi + Np * Xp); for P frame, T = R / Np, in which Xi and Xp are respectively current estimation of general complexity of I frames and P frames, Ni and Np number of the remaining corresponding frames. d = B - T, where B is the number of actual coded bits. 'd' is associated with R and separately counted for I and P frames, apparently it is a reasonable accumulative measurement of number of coded bits relative to due for either kind of frames. For given Q, the number of output bits can be denoted by B = ft(Q). Obviously, ft varies with frames (and therefore with time, that is why a 't' is put here), and is generally a decreasing function. According to the above discussion, the following equation set depicts the process:
ΔBn=Bn-T
dn+1=dn+ΔBn
Qn=31*dn/r
Bn=ft(Qn)
They can be simplified into:
Δdn=gt(dn)-T, where Δdn=ΔBn=dn+1-dn, gt(x)=ft(31*x/r)
Now we can see clearly that it represents a negative feedback loop.
If the differential |gt'(x)| keeps being less than 1, the system is stable and B wiggles around T (as both T and f are time varying).

TMN5 Virtual Buffer
posted @ 2008-02-03 23:55  quanben  阅读(227)  评论(0编辑  收藏  举报