MCPcopy Create free account
hub / github.com/SatDump/SatDump / get_best_ldpc_decoder

Function get_best_ldpc_decoder

src-core/common/codings/ldpc/ldpc_decoder.cpp:20–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 }
19
20 LDPCDecoder *get_best_ldpc_decoder(Sparse_matrix pcm)
21 {
22 std::map<std::string, std::function<LDPCDecoder *(Sparse_matrix)>> decoder_list;
23
24 satdump::eventBus->fire_event<GetLDPCDecodersEvent>({decoder_list});
25 decoder_list.insert({"generic", [](Sparse_matrix pcm)
26 { return new LDPCDecoderGeneric(pcm); }});
27
28 cpu_features::cpu_features_t cpu_caps = cpu_features::get_cpu_features();
29
30 if (cpu_caps.CPU_X86_AVX2 && decoder_list.count("avx2") > 0)
31 return decoder_list["avx2"](pcm);
32 else if (cpu_caps.CPU_X86_SSE41 && decoder_list.count("sse41") > 0)
33 return decoder_list["sse41"](pcm);
34 else if (cpu_caps.CPU_ARM_NEON && decoder_list.count("neon") > 0)
35 return decoder_list["neon"](pcm);
36 else
37 return decoder_list["generic"](pcm);
38 }
39 }
40}

Callers 1

init_decMethod · 0.85

Calls 2

get_cpu_featuresFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected