[FFmpeg-devel] [PATCH 18/25] avfilter/af_headphone: Avoid intermediate buffer III

Paul B Mahol onemda at gmail.com
Wed Sep 9 04:27:13 EEST 2020


On Tue, Sep 08, 2020 at 11:18:49PM +0200, Andreas Rheinhardt wrote:
> The headphone filter allocates a pair of buffers to be used as
> intermediate buffers lateron: Before every use they are zeroed, then
> some elements of the buffer are set and lateron the complete buffers are
> copied into another, bigger buffer. These intermediate buffers are
> unnecessary as the data can be directly written into the bigger buffer.
> Furthermore, the whole buffer has been zeroed initially and because no
> piece of this buffer is set twice (due to the fact that duplicate
> channel map entries are skipped), it is unnecessary to rezero the part
> of the big buffer that is about to be written to.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> ---
>  libavfilter/af_headphone.c | 28 +++++-----------------------
>  1 file changed, 5 insertions(+), 23 deletions(-)
> 

should be fine if properly tested.


More information about the ffmpeg-devel mailing list