Patent ID: 6922441

Claim:
A method for computing an average bits/frame (BA) for frames extracted from a buffer used for video encoding and decoding, each said frame having a same number of fields, said BA equal to (BR+BR 1 /J 1 )/J 2 , said BR 1 , J 1 , and J 2 each a positive integer, said BR a bit rate in bits/sec, BR 1 /BR being a positive integer, said method comprising: determining BR 1 , J 1 , and J 2 such that J 2 /(1+(BR 1 /BR)/J 1 ) as evaluated in floating point is approximately equal to FR, said FR a frame rate in frames/sec; calculating a quotient Q 1 and remainder R 1 from integer division of BR 1 by J 1 ; calculating a quotient Q 2 and remainder R 2 from integer division of (BR+Q 1 ) by J 2 ; initializing to zero accumulators A 1 and A 2 ; and executing N iterations, wherein N>1, and wherein executing each iteration includes: adding R 1 to A 1 ; if A 1 ≧J 1 , then adding 1 to A 2 and decrementing A 1 by J 1 ; setting BA=Q 2 and adding R 2 to A 2 ; if A 2 ≧J 2 , then adding 1 to BA and decrementing A 2 by J 2 .