1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-19 14:18:45 -04:00

DATV Demod: Add support for LDPC on Windows. Use Qt worker thread instead of external ldpc_tool process.

This commit is contained in:
Jon Beniston
2022-07-18 16:40:00 +01:00
parent a65c9458ed
commit ff26ece347
10 changed files with 353 additions and 73 deletions
@@ -7,7 +7,14 @@ Copyright 2019 <pabr@pabr.org>
*/
#include <stdlib.h>
#ifndef _MSC_VER
#include <unistd.h>
#else
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#include <io.h>
#include <malloc.h>
#endif
#include <iostream>
#include <iomanip>
#include <random>
@@ -21,6 +28,7 @@ Copyright 2019 <pabr@pabr.org>
#include "algorithms.h"
#include "ldpc.h"
#if 0
#include "flooding_decoder.h"
static const int DEFAULT_TRIALS = 50;
@@ -129,7 +137,7 @@ int main(int argc, char **argv)
int BLOCKS = batch_size;
ldpctool::code_type *code = new ldpctool::code_type[BLOCKS * CODE_LEN];
void *aligned_buffer = aligned_alloc(sizeof(ldpctool::simd_type), sizeof(ldpctool::simd_type) * CODE_LEN);
void *aligned_buffer = ldpctool::LDPCUtil::aligned_malloc(sizeof(ldpctool::simd_type), sizeof(ldpctool::simd_type) * CODE_LEN);
ldpctool::simd_type *simd = reinterpret_cast<ldpctool::simd_type *>(aligned_buffer);
// Expect LLR values in int8_t format.
@@ -212,7 +220,7 @@ int main(int argc, char **argv)
delete ldpc;
free(aligned_buffer);
ldpctool::LDPCUtil::aligned_free(aligned_buffer);
delete[] code;
return 0;