--- bitstream.h 2004/03/22 22:36:23 1.19 +++ 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.19 2004/03/22 22:36:23 edgomez Exp $ + * $Id: bitstream.h,v 1.22.2.1 2006/07/10 15:05:30 Isibaar Exp $ * ****************************************************************************/ @@ -128,7 +128,6 @@ int BitstreamReadHeaders(Bitstream * bs, DECODER * dec, uint32_t * rounding, - uint32_t * reduced_resolution, uint32_t * quant, uint32_t * fcode_forward, uint32_t * fcode_backward, @@ -147,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 */ @@ -181,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; } @@ -208,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; }