From 0fc3ae397e281035627ad8848b4a50c093ae5e4f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 21 Dec 2015 13:24:16 +0000 Subject: [PATCH] Increase number of frames stored in memory before write (#748). --- ChangeLog | 2 ++ src/lib/writer.cc | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0cdf8131b..ec4c1c988 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2015-12-21 c.hetherington + * Reduce frequency of temporary writes to disk (#748). + * Use new Dolby website for both Doremi and Dolby certificates (#775). 2015-12-18 c.hetherington 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 -- 2.30.2