--- encoder.c 2010/03/09 10:00:14 1.131 +++ encoder.c 2010/11/28 15:18:21 1.133 @@ -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.131 2010/03/09 10:00:14 Isibaar Exp $ + * $Id: encoder.c,v 1.133 2010/11/28 15:18:21 Isibaar Exp $ * ****************************************************************************/ @@ -888,13 +888,13 @@ for (k = 0; k < 6; k++) { frame->mbs[j*pEnc->mbParam.mb_width + i].lambda[k] = (int) ((float)(1<mbParam.mb_height; j++) for (i = 0; imbParam.mb_width; i++) for (k = 0; k < 6; k++) { frame->mbs[j*pEnc->mbParam.mb_width + i].lambda[k] = 1<coding_type = P_VOP; + if (current->vop_flags & XVID_VOP_RD_PSNRHVSM) { + image_block_variance(¤t->image, pParam->edged_width, current->mbs, + pParam->mb_width, pParam->mb_height); + } + call_plugins(pEnc, pEnc->current, NULL, XVID_PLG_FRAME, NULL, NULL, NULL); SetMacroblockQuants(&pEnc->mbParam, current); @@ -1884,7 +1888,7 @@ #if 0 DPRINTF(XVID_DEBUG_DEBUG, "kmu %i %i %i\n", current->sStat.kblks, current->sStat.mblks, current->sStat.ublks); #endif - if (current->sStat.kblks + current->sStat.mblks <= + if (current->sStat.kblks + current->sStat.mblks < (pParam->frame_drop_ratio * mb_width * mb_height) / 100 && ( (pEnc->bframenum_head >= pEnc->bframenum_tail) || !(pEnc->mbParam.global_flags & XVID_GLOBAL_CLOSED_GOP)) ) { @@ -2003,6 +2007,12 @@ } frame->coding_type = B_VOP; + + if (pEnc->current->vop_flags & XVID_VOP_RD_PSNRHVSM) { + image_block_variance(&pEnc->current->image, pEnc->mbParam.edged_width, pEnc->current->mbs, + pEnc->mbParam.mb_width, pEnc->mbParam.mb_height); + } + call_plugins(pEnc, frame, NULL, XVID_PLG_FRAME, NULL, NULL, NULL); frame->fcode = frame->bcode = pEnc->current->fcode;