Re: [FFmpeg-devel] [PATCH 06/25] lavc/cbs: avoid an AVCodecContext dependency

2021-05-21 Thread James Almer
On 5/21/2021 3:00 PM, Anton Khirnov wrote: This will allow to stop including avcodec.h in future commits. --- libavcodec/av1_parser.c | 3 ++- libavcodec/av1dec.c | 5 ++--- libavcodec/cbs.c| 10 -- libavcodec/cbs.h| 11 --- 4 files changed, 12 insertio

Re: [FFmpeg-devel] [PATCH] aarch64: hevc_idct: Fix overflows in idct_dc

2021-05-21 Thread Martin Storsjö
On Mon, 17 May 2021, Martin Storsjö wrote: This is marginally slower, but correct for all input values. The previous implementation failed with certain input seeds, e.g. "checkasm --test=hevc_idct 98". --- libavcodec/aarch64/hevcdsp_idct_neon.S | 11 +-- 1 file changed, 5 insertions(+), 6

Re: [FFmpeg-devel] [PATCH] avfilter/yadif: Fix time base for large denominators

2021-05-21 Thread Tom Boshoven
On Fri, May 21, 2021 at 11:28 AM Tom Boshoven wrote: > +outlink->time_base = av_mul_q(outlink->time_base, (AVRational){2, 1}); > This should be {1, 2} . I'll fix this after I get some feedback. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org

Re: [FFmpeg-devel] [PATCH 12/39] avcodec/libvpxenc: Avoid one level of indentation

2021-05-21 Thread James Zern
On Fri, May 21, 2021 at 2:19 AM Andreas Rheinhardt wrote: > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/libvpxenc.c | 64 -- > 1 file changed, 31 insertions(+), 33 deletions(-) > lgtm. ___ ffmpeg-deve

Re: [FFmpeg-devel] [PATCH 02/39] avcodec/libaomenc: Avoid copying data, allow user-supplied buffers

2021-05-21 Thread James Zern
On Fri, May 21, 2021 at 2:18 AM Andreas Rheinhardt wrote: > > Here the packet size is known before allocating the packet because > the encoder provides said information (and works with internal buffers > itself), so one can use this information to avoid the implicit use of > another intermediate b

[FFmpeg-devel] [PATCH] avfilter/yadif: Fix time base for large denominators

2021-05-21 Thread Tom Boshoven
This fixes an issue where the yadif filter could cause the timebase denominator to overflow. Signed-off-by: Tom Boshoven --- libavfilter/vf_yadif.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c index a6942a2aa2..adeec81c04

Re: [FFmpeg-devel] [PATCH 11/39] avcodec/libvpxenc: Avoid copying data, allow user-supplied buffers

2021-05-21 Thread James Zern
On Fri, May 21, 2021 at 2:19 AM Andreas Rheinhardt wrote: > > Here the packet size is known before allocating the packet because > the encoder provides said information (and works with internal buffers > itself), so one can use this information to avoid the implicit use of > another intermediate b

Re: [FFmpeg-devel] [PATCH 23/25] lavc/matroska: avoid avcodec.h dependency

2021-05-21 Thread Anton Khirnov
Quoting Andreas Rheinhardt (2021-05-21 20:17:10) > Anton Khirnov: > > --- > > libavformat/matroska.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/libavformat/matroska.h b/libavformat/matroska.h > > index 30cbe18a8b..2d04a6838b 100644 > > --- a/libavformat/matrosk

Re: [FFmpeg-devel] [PATCH 23/25] lavc/matroska: avoid avcodec.h dependency

2021-05-21 Thread Andreas Rheinhardt
Anton Khirnov: > --- > libavformat/matroska.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavformat/matroska.h b/libavformat/matroska.h > index 30cbe18a8b..2d04a6838b 100644 > --- a/libavformat/matroska.h > +++ b/libavformat/matroska.h > @@ -22,7 +22,7 @@ > #ifndef

Re: [FFmpeg-devel] [PATCH 01/25] lavc: move small misc definitions into a separate header

