[FFmpeg-devel] [PATCH] avcodec/mpegvideo_enc: remove direct=1 support

Paul B Mahol onemda at gmail.com
Thu Mar 3 10:24:13 EET 2022


On 3/2/22, Michael Niedermayer <michael at niedermayer.cc> wrote:
> On Wed, Mar 02, 2022 at 08:11:18PM +0100, Paul B Mahol wrote:
>> On 3/2/22, Michael Niedermayer <michael at niedermayer.cc> wrote:
>> > On Wed, Mar 02, 2022 at 12:38:05PM +0100, Paul B Mahol wrote:
>> >> It seems it does not work properly.
>> >>
>> >> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> >> ---
>> >>  libavcodec/mpegvideo_enc.c | 23 +++--------------------
>> >>  1 file changed, 3 insertions(+), 20 deletions(-)
>> >
>> > if iam not mistaken, that requires the whole image to  be copied
>> > one extra time
>> > i think before doing that it should be understood
>> > where the problem is
>> > and why that is the better solution to fixing it and not doing
>> > that extra copy
>> >
>> > of course i may be missing something
>> >
>>
>> Yea, If you manage to trigger that path, I'm all ears.
>
> thats a fair request
>
> i tried
> --- a/libavcodec/mpegvideo_enc.c
> +++ b/libavcodec/mpegvideo_enc.c
> @@ -1065,6 +1065,7 @@ static int load_input_picture(MpegEncContext *s, const
> AVFrame *pic_arg)
>          pic->reference = 3;
>
>          if (direct) {
> +            av_log(0,0, "direct mode\n");
>              if ((ret = av_frame_ref(pic->f, pic_arg)) < 0)
>                  return ret;
>          }
>
> with
> ./ffmpeg -i ~/videos/matrixbench_mpeg2.mpg -t 1 test.avi
>
> and that gives me:
> direct mode
>     Last message repeated 23 times
>
> so it seems the code is used

Same happens if filtering is used?

>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Observe your enemies, for they first find out your faults. -- Antisthenes
>


More information about the ffmpeg-devel mailing list