summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-12-17 13:11:34 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-12-17 13:11:34 +0000
commitaf6a403a0553ba37f07f475a2f000aad337d38a4 (patch)
tree634921671a86795f82effd44e024f088b86b3f91 /libavcodec/motion_est.c
parenta6daaf7cce2df4123cf3f560d9dd805f3578a0a7 (diff)
warn user if the selected diamond size is larger then the motion estimation score cache size
Originally committed as revision 7326 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r--libavcodec/motion_est.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index d81ab32a44..2df1f31e8d 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -231,6 +231,12 @@ static void zero_hpel(uint8_t *a, const uint8_t *b, int stride, int h){
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);