mbox series

[FFmpeg-devel,0/2] lavc/videotoolbox: use objpool instead of allocating memory each frame

Message ID 20221119213516.45148-1-kernrj@gmail.com
Headers show
Series lavc/videotoolbox: use objpool instead of allocating memory each frame | expand

Message

Rick Kern Nov. 19, 2022, 9:35 p.m. UTC
objpool was only being used in fftools, but it's useful in other components to reduce alloation time and memory fragmentation.

This patch set moves objpool to libavutil, so it can be used by lavc/videotoolboxenc for data being passed from input frames to output packets.

Rick Kern (2):
  fftools/objpool: move objpool to libavutil
  lavc/videotoolboxenc: use objectpool for encoder output information

 fftools/Makefile                 |  1 -
 fftools/ffmpeg_mux.c             |  2 +-
 fftools/sync_queue.c             |  2 +-
 fftools/thread_queue.c           |  2 +-
 fftools/thread_queue.h           |  2 +-
 libavcodec/videotoolboxenc.c     | 80 ++++++++++++++++++++++++++++----
 libavutil/Makefile               |  2 +
 {fftools => libavutil}/objpool.c |  0
 {fftools => libavutil}/objpool.h |  0
 9 files changed, 77 insertions(+), 14 deletions(-)
 rename {fftools => libavutil}/objpool.c (100%)
 rename {fftools => libavutil}/objpool.h (100%)

Comments

Zhao Zhili Nov. 20, 2022, 2:47 p.m. UTC | #1
On Sat, 2022-11-19 at 16:35 -0500, Rick Kern wrote:
> objpool was only being used in fftools, but it's useful in other
> components to reduce alloation time and memory fragmentation.
> 
> This patch set moves objpool to libavutil, so it can be used by
> lavc/videotoolboxenc for data being passed from input frames to
> output packets.
> 
> Rick Kern (2):
>   fftools/objpool: move objpool to libavutil
>   lavc/videotoolboxenc: use objectpool for encoder output information
> 
>  fftools/Makefile                 |  1 -
>  fftools/ffmpeg_mux.c             |  2 +-
>  fftools/sync_queue.c             |  2 +-
>  fftools/thread_queue.c           |  2 +-
>  fftools/thread_queue.h           |  2 +-
>  libavcodec/videotoolboxenc.c     | 80 ++++++++++++++++++++++++++++
> ----
>  libavutil/Makefile               |  2 +
>  {fftools => libavutil}/objpool.c |  0
>  {fftools => libavutil}/objpool.h |  0
>  9 files changed, 77 insertions(+), 14 deletions(-)
>  rename {fftools => libavutil}/objpool.c (100%)
>  rename {fftools => libavutil}/objpool.h (100%)
> 

libavutil.v specifies that only symbols with av prefix can be visible
outside of libavutil. So it doesn't work without rename those
functions.

Meanwhile I don't know if it's appropriate to add these functions to
libavutil.