Commit 1334ec13 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Update coding parameters to include rounds.

parent ff6388a4
Pipeline #1490 failed with stages
in 2 minutes and 1 second
......@@ -14,7 +14,10 @@ PrrtCodingParams *PrrtCodingParams_create(void)
PrrtCodingParams_update(cpar, K_START, N_START);
cpar->n_p = N_P_START;
cpar->c = 1;
cpar->n_cycle = (uint8_t*) calloc(sizeof(uint8_t), cpar->c);
cpar->n_cycle[0] = (cpar->n - cpar->k);
return cpar;
......@@ -27,6 +30,12 @@ bool PrrtCodingParams_update(PrrtCodingParams *cpar, uint8_t k, uint8_t n) {
cpar->k = k;
cpar->n = n;
cpar->r = cpar->n - cpar->k;
cpar->c = 1;
if(cpar->n_cycle != NULL) {
free(cpar->n_cycle);
}
cpar->n_cycle = (uint8_t*) calloc(sizeof(uint8_t), cpar->c);
cpar->n_cycle[0] = (cpar->n - cpar->k);
PrrtCoder_get_coder(&cpar->coder, n, k);
return true;
}
......@@ -36,6 +45,10 @@ bool PrrtCodingParams_destroy(PrrtCodingParams * cpar) {
PrrtCoder_destroy(cpar->coder);
if(cpar->n_cycle != NULL) {
free(cpar->n_cycle);
}
free(cpar);
return true;
}
......@@ -12,7 +12,8 @@ typedef struct prrtCodingParams {
uint8_t k;
uint8_t r;
uint8_t n;
uint8_t n_p;
uint8_t c;
uint8_t* n_cycle;
PrrtCoder* coder;
} PrrtCodingParams;
......
Supports Markdown
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