targeted bits r n for block n may be achieved by using a quality factor q n given by in general u03b1 n and u03b2 n are not known in advance but u03b2 n may be assumed to be a constant u03b2 then the quality factor is given by in motion jpeg and all mpeg coding schemes all the pictures in the video are compressed the same way and only one complexity metric needs to be maintained an input video signal is input to an mpeg or motion jpeg encoder 12 as shown in fig4 to obtain an actual r n 1 for the prior frame the actual r n 1 is input to a processor 14 the processor 14 has a complexity processor 16 which uses the previous history to estimate u03b1 n where u03b3 is the smoothing factor in the estimation of u03b1 r n 1 is the actual number of bits used for picture n 1 depending upon the application a value for u03b3 is selected from the range 0 u2266 u03b3 u2266 1 if u03b3 1 u03b1 n is a constant with respect to n and if u03b3 0 u03b1 n depends only on the preceding block coding results once u03b1 n is estimated then it is input to a quality processor 18 where the quality factor q n may be computed as above in mpeg the average rate r is used to obtain q n as well as the targeted r n for a particular picture q n is used to obtain results in actual r n which is used for updating u03b1 n in motion jpeg as well as in all i mpeg targeted r n is the same.