--- trunk/xvidcore/src/bitstream/bitstream.c 2002/09/10 22:52:13 469 +++ trunk/xvidcore/src/bitstream/bitstream.c 2002/09/23 10:59:10 529 @@ -3,7 +3,7 @@ * XVID MPEG-4 VIDEO CODEC * - Bitstream reader/writer functions - * - * Copyright (C) 2001-2002 - Peter Ross + * Copyright (C) 2001-2002 - Peter Ross * * This program is an implementation of a part of one or more MPEG-4 * Video tools as specified in ISO/IEC 14496-2 standard. Those intending @@ -28,7 +28,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.29 2002-09-10 22:52:12 edgomez Exp $ + * $Id: bitstream.c,v 1.34 2002-09-23 10:59:10 suxen_drol Exp $ * ****************************************************************************/ @@ -44,7 +44,7 @@ log2bin(uint32_t value) { /* Changed by Chenm001 */ -#ifndef WIN32 +#if !defined(_MSC_VER) int n = 0; while (value) { @@ -161,7 +161,7 @@ uint32_t coding_type; uint32_t start_code; uint32_t time_incr = 0; - int32_t time_increment; + int32_t time_increment = 0; do { BitstreamByteAlign(bs); @@ -417,7 +417,7 @@ if (vol_ver_id != 1) { - DEBUG("QUARTERPEL BITSTREAM"); + DPRINTF(DPRINTF_DEBUG, "QUARTERPEL BITSTREAM"); dec->quarterpel = BitstreamGetBit(bs); // quarter_sample } else @@ -688,40 +688,27 @@ BitstreamPutBit(bs, 1); // vol_control_parameters BitstreamPutBits(bs, 1, 2); // chroma_format 1="4:2:0" -#ifdef BFRAMES - if (pParam->max_bframes > 0) { - BitstreamPutBit(bs, 0); // low_delay - } else -#endif - { - BitstreamPutBit(bs, 1); // low_delay - } + BitstreamPutBit(bs, 1); // low_delay + BitstreamPutBit(bs, 0); // vbv_parameters (0=not given) BitstreamPutBits(bs, 0, 2); // video_object_layer_shape (0=rectangular) WRITE_MARKER(); - /* time_increment_resolution; ignored by current decore versions - eg. 2fps res=2 inc=1 - 25fps res=25 inc=1 - 29.97fps res=30000 inc=1001 + /* + * time_increment_resolution; ignored by current decore versions + * eg. 2fps res=2 inc=1 + * 25fps res=25 inc=1 + * 29.97fps res=30000 inc=1001 */ -#ifdef BFRAMES - BitstreamPutBits(bs, pParam->fbase, 16); -#else BitstreamPutBits(bs, pParam->fbase, 16); -#endif + WRITE_MARKER(); -#ifdef BFRAMES - BitstreamPutBit(bs, 1); // fixed_vop_rate = 1 - BitstreamPutBits(bs, pParam->fincr, log2bin(pParam->fbase)); // fixed_vop_time_increment -#else BitstreamPutBit(bs, 1); // fixed_vop_rate = 1 BitstreamPutBits(bs, pParam->fincr, log2bin(pParam->fbase)); // fixed_vop_time_increment -#endif WRITE_MARKER(); BitstreamPutBits(bs, pParam->width, 13); // width @@ -779,31 +766,15 @@ BitstreamPutBits(bs, frame->coding_type, 2); // time_base = 0 write n x PutBit(1), PutBit(0) -#ifdef BFRAMES - for (i = 0; i < frame->seconds; i++) { - BitstreamPutBit(bs, 1); - } - BitstreamPutBit(bs, 0); -#else for (i = 0; i < frame->seconds; i++) { BitstreamPutBit(bs, 1); } BitstreamPutBit(bs, 0); -// BitstreamPutBits(bs, 0, 1); -#endif WRITE_MARKER(); // time_increment: value=nth_of_sec, nbits = log2(resolution) -#ifdef BFRAMES BitstreamPutBits(bs, frame->ticks, log2bin(pParam->fbase)); - /*DPRINTF("[%i:%i] %c\n", frame->seconds, frame->ticks, - frame->coding_type == I_VOP ? 'I' : frame->coding_type == - P_VOP ? 'P' : 'B');*/ -#else - BitstreamPutBits(bs, frame->ticks, log2bin(pParam->fbase)); -// BitstreamPutBits(bs, 1, 1); -#endif WRITE_MARKER();