diff options
author | Andreas Rheinhardt <[email protected]> | 2025-09-18 17:57:16 +0200 |
---|---|---|
committer | Andreas Rheinhardt <[email protected]> | 2025-09-22 04:54:22 +0200 |
commit | c9168717bf4c7d6f72d5cb02064ce832f4af9c89 (patch) | |
tree | 5c0838cacb8de1e6fe6c6283d0ff025278d650c9 /tests/ref/fate/mss2-pal | |
parent | b5e0d9f648712198e83566ea8a49498127f370d2 (diff) |
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 <[email protected]>
Signed-off-by: Andreas Rheinhardt <[email protected]>
Diffstat (limited to 'tests/ref/fate/mss2-pal')
0 files changed, 0 insertions, 0 deletions