2021-05-21 Thread Anton Khirnov
Quoting Anton Khirnov (2021-05-21 20:00:32) > This will allow to avoid #including the entire avcodec.h in some places. > --- > doc/APIchanges | 10 +++ > libavcodec/Makefile | 1 + > libavcodec/avcodec.h | 139 +-- > libavcodec/defs.h| 170

[FFmpeg-devel] [PATCH 10/25] lavc/dolby_e_parser: #include avcodec.h explicitly

2021-05-21 Thread Anton Khirnov
This file uses definitions from it, but relies on an indirect include through get_bits.h --- libavcodec/dolby_e_parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/dolby_e_parser.c b/libavcodec/dolby_e_parser.c index 8e187523f3..ab8f1b6ef1 100644 --- a/libavcodec/dolby_e_parser

[FFmpeg-devel] [PATCH 07/25] lavc/cbs_bsf.h: explicitly #include all required headers

2021-05-21 Thread Anton Khirnov
--- libavcodec/cbs_bsf.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/cbs_bsf.h b/libavcodec/cbs_bsf.h index 6be95abc3f..a370be1b5f 100644 --- a/libavcodec/cbs_bsf.h +++ b/libavcodec/cbs_bsf.h @@ -19,7 +19,13 @@ #ifndef AVCODEC_CBS_BSF_H #define AVCODEC_CBS_BSF_H +#incl

[FFmpeg-devel] [PATCH 09/25] lavc/cbs_internal: clean up headers

2021-05-21 Thread Anton Khirnov
Include all required headers explicitly, avoid avcodec.h dependency. --- libavcodec/cbs_internal.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/cbs_internal.h b/libavcodec/cbs_internal.h index a392880036..f853086fa3 100644 --- a/libavcodec/cbs_internal.h +++

[FFmpeg-devel] [PATCH 24/25] lavc/mov_chan: avoid avcodec.h dependency

2021-05-21 Thread Anton Khirnov
--- libavformat/mov_chan.c | 2 +- libavformat/mov_chan.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c index 324dd5f913..4ec16f15c2 100644 --- a/libavformat/mov_chan.c +++ b/libavformat/mov_chan.c @@ -26,7 +26,7 @@ #include

[FFmpeg-devel] [PATCH 20/25] lavf/hevc: drop unnecessary avcodec.h include

2021-05-21 Thread Anton Khirnov
--- libavformat/hevc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/hevc.c b/libavformat/hevc.c index 94eb3a9cb1..df141aec26 100644 --- a/libavformat/hevc.c +++ b/libavformat/hevc.c @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

[FFmpeg-devel] [PATCH 22/25] lavf/latmenc: avoid avcodec.h dependency

2021-05-21 Thread Anton Khirnov
--- libavformat/latmenc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/latmenc.c b/libavformat/latmenc.c index 87a6b81798..21bb614f67 100644 --- a/libavformat/latmenc.c +++ b/libavformat/latmenc.c @@ -21,7 +21,9 @@ #include "libavcodec/get_bits.h" #include

[FFmpeg-devel] [PATCH 25/25] lavc/mp3dec: avoid avcodec.h dependency

2021-05-21 Thread Anton Khirnov
--- libavformat/mp3dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index b12cd31148..b9e8d1074e 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -32,7 +32,7 @@ #include "id3v1.h" #include "replaygain.h" -#incl

[FFmpeg-devel] [PATCH 21/25] lavf/id3v1: drop unnecessary avcodec.h include

2021-05-21 Thread Anton Khirnov
--- libavformat/id3v1.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavformat/id3v1.c b/libavformat/id3v1.c index eb66098f51..3189a48b8c 100644 --- a/libavformat/id3v1.c +++ b/libavformat/id3v1.c @@ -20,7 +20,6 @@ */ #include "id3v1.h" -#include "libavcodec/avcodec.h" #include "liba

[FFmpeg-devel] [PATCH 18/25] lavf/adtsenc: avoid avcodec.h dependency

2021-05-21 Thread Anton Khirnov
--- libavformat/adtsenc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c index 96caf9950e..ba15c0a724 100644 --- a/libavformat/adtsenc.c +++ b/libavformat/adtsenc.c @@ -22,7 +22,9 @@ #include "libavcodec/get_bits.h" #include

[FFmpeg-devel] [PATCH 23/25] lavc/matroska: avoid avcodec.h dependency

2021-05-21 Thread Anton Khirnov
--- libavformat/matroska.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/matroska.h b/libavformat/matroska.h index 30cbe18a8b..2d04a6838b 100644 --- a/libavformat/matroska.h +++ b/libavformat/matroska.h @@ -22,7 +22,7 @@ #ifndef AVFORMAT_MATROSKA_H #define AVFOR

[FFmpeg-devel] [PATCH 13/25] lavfi/lavfutils: include required headers explicitly

2021-05-21 Thread Anton Khirnov
--- libavfilter/lavfutils.c | 9 + 1 file changed, 9 insertions(+) diff --git a/libavfilter/lavfutils.c b/libavfilter/lavfutils.c index 2bc06257c6..9aa781ef7b 100644 --- a/libavfilter/lavfutils.c +++ b/libavfilter/lavfutils.c @@ -18,8 +18,17 @@ * Foundation, Inc., 51 Franklin Street, Fi

[FFmpeg-devel] [PATCH 17/25] lavf/a64: avoid avcodec.h dependency

2021-05-21 Thread Anton Khirnov
--- libavformat/a64.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/a64.c b/libavformat/a64.c index e6018f06d3..6e19162fe2 100644 --- a/libavformat/a64.c +++ b/libavformat/a64.c @@ -19,7 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA

[FFmpeg-devel] [PATCH 19/25] lavf/framecrcenc: avoid avcodec.h dependency

2021-05-21 Thread Anton Khirnov
--- libavformat/framecrcenc.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/framecrcenc.c b/libavformat/framecrcenc.c index c300702d55..56f7ea1b5a 100644 --- a/libavformat/framecrcenc.c +++ b/libavformat/framecrcenc.c @@ -22,7 +22,11 @@ #include #include

[FFmpeg-devel] [PATCH 11/25] lavc/mlp_parse: add required includes explicitly

2021-05-21 Thread Anton Khirnov
--- libavcodec/mlp_parse.h | 4 1 file changed, 4 insertions(+) diff --git a/libavcodec/mlp_parse.h b/libavcodec/mlp_parse.h index a0790ae8c7..f0d7b41c11 100644 --- a/libavcodec/mlp_parse.h +++ b/libavcodec/mlp_parse.h @@ -21,6 +21,10 @@ #ifndef AVCODEC_MLP_PARSE_H #define AVCODEC_MLP_PARS

[FFmpeg-devel] [PATCH 16/25] lavf/avformat.h: drop the avcodec.h include

2021-05-21 Thread Anton Khirnov
Since AVStream.codec is gone, avformat.h does not require anything from avcodec.h. --- libavformat/avformat.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index a28ac372da..92807e9657 100644 --- a/libavformat/avformat.h +

[FFmpeg-devel] [PATCH 12/25] lavc/get_bits: avoid avcodec.h dependency

2021-05-21 Thread Anton Khirnov
Include only defs.h, needed for AV_INPUT_BUFFER_PADDING_SIZE. --- libavcodec/get_bits.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index 66fb877599..d4e9276da1 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@

[FFmpeg-devel] [PATCH 14/25] lavf/internal: include avcodec.h explicitly

2021-05-21 Thread Anton Khirnov
Do not depend on avformat.h to provide it. --- libavformat/internal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/internal.h b/libavformat/internal.h index d57e63c1c2..f9abec9e44 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -24,6 +24,9 @@ #include

[FFmpeg-devel] [PATCH 06/25] lavc/cbs: avoid an AVCodecContext dependency

2021-05-21 Thread Anton Khirnov
This will allow to stop including avcodec.h in future commits. --- libavcodec/av1_parser.c | 3 ++- libavcodec/av1dec.c | 5 ++--- libavcodec/cbs.c| 10 -- libavcodec/cbs.h| 11 --- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/libavcodec/av

