summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-06-03 19:29:47 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-06-03 19:29:47 +0000
commit0e9d4a67f43146f25623e385a575f8075a883312 (patch)
treeb2ebccbcbc7262440a1570701617c4b9afcf410a /libavcodec/motion_est.c
parent676e61c7bbc5b48a7b9f6ca2ca227e345e3d4580 (diff)
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 Originally committed as revision 3189 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r--libavcodec/motion_est.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index d2ab2b2e65..b92b6dfad8 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -223,18 +223,17 @@ static inline int get_penalty_factor(MpegEncContext *s, int type){
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;
}
}