Skip to content
Snippets Groups Projects
Commit fc454577 authored by Dominik Loidolt's avatar Dominik Loidolt
Browse files

add code feedback from Armin

parent 3ef67b3d
No related branches found
No related tags found
1 merge request!2added feature to guess the compression configuration
......@@ -62,8 +62,8 @@ uint16_t cmp_guess_model_value(int n_model_updates)
return 11;
if (n_model_updates <= 21)
return 12;
else
return 13;
return 13;
}
......@@ -84,7 +84,7 @@ static uint32_t pre_cal_method(struct cmp_cfg *cfg)
uint32_t golomb_par_best = 0;
uint32_t spill_best = 0;
for (g = MIN_RDCU_GOLOMB_PAR; g < MAX_RDCU_GOLOMB_PAR; ++g) {
for (g = MIN_RDCU_GOLOMB_PAR; g < MAX_RDCU_GOLOMB_PAR; g++) {
uint32_t s = cmp_get_good_spill(g, cfg->cmp_mode);
cfg->golomb_par = g;
......@@ -133,8 +133,8 @@ static uint32_t brute_force(struct cmp_cfg *cfg)
printf("0%%... ");
fflush(stdout);
for (g = MIN_RDCU_GOLOMB_PAR; g < MAX_RDCU_GOLOMB_PAR; ++g) {
for (s = MIN_RDCU_SPILL; s < get_max_spill(g, cfg->cmp_mode); ++s) {
for (g = MIN_RDCU_GOLOMB_PAR; g < MAX_RDCU_GOLOMB_PAR; g++) {
for (s = MIN_RDCU_SPILL; s < get_max_spill(g, cfg->cmp_mode); s++) {
cfg->golomb_par = g;
cfg->spill = s;
......
......@@ -426,9 +426,9 @@ uint32_t get_max_spill(unsigned int golomb_par, unsigned int cmp_mode)
return LUT_MAX_RDCU[golomb_par];
} else {
if (golomb_par > MAX_ICU_GOLOMB_PAR)
if (golomb_par > MAX_ICU_GOLOMB_PAR) {
return 0;
else {
} else {
/* the ICU compressor can generate code words with a length of
* maximal 32 bits. */
unsigned int max_cw_bits = 32;
......
......@@ -250,7 +250,7 @@ static void remove_spaces(char *s)
do {
while (*d == ' ' || *d == '\t')
++d;
d++;
} while ((*s++ = *d++) != '\0');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment