diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-06-03 19:29:47 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-06-03 19:29:47 +0000 |
commit | 0e9d4a67f43146f25623e385a575f8075a883312 (patch) | |
tree | b2ebccbcbc7262440a1570701617c4b9afcf410a /libavcodec | |
parent | 676e61c7bbc5b48a7b9f6ca2ca227e345e3d4580 (diff) | |
download | ffmpeg-0e9d4a67f43146f25623e385a575f8075a883312.tar.gz |
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')
-rw-r--r-- | libavcodec/motion_est.c | 13 | ||||
-rw-r--r-- | libavcodec/mpegvideo.c | 2 |
2 files changed, 7 insertions, 8 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; } } diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 4bc15ef2fa..a0d0c8b62d 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -4623,7 +4623,7 @@ static void encode_picture(MpegEncContext *s, int picture_number) 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; |