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

Method build_conditioning

src/models/heartmula/codec.cpp:1406–1420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1404 out[static_cast<size_t>(q * frames + t)] = codes[static_cast<size_t>(t * codebooks + q)];
1405 }
1406 }
1407 return out;
1408}
1409
1410std::vector<int32_t> repeat_codes_to_length(
1411 const std::vector<int32_t> & codes_bqt,
1412 int64_t codebooks,
1413 int64_t frames,
1414 int64_t target_frames) {
1415 if (codebooks <= 0 || frames <= 0 || target_frames <= 0 ||
1416 static_cast<int64_t>(codes_bqt.size()) != codebooks * frames) {
1417 throw std::runtime_error("HeartCodec code repeat shape mismatch");
1418 }
1419 std::vector<int32_t> out(static_cast<size_t>(codebooks * target_frames), 0);
1420 for (int64_t q = 0; q < codebooks; ++q) {
1421 for (int64_t t = 0; t < target_frames; ++t) {
1422 out[static_cast<size_t>(q * target_frames + t)] =
1423 codes_bqt[static_cast<size_t>(q * frames + (t % frames))];

Callers 1

run_flow_chunkFunction · 0.80

Calls 3

release_workspaceMethod · 0.45
matchesMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected