aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mjpegenc.h
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2021-08-17 21:25:32 +0200
committerJames Almer <jamrial@gmail.com>2021-08-24 09:58:52 -0300
commit6bc29a6b571c83058d04dc7b8b0f827dfee31b2c (patch)
tree1ef02885ae312ecb9097a30da956b6f5d996a228 /libavcodec/mjpegenc.h
parentcf37c3fb6c84d8eb61079520b4c57e3c969bc25d (diff)
downloadffmpeg-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/mjpegenc.h')
0 files changed, 0 insertions, 0 deletions