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

Merge branch 'documentation' into 'master'

increase code coverage, general code refactoring

See merge request !12
parents 86c5b5bd 096da76a
Branches
Tags
1 merge request!12increase code coverage, general code refactoring
Showing
with 513 additions and 3539 deletions
[submodule "doc/doxygen/doxygen-awesome-css"]
path = doc/doxygen/doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
...@@ -2,6 +2,19 @@ ...@@ -2,6 +2,19 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [Unreleased] ## [Unreleased]
### Added
- add cross compile file for sparc
- add tests for the compression entity
- add test for cmp_rdcu_cfg.c
- add sparc inttypes.h definitions
###Changed
- refactor function and constants names
- refactor configure check functions
- move the rdcu setup functions to cmp_rdcu_cfg.c
- update Documentation
- update Doxygen setup
### Fixed
- remove memory leaks from tests
## [0.09] - 30-09-2022 ## [0.09] - 30-09-2022
### Added ### Added
...@@ -11,7 +24,7 @@ All notable changes to this project will be documented in this file. ...@@ -11,7 +24,7 @@ All notable changes to this project will be documented in this file.
- add max used bit version field to the compression entity - add max used bit version field to the compression entity
###Changed ###Changed
- Change the build system form make to meson - Change the build system form make to meson
- Change DEFAULT_CFG_MODEL and DEFAULT_CFG_DIFF to CMP_DIF_XXX constats - Change DEFAULT_CFG_MODEL and DEFAULT_CFG_DIFF to CMP_DIF_XXX constants
### Fixed ### Fixed
- now the adaptive compression size (ap1_cmp_size, ap2_cmp_size) is calculate when the --rdcu_par option is used - now the adaptive compression size (ap1_cmp_size, ap2_cmp_size) is calculate when the --rdcu_par option is used
......
...@@ -11,7 +11,9 @@ If you're on Linux, you probably already have these. On macOS and Windows, you c ...@@ -11,7 +11,9 @@ If you're on Linux, you probably already have these. On macOS and Windows, you c
Meson 0.56 or newer is required. Meson 0.56 or newer is required.
You can get meson through your package manager or using: You can get meson through your package manager or using:
```pip3 install meson``` ```
pip3 install meson
```
Check if meson is included in your PATH. Check if meson is included in your PATH.
...@@ -139,7 +141,9 @@ Optional you can install the "dot" tool from [graphviz](http://www.graphviz.org/ ...@@ -139,7 +141,9 @@ Optional you can install the "dot" tool from [graphviz](http://www.graphviz.org/
To generate the documentation you need to run: To generate the documentation you need to run:
``` ```
git submodule update --init
cd <name of the build directory> cd <name of the build directory>
meson compile doc meson compile doc
``` ```
You can find the documentation in the directory **generated_documentation**.
# PLATO Compression/Decompression Tool # PLATO Compression/Decompression Tool
If you find a bug or have a feature request please file an [issue][1] or send If you find a bug or have a feature request please file an [issue](https://gitlab.phaidra.org/loidoltd15/cmp_tool/-/issues) or send
me an [email][2]. me an [email](mailto:dominik.loidolt@univie.ac.at?subject=%5BIssue%5D%20cmp_tool).
Compiled executables can be found [here][3]. The building instructions can be found [here](INSTALL.md). Compiled executables can be found [here](https://gitlab.phaidra.org/loidoltd15/cmp_tool/-/releases). The building instructions can be found [here](INSTALL.md).
## Usage ## Usage
...@@ -21,7 +21,7 @@ Compiled executables can be found [here][3]. The building instructions can be fo ...@@ -21,7 +21,7 @@ Compiled executables can be found [here][3]. The building instructions can be fo
| `-V, --version` | Print program version and exit | | `-V, --version` | Print program version and exit |
| `-v, --verbose` | Print various debugging information | | `-v, --verbose` | Print various debugging information |
<a name="fnote2">1</a>) **NOTE:** If the -o option is not used the `<prefix>` <a name="fnote1">1</a>) **NOTE:** If the -o option is not used the `<prefix>`
will be set to "OUTPUT". will be set to "OUTPUT".
<a name="fnote2">2</a>) **NOTE:** In the default configurations the **samples** <a name="fnote2">2</a>) **NOTE:** In the default configurations the **samples**
and **buffer_length** parameter is set to **0**! and **buffer_length** parameter is set to **0**!
...@@ -33,10 +33,10 @@ and **buffer_length** parameter is set to **0**! ...@@ -33,10 +33,10 @@ and **buffer_length** parameter is set to **0**!
| `-c <file>` | File containing the compressing configuration | | `-c <file>` | File containing the compressing configuration |
| `-d <file>` | File containing the data to be compressed | | `-d <file>` | File containing the data to be compressed |
| `-m <file>` | File containing the model of the data to be compressed | | `-m <file>` | File containing the model of the data to be compressed |
| `--rdcu_pkt` | Generate RMAP packets for an RDCU compression<sup>[3](#fnoot3)</sup> | | `--rdcu_pkt` | Generate RMAP packets for an RDCU compression<sup>[3](#fnote3)</sup> |
| `--last_info <.info file>` | Generate RMAP packets for an RDCU compression with parallel read of the last results | | `--last_info <.info file>` | Generate RMAP packets for an RDCU compression with parallel read of the last results |
<a name="foot3">3</a>) **NOTE:** When using the `--rdcu_pkt` option the <a name="fnote3">3</a>) **NOTE:** When using the `--rdcu_pkt` option the
configuration of the RMAP parameters can be found in the `.rdcu_pkt_mode_cfg file`. configuration of the RMAP parameters can be found in the `.rdcu_pkt_mode_cfg file`.
The generated packets can be found in the `TC_FILES` directory. The generated packets can be found in the `TC_FILES` directory.
...@@ -52,15 +52,15 @@ The generated packets can be found in the `TC_FILES` directory. ...@@ -52,15 +52,15 @@ The generated packets can be found in the `TC_FILES` directory.
| Options | Description | | Options | Description |
|:------------------------|:--------------------------------------------------------------------------------| |:------------------------|:--------------------------------------------------------------------------------|
| `--guess <mode>` | Search for a good configuration for compression \<mode\><sup>[4](#fnoot4)</sup> | | `--guess <mode>` | Search for a good configuration for compression \<mode\><sup>[4](#fnote4)</sup> |
| `-d <file>` | File containing the data to be compressed | | `-d <file>` | File containing the data to be compressed |
| `-m <file>` | File containing the model of the data to be compressed | | `-m <file>` | File containing the model of the data to be compressed |
| `--guess_level <level>` | Set guess level to \<level\> (optional)<sup>[5](#fnoot5)</sup> | | `--guess_level <level>` | Set guess level to \<level\> (optional)<sup>[5](#fnote5)</sup> |
<a name="fnoot4">4</a>) **NOTE:** \<mode\> can be either the compression mode <a name="fnote4">4</a>) **NOTE:** \<mode\> can be either the compression mode
number or the keyword: `RDCU`. The RDCU mode automatically selects the correct number or the keyword: `RDCU`. The RDCU mode automatically selects the correct
RDCU-compatible compression mode depending on if the Model (-m) option is set. RDCU-compatible compression mode depending on if the Model (-m) option is set.
<a name="fnoot5">5</a>) **Supported levels:** <a name="fnote5">5</a>) **Supported levels:**
| guess level | Description | | guess level | Description |
|:------------|:--------------------------------| |:------------|:--------------------------------|
...@@ -86,7 +86,7 @@ You can find the user manual [here](doc). ...@@ -86,7 +86,7 @@ You can find the user manual [here](doc).
A simple example to show how the compression tool works. A simple example to show how the compression tool works.
Instructions on how to perform compression without headers can be found [here](how_to_no_header.md). Instructions on how to perform compression without headers can be found [here](how_to_no_header.md).
0. Download the [tool][3] or [build the tool](INSTALL.md) yourself 0. Download the [tool](https://gitlab.phaidra.org/loidoltd15/cmp_tool/-/releases) or [build the tool](INSTALL.md) yourself
1. Create a configuration file 1. Create a configuration file
* Create a cfg directory * Create a cfg directory
...@@ -132,6 +132,3 @@ Instructions on how to perform compression without headers can be found [here](h ...@@ -132,6 +132,3 @@ Instructions on how to perform compression without headers can be found [here](h
And also check if the updated model is the same And also check if the updated model is the same
`diff compressed/data2_upmodel.dat decompressed/test_data2_upmodel.dat` `diff compressed/data2_upmodel.dat decompressed/test_data2_upmodel.dat`
[1]: <https://gitlab.phaidra.org/loidoltd15/cmp_tool/-/issues> "issues"
[2]: <mailto:dominik.loidolt@univie.ac.at?subject=%5BIssue%5D%20Cmd_Tool> "email"
[3]: <https://gitlab.phaidra.org/loidoltd15/cmp_tool/-/releases> "release"
\ No newline at end of file
/** /**
* @file cmp_tool.c * @file cmp_tool.c
* @author Johannes Seelig (johannes.seelig@univie.ac.at)
* @author Dominik Loidolt (dominik.loidolt@univie.ac.at) * @author Dominik Loidolt (dominik.loidolt@univie.ac.at)
* @author Johannes Seelig (johannes.seelig@univie.ac.at)
* @date 2020 * @date 2020
* *
* @copyright GPLv2 * @copyright GPLv2
...@@ -23,12 +23,11 @@ ...@@ -23,12 +23,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <limits.h> #include <limits.h>
#include <getopt.h> #include <getopt.h>
#include <time.h>
#include "cmp_tool-config.h" #include "cmp_tool-config.h"
#include "cmp_io.h" #include "cmp_io.h"
#include "cmp_icu.h" #include "cmp_icu.h"
#include "cmp_rdcu.h" /*TODO: shift setup to support */ #include "cmp_rdcu.h"
#include "decmp.h" #include "decmp.h"
#include "cmp_guess.h" #include "cmp_guess.h"
#include "cmp_entity.h" #include "cmp_entity.h"
...@@ -42,6 +41,9 @@ ...@@ -42,6 +41,9 @@
#define DEFAULT_MODEL_COUNTER 0 #define DEFAULT_MODEL_COUNTER 0
/* parse a data_type option argument */
static enum cmp_data_type parse_data_type(const char *data_type_str);
/* find a good set of compression parameters for a given dataset */ /* find a good set of compression parameters for a given dataset */
static int guess_cmp_pars(struct cmp_cfg *cfg, const char *guess_cmp_mode, static int guess_cmp_pars(struct cmp_cfg *cfg, const char *guess_cmp_mode,
int guess_level); int guess_level);
...@@ -52,6 +54,11 @@ static int compression(struct cmp_cfg *cfg, struct cmp_info *info); ...@@ -52,6 +54,11 @@ static int compression(struct cmp_cfg *cfg, struct cmp_info *info);
/* decompress the data and write the results in file(s)*/ /* decompress the data and write the results in file(s)*/
static int decompression(struct cmp_entity *ent, uint16_t *input_model_buf); static int decompression(struct cmp_entity *ent, uint16_t *input_model_buf);
/* create a default configuration for a compression data type */
enum cfg_default_opt {DIFF_CFG, MODEL_CFG};
static int cmp_cfg_create_default(struct cmp_cfg *cfg, enum cmp_data_type data_type,
enum cfg_default_opt mode);
/* /*
* For long options that have no equivalent short option, use a * For long options that have no equivalent short option, use a
...@@ -70,12 +77,12 @@ enum { ...@@ -70,12 +77,12 @@ enum {
static const struct option long_options[] = { static const struct option long_options[] = {
{"rdcu_par", no_argument, NULL, 'a'}, {"rdcu_par", no_argument, NULL, 'a'},
{"model_cfg", no_argument, NULL, 'n'}, {"model_cfg", optional_argument, NULL, 'n'},
{"help", no_argument, NULL, 'h'}, {"help", no_argument, NULL, 'h'},
{"verbose", no_argument, NULL, 'v'}, {"verbose", no_argument, NULL, 'v'},
{"version", no_argument, NULL, 'V'}, {"version", no_argument, NULL, 'V'},
{"rdcu_pkt", no_argument, NULL, RDCU_PKT_OPTION}, {"rdcu_pkt", no_argument, NULL, RDCU_PKT_OPTION},
{"diff_cfg", no_argument, NULL, DIFF_CFG_OPTION}, {"diff_cfg", optional_argument, NULL, DIFF_CFG_OPTION},
{"guess", required_argument, NULL, GUESS_OPTION}, {"guess", required_argument, NULL, GUESS_OPTION},
{"guess_level", required_argument, NULL, GUESS_LEVEL}, {"guess_level", required_argument, NULL, GUESS_LEVEL},
{"last_info", required_argument, NULL, LAST_INFO}, {"last_info", required_argument, NULL, LAST_INFO},
...@@ -182,6 +189,9 @@ int main(int argc, char **argv) ...@@ -182,6 +189,9 @@ int main(int argc, char **argv)
break; break;
case 'n': /* --model_cfg */ case 'n': /* --model_cfg */
print_model_cfg = 1; print_model_cfg = 1;
cfg.data_type = parse_data_type(optarg);
if (cfg.data_type == DATA_TYPE_UNKNOWN)
exit(EXIT_FAILURE);
break; break;
case 'o': case 'o':
output_prefix = optarg; output_prefix = optarg;
...@@ -195,6 +205,9 @@ int main(int argc, char **argv) ...@@ -195,6 +205,9 @@ int main(int argc, char **argv)
break; break;
case DIFF_CFG_OPTION: case DIFF_CFG_OPTION:
print_diff_cfg = 1; print_diff_cfg = 1;
cfg.data_type = parse_data_type(optarg);
if (cfg.data_type == DATA_TYPE_UNKNOWN)
exit(EXIT_FAILURE);
break; break;
case GUESS_OPTION: case GUESS_OPTION:
guess_operation = 1; guess_operation = 1;
...@@ -262,30 +275,18 @@ int main(int argc, char **argv) ...@@ -262,30 +275,18 @@ int main(int argc, char **argv)
#endif #endif
if (print_model_cfg == 1) { if (print_model_cfg == 1) {
cfg = rdcu_cfg_create(CMP_DEF_IMA_MODEL_DATA_TYPE, CMP_DEF_IMA_MODEL_CMP_MODE, if (add_rdcu_pars)
CMP_DEF_IMA_MODEL_MODEL_VALUE, CMP_DEF_IMA_MODEL_LOSSY_PAR); cfg.data_type = DATA_TYPE_IMAGETTE_ADAPTIVE;
rdcu_cfg_buffers(&cfg, NULL, 0, NULL, CMP_DEF_IMA_MODEL_RDCU_DATA_ADR, cmp_cfg_create_default(&cfg, cfg.data_type, MODEL_CFG);
CMP_DEF_IMA_MODEL_RDCU_MODEL_ADR, CMP_DEF_IMA_MODEL_RDCU_UP_MODEL_ADR, cmp_cfg_print(&cfg);
CMP_DEF_IMA_MODEL_RDCU_BUFFER_ADR, 0);
rdcu_cfg_imagette(&cfg,
CMP_DEF_IMA_MODEL_GOLOMB_PAR, CMP_DEF_IMA_MODEL_SPILL_PAR,
CMP_DEF_IMA_MODEL_AP1_GOLOMB_PAR, CMP_DEF_IMA_MODEL_AP1_SPILL_PAR,
CMP_DEF_IMA_MODEL_AP2_GOLOMB_PAR, CMP_DEF_IMA_MODEL_AP2_SPILL_PAR);
print_cfg(&cfg, add_rdcu_pars);
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
if (print_diff_cfg == 1) { if (print_diff_cfg == 1) {
cfg = rdcu_cfg_create(CMP_DEF_IMA_DIFF_DATA_TYPE, CMP_DEF_IMA_DIFF_CMP_MODE, if (add_rdcu_pars)
CMP_DEF_IMA_DIFF_MODEL_VALUE, CMP_DEF_IMA_DIFF_LOSSY_PAR); cfg.data_type = DATA_TYPE_IMAGETTE_ADAPTIVE;
rdcu_cfg_buffers(&cfg, NULL, 0, NULL, CMP_DEF_IMA_DIFF_RDCU_DATA_ADR, cmp_cfg_create_default(&cfg, cfg.data_type, DIFF_CFG);
CMP_DEF_IMA_DIFF_RDCU_MODEL_ADR, CMP_DEF_IMA_DIFF_RDCU_UP_MODEL_ADR, cmp_cfg_print(&cfg);
CMP_DEF_IMA_DIFF_RDCU_BUFFER_ADR, 0);
rdcu_cfg_imagette(&cfg,
CMP_DEF_IMA_DIFF_GOLOMB_PAR, CMP_DEF_IMA_DIFF_SPILL_PAR,
CMP_DEF_IMA_DIFF_AP1_GOLOMB_PAR, CMP_DEF_IMA_DIFF_AP1_SPILL_PAR,
CMP_DEF_IMA_DIFF_AP2_GOLOMB_PAR, CMP_DEF_IMA_DIFF_AP2_SPILL_PAR);
print_cfg(&cfg, add_rdcu_pars);
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
...@@ -316,7 +317,7 @@ int main(int argc, char **argv) ...@@ -316,7 +317,7 @@ int main(int argc, char **argv)
if (cmp_operation) { if (cmp_operation) {
printf("## Starting the compression ##\n"); printf("## Starting the compression ##\n");
printf("Importing configuration file %s ... ", cfg_file_name); printf("Importing configuration file %s ... ", cfg_file_name);
error = read_cmp_cfg(cfg_file_name, &cfg, verbose_en); error = cmp_cfg_read(cfg_file_name, &cfg, verbose_en);
if (error) if (error)
goto fail; goto fail;
printf("DONE\n"); printf("DONE\n");
...@@ -327,11 +328,12 @@ int main(int argc, char **argv) ...@@ -327,11 +328,12 @@ int main(int argc, char **argv)
printf("Importing data file %s ... ", data_file_name); printf("Importing data file %s ... ", data_file_name);
/* count the samples in the data file when samples == 0 */ /* count the samples in the data file when samples == 0 */
if (cfg.samples == 0) { if (cfg.samples == 0) {
int samples; int32_t samples;
size = read_file_data(data_file_name, cfg.data_type, NULL, 0, 0); size = read_file_data(data_file_name, cfg.data_type, NULL, 0, 0);
if (size <= 0 || size > UINT32_MAX) /* empty file is treated as an error */ if (size <= 0 || size > UINT32_MAX) /* empty file is treated as an error */
goto fail; goto fail;
samples = cmp_input_size_to_samples(size, cfg.data_type); samples = cmp_input_size_to_samples((uint32_t)size, cfg.data_type);
if (samples < 0) if (samples < 0)
goto fail; goto fail;
cfg.samples = (uint32_t)samples; cfg.samples = (uint32_t)samples;
...@@ -359,7 +361,7 @@ int main(int argc, char **argv) ...@@ -359,7 +361,7 @@ int main(int argc, char **argv)
uint32_t cmp_size_byte; uint32_t cmp_size_byte;
printf("Importing decompression information file %s ... ", info_file_name); printf("Importing decompression information file %s ... ", info_file_name);
error = read_cmp_info(info_file_name, &info, verbose_en); error = cmp_info_read(info_file_name, &info, verbose_en);
if (error) if (error)
goto fail; goto fail;
printf("DONE\n"); printf("DONE\n");
...@@ -521,7 +523,29 @@ fail: ...@@ -521,7 +523,29 @@ fail:
} }
/* find a good set of compression parameters for a given dataset */ /**
* @brief parse a data_type option argument
*/
static enum cmp_data_type parse_data_type(const char *data_type_str)
{
/* default data type if no optional argument is used */
enum cmp_data_type data_type = DATA_TYPE_IMAGETTE;
if (data_type_str) {
data_type = string2data_type(optarg);
if (data_type == DATA_TYPE_UNKNOWN)
printf("Do not recognize %s compression data type.\n",
data_type_str);
}
return data_type;
}
/**
* @brief find a good set of compression parameters for a given dataset
*/
static int guess_cmp_pars(struct cmp_cfg *cfg, const char *guess_cmp_mode, static int guess_cmp_pars(struct cmp_cfg *cfg, const char *guess_cmp_mode,
int guess_level) int guess_level)
{ {
...@@ -563,7 +587,7 @@ static int guess_cmp_pars(struct cmp_cfg *cfg, const char *guess_cmp_mode, ...@@ -563,7 +587,7 @@ static int guess_cmp_pars(struct cmp_cfg *cfg, const char *guess_cmp_mode,
printf("DONE\n"); printf("DONE\n");
printf("Write the guessed compression configuration to file %s.cfg ... ", output_prefix); printf("Write the guessed compression configuration to file %s.cfg ... ", output_prefix);
error = write_cfg(cfg, output_prefix, add_rdcu_pars, verbose_en); error = cmp_cfg_fo_file(cfg, output_prefix, verbose_en);
if (error) if (error)
return -1; return -1;
printf("DONE\n"); printf("DONE\n");
...@@ -575,7 +599,10 @@ static int guess_cmp_pars(struct cmp_cfg *cfg, const char *guess_cmp_mode, ...@@ -575,7 +599,10 @@ static int guess_cmp_pars(struct cmp_cfg *cfg, const char *guess_cmp_mode,
} }
/* generate packets to setup an RDCU compression */ /**
* @brief generate packets to setup an RDCU compression
*/
static int gen_rdcu_write_pkts(struct cmp_cfg *cfg) static int gen_rdcu_write_pkts(struct cmp_cfg *cfg)
{ {
int error; int error;
...@@ -591,7 +618,7 @@ static int gen_rdcu_write_pkts(struct cmp_cfg *cfg) ...@@ -591,7 +618,7 @@ static int gen_rdcu_write_pkts(struct cmp_cfg *cfg)
/* generation of packets for parallel read/write RDCU setup */ /* generation of packets for parallel read/write RDCU setup */
struct cmp_info last_info = {0}; struct cmp_info last_info = {0};
error = read_cmp_info(last_info_file_name, &last_info, verbose_en); error = cmp_info_read(last_info_file_name, &last_info, verbose_en);
if (error) { if (error) {
fprintf(stderr, "%s: %s: Importing last decompression information file failed.\n", fprintf(stderr, "%s: %s: Importing last decompression information file failed.\n",
PROGRAM_NAME, last_info_file_name); PROGRAM_NAME, last_info_file_name);
...@@ -687,7 +714,10 @@ static int cmp_gernate_rdcu_info(const struct cmp_cfg *cfg, int cmp_size_bit, ...@@ -687,7 +714,10 @@ static int cmp_gernate_rdcu_info(const struct cmp_cfg *cfg, int cmp_size_bit,
} }
/* compress the data and write the results to files */ /**
* @brief compress the data and write the results to files
*/
static int compression(struct cmp_cfg *cfg, struct cmp_info *info) static int compression(struct cmp_cfg *cfg, struct cmp_info *info)
{ {
int cmp_size, error; int cmp_size, error;
...@@ -735,6 +765,7 @@ static int compression(struct cmp_cfg *cfg, struct cmp_info *info) ...@@ -735,6 +765,7 @@ static int compression(struct cmp_cfg *cfg, struct cmp_info *info)
if (model_id_str) { if (model_id_str) {
uint32_t red_val; uint32_t red_val;
error = atoui32("model_id", model_id_str, &red_val); error = atoui32("model_id", model_id_str, &red_val);
if (error || red_val > UINT16_MAX) if (error || red_val > UINT16_MAX)
return -1; return -1;
...@@ -742,6 +773,7 @@ static int compression(struct cmp_cfg *cfg, struct cmp_info *info) ...@@ -742,6 +773,7 @@ static int compression(struct cmp_cfg *cfg, struct cmp_info *info)
} }
if (model_counter_str) { if (model_counter_str) {
uint32_t red_val; uint32_t red_val;
error = atoui32("model_counter", model_counter_str, &red_val); error = atoui32("model_counter", model_counter_str, &red_val);
if (error || red_val > UINT8_MAX) if (error || red_val > UINT8_MAX)
return -1; return -1;
...@@ -791,7 +823,7 @@ static int compression(struct cmp_cfg *cfg, struct cmp_info *info) ...@@ -791,7 +823,7 @@ static int compression(struct cmp_cfg *cfg, struct cmp_info *info)
if (!include_cmp_header) { if (!include_cmp_header) {
printf("Write decompression information to file %s.info ... ", printf("Write decompression information to file %s.info ... ",
output_prefix); output_prefix);
error = write_info(info, output_prefix, add_rdcu_pars); error = cmp_info_to_file(info, output_prefix, add_rdcu_pars);
if (error) if (error)
goto error_cleanup; goto error_cleanup;
printf("DONE\n"); printf("DONE\n");
...@@ -816,7 +848,10 @@ error_cleanup: ...@@ -816,7 +848,10 @@ error_cleanup:
} }
/* decompress the data and write the results in file(s)*/ /**
* @brief decompress the data and write the results in file(s)
*/
static int decompression(struct cmp_entity *ent, uint16_t *input_model_buf) static int decompression(struct cmp_entity *ent, uint16_t *input_model_buf)
{ {
int error; int error;
...@@ -861,3 +896,47 @@ static int decompression(struct cmp_entity *ent, uint16_t *input_model_buf) ...@@ -861,3 +896,47 @@ static int decompression(struct cmp_entity *ent, uint16_t *input_model_buf)
return 0; return 0;
} }
/**
* @brief create a default configuration for a compression data type
*/
static int cmp_cfg_create_default(struct cmp_cfg *cfg, enum cmp_data_type data_type,
enum cfg_default_opt mode)
{
if (cmp_data_type_is_invalid(data_type))
return -1;
if (!cfg) /* nothing to do */
return 0;
if (cmp_imagette_data_type_is_used(data_type)) {
switch (mode) {
case MODEL_CFG:
*cfg = rdcu_cfg_create(data_type, CMP_DEF_IMA_MODEL_CMP_MODE,
CMP_DEF_IMA_MODEL_MODEL_VALUE, CMP_DEF_IMA_MODEL_LOSSY_PAR);
rdcu_cfg_buffers(cfg, NULL, 0, NULL, CMP_DEF_IMA_MODEL_RDCU_DATA_ADR,
CMP_DEF_IMA_MODEL_RDCU_MODEL_ADR, CMP_DEF_IMA_MODEL_RDCU_UP_MODEL_ADR,
CMP_DEF_IMA_MODEL_RDCU_BUFFER_ADR, 0);
rdcu_cfg_imagette(cfg,
CMP_DEF_IMA_MODEL_GOLOMB_PAR, CMP_DEF_IMA_MODEL_SPILL_PAR,
CMP_DEF_IMA_MODEL_AP1_GOLOMB_PAR, CMP_DEF_IMA_MODEL_AP1_SPILL_PAR,
CMP_DEF_IMA_MODEL_AP2_GOLOMB_PAR, CMP_DEF_IMA_MODEL_AP2_SPILL_PAR);
break;
case DIFF_CFG:
*cfg = rdcu_cfg_create(data_type, CMP_DEF_IMA_DIFF_CMP_MODE,
CMP_DEF_IMA_DIFF_MODEL_VALUE, CMP_DEF_IMA_DIFF_LOSSY_PAR);
rdcu_cfg_buffers(cfg, NULL, 0, NULL, CMP_DEF_IMA_DIFF_RDCU_DATA_ADR,
CMP_DEF_IMA_DIFF_RDCU_MODEL_ADR, CMP_DEF_IMA_DIFF_RDCU_UP_MODEL_ADR,
CMP_DEF_IMA_DIFF_RDCU_BUFFER_ADR, 0);
rdcu_cfg_imagette(cfg,
CMP_DEF_IMA_DIFF_GOLOMB_PAR, CMP_DEF_IMA_DIFF_SPILL_PAR,
CMP_DEF_IMA_DIFF_AP1_GOLOMB_PAR, CMP_DEF_IMA_DIFF_AP1_SPILL_PAR,
CMP_DEF_IMA_DIFF_AP2_GOLOMB_PAR, CMP_DEF_IMA_DIFF_AP2_SPILL_PAR);
break;
}
}
/* TODO: implement other data types */
return 0;
}
This diff is collapsed.
This diff is collapsed.
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.11 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<detaileddescription title=""/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<detaileddescription title=""/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<detaileddescription title=""/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<detaileddescription title=""/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>
This diff is collapsed.
This diff is collapsed.
/*
h1, .h1, h2, .h2, h3, .h3{
font-weight: 200 !important;
}
*/
h1,.h1 {
font-size: 24px;
}
h2,.h2 {
font-size: 20px;
}
h3,.h3 {
font-size: 16px;
}
h4,.h4 {
font-size: 14px;
}
h5,.h5 {
font-size: 12px;
}
h6,.h6 {
font-size: 10px;
}
#navrow1, #navrow2, #navrow3, #navrow4, #navrow5{
border-bottom: 1px solid #706d6e;
}
.adjust-right {
margin-left: 30px !important;
font-size: 1.15em !important;
}
.navbar{
border: 0px solid #222 !important;
}
/* Sticky footer styles
-------------------------------------------------- */
html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}
img {
max-width:100%;
max-height:100%;
}
/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto;
/* Negative indent footer by its height */
margin: 0 auto -60px;
/* Pad bottom by footer height */
padding: 0 0 60px;
}
/* Set the fixed height of the footer here */
#footer {
font-size: 0.9em;
padding: 8px 0px;
background-color: #f5f5f5;
}
.footer-row {
line-height: 44px;
}
#footer > .container {
padding-left: 15px;
padding-right: 15px;
}
.footer-follow-icon {
margin-left: 3px;
text-decoration: none !important;
}
.footer-follow-icon img {
width: 20px;
}
.footer-link {
padding-top: 5px;
display: inline-block;
color: #999999;
text-decoration: none;
}
.footer-copyright {
text-align: center;
}
@media (min-width: 992px) {
.footer-row {
text-align: left;
}
.footer-icons {
text-align: right;
}
}
@media (max-width: 991px) {
.footer-row {
text-align: center;
}
.footer-icons {
text-align: center;
}
}
/* DOXYGEN Code Styles
----------------------------------- */
div.ingroups {
font-size: 16pt;
width: 50%;
text-align: left;
padding-top: 10px;
}
a.qindex {
font-size: 8pt;
}
a.qindexHL {
font-size: 9pt;
font-weight: bold;
background-color: #9CAFD4;
color: #ffffff;
border: 1px double #869DCA;
}
.contents a.qindexHL:visited {
color: #ffffff;
}
a.code, a.code:visited, a.line, a.line:visited {
color: #4665A2;
}
a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited {
color: #4665A2;
}
/* @end */
dl.el {
margin-left: -1cm;
}
pre.fragment {
border: 1px solid #C4CFE5;
background-color: #FBFCFD;
padding: 4px 6px;
margin: 4px 8px 4px 2px;
overflow: auto;
word-wrap: break-word;
font-size: 8pt;
line-height: 125%;
font-family: monospace, fixed;
}
div.navtab {
text-align: left;
padding-left: 5px;
margin-right: 5px;
}
div.fragment {
padding: 4px 6px;
margin: 4px 8px 4px 2px;
border: 1px solid #C4CFE5;
}
div.line {
font-family: monospace, fixed;
font-size: 13px;
min-height: 13px;
line-height: 1.0;
text-wrap: unrestricted;
white-space: -moz-pre-wrap; /* Moz */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: pre-wrap; /* CSS3 */
word-wrap: break-word; /* IE 5.5+ */
text-indent: -53px;
padding-left: 53px;
padding-bottom: 0px;
margin: 0px;
-webkit-transition-property: background-color, box-shadow;
-webkit-transition-duration: 0.5s;
-moz-transition-property: background-color, box-shadow;
-moz-transition-duration: 0.5s;
-ms-transition-property: background-color, box-shadow;
-ms-transition-duration: 0.5s;
-o-transition-property: background-color, box-shadow;
-o-transition-duration: 0.5s;
transition-property: background-color, box-shadow;
transition-duration: 0.5s;
}
div.line.glow {
background-color: cyan;
box-shadow: 0 0 10px cyan;
}
span.lineno {
padding-right: 4px;
text-align: right;
border-right: 2px solid #0F0;
background-color: #E8E8E8;
white-space: pre;
}
span.lineno a {
background-color: #D8D8D8;
}
span.lineno a:hover {
background-color: #C8C8C8;
}
div.groupHeader {
margin-left: 16px;
margin-top: 12px;
font-weight: bold;
}
div.groupText {
margin-left: 16px;
font-style: italic;
}
.caption {
font-weight: bold;
padding-top: 10px;
padding-bottom: 20px;
}
/* @group Code Colorization */
span.keyword {
color: #008000
}
span.keywordtype {
color: #604020
}
span.keywordflow {
color: #e08000
}
span.comment {
color: #800000
}
span.preprocessor {
color: #806020
}
span.stringliteral {
color: #002080
}
span.charliteral {
color: #008080
}
span.vhdldigit {
color: #ff00ff
}
span.vhdlchar {
color: #000000
}
span.vhdlkeyword {
color: #700070
}
span.vhdllogic {
color: #ff0000
}
blockquote {
background-color: #F7F8FB;
border-left: 2px solid #9CAFD4;
margin: 0 24px 0 4px;
padding: 0 12px 0 16px;
}
$( document ).ready(function() {
$("div.headertitle").addClass("page-header");
$("div.title").addClass("h1");
$('li > a[href="index.html"] > span').before("<i class='fa fa-cog'></i> ");
$('li > a[href="index.html"] > span').text("CHEOPS IBSW");
$('li > a[href="modules.html"] > span').before("<i class='fa fa-square'></i> ");
$('li > a[href="namespaces.html"] > span').before("<i class='fa fa-bars'></i> ");
$('li > a[href="annotated.html"] > span').before("<i class='fa fa-list-ul'></i> ");
$('li > a[href="classes.html"] > span').before("<i class='fa fa-book'></i> ");
$('li > a[href="inherits.html"] > span').before("<i class='fa fa-sitemap'></i> ");
$('li > a[href="functions.html"] > span').before("<i class='fa fa-list'></i> ");
$('li > a[href="functions_func.html"] > span').before("<i class='fa fa-list'></i> ");
$('li > a[href="functions_vars.html"] > span').before("<i class='fa fa-list'></i> ");
$('li > a[href="functions_enum.html"] > span').before("<i class='fa fa-list'></i> ");
$('li > a[href="functions_eval.html"] > span').before("<i class='fa fa-list'></i> ");
$('img[src="ftv2ns.png"]').replaceWith('<span class="label label-danger">N</span> ');
$('img[src="ftv2cl.png"]').replaceWith('<span class="label label-danger">C</span> ');
$("ul.tablist").addClass("nav nav-pills nav-justified");
$("ul.tablist").css("margin-top", "0.5em");
$("ul.tablist").css("margin-bottom", "0.5em");
$("li.current").addClass("active");
$("iframe").attr("scrolling", "yes");
$("#nav-path > ul").addClass("breadcrumb");
$("table.params").addClass("table");
$("div.ingroups").wrapInner("<small></small>");
$("div.levels").css("margin", "0.5em");
$("div.levels > span").addClass("btn btn-default btn-xs");
$("div.levels > span").css("margin-right", "0.25em");
$("table.directory").addClass("table table-striped");
$("div.summary > a").addClass("btn btn-default btn-xs");
$("table.fieldtable").addClass("table");
$(".fragment").addClass("well");
$(".memitem").addClass("panel panel-default");
$(".memproto").addClass("panel-heading");
$(".memdoc").addClass("panel-body");
$("span.mlabel").addClass("label label-info");
$("table.memberdecls").addClass("table");
$("[class^=memitem]").addClass("active");
$("div.ah").addClass("btn btn-default");
$("span.mlabels").addClass("pull-right");
$("table.mlabels").css("width", "100%")
$("td.mlabels-right").addClass("pull-right");
$("div.ttc").addClass("panel panel-primary");
$("div.ttname").addClass("panel-heading");
$("div.ttname a").css("color", 'white');
$("div.ttdef,div.ttdoc,div.ttdeci").addClass("panel-body");
$('#MSearchBox').parent().remove();
$('div.fragment.well div.line:first').css('margin-top', '15px');
$('div.fragment.well div.line:last').css('margin-bottom', '15px');
$('table.doxtable').removeClass('doxtable').addClass('table table-striped table-bordered').each(function(){
$(this).prepend('<thead></thead>');
$(this).find('tbody > tr:first').prependTo($(this).find('thead'));
$(this).find('td > span.success').parent().addClass('success');
$(this).find('td > span.warning').parent().addClass('warning');
$(this).find('td > span.danger').parent().addClass('danger');
});
if($('div.fragment.well div.ttc').length > 0)
{
$('div.fragment.well div.line:first').parent().removeClass('fragment well');
}
$('table.memberdecls').find('.memItemRight').each(function(){
$(this).contents().appendTo($(this).siblings('.memItemLeft'));
$(this).siblings('.memItemLeft').attr('align', 'left');
});
function getOriginalWidthOfImg(img_element) {
var t = new Image();
t.src = (img_element.getAttribute ? img_element.getAttribute("src") : false) || img_element.src;
return t.width;
}
$('div.dyncontent').find('img').each(function(){
if(getOriginalWidthOfImg($(this)[0]) > $('#content>div.container').width())
$(this).css('width', '100%');
});
$(".memitem").removeClass('memitem');
$(".memproto").removeClass('memproto');
$(".memdoc").removeClass('memdoc');
$("span.mlabel").removeClass('mlabel');
$("table.memberdecls").removeClass('memberdecls');
$("[class^=memitem]").removeClass('memitem');
$("span.mlabels").removeClass('mlabels');
$("table.mlabels").removeClass('mlabels');
$("td.mlabels-right").removeClass('mlabels-right');
$(".navpath").removeClass('navpath');
$("li.navelem").removeClass('navelem');
$("a.el").removeClass('el');
$("div.ah").removeClass('ah');
$("div.header").removeClass("header");
$('.mdescLeft').each(function(){
if($(this).html()=="&nbsp;") {
$(this).siblings('.mdescRight').attr('colspan', 2);
$(this).remove();
}
});
$('td.memItemLeft').each(function(){
if($(this).siblings('.memItemRight').html()=="") {
$(this).attr('colspan', 2);
$(this).siblings('.memItemRight').remove();
}
});
});
Subproject commit e829184be56fd0d6212f495b29782ffdd53ae04a
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
<!--BEGIN GENERATE_TREEVIEW-->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
$navpath
<li class="footer">$generatedby
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
</ul>
</div>
<!--END GENERATE_TREEVIEW-->
</div>
</div>
</div>
</div>
</div>
<!--BEGIN !GENERATE_TREEVIEW-->
<hr class="footer"/><address class="footer"><small>
$generatedby &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/>
</a> $doxygenversion
</small></address>
<!--END !GENERATE_TREEVIEW-->
</body>
</html>
<!-- HTML header for doxygen 1.8.8--> <!-- HTML header for doxygen 1.9.5-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml" lang="$langISO">
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- For Mobile Devices -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen $doxygenversion"/> <meta name="generator" content="Doxygen $doxygenversion"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<script type="text/javascript" src="jquery.js"></script>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME--> <!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME--> <!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<!--<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>--> <link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN FULL_SIDEBAR-->
<script type="text/javascript">var page_layout=1;</script>
<!--END FULL_SIDEBAR-->
<!--END DISABLE_INDEX-->
<script type="text/javascript" src="$relpath^jquery.js"></script>
<script type="text/javascript" src="$relpath^dynsections.js"></script> <script type="text/javascript" src="$relpath^dynsections.js"></script>
<script type="text/javascript" src="$relpath^doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript" src="$relpath^doxygen-awesome-fragment-copy-button.js"></script>
<script type="text/javascript" src="$relpath^doxygen-awesome-interactive-toc.js"></script>
<script type="text/javascript">
DoxygenAwesomeFragmentCopyButton.init()
DoxygenAwesomeDarkModeToggle.init()
DoxygenAwesomeInteractiveToc.init()
</script>
$treeview $treeview
$search $search
$mathjax $mathjax
$darkmode
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" /> <link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="$relpath^bootstrap.min.css">
$extrastylesheet $extrastylesheet
<script src="$relpath^bootstrap.min.js"></script>
<script type="text/javascript" src="$relpath^doxy-boot.js"></script>
</head> </head>
<body> <body>
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN FULL_SIDEBAR-->
<div id="side-nav" class="ui-resizable side-nav-resizable"><!-- do not remove this div, it is closed by doxygen! -->
<!--END FULL_SIDEBAR-->
<!--END DISABLE_INDEX-->
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<nav class="navbar navbar-default" role="navigation"> <!--BEGIN TITLEAREA-->
<div class="container"> <div id="titlearea">
<div class="navbar-header"> <table cellspacing="0" cellpadding="0">
<a class="navbar-brand"> <tbody>
<img alt="Logo" align="left" style="margin-right: 1em;" src=$projectlogo/> <tr id="projectrow">
$projectname $projectnumber</a> <!--BEGIN PROJECT_LOGO-->
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td>
<!--END PROJECT_LOGO-->
<!--BEGIN PROJECT_NAME-->
<td id="projectalign">
<div id="projectname">$projectname<!--BEGIN PROJECT_NUMBER--><span id="projectnumber">&#160;$projectnumber</span><!--END PROJECT_NUMBER-->
</div> </div>
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
</td>
<!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME-->
<!--BEGIN PROJECT_BRIEF-->
<td>
<div id="projectbrief">$projectbrief</div>
</td>
<!--END PROJECT_BRIEF-->
<!--END !PROJECT_NAME-->
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN SEARCHENGINE-->
<!--BEGIN !FULL_SIDEBAR-->
<td>$searchbox</td>
<!--END !FULL_SIDEBAR-->
<!--END SEARCHENGINE-->
<!--END DISABLE_INDEX-->
</tr>
<!--BEGIN SEARCHENGINE-->
<!--BEGIN FULL_SIDEBAR-->
<tr><td colspan="2">$searchbox</td></tr>
<!--END FULL_SIDEBAR-->
<!--END SEARCHENGINE-->
</tbody>
</table>
</div> </div>
</nav> <!--END TITLEAREA-->
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div class="content" id="content">
<div class="container">
<div class="row">
<div class="col-sm-12 panel panel-default" style="padding-bottom: 15px;">
<div style="margin-bottom: 15px;">
<!-- end header part --> <!-- end header part -->
doc_layout_files = files([ Doxyfile_template = files('Doxyfile.in')
'DoxygenLayout.xml',
'bootstrap.min.css', doc_layout_files = files(
'customdoxygen.css',
'bootstrap.min.js',
'doxy-boot.js',
'header.html', 'header.html',
'footer.html' 'meson.build',
]) 'plato-logo-med.png',
'doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js',
'doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js',
'doxygen-awesome-css/doxygen-awesome-interactive-toc.js',
'doxygen-awesome-css/doxygen-awesome-paragraph-link.js',
'doxygen-awesome-css/doxygen-awesome-sidebar-only-darkmode-toggle.css',
'doxygen-awesome-css/doxygen-awesome-sidebar-only.css',
'doxygen-awesome-css/doxygen-awesome.css',
)
#Build a Doxyfile based on Doxyfile.in #Build a Doxyfile based on Doxyfile.in
...@@ -25,7 +30,7 @@ doxygen = find_program('doxygen', required : false) ...@@ -25,7 +30,7 @@ doxygen = find_program('doxygen', required : false)
if doxygen.found() if doxygen.found()
doxy_file = configure_file( doxy_file = configure_file(
input : 'Doxyfile.in', input : Doxyfile_template,
output : 'Doxyfile', output : 'Doxyfile',
configuration : cdata_doc, configuration : cdata_doc,
install : false, install : false,
...@@ -33,10 +38,12 @@ if doxygen.found() ...@@ -33,10 +38,12 @@ if doxygen.found()
custom_target('doc', custom_target('doc',
input : doxy_file, input : doxy_file,
output : 'html', output : 'generated_documentation',
depend_files : [doc_layout_files, main, cmplib_sources], depend_files : [doxy_file, doc_layout_files, main, cmplib_sources], # test files are missing
command : [doxygen, '@INPUT@'], command : [doxygen, '@INPUT@'],
build_by_default : false, build_by_default : false,
console : true, console : true,
) )
else
warning('Documentation disabled without doxygen')
endif endif
doc/doxygen/plato-logo-med.png

54.5 KiB

...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
A simple example to show how the compression tool works without the compression entity header. A simple example to show how the compression tool works without the compression entity header.
0. Download the [tool][3] or run `make` to build the tool 0. Download the [cmp_tool](https://gitlab.phaidra.org/loidoltd15/cmp_tool/-/releases) or [build](INSTALL.md) the tool
1. Create a configuration file 1. Create a configuration file
* Create a cfg directory * Create a cfg directory
......
/** /**
* @file byteorder.h * @file byteorder.h
* @author Armin Luntzer (armin.luntzer@univie.ac.at), * @author Armin Luntzer (armin.luntzer@univie.ac.at)
* @date 2015 * @date 2015
* *
* @copyright GPLv2 * @copyright GPLv2
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details. * more details.
* *
* This is a set of macros for consistent endianess conversion. They work * @brief This is a set of macros for consistent endianess conversion. They work
* for both little and big endian cpus. * for both little and big endian cpus.
* *
* conversion of XX-bit integers (16- or 32-) between native CPU format * conversion of XX-bit integers (16- or 32-) between native CPU format
...@@ -39,7 +39,11 @@ ...@@ -39,7 +39,11 @@
#include <stdint.h> #include <stdint.h>
#ifndef GCC_VERSION
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#endif
#ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN
#undef __BIG_ENDIAN #undef __BIG_ENDIAN
......
/** /**
* @file cmp_data_types.h * @file cmp_data_types.h
* @author Dominik Loidolt (dominik.loidolt@univie.ac.at), * @author Dominik Loidolt (dominik.loidolt@univie.ac.at)
* @date 2020 * @date 2020
* @brief definition of the different data types * @brief definition of the different compression data types
* *
* @copyright GPLv2 * @copyright GPLv2
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details. * more details.
* *
* @see for N-DPU packed definition: PLATO-LESIA-PL-RP-0031 Issue: 1.9 (N-DPU->ICU data rate) * @see for N-DPU packed definition: PLATO-LESIA-PL-RP-0031 Issue: 2.9 (N-DPU->ICU data rate)
* @see for calculation of the max used bits: PLATO-LESIA-PDC-TN-0054 Issue: 1.7 * @see for calculation of the max used bits: PLATO-LESIA-PDC-TN-0054 Issue: 1.7
* *
* Three data rates (for N-DPU): * Three data rates (for N-DPU):
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
* exp_flags = selected exposure flags * exp_flags = selected exposure flags
* fx = normal light flux * fx = normal light flux
* ncob = normal center of brightness * ncob = normal center of brightness
* efx = extended flux * efx = extended light flux
* ecob = extended center of brightness * ecob = extended center of brightness
* The prefixes F, S and L stand for Fast, Short and Long cadence * The prefixes f, s and l stand for fast, short and long cadence
*/ */
#ifndef CMP_DATA_TYPE_H #ifndef CMP_DATA_TYPE_H
...@@ -39,6 +39,10 @@ ...@@ -39,6 +39,10 @@
#include <compiler.h> #include <compiler.h>
#include <cmp_support.h> #include <cmp_support.h>
/* size of the source data header structure for multi entry packet */
#define MULTI_ENTRY_HDR_SIZE 12
#define MAX_USED_NC_IMAGETTE_BITS 16 #define MAX_USED_NC_IMAGETTE_BITS 16
#define MAX_USED_SATURATED_IMAGETTE_BITS 16 /* TBC */ #define MAX_USED_SATURATED_IMAGETTE_BITS 16 /* TBC */
#define MAX_USED_FC_IMAGETTE_BITS 16 /* TBC */ #define MAX_USED_FC_IMAGETTE_BITS 16 /* TBC */
...@@ -82,7 +86,10 @@ ...@@ -82,7 +86,10 @@
#define MAX_USED_FC_BACKGROUND_OUTLIER_PIXELS_BITS 16 /* TBC */ #define MAX_USED_FC_BACKGROUND_OUTLIER_PIXELS_BITS 16 /* TBC */
/* struct holding the maximum length of the different data products types in bits */ /**
* @brief Structure holding the maximum length of the different data product types in bits
*/
struct cmp_max_used_bits { struct cmp_max_used_bits {
uint8_t version; uint8_t version;
unsigned int s_exp_flags; unsigned int s_exp_flags;
...@@ -121,18 +128,12 @@ struct cmp_max_used_bits { ...@@ -121,18 +128,12 @@ struct cmp_max_used_bits {
}; };
/* Set and read the max_used_bits, which specify how many bits are needed to /**
* represent the highest possible value. * @brief source data header structure for multi entry packet
* @note a scientific package contains a multi-entry header followed by multiple
* entries of the same entry definition
* @see PLATO-LESIA-PL-RP-0031(N-DPU->ICU data rate)
*/ */
void cmp_set_max_used_bits(const struct cmp_max_used_bits *set_max_used_bits);
struct cmp_max_used_bits cmp_get_max_used_bits(void);
uint8_t cmp_get_max_used_bits_version(void);
/* Source data header structure for multi entry packet */
#define MULTI_ENTRY_HDR_SIZE 12
compile_time_assert(MULTI_ENTRY_HDR_SIZE % sizeof(uint32_t) == 0, N_DPU_ICU_MULTI_ENTRY_HDR_NOT_4_BYTE_ALLIED);
__extension__ __extension__
struct multi_entry_hdr { struct multi_entry_hdr {
...@@ -144,14 +145,23 @@ struct multi_entry_hdr { ...@@ -144,14 +145,23 @@ struct multi_entry_hdr {
uint8_t entry[]; uint8_t entry[];
} __attribute__((packed)); } __attribute__((packed));
compile_time_assert(sizeof(struct multi_entry_hdr) == MULTI_ENTRY_HDR_SIZE, N_DPU_ICU_MULTI_ENTRY_HDR_SIZE_IS_NOT_CORRECT); compile_time_assert(sizeof(struct multi_entry_hdr) == MULTI_ENTRY_HDR_SIZE, N_DPU_ICU_MULTI_ENTRY_HDR_SIZE_IS_NOT_CORRECT);
compile_time_assert(sizeof(struct multi_entry_hdr) % sizeof(uint32_t) == 0, N_DPU_ICU_MULTI_ENTRY_HDR_NOT_4_BYTE_ALLIED);
/**
* @brief short cadence normal light flux entry definition
*/
struct s_fx { struct s_fx {
uint8_t exp_flags; /* selected exposure flags (2 flags + 6 spare bits) */ uint8_t exp_flags; /**< selected exposure flags (2 flags + 6 spare bits) */
uint32_t fx; /* normal light flux */ uint32_t fx; /**< normal light flux */
} __attribute__((packed)); } __attribute__((packed));
/**
* @brief short cadence normal and extended light flux entry definition
*/
struct s_fx_efx { struct s_fx_efx {
uint8_t exp_flags; uint8_t exp_flags;
uint32_t fx; uint32_t fx;
...@@ -159,6 +169,10 @@ struct s_fx_efx { ...@@ -159,6 +169,10 @@ struct s_fx_efx {
} __attribute__((packed)); } __attribute__((packed));
/**
* @brief short cadence normal light flux, normal center of brightness entry definition
*/
struct s_fx_ncob { struct s_fx_ncob {
uint8_t exp_flags; uint8_t exp_flags;
uint32_t fx; uint32_t fx;
...@@ -167,6 +181,10 @@ struct s_fx_ncob { ...@@ -167,6 +181,10 @@ struct s_fx_ncob {
} __attribute__((packed)); } __attribute__((packed));
/**
* @brief short cadence normal and extended flux, normal and extended center of brightness entry definition
*/
struct s_fx_efx_ncob_ecob { struct s_fx_efx_ncob_ecob {
uint8_t exp_flags; uint8_t exp_flags;
uint32_t fx; uint32_t fx;
...@@ -178,17 +196,29 @@ struct s_fx_efx_ncob_ecob { ...@@ -178,17 +196,29 @@ struct s_fx_efx_ncob_ecob {
} __attribute__((packed)); } __attribute__((packed));
/**
* @brief fast cadence normal light flux entry definition
*/
struct f_fx { struct f_fx {
uint32_t fx; uint32_t fx;
} __attribute__((packed)); } __attribute__((packed));
/**
* @brief fast cadence normal and extended light flux entry definition
*/
struct f_fx_efx { struct f_fx_efx {
uint32_t fx; uint32_t fx;
uint32_t efx; uint32_t efx;
} __attribute__((packed)); } __attribute__((packed));
/**
* @brief fast cadence normal light flux, normal center of brightness entry definition
*/
struct f_fx_ncob { struct f_fx_ncob {
uint32_t fx; uint32_t fx;
uint32_t ncob_x; uint32_t ncob_x;
...@@ -196,6 +226,11 @@ struct f_fx_ncob { ...@@ -196,6 +226,11 @@ struct f_fx_ncob {
} __attribute__((packed)); } __attribute__((packed));
/**
* @brief fast cadence normal and extended flux, normal and extended center of
* brightness entry definition
*/
struct f_fx_efx_ncob_ecob { struct f_fx_efx_ncob_ecob {
uint32_t fx; uint32_t fx;
uint32_t ncob_x; uint32_t ncob_x;
...@@ -206,6 +241,10 @@ struct f_fx_efx_ncob_ecob { ...@@ -206,6 +241,10 @@ struct f_fx_efx_ncob_ecob {
} __attribute__((packed)); } __attribute__((packed));
/**
* @brief long cadence normal light flux entry definition
*/
__extension__ __extension__
struct l_fx { struct l_fx {
uint32_t exp_flags:24; /* selected exposure flags (24 flags) */ uint32_t exp_flags:24; /* selected exposure flags (24 flags) */
...@@ -214,6 +253,10 @@ struct l_fx { ...@@ -214,6 +253,10 @@ struct l_fx {
} __attribute__((packed)); } __attribute__((packed));
/**
* @brief long cadence normal and extended light flux entry definition
*/
__extension__ __extension__
struct l_fx_efx { struct l_fx_efx {
uint32_t exp_flags:24; /* selected exposure flags (24 flags) */ uint32_t exp_flags:24; /* selected exposure flags (24 flags) */
...@@ -223,6 +266,10 @@ struct l_fx_efx { ...@@ -223,6 +266,10 @@ struct l_fx_efx {
} __attribute__((packed)); } __attribute__((packed));
/**
* @brief long cadence normal light flux, normal center of brightness entry definition
*/
__extension__ __extension__
struct l_fx_ncob { struct l_fx_ncob {
uint32_t exp_flags:24; /* selected exposure flags (24 flags) */ uint32_t exp_flags:24; /* selected exposure flags (24 flags) */
...@@ -235,6 +282,11 @@ struct l_fx_ncob { ...@@ -235,6 +282,11 @@ struct l_fx_ncob {
} __attribute__((packed)); } __attribute__((packed));
/**
* @brief long cadence normal and extended flux, normal and extended center of
* brightness entry definition
*/
__extension__ __extension__
struct l_fx_efx_ncob_ecob { struct l_fx_efx_ncob_ecob {
uint32_t exp_flags:24; /* selected exposure flags (24 flags) */ uint32_t exp_flags:24; /* selected exposure flags (24 flags) */
...@@ -250,12 +302,20 @@ struct l_fx_efx_ncob_ecob { ...@@ -250,12 +302,20 @@ struct l_fx_efx_ncob_ecob {
} __attribute__((packed)); } __attribute__((packed));
/**
* @brief normal offset entry definition
*/
struct nc_offset { struct nc_offset {
uint32_t mean; uint32_t mean;
uint32_t variance; uint32_t variance;
} __attribute__((packed)); } __attribute__((packed));
/**
* @brief normal background entry definition
*/
struct nc_background { struct nc_background {
uint32_t mean; uint32_t mean;
uint32_t variance; uint32_t variance;
...@@ -263,6 +323,10 @@ struct nc_background { ...@@ -263,6 +323,10 @@ struct nc_background {
} __attribute__((packed)); } __attribute__((packed));
/**
* @brief smearing entry definition
*/
struct smearing { struct smearing {
uint32_t mean; uint32_t mean;
uint16_t variance_mean; uint16_t variance_mean;
...@@ -270,9 +334,18 @@ struct smearing { ...@@ -270,9 +334,18 @@ struct smearing {
} __attribute__((packed)); } __attribute__((packed));
/*
* Set and read the max_used_bits registry, which specify how many bits are
* needed to represent the highest possible value.
*/
uint8_t cmp_get_max_used_bits_version(void);
struct cmp_max_used_bits cmp_get_max_used_bits(void);
void cmp_set_max_used_bits(const struct cmp_max_used_bits *set_max_used_bits);
size_t size_of_a_sample(enum cmp_data_type data_type); size_t size_of_a_sample(enum cmp_data_type data_type);
unsigned int cmp_cal_size_of_data(unsigned int samples, enum cmp_data_type data_type); uint32_t cmp_cal_size_of_data(uint32_t samples, enum cmp_data_type data_type);
int cmp_input_size_to_samples(unsigned int size, enum cmp_data_type data_type); int32_t cmp_input_size_to_samples(uint32_t size, enum cmp_data_type data_type);
int cmp_input_big_to_cpu_endianness(void *data, uint32_t data_size_byte, int cmp_input_big_to_cpu_endianness(void *data, uint32_t data_size_byte,
enum cmp_data_type data_type); enum cmp_data_type data_type);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment