Mercurial > libavcodec.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
2052:4032a03192ec | 2053:c46e203dd698 |
---|---|
221 | 221 |
222 static inline int get_penalty_factor(MpegEncContext *s, int type){ | 222 static inline int get_penalty_factor(MpegEncContext *s, int type){ |
223 switch(type&0xFF){ | 223 switch(type&0xFF){ |
224 default: | 224 default: |
225 case FF_CMP_SAD: | 225 case FF_CMP_SAD: |
226 return s->qscale*2; | 226 return s->lambda>>FF_LAMBDA_SHIFT; |
227 case FF_CMP_DCT: | 227 case FF_CMP_DCT: |
228 return s->qscale*3; | 228 return (3*s->lambda)>>(FF_LAMBDA_SHIFT+1); |
229 case FF_CMP_SATD: | 229 case FF_CMP_SATD: |
230 return s->qscale*6; | 230 return (2*s->lambda)>>FF_LAMBDA_SHIFT; |
231 case FF_CMP_RD: | |
232 case FF_CMP_PSNR: | |
231 case FF_CMP_SSE: | 233 case FF_CMP_SSE: |
232 return s->qscale*s->qscale*2; | 234 return s->lambda2>>FF_LAMBDA_SHIFT; |
233 case FF_CMP_BIT: | 235 case FF_CMP_BIT: |
234 return 1; | 236 return 1; |
235 case FF_CMP_RD: | |
236 case FF_CMP_PSNR: | |
237 return (s->qscale*s->qscale*185 + 64)>>7; | |
238 } | 237 } |
239 } | 238 } |
240 | 239 |
241 void ff_init_me(MpegEncContext *s){ | 240 void ff_init_me(MpegEncContext *s){ |
242 MotionEstContext * const c= &s->me; | 241 MotionEstContext * const c= &s->me; |