ffmpeg/libavcodec/hevc
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 all: fix whitespace/new-line issues 2025-08-03 13:48:47 +02:00
data.c
data.h
dsp.c lavc/hevc: R-V V put_pixels(pow2) 2024-12-17 09:21:20 +08:00
dsp.h lavc/hevc: R-V V put_pixels(pow2) 2024-12-17 09:21:20 +08:00
dsp_template.c avcodec/hevc: ff_hevc_(qpel/epel)_filters are signed type 2024-09-14 16:36:34 +08:00
filter.c lavc/hevcdec: make a HEVCFrame hold a reference to its PPS 2024-09-06 13:59:29 +02:00
hevc.h avcodec/hevc/ps: Add basic HEVC_SCALABILITY_AUXILIARY support 2025-02-17 15:08:42 +08:00
hevcdec.c avcodec/h274: Make H274FilmGrainDatabase a shared object 2025-09-22 04:54:22 +02:00
hevcdec.h avcodec/h274: Make H274FilmGrainDatabase a shared object 2025-09-22 04:54:22 +02:00
Makefile avcodec/hevc/Makefile: Move rules for lavc/* files to lavc/Makefile 2024-06-09 10:59:33 +02:00
mvs.c lavc/hevcdec: make a HEVCFrame hold a reference to its PPS 2024-09-06 13:59:29 +02:00
parse.c lavc/hevcdec/parse: process NALUs with nuh_layer_id>0 2024-09-23 17:11:40 +02:00
parse.h
parser.c lavc/hevc/parser: only split packets on NALUs with nuh_layer_id=0 2024-09-23 17:11:40 +02:00
pred.c
pred.h lavc/hevc/pred: stop accessing parameter sets through HEVCParamSets 2024-06-11 17:39:34 +02:00
pred_template.c avcodec: use the renamed av_zero_extend 2024-06-13 20:36:09 -03:00
ps.c avcodec/get_bits: Add get_bits_bytesize() 2025-07-11 15:13:21 +02:00
ps.h all: Fix doxy comments wrongly designated as trailing ///< 2025-03-12 17:00:24 +01:00
ps_enc.c
refs.c avcodec/decode: Only use ff_progress_frame_get_buffer() with blank input 2025-04-14 10:15:08 +02:00
sei.c avcodec/hevc: Add support for output_corrupt/showall flags 2025-02-20 11:39:52 +08:00
sei.h avcodec/hevc: Add support for output_corrupt/showall flags 2025-02-20 11:39:52 +08:00