Closed lastrosade closed 2 years ago
I'm not sure how much benefit this provides. Generating the photon noise table is a very quick and deterministic process. Less than 1 second.
Is the concern that the files are cluttering the temp directory? Maybe we can find a way to clean them out even if the encode is interrupted. They should be taking up minimal space though, as these files are also about half a KB each.
I just ran some tests and it takes up to a minute to generate the model on a 1800 frame sample video of mine.
That seems unusual. I'll do some testing and see what's going on with that/if I can reproduce it.
The grain table generation should have nothing to do with the length of the video. It doesn't need to open the video file at all, except to know the width and height.
For reference, here is the code that generates the grain tables: https://github.com/master-of-zen/Av1an/blob/master/av1an-core/src/grain.rs
I can't reproduce the issue anymore when rerunning the same tests.
Currently photon noise generation is generated when the encode start and is kept in the temp dir.
An argument like
--photon-noise-model-path somemodel.tbl
would allow us to reuse the model when encoding the same video.