[FFmpeg-devel] [PATCH 15/25] lavf/icoenc: include required headers explicitly

2021-05-21 Thread Anton Khirnov
--- libavformat/icoenc.c | 4 1 file changed, 4 insertions(+) diff --git a/libavformat/icoenc.c b/libavformat/icoenc.c index 39e92a41b7..a1ca15155f 100644 --- a/libavformat/icoenc.c +++ b/libavformat/icoenc.c @@ -26,6 +26,10 @@ #include "libavutil/intreadwrite.h" #include "libavutil/pixd

[FFmpeg-devel] [PATCH 08/25] lavc/cbs.h: avoid avcodec.h dependency

2021-05-21 Thread Anton Khirnov
Include only the headers that are actually needed. --- libavcodec/cbs.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/cbs.h b/libavcodec/cbs.h index 8b432393b8..509f76b9c6 100644 --- a/libavcodec/cbs.h +++ b/libavcodec/cbs.h @@ -24,7 +24,9 @@ #include "libavu

[FFmpeg-devel] [PATCH 01/25] lavc: move small misc definitions into a separate header

2021-05-21 Thread Anton Khirnov
This will allow to avoid #including the entire avcodec.h in some places. --- doc/APIchanges | 10 +++ libavcodec/Makefile | 1 + libavcodec/avcodec.h | 139 +-- libavcodec/defs.h| 170 +++ 4 files changed, 182 in

[FFmpeg-devel] [PATCH 05/25] lavc: move av_get_profile_name() from avcodec.h to codec.h

2021-05-21 Thread Anton Khirnov
--- doc/APIchanges | 3 +++ libavcodec/avcodec.h | 9 - libavcodec/codec.h | 9 + 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 540a0c8b4d..e21970812b 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -14,6 +14,9 @@

[FFmpeg-devel] [PATCH 02/25] lavc: move av_get_[exact_]bits_per_sample() to codec_id.h

2021-05-21 Thread Anton Khirnov
--- doc/APIchanges| 4 libavcodec/avcodec.h | 18 -- libavcodec/codec_id.h | 18 ++ 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 30203d8ad5..f8d01caa84 100644 --- a/doc/APIchanges +++ b/doc/API

[FFmpeg-devel] [PATCH 03/25] lavc: move avcodec_profile_name() from avcodec.h to codec_id.h

2021-05-21 Thread Anton Khirnov
--- doc/APIchanges| 4 ++-- libavcodec/avcodec.h | 13 - libavcodec/codec_id.h | 13 + 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index f8d01caa84..731d55f10d 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@

[FFmpeg-devel] [PATCH 04/25] lavc: move av_get_audio_frame_duration2() from avcodec.h to codec_par.h

2021-05-21 Thread Anton Khirnov
--- doc/APIchanges | 3 +++ libavcodec/avcodec.h | 6 -- libavcodec/codec_par.h | 5 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 731d55f10d..540a0c8b4d 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -14,6 +14,9 @@ li

[FFmpeg-devel] Ping: [PATCH] avfilter/vf_subtitles: allow using embedded fonts

2021-05-21 Thread Oneric
On Sun, May 02, 2021 at 23:02:02 +0200, Oneric wrote: > ASS subtitles can have encoded fonts embedded into the subtitle file > itself. Allow libass to load those, to render subs as intended. > --- > libavfilter/vf_subtitles.c | 1 + > 1 file changed, 1 insertion(+) pinging again _

Re: [FFmpeg-devel] [PATCH 17/39] avcodec/libxavs: Avoid overallocating, copying packet data

2021-05-21 Thread Andreas Rheinhardt
James Almer: > On 5/21/2021 6:17 AM, Andreas Rheinhardt wrote: >> When the packet size is known in advance like here, one can avoid >> an intermediate buffer for the packet data; also, there is no reason >> to add AV_INPUT_BUFFER_MIN_SIZE to the packet size any more, as the >> actually needed packe

Re: [FFmpeg-devel] [PATCH 30/39] avcodec/internal: Remove outdated documentation of ff_alloc_packet2()

2021-05-21 Thread James Almer
On 5/21/2021 6:17 AM, Andreas Rheinhardt wrote: Its documentation described the way user-supplied buffers worked before 93016f5d1d280f9cb7856883af287fa66affc04c. Signed-off-by: Andreas Rheinhardt --- libavcodec/internal.h | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-

Re: [FFmpeg-devel] [PATCH 26/39] avcodec/dvenc: Avoid copying packet data, allow user-supplied buffers

2021-05-21 Thread James Almer
On 5/21/2021 6:17 AM, Andreas Rheinhardt wrote: When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data; this also makes it easy to allow user-supplied buffers. Only one thing needed to be changed: The earlier code relied on the buffer having b

Re: [FFmpeg-devel] [PATCH 06/39] avcodec/libmp3lame: Avoid copying data, allow user-supplied buffer

2021-05-21 Thread James Almer
On 5/21/2021 6:17 AM, Andreas Rheinhardt wrote: The libmp3lame encoder already uses an internal buffer, so that the packet size is already known before allocating the packet; therefore one can avoid another (implicit) intermediate buffer by switching to ff_get_encode_buffer(), thereby also suppor

Re: [FFmpeg-devel] [PATCH 17/39] avcodec/libxavs: Avoid overallocating, copying packet data

2021-05-21 Thread James Almer
On 5/21/2021 6:17 AM, Andreas Rheinhardt wrote: When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data; also, there is no reason to add AV_INPUT_BUFFER_MIN_SIZE to the packet size any more, as the actually needed packet size can be easily calc

[FFmpeg-devel] [PATCH] lavf/dashenc.c: Fix creating audio-only HLS playlists

2021-05-21 Thread Przemysław Sobala
With audio/video HLS playlists, audio chunklists are treated as alternative renditions for video chunklists. This is wrong for audio-only HLS playlists. fixes: 9252 Please correct indentation of introduced if statement's body, before applying. --- libavformat/dashenc.c | 39 +

Re: [FFmpeg-devel] [PATCH 2/2] lavfi/dnn: refine code to separate processing and detection in backends

2021-05-21 Thread Guo, Yejun
> -Original Message- > From: Guo, Yejun > Sent: Monday, May 17, 2021 1:54 PM > To: ffmpeg-devel@ffmpeg.org > Cc: Guo, Yejun > Subject: [PATCH 2/2] lavfi/dnn: refine code to separate processing and > detection in backends > > --- > libavfilter/dnn/dnn_backend_native.c | 2 +- > lib

[FFmpeg-devel] [PATCH 25/39] avcodec/libxavs2: Allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
Here the packet size is known before allocating the packet, so that supporting user-supplied buffers is trivial. Signed-off-by: Andreas Rheinhardt --- libavcodec/libxavs2.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.

[FFmpeg-devel] [PATCH 39/39] avcodec/avcodec: Don't free options on failure in avcodec_open2()

2021-05-21 Thread Andreas Rheinhardt
Instead return the dictionary in the state it is at the time the error occurred. This is more in line with the description of this parameter and allows to notify the user of unrecognized options if an error happens lateron (which might very well be due to e.g. misspelled options). Signed-off-by: A

[FFmpeg-devel] [PATCH 37/39] doc/examples/extract_mvs: Explicitly free options

2021-05-21 Thread Andreas Rheinhardt
The user should not rely on all options always being recognized (in particular not on error). Signed-off-by: Andreas Rheinhardt --- doc/examples/extract_mvs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/examples/extract_mvs.c b/doc/examples/extract_mvs.c index 42e1

[FFmpeg-devel] [PATCH 38/39] fftools/ffprobe: Remove redundant check before avcodec_free_context()

2021-05-21 Thread Andreas Rheinhardt
Besides being unnecessary it is also safer: If the error for an unrecognized option were triggered (which seems to be impossible right now), it might be that the stream whose codecpar is accessed is NULL. Signed-off-by: Andreas Rheinhardt --- fftools/ffprobe.c | 3 +-- 1 file changed, 1 insertio

[FFmpeg-devel] [PATCH 36/39] doc/examples/demuxing_decoding: Remove unused options

2021-05-21 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- doc/examples/demuxing_decoding.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/examples/demuxing_decoding.c b/doc/examples/demuxing_decoding.c index 55fdb2555c..ef1fd2bd53 100644 --- a/doc/examples/demuxing_decoding.c +++ b/doc/exa

[FFmpeg-devel] [PATCH 33/39] avcodec/frame_thread_encoder: Remove redundant memcpy

2021-05-21 Thread Andreas Rheinhardt
In case the underlying AVCodec has no private class, the private data of both the main as well as each worker AVCodecContext is just zeroed (the codec's init function has not been called on any of them and without a private class there is no way to legitimately set anything before the aforementione

[FFmpeg-devel] [PATCH 35/39] avcodec/avcodec: Avoid redundant copies of options in avcodec_open2

2021-05-21 Thread Andreas Rheinhardt
It is no longer necessary now that ff_frame_thread_encoder_init() no longer receives an options dictionary. Signed-off-by: Andreas Rheinhardt --- libavcodec/avcodec.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c i

[FFmpeg-devel] [PATCH 34/39] avutil/opt: Check directly for av_dict_copy() failure

2021-05-21 Thread Andreas Rheinhardt
av_dict_copy() returned void when this code was written. Signed-off-by: Andreas Rheinhardt --- Should one add AV_DICT_MULTIKEY to the flags to also copy dictionaries with multiple entries? libavutil/opt.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavutil/opt.c

[FFmpeg-devel] [PATCH 32/39] avcodec/frame_thread_encoder: Avoid dictionaries

2021-05-21 Thread Andreas Rheinhardt
avcodec_open2() allows to provide options via an AVDictionary; but it is also allowed to set options by simply setting the value of the AVCodecContext or via the AVOptions API if the codec has a private class. Any options provided via an AVDictionary have already been applied before ff_frame_thread

[FFmpeg-devel] [PATCH 31/39] avcodec/encode: Always use intermediate buffer in ff_alloc_packet2()

2021-05-21 Thread Andreas Rheinhardt
Up until now, ff_alloc_packet2() has a min_size parameter: It is supposed to be a lower bound on the final size of the packet to allocate. If it is not too far from the upper bound (namely, if it is at least half the upper bound), then ff_alloc_packet2() already allocates the final, already refcoun

[FFmpeg-devel] [PATCH 30/39] avcodec/internal: Remove outdated documentation of ff_alloc_packet2()

2021-05-21 Thread Andreas Rheinhardt
Its documentation described the way user-supplied buffers worked before 93016f5d1d280f9cb7856883af287fa66affc04c. Signed-off-by: Andreas Rheinhardt --- libavcodec/internal.h | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/libavcodec/internal.h b/libavcodec/i

[FFmpeg-devel] [PATCH 28/39] avcodec/omx: Reindentation

2021-05-21 Thread Andreas Rheinhardt
Also combine two if blocks that check for the same condition and don't check had_partial if we already have a complete packet. Signed-off-by: Andreas Rheinhardt --- libavcodec/omx.c | 33 - 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/libavcodec

[FFmpeg-devel] [PATCH 29/39] avcodec/omx: Zero packet padding

2021-05-21 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/omx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/omx.c b/libavcodec/omx.c index ddb3ba4f66..9597c60057 100644 --- a/libavcodec/omx.c +++ b/libavcodec/omx.c @@ -871,6 +871,7 @@ static int omx_encode_frame(AVCodecContext *avctx, A

[FFmpeg-devel] [PATCH 27/39] avcodec/omx: Remove remnants of old preallocated buffers

2021-05-21 Thread Andreas Rheinhardt
There are no preallocated buffer packets any more; this feature only worked with the old encode API and only until said API was turned into a wrapper for the new API in 93016f5d1d280f9cb7856883af287fa66affc04c. So remove its remnants. Signed-off-by: Andreas Rheinhardt --- libavcodec/omx.c | 15 -

[FFmpeg-devel] [PATCH 23/39] avcodec/pngenc: Avoid copying APNG data, allow user-supplied buffer

2021-05-21 Thread Andreas Rheinhardt
The APNG encoder already uses internal buffers, so that the packet size is already known before allocating the packet; therefore one can avoid another (implicit) intermediate buffer by switching to ff_get_encode_buffer(), thereby also supporting user-supplied buffers. Signed-off-by: Andreas Rheinh

[FFmpeg-devel] [PATCH 26/39] avcodec/dvenc: Avoid copying packet data, allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data; this also makes it easy to allow user-supplied buffers. Only one thing needed to be changed: The earlier code relied on the buffer having been initially zeroed by av_fast_padded_malloc(), s

[FFmpeg-devel] [PATCH 24/39] avcodec/sbcenc: Avoid copying packet data, allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data by using ff_get_encode_buffer() and also set AV_CODEC_CAP_DR1 at the same time. Signed-off-by: Andreas Rheinhardt --- libavcodec/sbcenc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 del

[FFmpeg-devel] [PATCH 21/39] avcodec/flacenc: Avoid copying packet data, allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
The FLAC encoder calculates the size in advance, so one can avoid an intermediate buffer for the packet data by using ff_get_encode_buffer() and also set AV_CODEC_CAP_DR1 at the same time. Signed-off-by: Andreas Rheinhardt --- The size was actually exact in all my tests; it seems the only way for

[FFmpeg-devel] [PATCH 22/39] avcodec/pngenc: Remove always-true check

2021-05-21 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/pngenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index a398155100..5a376765cf 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -847,7 +847,7 @@ static int encode_apn

[FFmpeg-devel] [PATCH 20/39] avcodec/pamenc: Avoid copying packet data, allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data by using ff_get_encode_buffer() and also set AV_CODEC_CAP_DR1 at the same time. Signed-off-by: Andreas Rheinhardt --- libavcodec/pamenc.c | 26 ++ 1 file changed,

[FFmpeg-devel] [PATCH 19/39] avcodec/pnmenc: Avoid intermediate buffer, allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
For all p*m encoders a very sharp upper bound for the size of the output packets is available before the packet is allocated. This can be used to avoid an intermediate buffer when encoding by using ff_get_encode_buffer() instead of ff_alloc_packet2() (without min_size); this also adds support for u

[FFmpeg-devel] [PATCH 18/39] avcodec/libxavs: Improve returned error codes

2021-05-21 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/libxavs.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c index ea53c49d38..88f674de40 100644 --- a/libavcodec/libxavs.c +++ b/libavcodec/libxavs.c @@ -112,7 +112,7 @@ static i

[FFmpeg-devel] [PATCH 17/39] avcodec/libxavs: Avoid overallocating, copying packet data

2021-05-21 Thread Andreas Rheinhardt
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data; also, there is no reason to add AV_INPUT_BUFFER_MIN_SIZE to the packet size any more, as the actually needed packet size can be easily calculated: It is three bytes more than the raw nal si

[FFmpeg-devel] [PATCH 16/39] avcodec/libx265: Allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
Here the packet size is known before allocating the packet, so that supporting user-supplied buffers is trivial. Signed-off-by: Andreas Rheinhardt --- libavcodec/libx265.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c inde

[FFmpeg-devel] [PATCH 15/39] avcodec/libx264: Avoid copying data, allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can use this information to avoid the implicit use of another intermediate buffer for the packet data; and by switching to ff_get_encode_buffer()

[FFmpeg-devel] [PATCH 14/39] avcodec/libwebpenc_animencoder: Allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
Here the packet size is known before allocating the packet, so that supporting user-supplied buffers is trivial. Signed-off-by: Andreas Rheinhardt --- libavcodec/libwebpenc_animencoder.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/libwebpenc_animencoder.c

[FFmpeg-devel] [PATCH 13/39] avcodec/libwebpenc: Allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
Here the packet size is known before allocating the packet, so that supporting user-supplied buffers is trivial. Signed-off-by: Andreas Rheinhardt --- libavcodec/libwebpenc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/libwebpenc.c b/libavcodec/libwebpenc.c

[FFmpeg-devel] [PATCH 12/39] avcodec/libvpxenc: Avoid one level of indentation

2021-05-21 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/libvpxenc.c | 64 -- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 2d9e56837b..66bad444d0 100644 --- a/libavcodec/libvpxenc.c +++ b/liba

[FFmpeg-devel] [PATCH 07/39] avcodec/libopenh264enc: Allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
Here the packet size is known before allocating the packet, so that supporting user-supplied buffers is trivial. Signed-off-by: Andreas Rheinhardt --- libavcodec/libopenh264enc.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/libopenh264enc.c b/libavcodec/

[FFmpeg-devel] [PATCH 11/39] avcodec/libvpxenc: Avoid copying data, allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can use this information to avoid the implicit use of another intermediate buffer for the packet data; and by switching to ff_get_encode_buffer()

[FFmpeg-devel] [PATCH 10/39] avcodec/libvorbisenc: Avoid copying data, allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can use this information to avoid the implicit use of another intermediate buffer for the packet data; and by switching to ff_get_encode_buffer()

[FFmpeg-devel] [PATCH 09/39] avcodec/libtheoraenc: Avoid copying data, allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can use this information to avoid the implicit use of another intermediate buffer for the packet data; and by switching to ff_get_encode_buffer()

[FFmpeg-devel] [PATCH 08/39] avcodec/libshine: Avoid copying data, allow user-supplied buffer

2021-05-21 Thread Andreas Rheinhardt
The libshine encoder already uses an internal buffer, so that the packet size is already known before allocating the packet; therefore one can avoid another (implicit) intermediate buffer by switching to ff_get_encode_buffer(), thereby also supporting user-supplied buffers. Signed-off-by: Andreas

[FFmpeg-devel] [PATCH 05/39] avcodec/libkvazaar: Allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
Here the packet size is known before allocating the packet, so that supporting user-supplied buffers is trivial. Signed-off-by: Andreas Rheinhardt --- libavcodec/libkvazaar.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar

[FFmpeg-devel] [PATCH 06/39] avcodec/libmp3lame: Avoid copying data, allow user-supplied buffer

2021-05-21 Thread Andreas Rheinhardt
The libmp3lame encoder already uses an internal buffer, so that the packet size is already known before allocating the packet; therefore one can avoid another (implicit) intermediate buffer by switching to ff_get_encode_buffer(), thereby also supporting user-supplied buffers.. Signed-off-by: Andre

[FFmpeg-devel] [PATCH 04/39] avcodec/libgsmenc: Avoid copying packet data, allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data by using ff_get_encode_buffer() and also set AV_CODEC_CAP_DR1 at the same time. Signed-off-by: Andreas Rheinhardt --- libavcodec/libgsmenc.c | 5 - 1 file changed, 4 insertions(+), 1

[FFmpeg-devel] [PATCH 03/39] avcodec/libcodec2: Avoid copying packet data, allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data by using ff_get_encode_buffer() and also set AV_CODEC_CAP_DR1 at the same time. Signed-off-by: Andreas Rheinhardt --- libavcodec/libcodec2.c | 5 +++-- 1 file changed, 3 insertions(+), 2

[FFmpeg-devel] [PATCH 02/39] avcodec/libaomenc: Avoid copying data, allow user-supplied buffers

2021-05-21 Thread Andreas Rheinhardt
Here the packet size is known before allocating the packet because the encoder provides said information (and works with internal buffers itself), so one can use this information to avoid the implicit use of another intermediate buffer for the packet data; and by switching to ff_get_encode_buffer()

[FFmpeg-devel] [PATCH 01/39] avcodec/audiotoolboxenc: Remove AV_CODEC_CAP_DR1

2021-05-21 Thread Andreas Rheinhardt
It has been added in 2016 when this flag made no sense for encoders at all; now that it makes sense, audiotoolboxenc doesn't support it, despite claiming to do so. Signed-off-by: Andreas Rheinhardt --- Will backport this to 4.4 as AV_CODEC_CAP_DR1 was already well-defined for this release. liba