--- trunk/xvidcore/src/bitstream/bitstream.c 2004/09/04 14:16:24 1547 +++ trunk/xvidcore/src/bitstream/bitstream.c 2005/03/27 03:59:42 1607 @@ -20,7 +20,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.c,v 1.46 2004-09-04 14:16:24 edgomez Exp $ + * $Id: bitstream.c,v 1.49 2005-03-27 03:59:42 suxen_drol Exp $ * ****************************************************************************/ @@ -381,7 +381,6 @@ BitstreamReadHeaders(Bitstream * bs, DECODER * dec, uint32_t * rounding, - uint32_t * reduced_resolution, uint32_t * quant, uint32_t * fcode_forward, uint32_t * fcode_backward, @@ -395,7 +394,7 @@ int32_t time_increment = 0; int resize = 0; - do { + while ((BitstreamPos(bs) >> 3) + 4 <= bs->length) { BitstreamByteAlign(bs); start_code = BitstreamShowBits(bs, 32); @@ -862,12 +861,8 @@ dec->shape == VIDOBJLAY_SHAPE_RECTANGULAR && (coding_type == P_VOP || coding_type == I_VOP)) { - *reduced_resolution = BitstreamGetBit(bs); - DPRINTF(XVID_DEBUG_HEADER, "reduced_resolution %i\n", *reduced_resolution); - } - else - { - *reduced_resolution = 0; + if (BitstreamGetBit(bs)); + DPRINTF(XVID_DEBUG_ERROR, "RRV not supported (anymore)\n"); } if (dec->shape != VIDOBJLAY_SHAPE_RECTANGULAR) { @@ -1038,7 +1033,6 @@ BitstreamSkip(bs, 8); } } - while ((BitstreamPos(bs) >> 3) < bs->length); #if 0 DPRINTF("*** WARNING: no vop_start_code found"); @@ -1257,10 +1251,12 @@ BitstreamPadAlways(bs); /* next_start_code(); */ - /* fake divx5 id, to ensure compatibility with divx5 decoder */ -#define DIVX5_ID "DivX999b000p" - if (pParam->max_bframes > 0 && (pParam->global_flags & XVID_GLOBAL_PACKED)) { - BitstreamWriteUserData(bs, DIVX5_ID, strlen(DIVX5_ID)); + /* divx5 userdata string */ +#define DIVX5_ID "DivX503b1393" + if ((pParam->global_flags & XVID_GLOBAL_DIVX5_USERDATA)) { + BitstreamWriteUserData(bs, DIVX5_ID, strlen(DIVX5_ID)); + if (pParam->max_bframes > 0 && (pParam->global_flags & XVID_GLOBAL_PACKED)) + BitstreamPutBits(bs, 'p', 8); } /* xvid id */ @@ -1343,7 +1339,7 @@ BitstreamPutBits(bs, frame->rounding_type, 1); if ((frame->vol_flags & XVID_VOL_REDUCED_ENABLE)) - BitstreamPutBit(bs, (frame->vop_flags & XVID_VOP_REDUCED)?1:0); + BitstreamPutBit(bs, 0); BitstreamPutBits(bs, 0, 3); /* intra_dc_vlc_threshold */