--- encoder.c 2003/08/07 15:41:33 1.95.2.38 +++ encoder.c 2003/08/26 14:07:11 1.95.2.40 @@ -21,7 +21,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: encoder.c,v 1.95.2.38 2003/08/07 15:41:33 chl Exp $ + * $Id: encoder.c,v 1.95.2.40 2003/08/26 14:07:11 edgomez Exp $ * ****************************************************************************/ @@ -1199,6 +1199,21 @@ /* ---- update vol flags at IVOP ----------- */ pEnc->current->vol_flags = pEnc->mbParam.vol_flags = frame->vol_flags; + switch(frame->par) { + case XVID_PAR_11_VGA: + case XVID_PAR_43_PAL: + case XVID_PAR_43_NTSC: + case XVID_PAR_169_PAL: + case XVID_PAR_169_NTSC: + case XVID_PAR_EXT: + pEnc->mbParam.par = frame->par; + break; + default: + pEnc->mbParam.par = XVID_PAR_EXT; + break; + } + pEnc->mbParam.par_width = (frame->par_width)?frame->par_width:1; + pEnc->mbParam.par_height = (frame->par_height)?frame->par_height:1; if ((pEnc->mbParam.vol_flags & XVID_VOL_MPEGQUANT)) { if (frame->quant_intra_matrix != NULL) @@ -1568,6 +1583,11 @@ current->sStat.kblks++; + if (pEnc->current->vop_flags & XVID_VOP_GREYSCALE) + { pMB->cbp &= 0x3C; /* keep only bits 5-2 */ + qcoeff[4*64+0]=0; /* zero, because for INTRA MBs DC value is saved */ + qcoeff[5*64+0]=0; + } MBCoding(current, pMB, qcoeff, bs, ¤t->sStat); stop_coding_timer(); continue; @@ -1894,9 +1914,12 @@ } } -#ifdef BFRAMES_DEC_DEBUG - BFRAME_DEBUG -#endif + /* keep only bits 5-2 -- Chroma blocks will just be skipped by the + * coding function for BFrames, that's why we don't zero teh DC + * coeffs */ + if ((frame->vop_flags & XVID_VOP_GREYSCALE)) + mb->cbp &= 0x3C; + start_timer(); MBCodingBVOP(mb, qcoeff, frame->fcode, frame->bcode, bs, &frame->sStat, direction);