--- decoder.c 2004/01/24 14:14:15 1.49.2.29 +++ decoder.c 2004/02/16 03:40:47 1.49.2.33 @@ -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: decoder.c,v 1.49.2.29 2004/01/24 14:14:15 syskin Exp $ + * $Id: decoder.c,v 1.49.2.33 2004/02/16 03:40:47 syskin Exp $ * ****************************************************************************/ @@ -779,7 +779,7 @@ start_timer(); image_setedges(&dec->refn[0], dec->edged_width, dec->edged_height, - dec->width, dec->height); + dec->width, dec->height, dec->bs_version); stop_edges_timer(); if (gmc_warp) { @@ -851,12 +851,12 @@ mb->quant = quant; if (dec->interlacing) { - if ((cbp || intra) && !mcsel) { + if (cbp || intra) { mb->field_dct = BitstreamGetBit(bs); DPRINTF(XVID_DEBUG_MB,"decp: field_dct: %i\n", mb->field_dct); } - if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q) { + if ((mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q) && !mcsel) { mb->field_pred = BitstreamGetBit(bs); DPRINTF(XVID_DEBUG_MB, "decp: field_pred: %i\n", mb->field_pred); @@ -1180,9 +1180,9 @@ start_timer(); image_setedges(&dec->refn[0], dec->edged_width, dec->edged_height, - dec->width, dec->height); + dec->width, dec->height, dec->bs_version); image_setedges(&dec->refn[1], dec->edged_width, dec->edged_height, - dec->width, dec->height); + dec->width, dec->height, dec->bs_version); stop_edges_timer(); for (y = 0; y < dec->mb_height; y++) { @@ -1510,13 +1510,13 @@ /* attemping to decode a bvop without atleast 2 reference frames */ image_printf(&dec->cur, dec->edged_width, dec->height, 16, 16, "broken b-frame, mising ref frames"); - stats->type = XVID_TYPE_NOTHING; + if (stats) stats->type = XVID_TYPE_NOTHING; } else if (dec->time_pp <= dec->time_bp) { /* this occurs when dx50_bvop_compatibility==0 sequences are decoded in vfw. */ image_printf(&dec->cur, dec->edged_width, dec->height, 16, 16, "broken b-frame, tpp=%i tbp=%i", dec->time_pp, dec->time_bp); - stats->type = XVID_TYPE_NOTHING; + if (stats) stats->type = XVID_TYPE_NOTHING; } else { decoder_bframe(dec, &bs, quant, fcode_forward, fcode_backward); decoder_output(dec, &dec->cur, dec->mbs, frame, stats, coding_type, quant); @@ -1526,7 +1526,7 @@ dec->frames++; } - BitstreamByteAlign(&bs); + /* BitstreamByteAlign(&bs); */ /* low_delay_default mode: repeat in packed_mode */ if (dec->low_delay_default && dec->packed_mode && output == 0 && success == 0) { @@ -1557,5 +1557,5 @@ emms(); stop_global_timer(); - return BitstreamPos(&bs) / 8; /* number of bytes consumed */ + return (BitstreamPos(&bs) + 7) / 8; /* number of bytes consumed */ }