| 299 | float median_like_torch_1d(std::vector<float> values) { |
| 300 | if (values.empty()) { |
| 301 | throw std::runtime_error("Seed-VC V1 f0 adjustment requires voiced F0 values"); |
| 302 | } |
| 303 | const size_t median_index = (values.size() - 1) / 2; |
| 304 | std::nth_element(values.begin(), values.begin() + static_cast<std::ptrdiff_t>(median_index), values.end()); |
| 305 | return values[median_index]; |
| 306 | } |
| 307 | |
| 308 | std::vector<float> adjust_source_f0_like_python( |
| 309 | const std::vector<float> & source_f0, |
| 310 | const std::vector<float> & target_f0, |
| 311 | bool auto_f0_adjust, |
no outgoing calls
no test coverage detected