--- branches/dev-api-4/xvidcore/src/utils/mbtransquant.c 2003/03/09 16:45:24 913 +++ branches/dev-api-4/xvidcore/src/utils/mbtransquant.c 2003/03/10 00:38:49 914 @@ -361,6 +361,8 @@ MBTransQuantInterBVOP(const MBParam * pParam, FRAMEINFO * frame, MACROBLOCK * pMB, + const uint32_t x_pos, + const uint32_t y_pos, int16_t data[6 * 64], int16_t qcoeff[6 * 64]) { @@ -371,7 +373,20 @@ MBfDCT(pParam,frame,pMB,data); cbp = MBQuantInter(pParam,frame->quant,data,qcoeff); -/* we don't have to DeQuant, iDCT and Transfer back data for B-frames */ + /* + * History comment: + * we don't have to DeQuant, iDCT and Transfer back data for B-frames + */ + + /* + * As an exception to the previous rule, if we are willing to have extra + * stats then we have to DeQuant, iDCT and Transfer back the data :-) + */ + if(frame->vop_flags & XVID_EXTRASTATS) { + MBDeQuantInter(pParam,frame->quant,data,qcoeff,cbp); + MBiDCT(data,cbp); + MBTransAdd(pParam,frame,pMB,x_pos,y_pos,data,cbp); + } return cbp; }