--- bitstream.h 2004/12/05 13:56:13 1.20 +++ bitstream.h 2006/07/10 15:05:30 1.22.2.1 @@ -19,7 +19,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: bitstream.h,v 1.20 2004/12/05 13:56:13 syskin Exp $ + * $Id: bitstream.h,v 1.22.2.1 2006/07/10 15:05:30 Isibaar Exp $ * ****************************************************************************/ @@ -146,8 +146,21 @@ unsigned int quant); void BitstreamWriteUserData(Bitstream * const bs, - uint8_t * data, - const int length); + const char *data, + const unsigned int length); + +void +BitstreamWriteEndOfSequence(Bitstream * const bs); + +void +BitstreamWriteGroupOfVopHeader(Bitstream * const bs, + const MBParam * pParam, + uint32_t is_closed_gov); + +void write_video_packet_header(Bitstream * const bs, + const MBParam * pParam, + const FRAMEINFO * const frame, + int mbnum); /* initialise bitstream structure */ @@ -180,7 +193,12 @@ #endif bs->bufb = tmp; - bs->buf = 0; + /* preserve the intervening bytes */ + if (bs->initpos > 0) + bs->buf = bs->bufa & (0xffffffff << (32 - bs->initpos)); + else + bs->buf = 0; + bs->pos = bs->initpos = bitpos*8; bs->length = length; } @@ -207,7 +225,12 @@ #endif bs->bufb = tmp; - bs->buf = 0; + /* preserve the intervening bytes */ + if (bs->initpos > 0) + bs->buf = bs->bufa & (0xffffffff << (32 - bs->initpos)); + else + bs->buf = 0; + bs->pos = bs->initpos; }