Files
ffmpeg/libavcodec
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
..
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-09-03 06:48:02 +00:00
2025-08-03 13:48:47 +02:00
2024-08-14 18:21:01 +02:00
2025-08-08 18:29:41 +09:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-02-04 00:14:14 +01:00
2025-08-03 13:48:47 +02:00
2025-07-29 23:38:16 +02:00
2025-08-03 13:48:47 +02:00
2025-04-27 15:52:30 +01:00
2025-04-27 15:52:30 +01:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-09-02 17:06:25 +02:00
2025-09-02 17:06:25 +02:00
2025-08-07 19:44:59 +00:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:19:25 +00:00
2025-08-03 13:48:47 +02:00
2025-07-03 20:35:23 +02:00
2025-08-11 20:31:09 +02:00
2025-06-23 17:16:42 +10:00
2025-05-13 00:20:23 +02:00
2025-08-03 13:48:47 +02:00
2024-09-28 18:35:35 +02:00
2024-09-28 18:35:35 +02:00
2025-01-01 20:31:08 +01:00
2025-08-03 13:48:47 +02:00
2025-06-06 17:21:37 +02:00
2025-08-03 13:19:25 +00:00
2025-08-03 13:19:25 +00:00
2025-07-20 01:05:23 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-05-09 22:26:51 +02:00
2025-08-06 21:04:56 +00:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-08-08 01:06:11 +09:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-09-02 17:06:25 +02:00
2025-09-02 17:06:25 +02:00
2025-08-08 18:29:40 +09:00
2025-08-08 18:29:40 +09:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-07-03 20:34:51 +02:00
2025-08-03 13:48:47 +02:00
2025-07-03 20:35:23 +02:00
2025-07-03 20:35:32 +02:00
2024-11-03 10:53:15 +11:00
2024-11-03 10:53:15 +11:00
2024-11-03 10:53:15 +11:00
2024-11-03 10:53:15 +11:00
2025-04-02 09:25:46 +02:00
2025-04-02 09:25:46 +02:00
2025-08-11 11:54:31 +02:00
2025-08-03 13:48:47 +02:00
2025-03-20 07:10:17 +01:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2024-10-12 11:21:14 -03:00
2024-10-12 11:21:14 -03:00
2024-10-12 11:21:14 -03:00
2024-11-01 12:13:07 +08:00
2024-09-24 15:37:19 +02:00
2025-08-03 13:48:47 +02:00
2025-06-21 22:08:52 +02:00
2025-08-03 13:48:47 +02:00
2025-08-20 11:20:14 +02:00
2025-08-03 13:48:47 +02:00
2025-08-03 13:48:47 +02:00
2024-10-31 17:49:48 +11:00
2025-04-25 23:01:37 +02:00
2024-10-31 17:49:48 +11:00
2025-08-08 18:29:40 +09:00
2025-08-08 18:29:40 +09:00
2025-08-03 13:48:47 +02:00
2025-08-04 09:12:17 +00:00
2025-07-03 20:35:23 +02:00
2024-09-24 15:37:20 +02:00