浏览代码

Speed up copy_to_fft_buffer a bit

dds
Pete (El Supremo) 10 年前
父节点
当前提交
764ea901fc
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. +4
    -5
      analyze_fft256.cpp

+ 4
- 5
analyze_fft256.cpp 查看文件

@@ -40,15 +40,14 @@ void AudioAnalyzeFFT256::init(void)
//outputflag = false;
}

// 140312 - PAH - slightly faster copy
static void copy_to_fft_buffer(void *destination, const void *source)
{
const int16_t *src = (const int16_t *)source;
int16_t *dst = (int16_t *)destination;
const uint16_t *src = (const uint16_t *)source;
uint32_t *dst = (uint32_t *)destination;

// TODO: optimize this
for (int i=0; i < AUDIO_BLOCK_SAMPLES; i++) {
*dst++ = *src++; // real
*dst++ = 0; // imaginary
*dst++ = *src++; // real sample plus a zero for imaginary
}
}


正在加载...
取消
保存