changeset 4305:4e75fbc983c9 libavcodec

warn user if the selected diamond size is larger then the motion estimation score cache size
author michael
date Sun, 17 Dec 2006 13:11:34 +0000
parents dbaae8e5ec55
children 331961478469
files motion_est.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/motion_est.c	Sun Dec 17 12:07:09 2006 +0000
+++ b/motion_est.c	Sun Dec 17 13:11:34 2006 +0000
@@ -231,6 +231,12 @@
 void ff_init_me(MpegEncContext *s){
     MotionEstContext * const c= &s->me;
     c->avctx= s->avctx;
+    int cache_size= FFMIN(ME_MAP_SIZE>>ME_MAP_SHIFT, 1<<ME_MAP_SHIFT);
+    int dia_size= FFMAX(FFABS(s->avctx->dia_size)&255, FFABS(s->avctx->pre_dia_size)&255);
+
+    if(cache_size < 2*dia_size && !c->stride){
+        av_log(s->avctx, AV_LOG_INFO, "ME_MAP size may be a little small for the selected diamond size\n");
+    }
 
     ff_set_cmp(&s->dsp, s->dsp.me_pre_cmp, c->avctx->me_pre_cmp);
     ff_set_cmp(&s->dsp, s->dsp.me_cmp, c->avctx->me_cmp);