aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-12-24 23:47:29 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-12-24 23:47:29 +0000
commitaacb6acc8aa3a3efc2a5a4f90bdad077ef5f299e (patch)
tree55d787b116d8e1fcacdb0ec3e51348c7929e77ed /libavcodec/motion_est.c
parentb7c51ebc89e98e27bed2664da7037c665b2f7a92 (diff)
downloadffmpeg-aacb6acc8aa3a3efc2a5a4f90bdad077ef5f299e.tar.gz
hmm did i mess the scaling of these up at some point?
anyway, this change decreases bitrate and increase PSNR by ~1.00 on my test file, other files also benefit significantly Originally committed as revision 4771 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r--libavcodec/motion_est.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index 757d8f3e6e..bd0074f3ad 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -1177,7 +1177,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
pic->mc_mb_var[s->mb_stride * mb_y + mb_x] = vard;
c->mc_mb_var_sum_temp += vard;
if (vard <= 64 || vard < varc) { //FIXME
- c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
+ c->scene_change_score+= ff_sqrt(vard<<8) - ff_sqrt(varc<<8);
}else{
c->scene_change_score+= s->qscale;
}
@@ -1268,7 +1268,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
#endif
if(mb_type){
if (vard <= 64 || vard < varc)
- c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
+ c->scene_change_score+= ff_sqrt(vard<<8) - ff_sqrt(varc<<8);
else
c->scene_change_score+= s->qscale;
@@ -1289,7 +1289,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
}
}else if(c->avctx->mb_decision > FF_MB_DECISION_SIMPLE){
if (vard <= 64 || vard < varc)
- c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
+ c->scene_change_score+= ff_sqrt(vard<<8) - ff_sqrt(varc<<8);
else
c->scene_change_score+= s->qscale;
@@ -1395,7 +1395,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
s->current_picture.mb_type[mb_y*s->mb_stride + mb_x]= 0;
if (vard <= 64 || vard < varc) { //FIXME
- c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
+ c->scene_change_score+= ff_sqrt(vard<<8) - ff_sqrt(varc<<8);
}else{
c->scene_change_score+= s->qscale;
}
@@ -1828,7 +1828,7 @@ void ff_estimate_b_frame_motion(MpegEncContext * s,
c->mb_var_sum_temp += varc;*/
c->mc_mb_var_sum_temp += vard;
/* if (vard <= 64 || vard < varc) {
- c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
+ c->scene_change_score+= ff_sqrt(vard<<8) - ff_sqrt(varc<<8);
}else{
c->scene_change_score+= s->qscale;
}*/