diff options
author | Niklas Haas <git@haasn.dev> | 2021-08-17 21:25:32 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-08-24 09:58:52 -0300 |
commit | 6bc29a6b571c83058d04dc7b8b0f827dfee31b2c (patch) | |
tree | 1ef02885ae312ecb9097a30da956b6f5d996a228 /libavcodec/qcelpdec.c | |
parent | cf37c3fb6c84d8eb61079520b4c57e3c969bc25d (diff) | |
download | ffmpeg-6bc29a6b571c83058d04dc7b8b0f827dfee31b2c.tar.gz |
avcodec/h274: add film grain synthesis routine
This could arguably also be a vf, but I decided to put it here since
decoders are technically required to apply film grain during the output
step, and I would rather want to avoid requiring users insert the
correct film grain synthesis filter on their own.
The code, while in C, is written in a way that unrolls/vectorizes fairly
well under -O3, and is reasonably cache friendly. On my CPU, a single
thread pushes about 400 FPS at 1080p.
Apart from hand-written assembly, one possible avenue of improvement
would be to change the access order to compute the grain row-by-row
rather than in 8x8 blocks. This requires some redundant PRNG calls, but
would make the algorithm more cache-oblivious.
The implementation has been written to the wording of SMPTE RDD 5-2006
as faithfully as I can manage. However, apart from passing a visual
inspection, no guarantee of correctness can be made due to the lack of
any publicly available reference implementation against which to
compare it.
Signed-off-by: Niklas Haas <git@haasn.dev>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/qcelpdec.c')
0 files changed, 0 insertions, 0 deletions