--- decoder.c 2002/07/24 00:49:04 1.34 +++ decoder.c 2002/09/04 03:23:23 1.37 @@ -55,7 +55,7 @@ * 22.12.2001 lock based interpolation * 01.12.2001 inital version; (c)2001 peter ross * - * $Id: decoder.c,v 1.34 2002/07/24 00:49:04 Isibaar Exp $ + * $Id: decoder.c,v 1.37 2002/09/04 03:23:23 h Exp $ * *************************************************************************/ @@ -653,8 +653,10 @@ mb->quant = quant; if (dec->interlacing) { - mb->field_dct = BitstreamGetBit(bs); - DEBUG1("decp: field_dct: ", mb->field_dct); + if (cbp || intra) { + mb->field_dct = BitstreamGetBit(bs); + DEBUG1("decp: field_dct: ", mb->field_dct); + } if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q) { mb->field_pred = BitstreamGetBit(bs); @@ -683,8 +685,8 @@ mb->mvs[1].y = mb->mvs[2].y = mb->mvs[3].y = mb->mvs[0].y; } - } else if (mb->mode == - MODE_INTER4V /* || mb->mode == MODE_INTER4V_Q */ ) { + } else if (mb->mode == MODE_INTER4V ) { + get_motion_vector(dec, bs, x, y, 0, &mb->mvs[0], fcode, bound); get_motion_vector(dec, bs, x, y, 1, &mb->mvs[1], fcode, bound); get_motion_vector(dec, bs, x, y, 2, &mb->mvs[2], fcode, bound); @@ -704,7 +706,7 @@ rounding); } else // not coded { - //DEBUG2("P-frame MB at (X,Y)=",x,y); + DEBUG2("P-frame MB at (X,Y)=",x,y); mb->mode = MODE_NOT_CODED; mb->mvs[0].x = mb->mvs[1].x = mb->mvs[2].x = mb->mvs[3].x = 0; mb->mvs[0].y = mb->mvs[1].y = mb->mvs[2].y = mb->mvs[3].y = 0; @@ -1277,17 +1279,8 @@ default: DEBUG1("Not support B-frame mb_type =", mb->mb_type); - ; } - if ( (x==19) && (y==8) ) - { - fprintf(stderr,"D %d %d %d %d %d %d \n",0, mb->mb_type, - mb->mvs[0].x, mb->mvs[0].y,mb->b_mvs[0].x, mb->b_mvs[0].y ); - } - - - } // end of FOR } #ifdef BFRAMES_DEC_DEBUG @@ -1386,14 +1379,14 @@ #ifdef BFRAMES_DEC // test if no B_VOP - if (dec->low_delay) { + if (dec->low_delay || dec->frames == 0) { #endif image_output(&dec->cur, dec->width, dec->height, dec->edged_width, frame->image, frame->stride, frame->colorspace); #ifdef BFRAMES_DEC } else { - if (dec->frames >= 0) { + if (dec->frames >= 1) { start_timer(); if ((vop_type == I_VOP || vop_type == P_VOP)) { image_output(&dec->refn[0], dec->width, dec->height,