Patent ID: 8588294

Claim:
A method for statistically multiplexing a plurality of programs using a plurality of two-pass encoders, the method comprising: encoding pictures in the plurality of programs in a first encoding pass using a plurality of first encoding modules; determining R W — passOne , wherein R W — passOne is a total number of bits used to encode a group of pictures in the plurality of programs in the first encoding pass; determining R W — passTwo , wherein R W — passTwo is a total target number of bits for the group of pictures in the plurality of programs in a second encoding pass; determining R two,Ff,picType (i,l), wherein R two,Ff,picType (i,l) is a target bit allocation for each picture i in each program l of the plurality of programs based on R W — passOne , R W — passTwo , and R one,Ff,picType (i,l), and R one,Ff,picType (i,l) is a number of bits consumed for a corresponding picture in the first encoding pass; encoding the plurality of programs using a plurality of second encoding modules and R two,Ff,picType (i,l) in the second encoding pass to form a plurality of variable bit rate (VBR) compressed bit streams; and multiplexing the plurality of VBR compressed bit streams to form a single constant bit rate (CBR) bit stream, wherein encoding the plurality of programs using a plurality of second encoding modules and R two,Ff,picType (i,l) comprises: determining a sliding window over the plurality of programs that slides along a time domain; and using R W — passTwo in the sliding window to encode the plurality of programs, wherein using R W — passTwo in the sliding window to encode the plurality of programs comprises: in the second encoding pass, setting R W — passTwo for the second encoding pass to a nominal value, R W — passTwo =R W — no min al after a picture is encoded, removing the picture from the sliding window and moving a new picture into the sliding window, and as pictures are being removed from and moved into the sliding window in the second encoding pass, updating R W — passTwo , wherein the updated R W — passTwo equals: R W — passTwo ( i )=2 ×R W — no min al − R W — passTwo ( i− 1), wherein R W — passTwo (i−1) is a number of bits generated within the sliding window right before the update.