[FFmpeg-devel] [PATCH 12/42] avcodec/decode: Use RefStruct API for hwaccel_picture_private

Lynne dev at lynne.ee
Mon Oct 2 15:30:56 EEST 2023


Sep 19, 2023, 21:58 by andreas.rheinhardt at outlook.com:

> Avoids allocations and therefore error checks: Syncing
> hwaccel_picture_private across threads can't fail any more.
> Also gets rid of an unnecessary pointer in structures and
> in the parameter list of ff_hwaccel_frame_priv_alloc().
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
>  libavcodec/av1dec.c           | 15 ++++-----------
>  libavcodec/av1dec.h           |  4 +---
>  libavcodec/decode.c           | 28 ++++++----------------------
>  libavcodec/decode.h           | 10 +++-------
>  libavcodec/h264_picture.c     | 19 +++++--------------
>  libavcodec/h264_slice.c       |  3 +--
>  libavcodec/h264dec.h          |  1 -
>  libavcodec/hevc_refs.c        |  7 +++----
>  libavcodec/hevcdec.c          | 11 ++---------
>  libavcodec/hevcdec.h          |  3 +--
>  libavcodec/hwaccel_internal.h |  3 ++-
>  libavcodec/mpegpicture.c      | 18 +++++-------------
>  libavcodec/mpegpicture.h      |  1 -
>  libavcodec/vp8.c              | 14 ++++----------
>  libavcodec/vp8.h              |  4 +---
>  libavcodec/vp9.c              | 15 +++++----------
>  libavcodec/vp9shared.h        |  3 +--
>  libavcodec/vulkan_av1.c       |  9 +++------
>  libavcodec/vulkan_h264.c      |  9 +++------
>  libavcodec/vulkan_hevc.c      |  9 +++------
>  20 files changed, 53 insertions(+), 133 deletions(-)
>

Patchhset works and tests fine.

I've reviewed the code in this patch. Looks good,
and it reduces a constant per-frame free/alloc.

Thanks


More information about the ffmpeg-devel mailing list