diff mbox series

[FFmpeg-devel,02/13] avcodec/mpegvideo_enc: Remove always-false checks

Message ID AS8P250MB0744E5F80664528404B83B668FC9A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 5aaaa7dbee959947fbb4f8f58cfd2a388725c09e
Headers show
Series [FFmpeg-devel,01/13] avcodec/mpegvideo_enc: Fix abort on allocation errors | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 6, 2023, 2:46 a.m. UTC
In case "!direct" we are not reusing the input buffers
(due to e.g. insufficient alignment), but allocating
new ones. These of course do not alias with the ones
provided by the user, so these checks are always-false.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mpegvideo_enc.c | 6 ------
 1 file changed, 6 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 6cd9d89e1b..3be6c1f928 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1171,11 +1171,6 @@  static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
             return ret;
 
         if (!direct) {
-            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]) {
-                // empty
-            } else {
                 int h_chroma_shift, v_chroma_shift;
                 av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt,
                                                  &h_chroma_shift,
@@ -1220,7 +1215,6 @@  static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
                     }
                 }
                 emms_c();
-            }
         }
         ret = av_frame_copy_props(pic->f, pic_arg);
         if (ret < 0) {