summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
authorCorey Hickey <bugfood-ml@fatooh.org>2006-01-22 20:54:52 +0000
committerCorey Hickey <bugfood-ml@fatooh.org>2006-01-22 20:54:52 +0000
commit39a64e3023436af020fb2846880f99c2160e13f2 (patch)
tree82fabaad961bfe9d785d5ad4dec2ca82bb6719be /libavcodec/motion_est.c
parentf53a2931cfc62aaf48b549fa6e0ca04c57ec8d4b (diff)
sc_factor support for encoding.
Here's the description I'll add to the mplayer man page: --- Causes frames with higher quantizers to be more likely to trigger a scene change detection and make libavcodec use an I-frame (default: 1). 1-16 is a sane range. Values between 2 and 6 may yield increasing PSNR (up to approximately 0.04 dB) and better placement of I-frames in high-motion scenes. Higher values than 6 may give very slightly better PSNR (approximately 0.01 dB more than sc_factor=6), but noticably worse visual quality. --- Original idea from Michael; patch by me. Originally committed as revision 4883 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 10b1db9232..526773b897 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -1179,7 +1179,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
if (vard <= 64<<8 || vard < varc) { //FIXME
c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
}else{
- c->scene_change_score+= s->qscale;
+ c->scene_change_score+= s->qscale * s->avctx->scenechange_factor;
}
return;
}
@@ -1270,7 +1270,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
if (vard <= 64<<8 || vard < varc)
c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
else
- c->scene_change_score+= s->qscale;
+ c->scene_change_score+= s->qscale * s->avctx->scenechange_factor;
if(mb_type == CANDIDATE_MB_TYPE_INTER){
c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
@@ -1291,7 +1291,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
if (vard <= 64<<8 || vard < varc)
c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
else
- c->scene_change_score+= s->qscale;
+ c->scene_change_score+= s->qscale * s->avctx->scenechange_factor;
if (vard*2 + 200*256 > varc)
mb_type|= CANDIDATE_MB_TYPE_INTRA;
@@ -1397,7 +1397,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
if (vard <= 64<<8 || vard < varc) { //FIXME
c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
}else{
- c->scene_change_score+= s->qscale;
+ c->scene_change_score+= s->qscale * s->avctx->scenechange_factor;
}
}
@@ -1843,7 +1843,7 @@ void ff_estimate_b_frame_motion(MpegEncContext * s,
/* if (vard <= 64<<8 || vard < varc) {
c->scene_change_score+= ff_sqrt(vard) - ff_sqrt(varc);
}else{
- c->scene_change_score+= s->qscale;
+ c->scene_change_score+= s->qscale * s->avctx->scenechange_factor;
}*/
return;
}