1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

Merge commit 'e0a1d0a2b04eb5220d00fc7ce46a57cc5e3c7118'

* commit 'e0a1d0a2b04eb5220d00fc7ce46a57cc5e3c7118':
  mpegvideo_enc: rework direct mode check

Conflicts:
	libavcodec/mpegvideo_enc.c

See: ad98567198
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-11-06 17:14:18 +01:00
commit 5241f90058

View File

@ -1116,13 +1116,10 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
}
if (pic_arg) {
if (!pic_arg->buf[0])
direct = 0;
if (pic_arg->linesize[0] != s->linesize)
direct = 0;
if (pic_arg->linesize[1] != s->uvlinesize)
direct = 0;
if (pic_arg->linesize[2] != s->uvlinesize)
if (!pic_arg->buf[0] ||
pic_arg->linesize[0] != s->linesize ||
pic_arg->linesize[1] != s->uvlinesize ||
pic_arg->linesize[2] != s->uvlinesize)
direct = 0;
if ((s->width & 15) || (s->height & 15))
direct = 0;
@ -1134,27 +1131,20 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
av_dlog(s->avctx, "%d %d %"PTRDIFF_SPECIFIER" %"PTRDIFF_SPECIFIER"\n", pic_arg->linesize[0],
pic_arg->linesize[1], s->linesize, s->uvlinesize);
i = ff_find_unused_picture(s, direct);
if (i < 0)
return i;
pic = &s->picture[i];
pic->reference = 3;
if (direct) {
i = ff_find_unused_picture(s, 1);
if (i < 0)
return i;
pic = &s->picture[i];
pic->reference = 3;
if ((ret = av_frame_ref(pic->f, pic_arg)) < 0)
return ret;
if (ff_alloc_picture(s, pic, 1) < 0) {
return -1;
}
} else {
i = ff_find_unused_picture(s, 0);
if (i < 0)
return i;
pic = &s->picture[i];
pic->reference = 3;
if (ff_alloc_picture(s, pic, 0) < 0) {
return -1;
}