mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-20 21:56:30 +01:00
Inrease the export "chunk size" to speed it up over 10% at least in some situations
git-svn-id: svn://localhost/ardour2/branches/3.0@12919 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
aa76272ae7
commit
d54d26e822
2 changed files with 16 additions and 4 deletions
|
|
@ -32,6 +32,7 @@ namespace AudioGrapher {
|
||||||
class SampleRateConverter;
|
class SampleRateConverter;
|
||||||
class PeakReader;
|
class PeakReader;
|
||||||
class Normalizer;
|
class Normalizer;
|
||||||
|
template <typename T> class Chunker;
|
||||||
template <typename T> class SampleFormatConverter;
|
template <typename T> class SampleFormatConverter;
|
||||||
template <typename T> class Interleaver;
|
template <typename T> class Interleaver;
|
||||||
template <typename T> class SndfileWriter;
|
template <typename T> class SndfileWriter;
|
||||||
|
|
@ -209,12 +210,14 @@ class ExportGraphBuilder
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef boost::shared_ptr<AudioGrapher::Interleaver<Sample> > InterleaverPtr;
|
typedef boost::shared_ptr<AudioGrapher::Interleaver<Sample> > InterleaverPtr;
|
||||||
|
typedef boost::shared_ptr<AudioGrapher::Chunker<Sample> > ChunkerPtr;
|
||||||
|
|
||||||
ExportGraphBuilder & parent;
|
ExportGraphBuilder & parent;
|
||||||
FileSpec config;
|
FileSpec config;
|
||||||
boost::ptr_list<SilenceHandler> children;
|
boost::ptr_list<SilenceHandler> children;
|
||||||
InterleaverPtr interleaver;
|
InterleaverPtr interleaver;
|
||||||
framecnt_t max_frames;
|
ChunkerPtr chunker;
|
||||||
|
framecnt_t max_frames_out;
|
||||||
};
|
};
|
||||||
|
|
||||||
Session const & session;
|
Session const & session;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#include "ardour/export_graph_builder.h"
|
#include "ardour/export_graph_builder.h"
|
||||||
|
|
||||||
#include "audiographer/process_context.h"
|
#include "audiographer/process_context.h"
|
||||||
|
#include "audiographer/general/chunker.h"
|
||||||
#include "audiographer/general/interleaver.h"
|
#include "audiographer/general/interleaver.h"
|
||||||
#include "audiographer/general/normalizer.h"
|
#include "audiographer/general/normalizer.h"
|
||||||
#include "audiographer/general/peak_reader.h"
|
#include "audiographer/general/peak_reader.h"
|
||||||
|
|
@ -474,11 +475,18 @@ ExportGraphBuilder::ChannelConfig::ChannelConfig (ExportGraphBuilder & parent, F
|
||||||
typedef ExportChannelConfiguration::ChannelList ChannelList;
|
typedef ExportChannelConfiguration::ChannelList ChannelList;
|
||||||
|
|
||||||
config = new_config;
|
config = new_config;
|
||||||
max_frames = parent.session.engine().frames_per_cycle();
|
|
||||||
|
|
||||||
|
framecnt_t max_frames = parent.session.engine().frames_per_cycle();
|
||||||
interleaver.reset (new Interleaver<Sample> ());
|
interleaver.reset (new Interleaver<Sample> ());
|
||||||
interleaver->init (new_config.channel_config->get_n_chans(), max_frames);
|
interleaver->init (new_config.channel_config->get_n_chans(), max_frames);
|
||||||
|
|
||||||
|
// Make the chunk size divisible by the channel count
|
||||||
|
int chan_count = new_config.channel_config->get_n_chans();
|
||||||
|
max_frames_out = 8192;
|
||||||
|
max_frames_out -= max_frames_out % chan_count;
|
||||||
|
chunker.reset (new Chunker<Sample> (max_frames_out));
|
||||||
|
interleaver->add_output(chunker);
|
||||||
|
|
||||||
ChannelList const & channel_list = config.channel_config->get_channels();
|
ChannelList const & channel_list = config.channel_config->get_channels();
|
||||||
unsigned chan = 0;
|
unsigned chan = 0;
|
||||||
for (ChannelList::const_iterator it = channel_list.begin(); it != channel_list.end(); ++it, ++chan) {
|
for (ChannelList::const_iterator it = channel_list.begin(); it != channel_list.end(); ++it, ++chan) {
|
||||||
|
|
@ -498,6 +506,8 @@ ExportGraphBuilder::ChannelConfig::ChannelConfig (ExportGraphBuilder & parent, F
|
||||||
void
|
void
|
||||||
ExportGraphBuilder::ChannelConfig::add_child (FileSpec const & new_config)
|
ExportGraphBuilder::ChannelConfig::add_child (FileSpec const & new_config)
|
||||||
{
|
{
|
||||||
|
assert (*this == new_config);
|
||||||
|
|
||||||
for (boost::ptr_list<SilenceHandler>::iterator it = children.begin(); it != children.end(); ++it) {
|
for (boost::ptr_list<SilenceHandler>::iterator it = children.begin(); it != children.end(); ++it) {
|
||||||
if (*it == new_config) {
|
if (*it == new_config) {
|
||||||
it->add_child (new_config);
|
it->add_child (new_config);
|
||||||
|
|
@ -505,9 +515,8 @@ ExportGraphBuilder::ChannelConfig::add_child (FileSpec const & new_config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
framecnt_t const max_frames_out = new_config.channel_config->get_n_chans() * max_frames;
|
|
||||||
children.push_back (new SilenceHandler (parent, new_config, max_frames_out));
|
children.push_back (new SilenceHandler (parent, new_config, max_frames_out));
|
||||||
interleaver->add_output (children.back().sink ());
|
chunker->add_output (children.back().sink ());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue