📄 rsdecoder.h
字号:
#ifndef _RSDEC
#define _RSDEC
#include "GF.h"
#include "Polynom.h"
#include "RSParam.h"
//#include "BMA.h"
//#include "KVA.h"
//#include "SoftDecShell.h"
#include "EncodeCores.h"
typedef bool (*HDecFunc)(GFE*, const GFE*, const RSCodeParam&, void*);
typedef bool (*SDecFunc)(GFE*, const double*, const RSCodeParam&, void*);
//typedef void (*InitAlgFunc)(void*, const RSCodeParam&, const DecAlgInterface&);
typedef void (*CloseAlgFunc)(void*);
struct DecAlgInterface {
void* DecAlgRegs;
// InitAlgFunc InitDecAlg;
CloseAlgFunc CloseDecAlg;
HDecFunc DecodeOneWord_Hard;
SDecFunc DecodeOneWord_Soft;
bool isHardDecoder;
int AlgStructSize;
};
enum DecAlg {
BMA,
//SDShell,
KVA,
VoidDec
};
/*
static DecAlgInterface DecodeAlgs[]= {
//{InitFunc, CloseFunc, HDecFunc, SDecFunc, IsHard, AlgStructSize}
{InitBMA, CloseBMA, DecodeOneWord_BMA, NULL, true, sizeof(BMARegs)},
//{InitSDec, CloseSDec, NULL, DecodeOneWord_SDec, false, sizeof(SDecStruc)},
{InitKVA, CloseKVA, NULL, DecodeOneWord_KVA, false, sizeof(KVAMember)},
{NULL, NULL, DecodeOneWord_Void, NULL, true, 0}
};
*/
struct DecodeResult {
int succeedNum;
int failureNum;
bool lastframeFail;
bool curframeFail;
bool failureIgnore;
};
struct RSDecoder {
GFE* R;
GFE* C;
RSCodeParam rsp;
byte *decodeblock;
byte masko;
int ib;//输出译码码字的字节块,及指示当前填充码字位置的指针
GFE maskw;//maskw:用于码元的掩码
GFE masktop;
int ir;
double* reliabMat;//可信度矩阵(用一维数组表示)
int col;//指向当前应被填充的可信度矩阵的列
double* symReliab;
int iSymRel;
void* AlgRegs;
bool isHardDecoder;
HDecFunc DecodeOneWord_Hard;
SDecFunc DecodeOneWord_Soft;
// InitAlgFunc InitDecAlg;
CloseAlgFunc CloseDecAlg;
DecodeResult decResult;
};
extern void ResetRSDecoder(RSDecoder& decoder);
extern void InitRSDecoder(RSDecoder&, const RSCodeParam&, const DecAlgInterface&);
extern void CloseRSDecoder(RSDecoder& decoder);
extern int DecodeOneByte(byte b, byte*& outblockp, RSDecoder& dec);
extern int DecodeOneReliabBit(double rel, byte*& output, RSDecoder& dec);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -