--- trunk/xvidcore/src/bitstream/bitstream.c 2004/05/31 21:26:23 1465 +++ trunk/xvidcore/src/bitstream/bitstream.c 2004/05/31 21:36:23 1466 @@ -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.43 2004-05-21 14:40:15 edgomez Exp $ + * $Id: bitstream.c,v 1.44 2004-05-31 21:36:23 edgomez Exp $ * ****************************************************************************/ @@ -547,7 +547,7 @@ #endif if (dec->time_inc_resolution > 0) { - dec->time_inc_bits = log2bin(dec->time_inc_resolution-1); + dec->time_inc_bits = MAX(log2bin(dec->time_inc_resolution-1), 1); } else { #if 0 dec->time_inc_bits = 0; @@ -814,23 +814,12 @@ if (coding_type != B_VOP) { dec->last_time_base = dec->time_base; dec->time_base += time_incr; - dec->time = time_increment; - -#if 0 - dec->time_base * dec->time_inc_resolution + - time_increment; -#endif - dec->time_pp = (uint32_t) - (dec->time_inc_resolution + dec->time - dec->last_non_b_time)%dec->time_inc_resolution; + dec->time = dec->time_base*dec->time_inc_resolution + time_increment; + dec->time_pp = (int32_t)(dec->time - dec->last_non_b_time); dec->last_non_b_time = dec->time; } else { - dec->time = time_increment; -#if 0 - (dec->last_time_base + - time_incr) * dec->time_inc_resolution + time_increment; -#endif - dec->time_bp = (uint32_t) - (dec->time_inc_resolution + dec->last_non_b_time - dec->time)%dec->time_inc_resolution; + dec->time = (dec->last_time_base + time_incr)*dec->time_inc_resolution + time_increment; + dec->time_bp = dec->time_pp - (int32_t)(dec->last_non_b_time - dec->time); } DPRINTF(XVID_DEBUG_HEADER,"time_pp=%i\n", dec->time_pp); DPRINTF(XVID_DEBUG_HEADER,"time_bp=%i\n", dec->time_bp); @@ -1023,7 +1012,7 @@ else sscanf(tmp, "XviD%d", &dec->bs_version); - DPRINTF(XVID_DEBUG_HEADER, "xvid bitstream version=%i", dec->bs_version); + DPRINTF(XVID_DEBUG_HEADER, "xvid bitstream version=%i\n", dec->bs_version); } /* divx detection */