Skip to content

Commit

Permalink
dtv: Expand LDPC lut array size for worst case table generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
drmpeg authored and mbr0wn committed Feb 17, 2019
1 parent d33816f commit 3a533f7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
17 changes: 16 additions & 1 deletion gr-dtv/lib/dvb/dvb_ldpc_bb_impl.cc
Expand Up @@ -380,7 +380,21 @@ for (int row = 0; row < ROWS; row++) { /* count the entries in the table */ \
} \
max_lut_arraysize *= 360; /* 360 bits per table entry */ \
max_lut_arraysize /= pbits; /* spread over all parity bits */ \
max_lut_arraysize += 2; /* 1 for the size at the start of the array, one as buffer */ \
for (int i = 0; i < FRAME_SIZE_NORMAL; i++) { \
ldpc_lut_index[i] = 1; \
} \
for (int row = 0; row < ROWS; row++) { \
for (int n = 0; n < 360; n++) { \
for (int col = 1; col <= TABLE_NAME[row][0]; col++) { \
int current_pbit = (TABLE_NAME[row][col] + (n * q)) % pbits; \
ldpc_lut_index[current_pbit]++; \
if (ldpc_lut_index[current_pbit] > max_index) { \
max_index = ldpc_lut_index[current_pbit]; \
} \
} \
} \
} \
max_lut_arraysize += 1 + (max_index - max_lut_arraysize); /* 1 for the size at the start of the array */ \
\
/* Allocate a 2D Array with pbits * max_lut_arraysize
* while preserving two-subscript access
Expand Down Expand Up @@ -417,6 +431,7 @@ for (int row = 0; row < ROWS; row++) { \
int pbits = (frame_size_real + Xp) - nbch; //number of parity bits
int q = q_val;
int max_lut_arraysize = 0;
int max_index = 0;

if (frame_size_type == FECFRAME_NORMAL) {
if (code_rate == C1_4) {
Expand Down
1 change: 1 addition & 0 deletions gr-dtv/lib/dvb/dvb_ldpc_bb_impl.h
Expand Up @@ -45,6 +45,7 @@ namespace gr {
int Xp;
unsigned char puncturing_buffer[FRAME_SIZE_NORMAL];
unsigned char shortening_buffer[FRAME_SIZE_NORMAL];
int ldpc_lut_index[FRAME_SIZE_NORMAL];
void ldpc_lookup_generate(void);

int** ldpc_lut;
Expand Down

0 comments on commit 3a533f7

Please sign in to comment.