summaryrefslogtreecommitdiff
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-01-24 19:06:47 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-01-24 19:06:47 +0000
commit2ddeed44a58e507a862845ce45b292b31c6ff72e (patch)
tree6de917fdd8f4eaa2fab61ddb7c166b3a50a8e723 /libavcodec/motion_est.c
parentd2b3c3d7bb12b7a69c6f3201ec4beb1a97712cbd (diff)
(commit by michael)
motion-estimation on width/height not divisable through 16 files bugfix Originally committed as revision 279 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r--libavcodec/motion_est.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index d3e31fc428..20f918ff0e 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -409,13 +409,20 @@ int estimate_motion(MpegEncContext * s,
if (s->unrestricted_mv) {
xmin = -16;
ymin = -16;
- xmax = s->width;
- ymax = s->height;
+ if(s->avctx==NULL || s->avctx->codec->id!=CODEC_ID_MPEG4){
+ xmax = s->mb_width*16;
+ ymax = s->mb_height*16;
+ }else {
+ /* XXX: dunno if this is correct but ffmpeg4 decoder wont like it otherwise
+ (cuz the drawn edge isnt large enough))*/
+ xmax = s->width;
+ ymax = s->height;
+ }
} else {
xmin = 0;
ymin = 0;
- xmax = s->width - 16;
- ymax = s->height - 16;
+ xmax = s->mb_width*16 - 16;
+ ymax = s->mb_height*16 - 16;
}
switch(s->full_search) {