Patent ID: 8681858

Claim:
A method of providing rate control in a two-pass encoder, the method comprising: receiving an input video sequence, wherein the input video sequence includes a sequence of pictures and each picture i is one of an I, P, B s , or B picture in field or frame; performing a first encoding pass to encode the input video sequence; collecting coding statistics for the first encoding pass including: R one,Ff,picType (i), wherein R one,Ff,picType (i) is a number of bits for each picture i in the first encoding pass, R GOP — passOne , wherein R GOP — passOne is a number of bits for a group of pictures (GoP) in the first encoding pass, and Q one,Ff,picType (i), wherein Q one,Ff,picType (i) is an average quantization parameter (QP) for each picture i in the first encoding pass; calculating target coding parameters for a second encoding pass based on the coding statistics for the first encoding pass, the target coding parameters including: R two,Ff,picType (i), wherein R two,Ff,picType (i) is a target number of bits for each picture i in the second encoding pass, R GOP — passTwo , wherein R GOP — passTwo is a target number of bits budgeted for a GoP in the second encoding pass, and a QP for each picture i in the second encoding pass; and performing the second encoding pass at a constant bit rate (CBR) on the input video sequence using the target coding parameters to form a second pass encoded stream.