|
| 1 | +// This file is part of OpenCV project. |
| 2 | +// It is subject to the license terms in the LICENSE file found in the top-level directory |
| 3 | +// of this distribution and at http://opencv.org/license.html. |
| 4 | + |
| 5 | +#include "perf_precomp.hpp" |
| 6 | + |
| 7 | +using namespace std; |
| 8 | +using namespace cv; |
| 9 | +using namespace perf; |
| 10 | + |
| 11 | +namespace opencv_test { namespace { |
| 12 | + |
| 13 | +typedef TestBaseWithParam< tuple<uint32_t, uint32_t, uint32_t> > TestResampleFunc; |
| 14 | + |
| 15 | +PERF_TEST_P( TestResampleFunc, resample_sin_signal, |
| 16 | + testing::Combine( |
| 17 | + testing::Values(1234U, 12345U, 123456U, 1234567U, 12345678U), |
| 18 | + testing::Values(16000U, 32000U, 44100U, 48000U), |
| 19 | + testing::Values(48000U, 44100U, 32000U, 16000U)) |
| 20 | +) |
| 21 | +{ |
| 22 | + uint32_t sample_signal_size = GET_PARAM(0); |
| 23 | + uint32_t inFreq = GET_PARAM(1); |
| 24 | + uint32_t outFreq = GET_PARAM(2); |
| 25 | + |
| 26 | + Mat1f sample_signal(Size(sample_signal_size,1U)); |
| 27 | + Mat1f outSignal(Size(1U, 1U)); |
| 28 | + for (uint32_t i = 0U; i < (uint32_t)sample_signal.cols; ++i) |
| 29 | + { |
| 30 | + sample_signal.at<float>(0, i) = sinf(float(i)); |
| 31 | + } |
| 32 | + declare.in(sample_signal).out(outSignal); |
| 33 | + TEST_CYCLE() resampleSignal(sample_signal, outSignal, inFreq, outFreq); |
| 34 | + SANITY_CHECK_NOTHING(); |
| 35 | +} |
| 36 | + |
| 37 | +}} |
0 commit comments