Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: remove direct=1 support
@ 2022-03-02 11:38 Paul B Mahol
  2022-03-02 13:00 ` Michael Niedermayer
  0 siblings, 1 reply; 6+ messages in thread
From: Paul B Mahol @ 2022-03-02 11:38 UTC (permalink / raw)
  To: ffmpeg-devel

It seems it does not work properly.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/mpegvideo_enc.c | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index c69114ea15..fb36c8e2d8 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1009,7 +1009,6 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
     int encoding_delay = s->max_b_frames ? s->max_b_frames
                                          : (s->low_delay ? 0 : 1);
     int flush_offset = 1;
-    int direct = 1;
 
     if (pic_arg) {
         pts = pic_arg->pts;
@@ -1042,37 +1041,21 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
             }
         }
 
-        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;
-        if (((intptr_t)(pic_arg->data[0])) & (STRIDE_ALIGN-1))
-            direct = 0;
-        if (s->linesize & (STRIDE_ALIGN-1))
-            direct = 0;
-
         ff_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->avctx, s->picture, direct);
+        i = ff_find_unused_picture(s->avctx, s->picture, 0);
         if (i < 0)
             return i;
 
         pic = &s->picture[i];
         pic->reference = 3;
 
-        if (direct) {
-            if ((ret = av_frame_ref(pic->f, pic_arg)) < 0)
-                return ret;
-        }
-        ret = alloc_picture(s, pic, direct);
+        ret = alloc_picture(s, pic, 0);
         if (ret < 0)
             return ret;
 
-        if (!direct) {
+        if (1) {
             if (pic->f->data[0] + INPLACE_OFFSET == pic_arg->data[0] &&
                 pic->f->data[1] + INPLACE_OFFSET == pic_arg->data[1] &&
                 pic->f->data[2] + INPLACE_OFFSET == pic_arg->data[2]) {
-- 
2.33.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-03-03  8:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-02 11:38 [FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: remove direct=1 support Paul B Mahol
2022-03-02 13:00 ` Michael Niedermayer
2022-03-02 19:11   ` Paul B Mahol
2022-03-02 21:47     ` Michael Niedermayer
2022-03-03  1:34       ` Andreas Rheinhardt
2022-03-03  8:24       ` Paul B Mahol

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git