diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-12-21 13:24:16 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-12-21 13:24:16 +0000 |
| commit | 0fc3ae397e281035627ad8848b4a50c093ae5e4f (patch) | |
| tree | 823bc3605a8a953424980fdcba2fdd94244cfe7b /src | |
| parent | b0838292820cf1b3326529fa4d31862b3f9df9f3 (diff) | |
Increase number of frames stored in memory before write (#748).
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/writer.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 93f5ed6d6..47c6b8381 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -570,7 +570,16 @@ operator== (QueueItem const & a, QueueItem const & b) void Writer::set_encoder_threads (int threads) { - _maximum_frames_in_memory = lrint (threads * 1.1); + /* I think the scaling factor here should be the ratio of the longest frame + encode time to the shortest; if the thread count is T, longest time is L + and the shortest time S we could encode L/S frames per thread whilst waiting + for the L frame to encode so we might have to store LT/S frames. + + However we don't want to use too much memory, so keep it a bit lower than we'd + perhaps like. A J2K frame is typically about 1Mb so 3 here will mean we could + use about 240Mb with 72 encoding threads. + */ + _maximum_frames_in_memory = lrint (threads * 3); } void |
