MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / pad1d_reflect_fast

Function pad1d_reflect_fast

src/models/demucs/frontend.cpp:70–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void pad1d_reflect_fast(
71 std::vector<float> & out,
72 const std::vector<float> & signal,
73 int64_t channels,
74 int64_t samples,
75 const std::vector<int32_t> & indices) {
76 const int64_t out_len = static_cast<int64_t>(indices.size());
77 out.resize(static_cast<size_t>(channels * out_len));
78#ifdef _OPENMP
79 #pragma omp parallel for if(channels >= 2)
80#endif
81 for (int64_t ch = 0; ch < channels; ++ch) {
82 const float * src = signal.data() + static_cast<size_t>(ch * samples);
83 float * dst = out.data() + static_cast<size_t>(ch * out_len);
84 for (int64_t i = 0; i < out_len; ++i) {
85 dst[i] = src[indices[static_cast<size_t>(i)]];
86 }
87 }
88}
89
90void compute_stft_complex_normalized(
91 std::vector<float> & framed,

Callers 1

prepare_chunkMethod · 0.85

Calls 3

sizeMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected