ffmpeg/libavcodec/vvc
Andreas Rheinhardt c9168717bf avcodec/h274: Make H274FilmGrainDatabase a shared object
Right now, the private contexts of every decoder supporting
H.274 film grain synthesis (namely H.264, HEVC and VVC)
contain a H274FilmGrainDatabase; said structure is very large
700442B before this commit) and takes up the overwhelming
majority of said contexts: Removing it reduces sizeof(H264Context)
by 92.88%, sizeof(HEVCContext) by 97.78% and sizeof(VVCContext)
by 99.86%. This is especially important for H.264 and HEVC
when using frame-threading.

The content of said film grain database does not depend on
any input parameter; it is shareable between all its users and
could be hardcoded in the binary (but isn't, because it is so huge).

This commit adds a database with static storage duration to h274.c
and uses it instead of the elements in the private contexts above.
It is still lazily initialized as-needed; a mutex is used
for the necessary synchronization. An alternative would be to use
an AV_ONCE to initialize the whole database either in the decoders'
init function (which would be wasteful given that most videos
don't use film grain synthesis) or in ff_h274_apply_film_grain().

Reviewed-by: Niklas Haas <ffmpeg@haasn.dev>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2025-09-22 04:54:22 +02:00
..
cabac.c lavc/vvc: Add max parameter to kth_order_egk_decode 2025-07-28 20:46:10 +01:00
cabac.h lavc/vvc: Add max parameter to kth_order_egk_decode 2025-07-28 20:46:10 +01:00
ctu.c avcodec/vvc/ctu: should use the width and height of the start component 2025-08-08 16:55:12 +00:00
ctu.h avcodec/vvc/ctu: add palette support 2025-05-17 09:22:40 +08:00
data.c
data.h avcodec/vvc/data: Mark tables as hidden 2025-09-17 22:48:39 +02:00
dec.c avcodec/h274: Make H274FilmGrainDatabase a shared object 2025-09-22 04:54:22 +02:00
dec.h avcodec/h274: Make H274FilmGrainDatabase a shared object 2025-09-22 04:54:22 +02:00
dsp.c
dsp.h avcodec/vvc/intra: make lmcs_scale_chroma inplace 2025-05-17 09:22:40 +08:00
dsp_template.c avcodec/vvc/intra: refact, predict jcbcr to tb->coeffs 2025-05-17 09:22:40 +08:00
filter.c lavc/vvc: Avoid UB in DB strength derivation for PLT CUs 2025-05-24 21:50:46 +08:00
filter.h
filter_template.c
inter.c
inter.h
inter_template.c
intra.c all: fix whitespace/new-line issues 2025-08-03 13:48:47 +02:00
intra.h avcodec/vvc/intra: add ff_vvc_palette_derive_scale 2025-05-17 09:22:40 +08:00
intra_template.c avcodec/vvc/intra: make lmcs_scale_chroma inplace 2025-05-17 09:22:40 +08:00
intra_utils.c all: fix typos found by codespell 2025-08-03 13:48:47 +02:00
itx_1d.c
itx_1d.h
Makefile avcodec/vvc: support decoding prefix and suffix nal units 2025-05-31 09:35:54 +08:00
mvs.c all: fix typos found by codespell 2025-08-03 13:48:47 +02:00
mvs.h avcodec/vvc: refact, save pf and ciip_flag in ff_vvc_set_intra_mvf 2025-05-17 09:22:40 +08:00
ps.c lavc/vvc: Mark SPS used if multiple CLVSSs use it 2025-08-02 15:04:39 +00:00
ps.h
refs.c avcodec/vvc/refs: remove early return 2025-06-28 15:16:45 +02:00
refs.h
sei.c avcodec/vvc: parse all SEI messages 2025-06-12 21:17:07 +08:00
sei.h avcodec/vvc/sei: add decode_frame_field_info 2025-05-31 09:35:54 +08:00
thread.c avcodec: Add av_cold to flush,init,close functions missing it 2025-09-13 20:37:03 +00:00
thread.h