You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
mpegvideo_enc: rework direct mode check
Remove stray semicolon and share codepaths. CC: libav-stable@libav.org Bug-Id: CID 991857
This commit is contained in:
@@ -985,39 +985,29 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pic_arg) {
|
if (pic_arg) {
|
||||||
if (!pic_arg->buf[0]);
|
if (!pic_arg->buf[0] ||
|
||||||
direct = 0;
|
pic_arg->linesize[0] != s->linesize ||
|
||||||
if (pic_arg->linesize[0] != s->linesize)
|
pic_arg->linesize[1] != s->uvlinesize ||
|
||||||
direct = 0;
|
pic_arg->linesize[2] != s->uvlinesize)
|
||||||
if (pic_arg->linesize[1] != s->uvlinesize)
|
|
||||||
direct = 0;
|
|
||||||
if (pic_arg->linesize[2] != s->uvlinesize)
|
|
||||||
direct = 0;
|
direct = 0;
|
||||||
|
|
||||||
av_dlog(s->avctx, "%d %d %td %td\n", pic_arg->linesize[0],
|
av_dlog(s->avctx, "%d %d %td %td\n", pic_arg->linesize[0],
|
||||||
pic_arg->linesize[1], s->linesize, s->uvlinesize);
|
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) {
|
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)
|
if ((ret = av_frame_ref(pic->f, pic_arg)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
if (ff_alloc_picture(s, pic, 1) < 0) {
|
if (ff_alloc_picture(s, pic, 1) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} 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) {
|
if (ff_alloc_picture(s, pic, 0) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user