--- bitstream.c 2002/12/08 06:43:34 1.28.2.8 +++ bitstream.c 2002/12/14 09:39:42 1.28.2.11 @@ -67,6 +67,8 @@ #include +#include + #include "bitstream.h" #include "zigzag.h" #include "../quant/quant_matrix.h" @@ -77,7 +79,7 @@ log2bin(uint32_t value) { /* Changed by Chenm001 */ -#ifndef WIN32 +#if !defined(_MSC_VER) int n = 0; while (value) { @@ -568,6 +570,8 @@ BitstreamSkip(bs, 15); // latter_half_vbv_occupancy READ_MARKER(); } + }else{ + dec->low_delay = dec->low_delay_default; } dec->shape = BitstreamGetBits(bs, 2); // video_object_layer_shape @@ -872,6 +876,8 @@ dec->time_bp = (uint32_t) (dec->time_inc_resolution + dec->last_non_b_time - dec->time)%dec->time_inc_resolution; } + DPRINTF(DPRINTF_HEADER,"time_pp=%i", dec->time_pp); + DPRINTF(DPRINTF_HEADER,"time_bp=%i", dec->time_bp); READ_MARKER(); @@ -1110,7 +1116,8 @@ { int vol_ver_id=1; - if ( (pParam->m_quarterpel) || (frame->global_flags & XVID_GMC) ) + if ( pParam->m_quarterpel || (frame->global_flags & XVID_GMC) || + (pParam->global & XVID_GLOBAL_REDUCED)) vol_ver_id = 2; // video object_start_code & vo_id @@ -1222,7 +1229,9 @@ if (vol_ver_id != 1) { BitstreamPutBit(bs, 0); // newpred_enable - BitstreamPutBit(bs, 0); // reduced_resolution_vop_enabled + + BitstreamPutBit(bs, (pParam->global & XVID_GLOBAL_REDUCED)?1:0); + /* reduced_resolution_vop_enabled */ } BitstreamPutBit(bs, 0); // scalability @@ -1234,7 +1243,8 @@ write vop header */ void -BitstreamWriteVopHeader(Bitstream * const bs, +BitstreamWriteVopHeader( + Bitstream * const bs, const MBParam * pParam, const FRAMEINFO * const frame, int vop_coded) @@ -1273,6 +1283,9 @@ if ( (frame->coding_type == P_VOP) || (frame->coding_type == S_VOP) ) BitstreamPutBits(bs, frame->rounding_type, 1); + if ((pParam->global & XVID_GLOBAL_REDUCED)) + BitstreamPutBit(bs, (frame->global_flags & XVID_REDUCED)?1:0); + BitstreamPutBits(bs, 0, 3); // intra_dc_vlc_threshold if (frame->global_flags & XVID_INTERLACING) {