Commit 5305c82d authored by Kevin JOLY's avatar Kevin JOLY

Rename reds decoder to flooded

parent 960737fe
......@@ -23,9 +23,9 @@ SRC= \
../src/CDecoder/template/CDecoder.cpp \
../src/CDecoder/template/CDecoder_fixed.cpp \
../src/CDecoder/template/CDecoder_fixed_SSE.cpp \
../src/CDecoder/template/CDecoder_fixed_reds.cpp \
../src/CDecoder/template/CDecoder_fixed_flooded.cpp \
../src/CDecoder/OMS/CDecoder_OMS_fixed_SSE.cpp \
../src/CDecoder/MS/CDecoder_MS_fixed_reds.cpp \
../src/CDecoder/MS/CDecoder_MS_fixed_flooded.cpp \
../src/CDecoder/NMS/CDecoder_NMS_fixed_SSE.cpp \
../src/CEncoder/CFakeEncoder.cpp \
../src/CEncoder/Encoder.cpp \
......
......@@ -34,7 +34,7 @@ using namespace std;
#include "./NMS/CDecoder_NMS_fixed_SSE.h"
#include "./NMS/CDecoder_NMS_fixed_AVX.h"
#include "./MS/CDecoder_MS_fixed_reds.h"
#include "./MS/CDecoder_MS_fixed_flooded.h"
#define UNAVAILABLE { cout << "(EE) Error, decoder unavailable" << endl; \
cout << "(EE) - decoder type : " << type << endl; \
......@@ -123,8 +123,8 @@ CDecoder* CreateDecoder(
}
} else if(type.compare("MS") == 0) {
if(format.compare("fixed") == 0 && arch.compare("reds") == 0) {
CDecoder_MS_fixed_reds *dec = new CDecoder_MS_fixed_reds();
if(format.compare("fixed") == 0 && arch.compare("flooded") == 0) {
CDecoder_MS_fixed_flooded *dec = new CDecoder_MS_fixed_flooded();
return dec;
}
else {
......
#include "CDecoder_MS_fixed_reds.h"
#include "CDecoder_MS_fixed_flooded.h"
CDecoder_MS_fixed_reds::CDecoder_MS_fixed_reds()
CDecoder_MS_fixed_flooded::CDecoder_MS_fixed_flooded()
{
const size_t nb_edges = _M;
const size_t nb_rows = _K;
......@@ -59,21 +59,21 @@ CDecoder_MS_fixed_reds::CDecoder_MS_fixed_reds()
}
}
CDecoder_MS_fixed_reds::~CDecoder_MS_fixed_reds()
CDecoder_MS_fixed_flooded::~CDecoder_MS_fixed_flooded()
{
delete p_vn_addr;
delete p_cn_addr;
}
void CDecoder_MS_fixed_reds::decode(
void CDecoder_MS_fixed_flooded::decode(
char var_nodes[],
char Rprime_fix[],
int nombre_iterations)
{
char *llr_vn = var_nodes;
char *vn = CDecoder_fixed_reds::var_nodes;
char *vn_msgs = CDecoder_fixed_reds::var_msgs;
char *cn_msgs = CDecoder_fixed_reds::check_msgs;
char *vn = CDecoder_fixed_flooded::var_nodes;
char *vn_msgs = CDecoder_fixed_flooded::var_msgs;
char *cn_msgs = CDecoder_fixed_flooded::check_msgs;
size_t vn_deg = vn_deg_max;
size_t cn_deg = cn_deg_max;
const size_t nb_vn = _N; // _N is number of VN
......@@ -99,13 +99,15 @@ void CDecoder_MS_fixed_reds::decode(
/* FIXME : in DVB-S2, the H matrix has one row with different degree:
* the last one. */
cn_deg = cn_idx == (nb_cn-1) ? DEG_2 : cn_deg_max;
cn_deg = cn_idx == (nb_cn-1) ? DEG_2 : cn_deg_max; /* TODO JKI Move this out of loops */
/* TODO JKI : compute cn_idx*cn_deg_max once for all */
/* We compute a different estimate (the message sent), for each
* neighbouring VN */
for(size_t edge_idx = 0; edge_idx < cn_deg; edge_idx++) {
char sign = -1;
char minLLR = 127;
/* TODO JKI : compute global sign and minLLR */
for(size_t other_edge_idx = 0; other_edge_idx < cn_deg; other_edge_idx++) {
if(other_edge_idx == edge_idx) continue;
char msg = *p_vn_addr[cn_idx*cn_deg_max + other_edge_idx];
......
#ifndef CDECODER_MS_FIXED_REDS_H
#define CDECODER_MS_FIXED_REDS_H
#ifndef CDECODER_MS_FIXED_FLOODED_H
#define CDECODER_MS_FIXED_FLOODED_H
#include "../template/CDecoder_fixed_reds.h"
#include "../template/CDecoder_fixed_flooded.h"
class CDecoder_MS_fixed_reds : public CDecoder_fixed_reds {
class CDecoder_MS_fixed_flooded : public CDecoder_fixed_flooded {
protected:
char **p_vn_addr; // From a CN perspective, the addresses of all neighbouring VNs
char **p_cn_addr; // From a VN perspective, the addresses of all neighbouring CNs
public:
CDecoder_MS_fixed_reds();
~CDecoder_MS_fixed_reds();
CDecoder_MS_fixed_flooded();
~CDecoder_MS_fixed_flooded();
void decode(char var_nodes[], char Rprime_fix[], int nombre_iterations);
private:
};
#endif
\ No newline at end of file
#endif
#include "./CDecoder_fixed_reds.h"
#include "./CDecoder_fixed_flooded.h"
#include "./Constantes/constantes_sse.h"
CDecoder_fixed_reds::CDecoder_fixed_reds()
CDecoder_fixed_flooded::CDecoder_fixed_flooded()
{
var_nodes = new char[NOEUD];
var_nodes = new char[NOEUD];
var_msgs = new char[vn_deg_max * _N];
check_msgs = new char[cn_deg_max * _K];
}
CDecoder_fixed_reds::~CDecoder_fixed_reds()
CDecoder_fixed_flooded::~CDecoder_fixed_flooded()
{
//delete var_nodes;
delete var_msgs;
delete check_msgs;
}
void CDecoder_fixed_reds::decode(float var_nodes[], char Rprime_fix[], int nombre_iterations)
void CDecoder_fixed_flooded::decode(float var_nodes[], char Rprime_fix[], int nombre_iterations)
{
}
#ifndef __CDecoder_reds_
#define __CDecoder_reds_
#ifndef __CDecoder_flooded_
#define __CDecoder_flooded_
#include "../../Constantes/constantes_sse.h"
......@@ -9,7 +9,7 @@
#include "./CDecoder_fixed.h"
class CDecoder_fixed_reds : public CDecoder_fixed {
class CDecoder_fixed_flooded : public CDecoder_fixed {
protected:
const size_t cn_deg_max = DEG_1;
const size_t vn_deg_max = DEG_VN_MAX; // FIXME : find this constant somewhere
......@@ -18,8 +18,8 @@ protected:
char *var_nodes;
public:
CDecoder_fixed_reds();
virtual ~CDecoder_fixed_reds();
CDecoder_fixed_flooded();
virtual ~CDecoder_fixed_flooded();
virtual void decode(char var_nodes[], char Rprime_fix[], int nombre_iterations) = 0;
virtual void decode(float var_nodes[], char Rprime_fix[], int nombre_iterations);
};
......
......@@ -285,8 +285,8 @@ int main(int argc, char* argv[]) {
arch = "x86";
nb_frames = 1;
} else if(strcmp(argv[p], "-reds") == 0) {
arch = "reds";
} else if(strcmp(argv[p], "-flooded") == 0) {
arch = "flooded";
nb_frames = 1;
} else if (strcmp(argv[p], "-NMS") == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment