Commit 262177f4 authored by Florian Kaltenberger's avatar Florian Kaltenberger

patch 2 from Milan Zivkovic (Nokia Bell Labs)

parent d6f3297f
...@@ -310,12 +310,18 @@ int test_ldpc(short No_iteration, ...@@ -310,12 +310,18 @@ int test_ldpc(short No_iteration,
} }
stop_meas(&time); stop_meas(&time);
start_meas(time_optim); /* start_meas(time_optim);
ldpc_encoder_optim_8seg(test_input,channel_input_optim,block_length,BG,n_segments,&tinput,&tprep,&tparity,&toutput); ldpc_encoder_optim_8seg(test_input,channel_input_optim,block_length,BG,n_segments,&tinput,&tprep,&tparity,&toutput);
/*for(j=0;j<n_segments;j++) { for(j=0;j<n_segments;j++) {
ldpc_encoder_optim(test_input[j],channel_input_optim[j],block_length,BG,&tinput,&tprep,&tparity,&toutput); ldpc_encoder_optim(test_input[j],channel_input_optim[j],block_length,BG,&tinput,&tprep,&tparity,&toutput);
}*/ }
stop_meas(time_optim);*/
for(j=0;j<(n_segments%8+1);j++) {
start_meas(time_optim);
ldpc_encoder_optim_8seg_multi(test_input,channel_input_optim,block_length, BG, n_segments,j,&tinput,&tprep,&tparity,&toutput);
stop_meas(time_optim); stop_meas(time_optim);
}
if (ntrials==1) if (ntrials==1)
for (j=0;j<n_segments;j++) for (j=0;j<n_segments;j++)
...@@ -398,15 +404,18 @@ int test_ldpc(short No_iteration, ...@@ -398,15 +404,18 @@ int test_ldpc(short No_iteration,
decParams.outMode = nrLDPC_outMode_BIT; decParams.outMode = nrLDPC_outMode_BIT;
//decParams.outMode =nrLDPC_outMode_LLRINT8; //decParams.outMode =nrLDPC_outMode_LLRINT8;
start_meas(time_decoder);
for(j=0;j<n_segments;j++) { for(j=0;j<n_segments;j++) {
start_meas(time_decoder);
// decode the sequence // decode the sequence
// decoder supports BG2, Z=128 & 256 // decoder supports BG2, Z=128 & 256
//esimated_output=ldpc_decoder(channel_output_fixed, block_length, No_iteration, (double)((float)nom_rate/(float)denom_rate)); //esimated_output=ldpc_decoder(channel_output_fixed, block_length, No_iteration, (double)((float)nom_rate/(float)denom_rate));
///nrLDPC_decoder(&decParams, channel_output_fixed, estimated_output, NULL); ///nrLDPC_decoder(&decParams, channel_output_fixed, estimated_output, NULL);
n_iter = nrLDPC_decoder(&decParams, (int8_t*)channel_output_fixed[j], (int8_t*)estimated_output[j], p_decoder_profiler); n_iter = nrLDPC_decoder(&decParams, (int8_t*)channel_output_fixed[j], (int8_t*)estimated_output[j], p_decoder_profiler);
}
stop_meas(time_decoder); stop_meas(time_decoder);
}
//for (i=(Kb+nrows) * Zc-5;i<(Kb+nrows) * Zc;i++) //for (i=(Kb+nrows) * Zc-5;i<(Kb+nrows) * Zc;i++)
// printf("esimated_output[%d]=%d\n",i,esimated_output[i]); // printf("esimated_output[%d]=%d\n",i,esimated_output[i]);
...@@ -528,8 +537,6 @@ int main(int argc, char *argv[]) ...@@ -528,8 +537,6 @@ int main(int argc, char *argv[])
time_stats_t time_optim[10], time_decoder[10]; time_stats_t time_optim[10], time_decoder[10];
n_iter_stats_t dec_iter[3]; n_iter_stats_t dec_iter[3];
short BG,Zc,Kb; short BG,Zc,Kb;
while ((c = getopt (argc, argv, "q:r:s:S:l:n:d:i:t:u:h")) != -1) while ((c = getopt (argc, argv, "q:r:s:S:l:n:d:i:t:u:h")) != -1)
......
...@@ -38,6 +38,7 @@ int encode_parity_check_part_orig(unsigned char *c,unsigned char *d, short BG,sh ...@@ -38,6 +38,7 @@ int encode_parity_check_part_orig(unsigned char *c,unsigned char *d, short BG,sh
void encode_parity_check_part_optim(uint8_t *c,uint8_t *d, short BG,short Zc,short Kb); void encode_parity_check_part_optim(uint8_t *c,uint8_t *d, short BG,short Zc,short Kb);
int ldpc_encoder_optim(unsigned char *test_input,unsigned char *channel_input,short block_length,short BG,time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput); int ldpc_encoder_optim(unsigned char *test_input,unsigned char *channel_input,short block_length,short BG,time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput);
int ldpc_encoder_optim_8seg(unsigned char **test_input,unsigned char **channel_input,short block_length,short BG,int n_segments,time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput); int ldpc_encoder_optim_8seg(unsigned char **test_input,unsigned char **channel_input,short block_length,short BG,int n_segments,time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput);
int ldpc_encoder_optim_8seg_multi(unsigned char **test_input,unsigned char **channel_input,short block_length, short BG, int n_segments,unsigned int macro_num, time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput);
/*ldpc_generate_coefficient.c*/ /*ldpc_generate_coefficient.c*/
int ldpc_encoder_orig(unsigned char *test_input,unsigned char *channel_input,short block_length,short BG,unsigned char gen_code); int ldpc_encoder_orig(unsigned char *test_input,unsigned char *channel_input,short block_length,short BG,unsigned char gen_code);
......
...@@ -518,10 +518,10 @@ int ldpc_encoder_optim_8seg(unsigned char **test_input,unsigned char **channel_i ...@@ -518,10 +518,10 @@ int ldpc_encoder_optim_8seg(unsigned char **test_input,unsigned char **channel_i
return 0; return 0;
} }
int ldpc_encoder_optim_8seg_multi(unsigned char **test_input,unsigned char **channel_input,short block_length,int nom_rate,int denom_rate,int n_segments,unsigned int macro_num, time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput) int ldpc_encoder_optim_8seg_multi(unsigned char **test_input,unsigned char **channel_input,short block_length, short BG, int n_segments,unsigned int macro_num, time_stats_t *tinput,time_stats_t *tprep,time_stats_t *tparity,time_stats_t *toutput)
{ {
short BG,Zc,Kb,nrows,ncols; short Zc,Kb,nrows,ncols;
int i,i1,j; int i,i1,j;
int no_punctured_columns,removed_bit; int no_punctured_columns,removed_bit;
//Table of possible lifting sizes //Table of possible lifting sizes
...@@ -555,14 +555,14 @@ int ldpc_encoder_optim_8seg_multi(unsigned char **test_input,unsigned char **cha ...@@ -555,14 +555,14 @@ int ldpc_encoder_optim_8seg_multi(unsigned char **test_input,unsigned char **cha
///AssertFatal(n_segments>0&&n_segments<=8,"0 < n_segments %d <= 8\n",n_segments); ///AssertFatal(n_segments>0&&n_segments<=8,"0 < n_segments %d <= 8\n",n_segments);
//determine number of bits in codeword //determine number of bits in codeword
if (block_length>3840) if (BG==1)
{ {
BG=1; BG=1;
Kb = 22; Kb = 22;
nrows=46; //parity check bits nrows=46; //parity check bits
ncols=22; //info bits ncols=22; //info bits
} }
else if (block_length<=3840) else if (BG==2)
{ {
BG=2; BG=2;
nrows=42; //parity check bits nrows=42; //parity check bits
......
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