diff --git a/inputsource.cpp b/inputsource.cpp index 6012f1b..d68c2e0 100644 --- a/inputsource.cpp +++ b/inputsource.cpp @@ -45,7 +45,7 @@ InputSource::~InputSource() { } void InputSource::GetViewport(float *dest, int x, int y, int width, int height, int zoom) { - fftwf_complex *sample_ptr = &m_data[y * GetOverlap()]; + fftwf_complex *sample_ptr = &m_data[y * GetFFTStride()]; for (int i = 0; i < height; i++) { memcpy(m_fftw_in, sample_ptr, m_fft_size * sizeof(fftw_complex)); @@ -67,14 +67,14 @@ void InputSource::GetViewport(float *dest, int x, int y, int width, int height, *dest = magdb; dest++; } - sample_ptr += GetOverlap(); + sample_ptr += GetFFTStride(); } } int InputSource::GetHeight() { - int lines = m_file_size / sizeof(fftwf_complex) / GetOverlap(); + int lines = m_file_size / sizeof(fftwf_complex) / GetFFTStride(); // Force height to be a multiple of overlap size - return (lines / GetOverlap()) * GetOverlap(); + return (lines / GetFFTStride()) * GetFFTStride(); } int InputSource::GetWidth() { @@ -99,6 +99,6 @@ bool InputSource::ZoomOut() { return true; } -int InputSource::GetOverlap() { +int InputSource::GetFFTStride() { return m_fft_size / pow(2, m_zoom); } diff --git a/inputsource.h b/inputsource.h index 7ce2b3b..3986c2f 100644 --- a/inputsource.h +++ b/inputsource.h @@ -19,7 +19,7 @@ private: int m_zoom; int m_max_zoom; - int GetOverlap(); + int GetFFTStride(); public: