# HG changeset patch # User michael # Date 1086290987 0 # Node ID c46e203dd698214d89050b3214325993af7d4e53 # Parent 4032a03192ecf2cfe17d910e583ebe4e882e8c87 change qscale -> lambda for the motion estimation finetune bit/distortion weighting factor used in motion estimation, the old coeffs where finetuned relative to incorrect mv_penalty tables which where then fixed later but the coeffs where not this _may_ fix the long standing blocking artifacts, but may also introduce mudding artefacts theoretically, so please tell us if u stumble across any so we can either fix them or export this variable so the user can change it diff -r 4032a03192ec -r c46e203dd698 motion_est.c --- a/motion_est.c Thu Jun 03 14:17:59 2004 +0000 +++ b/motion_est.c Thu Jun 03 19:29:47 2004 +0000 @@ -223,18 +223,17 @@ switch(type&0xFF){ default: case FF_CMP_SAD: - return s->qscale*2; + return s->lambda>>FF_LAMBDA_SHIFT; case FF_CMP_DCT: - return s->qscale*3; + return (3*s->lambda)>>(FF_LAMBDA_SHIFT+1); case FF_CMP_SATD: - return s->qscale*6; + return (2*s->lambda)>>FF_LAMBDA_SHIFT; + case FF_CMP_RD: + case FF_CMP_PSNR: case FF_CMP_SSE: - return s->qscale*s->qscale*2; + return s->lambda2>>FF_LAMBDA_SHIFT; case FF_CMP_BIT: return 1; - case FF_CMP_RD: - case FF_CMP_PSNR: - return (s->qscale*s->qscale*185 + 64)>>7; } } diff -r 4032a03192ec -r c46e203dd698 mpegvideo.c --- a/mpegvideo.c Thu Jun 03 14:17:59 2004 +0000 +++ b/mpegvideo.c Thu Jun 03 19:29:47 2004 +0000 @@ -4623,7 +4623,7 @@ s->me.scene_change_score=0; - s->lambda= s->current_picture_ptr->quality; //FIXME qscale / ... stuff for ME ratedistoration +// s->lambda= s->current_picture_ptr->quality; //FIXME qscale / ... stuff for ME ratedistoration if(s->pict_type==I_TYPE){ if(s->msmpeg4_version >= 3) s->no_rounding=1;