diff options
author | Niklas Haas <git@haasn.dev> | 2021-08-17 21:54:56 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-08-24 09:58:52 -0300 |
commit | 66845cffc3bbb17f91294d15cd6f57f3df3bce97 (patch) | |
tree | 413847a6a899872e940d88fd1ad1c34e91631794 /libavcodec/mlp.h | |
parent | 6bc29a6b571c83058d04dc7b8b0f827dfee31b2c (diff) | |
download | ffmpeg-66845cffc3bbb17f91294d15cd6f57f3df3bce97.tar.gz |
avcodec/h264dec: apply H.274 film grain
Because we need access to ref frames without film grain applied, we have
to add an extra AVFrame to H264Picture to avoid messing with the
original. This requires some amount of overhead to make the reference
moves work out, but it allows us to benefit from frame multithreading
for film grain application "for free".
Unfortunately, this approach requires twice as much RAM to be constantly
allocated for ref frames, due to the need for an extra buffer per
H264Picture. In theory, we could get away with freeing up this memory as
soon as it's no longer needed (since ref frames do not need film grain
buffers any longer), but trying to call ff_thread_release_buffer() from
output_frame() conflicts with possible later accesses to that same frame
and I'm not sure how to synchronize that well.
Tested on all three cases of (no fg), (fg present but exported) and (fg
present and not exported), with and without threading.
Co-authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: Niklas Haas <git@haasn.dev>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/mlp.h')
0 files changed, 0 insertions, 0 deletions