Audacity 3.2.0
Functions
staffpad::vo Namespace Reference

Functions

void * allocate (int32_t bytes)
 
void free (void *ptr)
 
template<class T >
void copy (const T *src, T *dst, int32_t n)
 
template<class T >
void add (const T *src1, const T *src2, T *dst, int32_t n)
 
template<class T >
void subtract (const T *src1, const T *src2, T *dst, int32_t n)
 
template<class T >
void constantMultiply (const T *src, T constant, T *dst, int32_t n)
 
template<class T >
void constantMultiplyAndAdd (const T *src, T constant, T *dst, int32_t n)
 
template<class T >
void multiply (const T *src1, const T *src2, T *dst, int32_t n)
 
template<class T >
void setToZero (T *dst, int32_t n)
 
template<class T >
void findMaxElement (const T *src, int32_t n, int32_t &maxIndex, T &maxValue)
 
void calcPhases (const std::complex< float > *src, float *dst, int32_t n)
 
void calcNorms (const std::complex< float > *src, float *dst, int32_t n)
 
void rotate (const float *oldPhase, const float *newPhase, std::complex< float > *dst, int32_t n)
 

Function Documentation

◆ add()

template<class T >
void staffpad::vo::add ( const T *  src1,
const T *  src2,
T *  dst,
int32_t  n 
)
inline

Definition at line 46 of file VectorOps.h.

47{
48 for (int32_t i = 0; i < n; i++)
49 dst[i] = src1[i] + src2[i];
50}

Referenced by LV2Symbols::Lookup_URI(), PluginRegistrationDialog::RegenerateEffectsList(), and VoiceKey::TestEnergyUpdate().

Here is the caller graph for this function:

◆ allocate()

void * staffpad::vo::allocate ( int32_t  bytes)
inline

Definition at line 29 of file VectorOps.h.

30{
31 return ::malloc(bytes);
32}

◆ calcNorms()

void staffpad::vo::calcNorms ( const std::complex< float > *  src,
float *  dst,
int32_t  n 
)
inline

Definition at line 134 of file VectorOps.h.

135{
136 for (int32_t i = 0; i < n; i++)
137 dst[i] = std::norm(src[i]);
138}
__m128 norm(__m128 x, __m128 y)

References simd_complex_conversions::norm().

Referenced by staffpad::TimeAndPitch::_process_hop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calcPhases()

void staffpad::vo::calcPhases ( const std::complex< float > *  src,
float *  dst,
int32_t  n 
)
inline

Definition at line 128 of file VectorOps.h.

129{
130 for (int32_t i = 0; i < n; i++)
131 dst[i] = std::arg(src[i]);
132}

Referenced by staffpad::TimeAndPitch::_process_hop().

Here is the caller graph for this function:

◆ constantMultiply()

template<class T >
void staffpad::vo::constantMultiply ( const T *  src,
constant,
T *  dst,
int32_t  n 
)
inline

Definition at line 60 of file VectorOps.h.

61{
62 for (int32_t i = 0; i < n; i++)
63 dst[i] = src[i] * constant;
64}

Referenced by staffpad::TimeAndPitch::_process_hop(), and staffpad::audio::CircularSampleBuffer< SampleT >::readBlockWithGain().

Here is the caller graph for this function:

◆ constantMultiplyAndAdd()

template<class T >
void staffpad::vo::constantMultiplyAndAdd ( const T *  src,
constant,
T *  dst,
int32_t  n 
)
inline

Definition at line 67 of file VectorOps.h.

68{
69 for (int32_t i = 0; i < n; i++)
70 dst[i] += src[i] * constant;
71}

Referenced by staffpad::audio::CircularSampleBuffer< SampleT >::readAddBlockWithGain(), and staffpad::audio::CircularSampleBuffer< SampleT >::writeAddBlockWithGain().

Here is the caller graph for this function:

◆ copy()

template<class T >
void staffpad::vo::copy ( const T *  src,
T *  dst,
int32_t  n 
)
inline

Definition at line 40 of file VectorOps.h.

41{
42 memcpy(dst, src, n * sizeof(T));
43}

