Merge remote-tracking branch 'upstream/master' into performance_optimizations

This commit is contained in:
Moreno Razzoli
2021-10-13 20:28:00 +02:00
4 changed files with 871 additions and 867 deletions
+4 -6
View File
@@ -208,12 +208,12 @@ void SampleBuffer::transform_volume_for_sample_on_channel(int sample_index, int
data_[channel][sample_index] *= volume;
}
void SampleBuffer::fill(const float &f)
void SampleBuffer::silence()
{
fill(f, 0, sample_count_per_channel_);
silence(0, sample_count_per_channel_);
}
void SampleBuffer::fill(const float &f, int start_sample, int end_sample)
void SampleBuffer::silence(int start_sample, int end_sample)
{
if (!is_allocated()) {
qWarning() << "Tried to fill an unallocated sample buffer";
@@ -221,9 +221,7 @@ void SampleBuffer::fill(const float &f, int start_sample, int end_sample)
}
for (int i=0;i<audio_params().channel_count();i++) {
for (int j=start_sample;j<end_sample;j++) {
data_[i][j] = f;
}
memset(data_[i].data(), start_sample * sizeof(float), (end_sample-start_sample) * sizeof(float));
}
}
+2 -2
View File
@@ -77,8 +77,8 @@ public:
void transform_volume_for_sample(int sample_index, float volume);
void transform_volume_for_sample_on_channel(int sample_index, int channel, float volume);
void fill(const float& f);
void fill(const float& f, int start_sample, int end_sample);
void silence();
void silence(int start_sample, int end_sample);
void set(int channel, const float* data, int sample_offset, int sample_length);
void set(int channel, const float* data, int sample_length)
+2 -2
View File
@@ -258,7 +258,7 @@ NodeValueTable RenderProcessor::GenerateBlockTable(const Track *track, const Tim
// All these blocks will need to output to a buffer so we create one here
SampleBufferPtr block_range_buffer = SampleBuffer::CreateAllocated(audio_params,
audio_params.time_to_samples(range.length()));
block_range_buffer->fill(0);
block_range_buffer->silence();
NodeValueTable merged_table;
@@ -284,7 +284,7 @@ NodeValueTable RenderProcessor::GenerateBlockTable(const Track *track, const Tim
if (qIsNull(speed_value)) {
// Just silence, don't think there's any other practical application of 0 speed audio
samples_from_this_block->fill(0);
samples_from_this_block->silence();
} else if (!qFuzzyCompare(speed_value, 1.0)) {
// Multiply time
samples_from_this_block->speed(speed_value);
+863 -857
View File
File diff suppressed because it is too large Load Diff