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 calcMagnitudes (const std::complex< float > *src, float *dst, int32_t n)
 
void convertPolarToCartesian (const float *srcMag, const float *srcPh, 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 37 of file VectorOps.h.

38{
39 for (int32_t i = 0; i < n; i++)
40 dst[i] = src1[i] + src2[i];
41}

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 20 of file VectorOps.h.

21{
22 return ::malloc(bytes);
23}

◆ calcMagnitudes()

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

Definition at line 99 of file VectorOps.h.

100{
101 for (int32_t i = 0; i < n; i++)
102 dst[i] = std::abs(src[i]);
103}

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

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 93 of file VectorOps.h.

94{
95 for (int32_t i = 0; i < n; i++)
96 dst[i] = std::arg(src[i]);
97}

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 51 of file VectorOps.h.

52{
53 for (int32_t i = 0; i < n; i++)
54 dst[i] = src[i] * constant;
55}

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 58 of file VectorOps.h.

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

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

Here is the caller graph for this function:

◆ convertPolarToCartesian()

void staffpad::vo::convertPolarToCartesian ( const float *  srcMag,
const float *  srcPh,
std::complex< float > *  dst,
int32_t  n 
)
inline

Definition at line 105 of file VectorOps.h.

106{
107 for (int32_t i = 0; i < n; i++)
108 dst[i] = std::polar<float>(srcMag[i], srcPh[i]);
109}

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

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 31 of file VectorOps.h.

32{
33 memcpy(dst, src, n * sizeof(T));
34}

Referenced by staffpad::TimeAndPitch::_time_stretch(), TrackIter< TrackType >::advance(), MemoryStream::Chunk::Append(), Sequence::AppendBlocksIfConsistent(), LadspaEffectOutputs::Assign(), LV2EffectOutputs::Assign(), staffpad::SamplesFloat< T >::assignSamples(), SpecCache::CalculateOneSpectrum(), TestWaveClipMaker::ClipFilledWith(), AVCodecContextWrapper::ConsumeFrame(), anonymous_namespace{MockSampleBlock.cpp}::copyToVector(), audacity::network_manager::anonymous_namespace{CurlResponse.cpp}::DataStreamRead(), AudioSegmentSampleView::DoCopy(), MockSampleBlock::DoGetSamples(), anonymous_namespace{TimeShiftHandle.cpp}::FindCorrespondence(), SpectrumVRulerControls::HitTest(), WaveformVRulerControls::HitTest(), TimeTrackVRulerControls::HitTest(), NoteTrackVRulerControls::HitTest(), TrackShifter::InitIntervals(), ScreenshotCommand::kCaptureWhatStrings(), 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(), RealtimeEffectState::Process(), Mixer::Process(), TimeAndPitchRealSource::Pull(), staffpad::audio::CircularSampleBuffer< SampleT >::readAndClearBlock(), staffpad::audio::CircularSampleBuffer< SampleT >::readBlock(), audacity::network_manager::CurlResponse::readData(), Sequence::SetSamples(), ToChars(), Vector::Vector(), 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 78 of file VectorOps.h.

79{
80 maxIndex = 0;
81 maxValue = n > 0 ? src[0] : std::numeric_limits<T>::min();
82
83 for (int32_t i = 1; i < n; i++)
84 {
85 if (src[i] > maxValue)
86 {
87 maxValue = src[i];
88 maxIndex = i;
89 }
90 }
91}
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 25 of file VectorOps.h.

26{
27 return ::free(ptr);
28}
void free(void *ptr)
Definition: VectorOps.h:25

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(), Valigned_free(), 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 65 of file VectorOps.h.

66{
67 for (int32_t i = 0; i < n; i++)
68 dst[i] = src1[i] * src2[i];
69}

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

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 72 of file VectorOps.h.

73{
74 std::fill(dst, dst + n, 0.f);
75}

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 44 of file VectorOps.h.

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