Referenced by TrackIter< TrackType >::advance(), MemoryStream::Chunk::Append(), Sequence::AppendBlocksIfConsistent(), LadspaEffectOutputs::Assign(), LV2EffectOutputs::Assign(), staffpad::SamplesFloat< T >::assignSamples(), SpecCache::CalculateOneSpectrum(), WaveTrack::ClearAndPaste(), TestWaveClipMaker::ClipFilledWith(), AVCodecContextWrapper::ConsumeFrame(), anonymous_namespace{MockSampleBlock.cpp}::copyToVector(), audacity::network_manager::anonymous_namespace{CurlResponse.cpp}::DataStreamRead(), MockSampleBlock::DoGetSamples(), anonymous_namespace{TimeShiftHandle.cpp}::FindCorrespondence(), LibImportExport::GetAcidizerTags(), SpectrumVRulerControls::HitTest(), WaveformVRulerControls::HitTest(), TimeTrackVRulerControls::HitTest(), NoteTrackVRulerControls::HitTest(), TrackShifter::InitIntervals(), NoteTrack::MakeExportableSeq(), ProjectAudioManager::OnRecord(), WideChannelGroupInterval::ChannelIterator< IntervalType >::operator++(), Channel::IntervalIterator< IntervalType >::operator++(), ChannelGroup::ChannelIterator< ChannelType >::operator++(), ChannelGroup::IntervalIterator< IntervalType >::operator++(), WideChannelGroupInterval::ChannelIterator< IntervalType >::operator--(), Channel::IntervalIterator< IntervalType >::operator--(), ChannelGroup::ChannelIterator< ChannelType >::operator--(), ChannelGroup::IntervalIterator< IntervalType >::operator--(), Vector::operator=(), WaveClip::Paste(), WaveTrack::PasteWaveTrack(), RealtimeEffectState::Process(), OpusExportProcessor::Process(), Mixer::Process(), TimeAndPitchRealSource::Pull(), staffpad::audio::CircularSampleBuffer< SampleT >::readAndClearBlock(), staffpad::audio::CircularSampleBuffer< SampleT >::readBlock(), audacity::network_manager::CurlResponse::readData(), MIR::WavMirAudioReader::ReadFloats(), Sequence::SetSamples(), ToChars(), Vector::Vector(), MIR::WavMirAudioReader::WavMirAudioReader(), OpusExportProcessor::OggPacket::Write(), and staffpad::audio::CircularSampleBuffer< SampleT >::writeBlock().

Here is the caller graph for this function:

◆ findMaxElement()

template<class T >
void staffpad::vo::findMaxElement ( const T *  src,
int32_t  n,
int32_t &  maxIndex,
T &  maxValue 
)
inline

Definition at line 87 of file VectorOps.h.

88{
89 maxIndex = 0;
90 maxValue = n > 0 ? src[0] : std::numeric_limits<T>::min();
91
92 for (int32_t i = 1; i < n; i++)
93 {
94 if (src[i] > maxValue)
95 {
96 maxValue = src[i];
97 maxIndex = i;
98 }
99 }
100}
int min(int a, int b)

References min().

Referenced by staffpad::TimeAndPitch::_time_stretch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free()

void staffpad::vo::free ( void *  ptr)
inline

Definition at line 34 of file VectorOps.h.

35{
36 return ::free(ptr);
37}
void free(void *ptr)
Definition: VectorOps.h:34

References free().

Referenced by staffpad::audio::simd::aligned_free(), AVAllocator< T >::deallocate(), fifo_delete(), SampleBuffer::Free(), free(), ProjectFileIO::GetFreeDiskSpace(), freer::operator()(), RingBuffer::Put(), reverb_delete(), AudioGraph::Buffers::Rotate(), Steinberg::MemoryStream::setSize(), Steinberg::MemoryStream::truncate(), zix_ring_free(), staffpad::audio::CircularSampleBuffer< SampleT >::~CircularSampleBuffer(), and Steinberg::MemoryStream::~MemoryStream().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ multiply()

template<class T >
void staffpad::vo::multiply ( const T *  src1,
const T *  src2,
T *  dst,
int32_t  n 
)
inline

Definition at line 74 of file VectorOps.h.

75{
76 for (int32_t i = 0; i < n; i++)
77 dst[i] = src1[i] * src2[i];
78}

Referenced by staffpad::TimeAndPitch::_process_hop().

Here is the caller graph for this function:

◆ rotate()

void staffpad::vo::rotate ( const float *  oldPhase,
const float *  newPhase,
std::complex< float > *  dst,
int32_t  n 
)
inline

Definition at line 140 of file VectorOps.h.

141{
142 for (int32_t i = 0; i < n; i++) {
143 auto theta = newPhase[i] - oldPhase[i];
144 dst[i] *= std::complex<float>(cosf(theta), sinf(theta));
145 }
146}

Referenced by staffpad::TimeAndPitch::_process_hop(), anonymous_namespace{TrackMenus.cpp}::DoMixAndRender(), SubViewAdjuster::ModifyPermutation(), RealtimeEffectList::MoveEffect(), BenchmarkDialog::OnRun(), SpectrumTransformer::RotateWindows(), and LabelTrack::SortLabels().

Here is the caller graph for this function:

◆ setToZero()

template<class T >
void staffpad::vo::setToZero ( T *  dst,
int32_t  n 
)
inline

Definition at line 81 of file VectorOps.h.

82{
83 std::fill(dst, dst + n, 0.f);
84}

Referenced by staffpad::audio::CircularSampleBuffer< SampleT >::clearBlock(), staffpad::audio::CircularSampleBuffer< SampleT >::readAndClearBlock(), and staffpad::SamplesFloat< T >::zeroOut().

Here is the caller graph for this function:

◆ subtract()

template<class T >
void staffpad::vo::subtract ( const T *  src1,
const T *  src2,
T *  dst,
int32_t  n 
)
inline

Definition at line 53 of file VectorOps.h.

54{
55 for (int32_t i = 0; i < n; i++)
56 dst[i] = src2[i] - src1[i];
57}