Mercurial > libavcodec.hg
diff motion_est.c @ 2053:c46e203dd698 libavcodec
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
author | michael |
---|---|
date | Thu, 03 Jun 2004 19:29:47 +0000 |
parents | 3ab8f3e2ae6a |
children | 9e4bebc39ade |
line wrap: on
line diff
--- 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; } }